美文网首页
circos绘制变异分布图

circos绘制变异分布图

作者: 花生学生信 | 来源:发表于2023-03-20 11:12 被阅读0次

    目的:绘制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()
    
    数据不好,只能搞点花里胡哨的了

    相关文章

      网友评论

          本文标题:circos绘制变异分布图

          本文链接:https://www.haomeiwen.com/subject/xjmurdtx.html