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
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
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 ofGviz
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.That sounds ideal, thanks! :-)
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
andticksAt=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
You need to specify the positions of tick marks, i.e.
seq(280e3, 320e3, 40e3)
. Complete example:with
ticksAt
parameter:Hi Robert,
I was checking over my figures again just now and noticed that the tick labels are back to the overlapping state they were in before. Checking my R script it seems like the
ticksAt
argument has stopped working; changing the values to the argument inplotTracks
doesn't seem to have any effect on tick placement.Have there been changes to the way this is implemented since we talked in January? I'm using Gviz 1.27.6.
Thanks, Will
Hi Will, It works for me. Can you post your code? Best, Robert
Hi Robert, Strange, I restarted everything and it seems to work now. Sorry for wasting your time! Will