Open zhenyisong opened 7 years ago
Do you really want to overlay the plots? There would be occlusion when filling. You could combine/stack the GAlignments with a grouping variable tracking their origin. Map that to color and then use lines as the geom. Not sure if ggbio supports that, though.
@lawremi This could be useful to overlay coverage of long and short reads from the same gDNA sample. Coverage is likely to be quite different (Y-axis), so I think you'd have to specify a ylim or ymax on both but that's a separate issue #105.
Overlapping works: ggplot() + stat_coverage(short.bam, geom = 'line', col = 'red', alpha = 0.2) + stat_coverage(long.bam, geom = 'line', col = 'blue', alpha = 0.2)
where bam each are GRanges objects from two different alignment files.
I figured out the following snippet to draw the read coverage plot:
xinli.test.gene is a GenomicAlignments object.
However, I would like to overlay two plots, one is the treatment result and the other is the input control. In this case , I do not want to split the coverage plots in two panes as usual.
Instead, the question is, There are two GenomicAlignments objects from two independent experiments, how can I impose one on the other?
Thanks in advance.