Gviz DataTrack, type="densityplot"
1
0
Entering edit mode
@brent-pedersen-4815
Last seen 9.5 years ago
United States
Hi, I have been using Gviz to plot some of our methylation data. It is very easy to make detailed figures. I had been plotting the methylation of case vs. control using DataTrack with groups and type="boxplot". I also tried an AnnotationTrack with fun=details, where details is essentially identical to that from the documentation to draw a densityplot. But drawing the density plots gets a bit crowded even if I split them into a couple tracks. Would it be feasible to allow type="densityplot" in DataTrack which would then plot the densityplot rotated 90 degrees. it looks like I could add this in Gviz-methods.R in setMethod("drawGD"). I'm not familiar with the lattice stuff, is there a reason that this hasn't been implemented? thanks, -Brent
Gviz Gviz • 1.6k views
ADD COMMENT
0
Entering edit mode
@florianhahnenovartiscom-3784
Last seen 5.6 years ago
Switzerland
Hi Brent, There is no particular reason why density plots are nor a standard plot type in Gviz. I guess my reasoning was that those would not be necessary because the only real application that I see here is for data smoothing, and one can already archive that with the 'smooth' plot type. I am happy to add this to the next release of Gviz. Thanks for the suggestion. Florian -- On 11/13/12 5:13 PM, "Brent Pedersen" <bpederse at="" gmail.com=""> wrote: >Hi, I have been using Gviz to plot some of our methylation data. It is >very easy to make detailed figures. >I had been plotting the methylation of case vs. control using >DataTrack with groups and type="boxplot". I also tried an >AnnotationTrack with fun=details, where details is essentially >identical to that from the documentation to draw a densityplot. But >drawing the density plots gets a bit crowded even if I split them into >a couple tracks. > >Would it be feasible to allow type="densityplot" in DataTrack which >would then plot the densityplot rotated 90 degrees. it looks like I >could add this in Gviz-methods.R in setMethod("drawGD"). >I'm not familiar with the lattice stuff, is there a reason that this >hasn't been implemented? > >thanks, >-Brent
ADD COMMENT
0
Entering edit mode
On Thu, Nov 15, 2012 at 1:27 AM, Hahne, Florian <florian.hahne at="" novartis.com=""> wrote: > Hi Brent, > There is no particular reason why density plots are nor a standard plot > type in Gviz. I guess my reasoning was that those would not be necessary > because the only real application that I see here is for data smoothing, > and one can already archive that with the 'smooth' plot type. I am happy > to add this to the next release of Gviz. Thanks for the suggestion. > Florian > -- > > > > > > > On 11/13/12 5:13 PM, "Brent Pedersen" <bpederse at="" gmail.com=""> wrote: > >>Hi, I have been using Gviz to plot some of our methylation data. It is >>very easy to make detailed figures. >>I had been plotting the methylation of case vs. control using >>DataTrack with groups and type="boxplot". I also tried an >>AnnotationTrack with fun=details, where details is essentially >>identical to that from the documentation to draw a densityplot. But >>drawing the density plots gets a bit crowded even if I split them into >>a couple tracks. >> >>Would it be feasible to allow type="densityplot" in DataTrack which >>would then plot the densityplot rotated 90 degrees. it looks like I >>could add this in Gviz-methods.R in setMethod("drawGD"). >>I'm not familiar with the lattice stuff, is there a reason that this >>hasn't been implemented? >> >>thanks, >>-Brent > Hi, thanks for the reply. Here's an example where I'm using the densityplot in detail view to get a better idea of the distribution of the data: http://www.freeimagehosting.net/6k4i1 It does show essentially the same information as in the boxplot, but between the rug and the density, it's actually showing more. IIUC smooth, is across probes, rather than within probes and across samples within a group. I had tried for a bit yesterday to add densityplot to DataTrack to show (rotated 90 degrees) without success. -B
ADD REPLY
0
Entering edit mode
Hi Brent, I get what you are trying to do now. The only problem I see here is that the coordinates of the 90 degrees rotated density plots are not particularly meaningful anymore, at least not between different ranges. The genomic locations associated to the data values are not necessarily all of equal size. So if you plot two flipped density plots for neighboring genomic regions with identical data values next to each other, and one of those regions is much smaller than the other, you will end up with one squished density plot. This may even look like the data distributions are different, even though they are not. I am not sure how you tried to add this to the drawGD method, but it will not work out of the box with the density plot function (or panel.densityplot). We will need to compute density estimates for each group at each position and put the results together in one large vector to plot it using panel.lines. If I find some time next week I can hack up a quick prototype to check whether that is what you are aiming for. Maybe something along the lines of a violin or beans plot would be a bit more appropriate, although I am not sure how grouping would work out for those. Cheers, Florian -- On 11/15/12 4:53 PM, "Brent Pedersen" <bpederse at="" gmail.com=""> wrote: >On Thu, Nov 15, 2012 at 1:27 AM, Hahne, Florian ><florian.hahne at="" novartis.com=""> wrote: >> Hi Brent, >> There is no particular reason why density plots are nor a standard plot >> type in Gviz. I guess my reasoning was that those would not be necessary >> because the only real application that I see here is for data smoothing, >> and one can already archive that with the 'smooth' plot type. I am happy >> to add this to the next release of Gviz. Thanks for the suggestion. >> Florian >> -- >> >> >> >> >> >> >> On 11/13/12 5:13 PM, "Brent Pedersen" <bpederse at="" gmail.com=""> wrote: >> >>>Hi, I have been using Gviz to plot some of our methylation data. It is >>>very easy to make detailed figures. >>>I had been plotting the methylation of case vs. control using >>>DataTrack with groups and type="boxplot". I also tried an >>>AnnotationTrack with fun=details, where details is essentially >>>identical to that from the documentation to draw a densityplot. But >>>drawing the density plots gets a bit crowded even if I split them into >>>a couple tracks. >>> >>>Would it be feasible to allow type="densityplot" in DataTrack which >>>would then plot the densityplot rotated 90 degrees. it looks like I >>>could add this in Gviz-methods.R in setMethod("drawGD"). >>>I'm not familiar with the lattice stuff, is there a reason that this >>>hasn't been implemented? >>> >>>thanks, >>>-Brent >> > > >Hi, thanks for the reply. Here's an example where I'm using the >densityplot >in detail view to get a better idea of the distribution of the data: >http://www.freeimagehosting.net/6k4i1 >It does show essentially the same information as in the boxplot, but >between the rug and >the density, it's actually showing more. IIUC smooth, is across probes, >rather >than within probes and across samples within a group. > >I had tried for a bit yesterday to add densityplot to DataTrack >to show (rotated 90 degrees) without success. >-B
ADD REPLY

Login before adding your answer.

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