Gviz: Set height to avoid empty whitespace below reads in an AlignmentsTrack?
2
0
Entering edit mode
stianlagstad ▴ 90
@stianlagstad-9723
Last seen 4.1 years ago

This code:

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

Gviz::plotTracks(
  alTrack,
  from = 3048500,
  to = 3049000,
  chromosome = "chr12")

Produces this plot:

How can I avoid the not-used whitespace at the bottom of the plot, below the reads? Regardless of the device height I set, there's always empty whitespace below the reads.

The specific region I don't want to appear:

Edit with answer:

Florian to the rescue again! The max.height parameter did it. Updated code with result:

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

Gviz::displayPars(alTrack) <- list(
  min.height = 25
)

Gviz::plotTracks(
  alTrack,
  from = 3048500,
  to = 3049000,
  chromosome = "chr12")

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

My bad. But it is the max.height parameter that will do the trick for you. Set this to a large value, and the white space will be filled with expanded reads. Doesn't look very nice. 

Changing the device height not having any effect is not true btw. Just limit the height of your plotting device and you will see less white space. 

ADD COMMENT
0
Entering edit mode

Thank you. I must have had some other error, because I just confirmed that setting the displaypar max.height to 30 made the whitespace go away. Sorry!

ADD REPLY
0
Entering edit mode
@florianhahnenovartiscom-3784
Last seen 5.5 years ago
Switzerland

Could you try and play around with the min.height and max.height and coverageHeight parameters to see if that fixes the issue? Without having the data to reproduce it is hard to give any more advise. 

ADD COMMENT
0
Entering edit mode

Thank you for answering. You do have the data - it's the example data included in Gviz :) I have already tried to play with those parameters but I will try some more. I believe this person on SEQanswers also has the same problem.

ADD REPLY

Login before adding your answer.

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