Gviz: HighlightTrack on AlignmentsTrack - over pileup (reads) but behind coverage?
1
0
Entering edit mode
stianlagstad ▴ 90
@stianlagstad-9723
Last seen 4.8 years ago

I had some trouble with the title for this one, but a plot should explain:

alTrack <- Gviz::AlignmentsTrack(
  system.file(package = "Gviz", "extdata", "gapped.bam"),
  isPaired = TRUE)

alTrackHighlight <- Gviz::HighlightTrack(
  trackList = alTrack,
  start = 3048600,
  end = 3048700,
  chromosome = "chr12")
Gviz::displayPars(alTrackHighlight) <- list(
  fill = "green",
  col = "transparent"
)

res <- Gviz::plotTracks(
  alTrackHighlight,
  from = 3048500,
  to = 3049000,
  type = c("coverage", "sashimi", "pileup"),
  chromosome = "chr12"
)

Is there a way I can tell the highlighted region to be added "on top of" the coverage histogram, just like it is "on top of" the reads below?

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

I think that you'd have to add transparency to the coverage histogram. HighlightTracks always sit behind the drawing canvas. The only reason why it appears to be above the reads is because they also use transparent colours. I don't think that we are exposing the alpha level for the histogram, though. If you just want constancy, you could set alpha.read=1

That would remove the transparency from the reads.

ADD COMMENT
0
Entering edit mode

Thank you for the quick answer, and again for the Gviz package. Could I draw your attention to these two questions?

Gviz: Set height to avoid empty whitespace below reads in an AlignmentsTrack?

Gviz: Is it possible to retrieve coordinates of a plotted HightlightTrack?

ADD REPLY

Login before adding your answer.

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