最近大量跑chip-seq,看到一篇2016Cell的文章《Cistrome and Epicistrome Features Shape the Regulatory DNA Landscape》感觉图3好惊艳。 找了下材料和方法,发现是一个叫MotifStack(http://www./packages/release/bioc/html/motifStack.html)的包画的。 什么是motif? Motif是在生物学中是一个基于数据的数学统计模型,典型的是一段sequence也可以是一个结构。如转录因子倾向于结合某些特定的序列。把这个R包和数据下载下来自己画一下,它motif的测试数据是pcm格式的文本。MotifStack 还有一些motif格式转换的函数。(Cell重磅综述:关于人类转录因子,你想知道的都在这) motif的格式是什么? Chip-seq鉴定出的motif,是一个ATCG的序列矩阵。对于这个字母矩阵,目前主流Motif的序列格式主要有JASPAR\MEME\RAW PFM。此外JASPAR数据库 (http://jaspar./) 提供了转录因子与DNA结合位点motif最全面的公开数据,共收集了脊椎动物、植物、昆虫、线虫、真菌和尾索动物六大类不同类生物的数据 (AnimalTFDB 动物转录因子注释和预测的综合资源库)。 1 Single motif log pcm <> read.table('/Users/zt/learn/软件包/motifStack/test_data/bin_SOLEXA.pcm',header = F) # 创造Motif对象 pcm <> pcm[,3:ncol(pcm)] rownames(pcm) <> c('A','C','G','T') motif <> new('pcm', mat=as.matrix(pcm), name='bin_SOLEXA') opar<>par(mfrow=c(4,1)) plot(motif) #plot the logo with same height plot(motif, ic.scale=FALSE, ylab='probability') #try a different font plot(motif, font='mono,Courier') #try a different font and a different color group motif@color <> colorset(colorScheme='basepairing') plot(motif,font='Times') 2 Affinity motif log需要画出双链。
3 Stacked motif当要画多个motif以堆积起来,对不同的motif进行距离计算构建进化树。导入的数据文件是单个motif一个pcm文件,通过file.path命令读取整个目录 motifs<>importMatrix(dir(file.path('/Users/zt/learn/软件包/motifStack/test_data'),'pcm$', full.names = TRUE)) motifStack(motifs, layout='stack', ncex=1.0) # 建立进化树 motifStack(motifs, layout='tree') 4 Circle Motif 4 Circle motif设置layout的格式,可以设置成环形,有点像circles motifStack(motifs, layout='radialPhylog', circle=0.5, cleaves = 0.3, clabel.leaves = 0.3, col.bg=rep(color, each=5), col.bg.alpha=0.3, col.leaves=rep(color, each=5), col.inner.label.circle=rep(color, each=5), inner.label.circle.width=0.05, col.outer.label.circle=rep(color, each=5), outer.label.circle.width=0.1, circle.motif=1.2, angle=350)
|
|