[BioC] Gviz: axes related parameters

Hahne, Florian florian.hahne at novartis.com
Tue Mar 4 11:57:53 CET 2014


Hi Maxim,
We consciously chose not to replicate x-axes for each track in a Gviz
plot, and I do not think that your boss' argument is valid. Assuming that
you have included a GenomeAxis track, the data are plotted along with a
proper x-axis annotation. The whole purpose of this sort of visualisation
is to make comparison across tracks as easy as possible. The scale of the
x-axis is forced to be the same for all of the stacked tracks, and adding
axis annotations would just create unnecessary visual clutter. If you need
additional ammunition for a discussion with your boss you could refer him
to the work of Edward Tufte or Bill Cleveland.
If all he needs is a horizontal reference line you can archive that using
the baseline display parameter. The following code would create something
the looks pretty much like a standard xyplot, however without x-axis
annotation. Please note that the innerMargin argument is only available in
the current devel version.

plotTracks(dtTrack, baseline=0, innerMargin=0, frame=T, col.baseline=1,
col.axis=1, background.title=NA)

Florian

On 2/25/14 3:03 PM, "James W. MacDonald" <jmacdon at uw.edu> wrote:

>Hi Maxim,
>
>I am not sure I understand why you claim there is no horizontal axis on
>these plots. The GenomeAxisTrack shows the only 'x-axis' information
>that is relevant to these data, and there is one right there in the
>plot!
>
>What more information could possibly be conveyed to your boss or
>potential manuscript readers by repeating the same information six
>times in the DataTrack?
>
>Best,
>
>Jim
>
>
>
>On Tuesday, February 25, 2014 8:35:46 AM, Maxim wrote:
>> Hi,
>>
>> thanks for the information, the plot suggested by you is exactly what I
>> have right now!
>> Actually I like the plots that I was able to produce with Gviz a lot.
>>
>> http://postimg.org/image/u9cs7014f/
>>
>> The code was produced using a wrapper function, the relevant part
>>producing
>> the DataTracks looks like:
>>
>> x<-GeneRegionTrack(txdb,chromosome =
>> coords$chr,start=coords$start,end=coords$end,showId =
>> TRUE,geneSymbols=TRUE,name = "Gene Model",col.sampleNames="black"
>> 
>>,background.title="white",col.axis="black",col.title="black",col=1,fill=1
>> ,fontfamily="Helvetica")
>>
>> axisTrack <- GenomeAxisTrack()
>>
>> ### this happens in a loop
>>
>> myDataTrack[[i+2]]<-DataTrack(data = bDat[[i]][,2],start=bDat[[i]][,1
>> ],end=bDat[[i]][,1],chromosome=coords$chr,genome="hg19"
>> ,name=myNames[c],ylim=c(mn,mx),type="polygon",fill
>> .mountain=c(myCols[c],myCols[c]),col.mountain=myCols[c],col.sampleNames=
>> "black",background.title="white",col.axis="black",col.title="black")
>>
>>
>> ### then plot
>>
>> myDataTrack[[1]]<-x
>>
>> myDataTrack[[2]]<-axisTrack
>>
>> plotTracks(myDataTrack,chromosome =
>> coords$chr,from=coords$start,to=coords$end)
>>
>>
>>
>>
>>
>> Similar to my plots your plot has no real X-axis - I can live with that,
>> but my boss obviously thinks that quantitative data like this is best
>>shown
>> in a classical x/y-plot (having a real x-axis, same color and style as
>> y-axis with both axes crossing). I will try to convince him that this is
>> not necessary.
>>
>>
>>
>> Best
>>
>> Maxim
>>
>>
>>
>>
>>
>> 2014-02-25 10:24 GMT+01:00 Dan Du <tooyoung at gmail.com>:
>>
>>> Hi Maxim,
>>>
>>> Perhaps you should read the package vignette more carefully given that
>>> you had indeed read it, say the first subsection of Track classes
>>>maybe.
>>> Since you had never shown us what you had done with any Gviz related
>>> codes.
>>>
>>> And regarding the cross which you think is important, someone correct
>>>me
>>> if I am wrong, you will never get it with Gviz. Those stacking tracks
>>> are never mean to be overlapping.
>>>
>>> Here is my 2ct if color is all you / your boss want,
>>>
>>> data(twoGroups)
>>> dTrack <- DataTrack(twoGroups, name = "uniform", type='polygon',
>>> col.axis='red', background.title = "white")
>>> axisTrack <- GenomeAxisTrack(col='red', fontcolor="red")
>>> plotTracks(list(dTrack, axisTrack))
>>>
>>> HTH,
>>> Dan
>>>
>>>
>>> On Mon, 2014-02-24 at 20:30 +0100, Maxim wrote:
>>>> Hi,
>>>>
>>>> sorry, you're of course right, my question not phrased correctly. I
>>> didn't
>>>> mean "cut", rather cross, better intersect, i.e. a typical coordinate
>>>> system, where x and y intersect at coordinate (0,0), e.g.:
>>>>
>>>> http://en.wikipedia.org/wiki/File:Cartesian-coordinate-system.svg (of
>>>> course without negative x-values)
>>>>
>>>> In contrast to this, all my efforts to plot with Gviz resulted in
>>>>plots
>>>> without any x-axis, so my actual question is:
>>>>
>>>> how to draw an x-axis in a gviz polygon, mountain or histogram plot?
>>>>In
>>> the
>>>> documentation I couldn't find any parameter that allows setting x-axis
>>>> related parameters (e.g. color, where is the intersection with y-axis,
>>>> ticks ...), nor does the manual show an example that would suggest
>>>>this
>>> is
>>>> possible. But perhaps I'm just looking for the wrong descriptions.
>>>>
>>>> Furthermore I aim at an axis, that indeed intersects the y-axis, e.g.
>>>>a
>>>> plot like
>>>>
>>>> plot(1,frame.plot=T)
>>>>
>>>> does, whereas
>>>>
>>>> plot(1,frame.plot=F)
>>>>
>>>> does not. The latter aspect is not that important, having the x-axis
>>>>(in
>>>> the same color as the y-axis) is most important!
>>>>
>>>> Thank you for your efforts!
>>>> Best
>>>> Maxim
>>>>
>>>>
>>>> 2014-02-24 18:28 GMT+01:00 Steve Lianoglou <lianoglou.steve at gene.com>:
>>>>
>>>>> Hi,
>>>>>
>>>>> On Mon, Feb 24, 2014 at 7:03 AM, Maxim <deeepersound at googlemail.com>
>>>>> wrote:
>>>>>> Hi,
>>>>>>
>>>>>> since very recently I'm using Gviz for plotting coverage vectors
>>>>>>from
>>>>>> ChIP-seq data. I would like to stick to it as it draws gene models
>>> much
>>>>>> nicer than my previous attempts drawing them with my own plotting
>>>>>> functions. I wonder whether it is possible to have mountain/polygon
>>> or
>>>>>> histogram tracks with a continuous x-axis that indeed cuts the
>>> y-axis, at
>>>>>> best in the same color as the y-axis? This is because I personally
>>> like
>>>>> the
>>>>>> Gviz plots a lot but my boss expects me to produce typical plots
>>> with a
>>>>>> standard x/y coordinate system!
>>>>>
>>>>> Can you give a concrete example of what you mean? I'm having a hard
>>>>> time understanding what "cuts the y-axis" means.
>>>>>
>>>>> Perhaps you could provide  graphic of how gviz plots your data now,
>>>>> and another (perhaps using photoshop) of you you'd like it to look
>>>>> like.
>>>>>
>>>>> -steve
>>>>>
>>>>> --
>>>>> Steve Lianoglou
>>>>> Computational Biologist
>>>>> Genentech
>>>>>
>>>>
>>>>        [[alternative HTML version deleted]]
>>>>
>>>> _______________________________________________
>>>> Bioconductor mailing list
>>>> Bioconductor at r-project.org
>>>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>>>> Search the archives:
>>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>>
>>>
>>>
>>
>> 	[[alternative HTML version deleted]]
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives:
>>http://news.gmane.org/gmane.science.biology.informatics.conductor
>
>--
>James W. MacDonald, M.S.
>Biostatistician
>University of Washington
>Environmental and Occupational Health Sciences
>4225 Roosevelt Way NE, # 100
>Seattle WA 98105-6099
>
>_______________________________________________
>Bioconductor mailing list
>Bioconductor at r-project.org
>https://stat.ethz.ch/mailman/listinfo/bioconductor
>Search the archives:
>http://news.gmane.org/gmane.science.biology.informatics.conductor



More information about the Bioconductor mailing list