Search
Question: Gviz: HighlightTrack on AlignmentsTrack - over pileup (reads) but behind coverage?
0
2.5 years ago by

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?

modified 2.5 years ago by florian.hahne@novartis.com1.6k • written 2.5 years ago by stianlagstad90
2
2.5 years ago by
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.

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?