Question: Plot reads from .BAM file above reference sequence in R?
0
gravatar for stianlagstad
3.8 years ago by
stianlagstad1000
Oslo, Norway
stianlagstad1000 wrote:

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.

plot R • 2.3k views
ADD COMMENTlink modified 3.8 years ago • written 3.8 years ago by stianlagstad1000
1

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 REPLYlink written 3.8 years ago by dariober11k

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 REPLYlink written 3.8 years ago by stianlagstad1000
1

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 REPLYlink written 3.8 years ago by Sukhdeep Singh10.0k

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 REPLYlink written 3.8 years ago by stianlagstad1000

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 REPLYlink written 3.8 years ago by Sukhdeep Singh10.0k
1

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 REPLYlink written 3.8 years ago by stianlagstad1000

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 REPLYlink written 3.8 years ago by Sukhdeep Singh10.0k
Please log in to add an answer.

Help
Access

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