Gviz: Histograms in layers instead of stacked ANSWERED!
0
0
Entering edit mode
@stephenwilliams-15198
Last seen 5.7 years ago

I am plotting a set of data that I'd like to layer on top of each other. This is sequencing read depth from two samples. Here a snippet of my data

GRanges object with 3828 ranges and 2 metadata columns:
         seqnames                 ranges strand |    depth1     depth2
            <Rle>              <IRanges>  <Rle> | <integer> <integer>
     [1]     chr5 [171387115, 171387116]      * |         6        10
     [2]     chr5 [171387116, 171387117]      * |         5        10
     [3]     chr5 [171387117, 171387118]      * |         6        10
     [4]     chr5 [171387118, 171387119]      * |         6        11
     [5]     chr5 [171387119, 171387120]      * |         5         9

When I plot this data with the histogram function using

data_track <- DataTrack(data_grange, name = " ", col = c("black","grey"))
plotTracks(data_track, type = "histogram", showId = TRUE, c("depth1","depth2"))

The histograms are stacked one on top of the other. As such

 

I'd like to have them layered instead to show the difference between the two samples. Stacking is in this instance is very hard to interpret. 

Thanks for any an all advice. 

R Gviz gviz-package • 893 views
ADD COMMENT
0
Entering edit mode

Once again, I have figured out my own question. The OverlayTrack function is the solution. Thanks to bioconductor support for being a great sounding board!

ADD REPLY

Login before adding your answer.

Traffic: 679 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6