Gviz: Fewer ticks on GenomeAxisTrack?
1
0
Entering edit mode
stianlagstad ▴ 90
@stianlagstad-9723
Last seen 4.1 years ago

Is it possible to get fewer ticks on the GenomeAxisTrack? Example:

library(Gviz)
library(biomaRt)

# Create mart
mart <- biomaRt::useMart(
  biomart = "ENSEMBL_MART_ENSEMBL",
  dataset = "hsapiens_gene_ensembl",
  host = "dec2013.archive.ensembl.org")

# Create transcript track
biomartTrack <- Gviz::BiomartGeneRegionTrack(
  filters = list(
    ensembl_transcript_id = "ENST00000420055"),
  biomart = mart)

# Create axis track
axisTrack <- Gviz::GenomeAxisTrack()
Gviz::displayPars(axisTrack) <- list(
  add53 = TRUE,
  add35 = TRUE,
  labelPos = "below",
  cex = 1,
  col = "black", # line color
  fontcolor = "black",
  lwd = 1,
  littleTicks = TRUE
)

# Plot
Gviz::plotTracks(
  list(biomartTrack, axisTrack))

I do want to place the ticks below the axis, but I want fewer of them. As you can see it doesn't look good with this many.

gviz • 1.1k views
ADD COMMENT
1
Entering edit mode
@florianhahnenovartiscom-3784
Last seen 5.6 years ago
Switzerland

You don't have control down to that level, I'm afraid. In your example the problem seems to be that your overall plot width is extremely narrow. Guess your only options are reducing the font size or providing a wider plotting region.

Florian

ADD COMMENT
0
Entering edit mode

Thanks again for helping a beginner out - Gviz is great! I'll work around it with a smaller font size.

ADD REPLY

Login before adding your answer.

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