Gviz: Keep transcripts on same line even when using reverseStrand+showId?
2
0
Entering edit mode
stianlagstad ▴ 90
@stianlagstad-9723
Last seen 4.8 years ago

This code:

Gviz::plotTracks(
  c(biomartBoth, axisTrack),
  from = biomartBoth@start,
  to = biomartBoth@end,
  chromosome = rep("chr15", 2),
  showId = TRUE,
  just.group = "below"
)

Produces this plot, as expected:

However, if I add the option reverseStrand=TRUE:

Gviz::plotTracks(
  c(biomartBoth, axisTrack),
  from = biomartBoth@start,
  to = biomartBoth@end,
  chromosome = rep("chr15", 2),
  showId = TRUE,
  just.group = "below",
  reverseStrand = TRUE
)

Then I get this:

I figured out that removing the ids, like this:

Gviz::plotTracks(
  c(biomartBoth, axisTrack),
  from = biomartBoth@start,
  to = biomartBoth@end,
  chromosome = rep("chr15", 2),
  showId = FALSE,
  just.group = "below",
  reverseStrand = TRUE
)

Plots the transcripts on the same line again:

But how can I plot the transcripts on the same line while showing the ids?

Complete code example.

gviz • 1.4k views
ADD COMMENT
2
Entering edit mode
@florianhahnenovartiscom-3784
Last seen 6.3 years ago
Switzerland

Ok, also fixed this issue along with the other committed changes referenced here:

C: Gviz: HighlightTrack doesn't react to reverseStrand = TRUE ?

Thanks for reporting.

ADD COMMENT
0
Entering edit mode
@florianhahnenovartiscom-3784
Last seen 6.3 years ago
Switzerland

Could you please include the code that created the biomartBoth object in order to replicate the issue.

Also, out of curiosity, why are you explicitly passing in biomartBoth@start and biomartBoth@end as the from and to parameters? Gviz should pick those up automatically. Not forcing from and to will also allow Gviz to add some space before the beginning of each transcript in order to accommodate the labels if needed, which in most cases is beneficial.

Florian

ADD COMMENT
0
Entering edit mode

Thank you for answering. The link "Complete code example" at the bottom has the whole example. I'm passing in start/end because I have to do it in my bigger plotting scripts, where I'm plotting multiple types of tracks together (Gviz then says it can't automatically calculate the start/stop positions).

ADD REPLY

Login before adding your answer.

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