MotifStack:多motif序列比较和可视化

本文介绍使用R包MotifStack绘制转录因子结合位点(Motif)的方法,包括单个Motif、亲和力Motif、堆叠Motif及环形Motif的绘制流程。MotifStack支持多种Motif格式,如JASPAR、MEME等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

授权转载自 SimonCat。

最近大量跑chip-seq,看到一篇2016Cell的文章《Cistrome and Epicistrome Features Shape the Regulatory DNA Landscape》感觉图3好惊艳。

6d093a7502e77b736d4889a9443e9a3f.png

找了下材料和方法,发现是一个叫MotifStack(http://www.bioconductor.org/packages/release/bioc/html/motifStack.html)的包画的。

什么是motif?

Motif是在生物学中是一个基于数据的数学统计模型,典型的是一段sequence也可以是一个结构。如转录因子倾向于结合某些特定的序列。把这个R包和数据下载下来自己画一下,它motif的测试数据是pcm格式的文本。MotifStack 还有一些motif格式转换的函数。(Cell重磅综述:关于人类转录因子,你想知道的都在这

afb702ef2323a7eb837a3ff48b8f357c.png

motif的格式是什么?

Chip-seq鉴定出的motif,是一个ATCG的序列矩阵。对于这个字母矩阵,目前主流Motif的序列格式主要有JASPAR\MEME\RAW PFM。此外JASPAR数据库 (http://jaspar.genereg.net/) 提供了转录因子与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")

1e5fbe711c2fbe1e15759c822803f098.png

2 Affinity motif log

需要画出双链。

 
 
motif<-matrix(
c(
.846, .631, .593, .000, .000, .000, .434, .410, 1.00, .655, .284, .000, .000, .771, .640, .961,
.625, .679, .773, 1.00, 1.00, .000, .573, .238, .397, 1.00, 1.00, .000, .298, 1.00, 1.00, .996,
1.00, 1.00, 1.00, .228, .000, 1.00, 1.00, .597, .622, .630, .000, 1.00, 1.00, .871, .617, 1.00,
.701, .513, .658, .000, .000, .247, .542, 1.00, .718, .686, .000, .000, .000, .595, .437, .970
), nrow=4, byrow = TRUE)
rownames(motif) <- c("A", "C", "G", "T")
motif<-new("psam", mat=motif, name="affinity logo")
plot(motif)

7762a4407f943873bdd8308542a7cde6.png

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

ab0611634f688c71bbf5d3c465acec56.png

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)

d44157d68de7e91e88b73d3f592b5e0a.png

原文:https://mp.weixin.qq.com/s/hiXEgwwgtKGxFhMawtg3fQ

R统计和作图

更多阅读

画图三字经 生信视频 生信系列教程 

心得体会 癌症数据库 Linux Python 

高通量分析 在线画图 测序历史 超级增强子

培训视频 PPT EXCEL 文章写作 ggplot2

海哥组学 可视化套路 基因组浏览器

色彩搭配 图形排版 互作网络

0668f6f96ee86affc011efcb6378958d.png

6be56ccfd75249c478d6a903fc36fbd9.png

后台回复“生信宝典福利第一波”获取教程合集

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值