Question: Gviz: Histograms in layers instead of stacked ANSWERED!
0
gravatar for stephen.williams
10 months ago by
stephen.williams10 wrote:

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. 

gviz R gviz-package • 193 views
ADD COMMENTlink modified 10 months ago • written 10 months ago by stephen.williams10

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 REPLYlink written 10 months ago by stephen.williams10
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 129 users visited in the last hour