目的:绘制SNP在染色体上的密度分布
数据格式
代码部分:
#vcftools --vcf snp.bialles.vcf --SNPdensity 100000 --out StatResults/SNPdensity
df<-read.table("SNPdensity.snpden",sep="\t",header=T)
head(df)
df<-df[,c(1,2,4)]
colnames(df)<-c("Chr","X","Y")
head(df)
df$X<-df$X/1000000
options(scipen=999)
library(circlize)
library(RColorBrewer)
col<-RColorBrewer::brewer.pal(12,"Paired")
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.05)
for(i in 1:12){
highlight.sector(sector.index = paste0("LG",i),col=col[i])
circos.text(CELL_META$xcenter, CELL_META$ycenter,
labels = paste0("LG",i),
sector.index = paste0("LG",i),cex=0.5)
}
for(i in 1:12){
highlight.sector(sector.index = paste("LG",i),col=col[i])
circos.text(CELL_META$xcenter, CELL_META$ycenter,
labels = paste("LG",i),
sector.index = paste("LG",i),cex=0.5)
}
circos.trackPlotRegion(factors=df$Chr,y=df$Y)
circos.trackLines(df$Chr,df$X,df$Y,col=col)
circos.trackPlotRegion(factors=df$Chr,y=df$Y)
circos.trackPoints(df$Chr,df$X,df$Y,col=col,cex=0.5)
circos.trackPlotRegion(factors=df$Chr,y=df$Y)
circos.trackHist(df$Chr,df$X,col=col)
circos.clear()
数据不好,只能搞点花里胡哨的了
网友评论