Circos玩多了难免会视觉疲劳,今天换一个新工具可视化,回到直条的染色体形式。
https://www.jianshu.com/p/07ae1fe18071
https://cran.r-project.org/web/packages/RIdeogram/vignettes/RIdeogram.html
#install.packages('RIdeogram')
library(RIdeogram)
library(plyr)
library(dplyr)
library(magrittr)
#data(human_karyotype, package="RIdeogram")
#data(gene_density, package="RIdeogram")
#data(Random_RNAs_500, package="RIdeogram")
#head(human_karyotype)
#head(gene_density)
#head(Random_RNAs_500)
setwd("/Users/liuxin/Desktop/xxx")
karyotype <- read.table("karyotype.txt", header = T)
gene_density <- GFFex(input = "xxx.maker.genes.gff", karyotype = "karyotype.txt", feature = "gene", window = 500000)
copia_density <- GFFex(input = "xxx.fasta.mod.EDTA.TEanno.gff3", karyotype = "karyotype.txt", feature = "Copia_LTR_retrotransposon", window = 500000)
gypsy_density <- GFFex(input = "xxx.fasta.mod.EDTA.TEanno.gff3", karyotype = "karyotype.txt", feature = "Gypsy_LTR_retrotransposon", window = 500000)
#构造组合数据
copia_density$Color <- "f77f00"
Combined_density <- copia_density
Combined_density$Value_2 <- gypsy_density$Value
Combined_density$Color_2 <- "29bf12"
names(Combined_density)[4] <-"Value_1"
names(Combined_density)[5] <-"Color_1"
head(Combined_density)
#作图
ideogram(karyotype = karyotype, overlaid = gene_density,label = Combined_density, label_type = "line", width = 200, colorset1 = c("#fdfcdc","#00afb9","#0081a7"))
convertSVG("chromosome.svg", device = "pdf", dpi = 600)
这个包功能基本够用了。GFFex函数可以方便读取GFF文件,提取feature特征的密度,以便于可视化,这一点比起circos简直方便太多了。
标签:head,package,library,染色体,可视化,RIdeogram,data From: https://www.cnblogs.com/liuxinxin21d/p/17653723.html