如何使用R语言包circlize可视化展示blast双序列比对结果
发表于:2024-09-21 作者:千家信息网编辑
千家信息网最后更新 2024年09月21日,如何使用R语言包circlize可视化展示blast双序列比对结果,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。circlize这个
千家信息网最后更新 2024年09月21日如何使用R语言包circlize可视化展示blast双序列比对结果
如何使用R语言包circlize可视化展示blast双序列比对结果,针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。
circlize这个包挺强大的,R语言里用来画圈图非常方便。
今天这篇文章记录用circlize这个包画圈图展示blast双序列比对结果的代码
植物线粒体基因组类的文章通常会分析细胞器基因组间基因转移情况,基本的分析方法就是blast比对。可视化展示可以选择用这个圈图来做
首先是使用blast建库比对
makeblastdb -in mt.fasta -dbtype nucl -out mt
blastn -query cp.fasta -db mt -outfmt 6 > output.txt
然后是准备数据用来画最外圈用来展示两条序列的部分
df<-data.frame(chr=c(rep("chloroplast",2),rep("mitochondrial",2)),
x=c(1,131478,1,444567),
y=c(0,1,0,1))
> df
chr x y
1 chloroplast 1 0
2 chloroplast 131478 1
3 mitochondrial 1 0
4 mitochondrial 444567 1
然后是读入blast的输出结果
df1<-read.csv("output6.txt",stringsAsFactors = F,header=F,sep="\t")
作图用到的代码
library(circlize)
library(RColorBrewer)
library(ComplexHeatmap)
col<-RColorBrewer::brewer.pal(6,"Paired")
circos.par("start.degree" = 130)
circos.initialize(factors = df$chr,x=df$x)
circos.trackPlotRegion(factors = df$chr,y=df$y,
panel.fun = function(x,y){
circos.axis()
},track.height = 0.1)
highlight.sector(sector.index = "chloroplast",col=col[1])
highlight.sector(sector.index = "mitochondrial",col=col[2])
circos.text(x=70000,y=0.5,
labels = "chloroplast",
sector.index = "chloroplast")
circos.text(x=220000,y=0.5,
labels = "mitochondrial",
sector.index = "mitochondrial",
facing = "outside")
col_fun = colorRamp2(c(70,90,100),
c("green", "yellow", "red"))
for (i in 1:13){
x<-sort(c(df1[i,8],df1[i,7]))
y<-sort(c(df1[i,10],df1[i,9]))
z<-df1[i,3]
circos.link("chloroplast",x,"mitochondrial",y,
col=add_transparency(col_fun(z)))
}
circos.clear()
lgd_links = Legend(at = c(70, 80, 90, 100),
col_fun = col_fun,
title_position = "topleft",
title = "identity(%)")
lgd_list_vertical = packLegend(lgd_links)
draw(lgd_list_vertical, x = unit(10, "mm"),
y = unit(10, "mm"), just = c("left", "bottom"))
新学到的两个知识点调整整体的角度
circos.par("start.degree" = 130)
调整用来表示染色体的外圈粗细
circos.trackPlotRegion(factors = df$chr,y=df$y,
panel.fun = function(x,y){
circos.axis()
},track.height = 0.1)
画图的时候可以加一个track.height参数
遇到的问题是调整外圈的刻度,现在展示的有点多,我想增大间隔,减少展示的数字,暂时不知道如何实现。
关于如何使用R语言包circlize可视化展示blast双序列比对结果问题的解答就分享到这里了,希望以上内容可以对大家有一定的帮助,如果你还有很多疑惑没有解开,可以关注行业资讯频道了解更多相关知识。
序列
结果
问题
语言
可视化
基因
外圈
分析
调整
代码
基因组
方法
更多
知识
篇文章
帮助
解答
强大
易行
简单易行
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
有关网络安全队名
临安行业专业软件开发
一个服务器挂多个网站
怎么限制某个数据库用户连接数
国家网络安全服务市场
e14服务器怎么设置
dna数据库浙江
南宁局网络安全
table 隐藏数据库
hcna网络技术学习心得
生信数据库验证
网络安全前沿知识
东莞有招聘网络安全员的吗
中国人事人才网数据库
美国超级服务器
广州电商定制软件开发公司
还原数据库如何不要日志
大手互联网科技有限公司
jsp数据库 登录代码
如何解释通达信服务器
投稿时上传数据到公共数据库
奉贤区信息软件开发品质保障
管家婆nas数据库
怎么限制某个数据库用户连接数
朋友专享网络安全吗
恶意攻击服务器报警
aix服务器编辑文件命令
山西惠普服务器维修维保
数据库dbo代表什么
崇明区品牌软件开发有哪些