Question: Gviz: decreasing tick resolution
0
gravatar for willbradshaw
11 weeks ago by
willbradshaw0 wrote:

Hi everyone!

I'm currently mapping out a genomic locus with Gviz, and I'm running into an issue in one of my sub-figures where the Genome Axis Track tick labels are mashing into each other:

It seems to have automatically decided to show ticks every 1kb due to the relatively short range being plotted (~5kb), but in order to prevent the labels overlapping it would be good if I could specify to only plot them every 2kb or similar.

The only graphical option I can find relating to tick resolution is littleticks, which does the opposite of what I want. Is there any way to reduce the tick resolution rather than increasing it? If not, can anyone suggest a good alternative solution? I don't really want to alternate the tick labels above and below the axis unless there's no alternative, as that will interfere with some other annotations I want to add later.

Thanks!

Will

gviz gviz-package • 96 views
ADD COMMENTlink modified 11 weeks ago by Robert Ivanek590 • written 11 weeks ago by willbradshaw0
Answer: Gviz: decreasing tick resolution
2
gravatar for Robert Ivanek
11 weeks ago by
Robert Ivanek590
Switzerland
Robert Ivanek590 wrote:

Hi Will,

I added new parameter called ticksAt for GenomeAxisTrack. It will be available in developmental version of Gviz (1.27.5) (Bioc 3.9)

Best

Robert

ADD COMMENTlink written 11 weeks ago by Robert Ivanek590

Hi Robert,

Thanks for the quick and helpful answer; great to know this will be available soon! Just to check (I'm not used to working with dev versions), since this is in Bioc 3.9 and R 3.6 isn't released yet, I'll need to set up r-devel to use it, right?

Thanks again,

Will

ADD REPLYlink modified 11 weeks ago • written 11 weeks ago by willbradshaw0

Yes, that is correct.

I think that installing devel version of R and all the packages might be an overkill, especially for one figure. If you do not mind to use a dirty hack you can also install the devel version of Gviz in current release version of R (assuming all dependencies for release version of Gviz are met). You need to wait 1-2 days until the new version is available (currently only 1.27.4). Keep in mind that this is a quick and dirty hack, which stops updating Gviz in your current installation. So do not forget to reinstall the release version afterwards.

install.packages("http://bioconductor.org/packages/devel/bioc/src/contrib/Gviz_1.27.5.tar.gz", repos=NULL)
ADD REPLYlink modified 11 weeks ago • written 11 weeks ago by Robert Ivanek590

That sounds ideal, thanks! :-)

ADD REPLYlink written 11 weeks ago by willbradshaw0

Hi Robert,

I just installed Gviz 1.27.5 and then realised I didn't actually ask how to use the new parameter to do what I want. Whoops.

I tried adding ticksAt = 2000 and ticksAt=seq(0, <end>, 2000) to my GenomeAxisTrack call and it didn't seem to make any difference. Could you give me a quick example of how to use it?

Thanks again for your help!

Will

ADD REPLYlink modified 11 weeks ago • written 11 weeks ago by willbradshaw0

You need to specify the positions of tick marks, i.e. seq(280e3, 320e3, 40e3). Complete example:

library(Gviz)
axisTrack <- GenomeAxisTrack()
plotTracks(axisTrack, from=270e3, to=330e3)

with ticksAt parameter:

plotTracks(axisTrack, from=270e3, to=330e3, ticksAt=seq(280e3, 320e3, 40e3))
ADD REPLYlink modified 11 weeks ago • written 11 weeks ago by Robert Ivanek590
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: 341 users visited in the last hour