These look promising, thanks.
I am working on new software for exploring genetic variation and genome annotations. One feature I would like to add is the ability to plot features (gene's, SNPs, SVs, etc.) in a given genomic region. What libraries are you aware of for producing "plots" or images like this in Python. Essentially, I am looking for something similar to Perl's Bio::Graphics module.
So far, I've seen that GenomeTools has a Python interface, but I am looking for possible alternatives.
4 answers
Have a look at BioGraphy by Andrea Pierleoni. It is probably going to be integrated into BioPython soon.
Example of BioGraphy output (from the tutorial):

Another alternative is GenomeDiagram. I can not reach the page linked in the article now, but this library should be included in the newer versions of BioPython. You can see some examples in the BioPython cookbook, chapter 15.
Example of GenomeDiagram output:

I have tryed to use BioGraphy and got it via:
git clone git://github.com/apierleoni/BioGraPy
After the two steps python setup.py build and python setup.py install, I tested the tutorial code from http://apierleoni.github.io/BioGraPy/tutorial.html:
from biograpy import Panel, tracks, features
panel=Panel(fig_width=900, padding = 25)#initialize a drawer, and add some padding
test_track = tracks.BaseTrack(features.Simple(name = 'feat1', start = 100, end = 356, ),
features.Simple(name = 'feat2', start = 30, end = 856, ),
features.Simple(name = 'feat3', start = 400, end = 700, ),
sort_by = 'None',)
panel.add_track(test_track)
panel.save('basic_test.png')
However, after this I got the following error message by using the ipython notebook (python 2.7):
AttributeError Traceback (most recent call last)
<ipython-input-1-050f14eab25c> in <module>()
4 features.Simple(name = 'feat2', start = 30, end = 856, ),
5 features.Simple(name = 'feat3', start = 400, end = 700, ),
----> 6 sort_by = 'None',)
7 panel.add_track(test_track)
8 panel.save('basic_test.png')
/home/linux/anaconda2/lib/python2.7/site-packages/biograpy-1.0b0dev_r0-py2.7.egg/biograpy/tracks.pyc in __init__(self, *args, **kwargs)
151 self.norm = kwargs.get('norm', None)# normalizing function, if None build one. could be any function taking a value an returning a float between 0 and 1
152 if not self.norm:
--> 153 self.norm = colors.normalize(vmin = self.min_score, vmax = self.max_score)
154
155
AttributeError: 'module' object has no attribute 'normalize'
Does somebody know how to solve this problem?
Thanks
The link is outdated. It should be Chapter 17 Graphics including GenomeDiagram
I haven't tried these, but also check out:
- willow by Titus brown--I think that's tied to pygr somehow
- GenomeViewer which uses Wx for rendering.
Also, there is http://genes.mit.edu/burgelab/miso/docs/sashimi.html
Log in to answer this question.
