Biostar Beta. Not for public use.
What Python Libraries Exist For Drawing Genes/Features/Intervals?
12
Entering edit mode
2.4 years ago
United States

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.

ADD COMMENTlink
16
Entering edit mode
18 months ago
London, UK

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):

alt text

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:

alt text

0
Entering edit mode

These look promising, thanks.

ADD REPLYlink
0
Entering edit mode

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

ADD REPLYlink
5
Entering edit mode
2.8 years ago
Cambridge, UK

BioPython can now do diagrams as well. The picture below is for restriction analysis, but you get the idea.

alt text

ADD COMMENTlink
0
Entering edit mode

The link is outdated. It should be Chapter 17 Graphics including GenomeDiagram

ADD REPLYlink
2
Entering edit mode
20 months ago
brentp 23k
Salt Lake City, UT

I haven't tried these, but also check out:

  1. willow by Titus brown--I think that's tied to pygr somehow
  2. GenomeViewer which uses Wx for rendering.
ADD COMMENTlink
2
Entering edit mode
5.9 years ago
bw. • 150
San Francisco

Also, there is

http://genes.mit.edu/burgelab/miso/docs/sashimi.html

ADD COMMENTlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.3.1