Gviz Group of different sizes
1
0
Entering edit mode
drummerz • 0
@drummerz-9800
Last seen 8.1 years ago

I am attempting to plot data where the groups are not the same size. The example argument for using groups is:

> plotTracks(dTrack, groups = rep(c("control", "treated"), + each = 3), type = c("a", "p", "confint")) 

 

Does anyone know how to plot with groups that are different sizes?

gviz R granges • 1.3k views
ADD COMMENT
0
Entering edit mode
@florianhahnenovartiscom-3784
Last seen 5.6 years ago
Switzerland

You can build the groups vector by whatever method you like. It just needs to be of the same length as the number of samples in your DataTrack object. For instance:

plotTracks(dTrack, groups = c("control", "control", "treated", "treated", "treated"), type = c("a", "p", "confint"))

In many cases you will have your sample information available in an annotation table of some sorts, and it could make sense to use that. For instance, if you store the control/treated factor in a data.frame, you could do something like this:

plotTracks(dTrack, groups = yourAnnotationDf$treatment, type = c("a", "p", "confint"))

Obviously there can also be more than just two groups here. A little hard to give more concrete advise without knowing what exactly you are trying to do...

Florian

ADD COMMENT

Login before adding your answer.

Traffic: 796 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