0

目前,我已经阅读了一个 genbank ptt 文件并使用它在 R 中使用 genoplotR 绘制基因组

    plot_gene_map(dna_segs=list(mo),xlims=xlims,annotations=annotMED,annotation_height=5,main="Region",gene_type="side_blocks",dna_seg_scale=TRUE, scale=FALSE)

我还阅读了其相应的排序 bam 文件并使用 rbamtools 制作了覆盖图

    start<-130000
    end<-140000
    coords<-as.integer(c(0,start,end))
    range<-bamRange(reader,coords)
    bamClose(reader)
    ad<-alignDepth(range)

    add<-data.frame(ad@pos, ad@depth)

    count<-bamCountAll(reader,verbose=TRUE)

    ggplot(add, aes(x=ad.pos, y=ad.depth)) + geom_histogram(stat="identity", position="dodge") + theme_bw() 

我现在想将这两个数字叠加在一张图上,这样我们就可以在 R 中拥有一个基本的基因组比对查看器。但是,我一直在尝试叠加这两个数字,以及匹配 x 轴上的相应位置。

任何帮助将不胜感激!

谢谢

4

1 回答 1

0

也许使用viewports,就像在这个线程中一样:

在 R 图形窗口中组合 base 和 ggplot 图形

于 2013-11-08T04:07:01.067 回答