Plot reads from .BAM file above reference sequence in R?
0
0
Entering edit mode
8.7 years ago
stianlagstad ★ 1.1k

I want to plot something like this:

enter image description here

This was produced with Gviz. My problem with Gviz is the empty space added at the bottom of the plot (below the reads). I posted a question about that here.

Do you have any suggestions on how I can plot reads aligned to a reference sequence in R, and not use Gviz?

Edit: The observant might have noticed that the "empty space problem" with the Gviz plot was solved in the post I linked to. I'm still curious if there are other solutions, though.

R plot • 5.5k views
ADD COMMENT
1
Entering edit mode

I surmise it might be easier to do it manually in inkscape or gimp or semi-manually with imagemagick convert. Surely it is possible in pure R but it might be a pain... (I'd be happy to be proved wrong though...)

ADD REPLY
0
Entering edit mode

Thank you for the answer! For a single case it would be easier to do it manually, but I have to do this automatically in R :) I have a solution that works with Gviz, but that empty space is giving me problems when I export the plot in scalable formats.

ADD REPLY
1
Entering edit mode

Try Sushi: An R/Bioconductor package for visualizing genomic data or if you export pdf via gviz, and import in Adobe Illustrator, each feature becomes an object and you can manually edit it.

ADD REPLY
0
Entering edit mode

Thank you for the answer! I have looked at the Sushi manual before but I couldn't see anything that would help me. Could you point me in the right direction?

ADD REPLY
0
Entering edit mode

I haven't used Sushi personally, I suggested as it might be useful. I could suggest you a few more, that I've come across, might solve your purpose.

First of all this a resource of most tools What Tools/Libraries Do You Use To Visualize Genomic Feature Data?

ggbio - has support for BAM file. GenomeGraphs

ADD REPLY
1
Entering edit mode

Thank you, but rest assured that I've done more than a few searches and I've looked at more than a couple of packages before coming here to ask the question. If you have a specific suggestion that would be helpful :)

ADD REPLY
0
Entering edit mode

Just for the time being, if you want you can use the illustrator trick, if you export the pdf plot from Gviz. Good Luck!

ADD REPLY

Login before adding your answer.

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