Question: Gviz: HighlightTrack on AlignmentsTrack - over pileup (reads) but behind coverage?
gravatar for stianlagstad
2.3 years ago by
stianlagstad90 wrote:

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(
  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?

ADD COMMENTlink modified 2.3 years ago by florian.hahne@novartis.com1.6k • written 2.3 years ago by stianlagstad90
gravatar for
2.3 years ago by

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

That would remove the transparency from the reads.

ADD COMMENTlink written 2.3 years ago by florian.hahne@novartis.com1.6k

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 REPLYlink written 2.3 years ago by stianlagstad90
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.2.0
Traffic: 321 users visited in the last hour