GithubHelp home page GithubHelp logo

zulko / biograpy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apierleoni/biograpy

2.0 2.0 0.0 8.25 MB

Biological Graphic tool in Python

Home Page: http://apierleoni.github.com/BioGraPy/

License: Other

Shell 0.13% Python 99.87%

biograpy's Introduction

BioGraPy - Biological Graphical Library in Python
=================================================


Quick examples
------------------------------------------

Simple test

    >>> from biograpy import Panel, tracks, features
    >>> panel=Panel(fig_width=1000,fig_dpi=100)#initialize a drawer
    >>> test_track = tracks.BaseTrack(name = 'test') 

Create 5 graphicfeatures

    >>> feat1=features.Simple(name='feat1',start=100,end=756,fc='r',aplha=0.5,height=1)
    >>> feat2=features.Simple(name='feat2',start=300,end=1056,fc='pink',aplha=0.5,height=1)
    >>> feat3=features.Simple(name='feat3',start=600,end=1356,fc='y',aplha=0.5,height=1)
    >>> feat4=features.Simple(name='feat4',start=800,end=1356,fc='g',aplha=0.5,height=1)
    >>> feat5=features.Simple(name='feat5',start= 1357,end=1806,fc='b',aplha=0.5,height=1)

Add the features to the track::

    >>> test_track.append(feat1)
    >>> test_track.append(feat2)
    >>> test_track.append(feat3)
    >>> test_track.append(feat4)
    >>> test_track.append(feat5)

Add the track to the panel::

    >>> panel.add_track(test_track)

Save the drawn image in PDF format::

    >>> panel.save('test.pdf')


or in short, using default styles, and saving as PNG::

    >>> from biograpy import Panel, tracks, features
    >>> panel=Panel(fig_width=1000)#initialize a drawer
    >>> test_track = tracks.BaseTrack(features.Simple(name='feat1',start=100,end=756,),
            features.Simple(name='feat2',start=300,end=1056,),
            features.Simple(name='feat3',start=600,end=1356,),
            features.Simple(name='feat4',start=800,end=1356,),
            features.Simple(name='feat5',start= 1357,end=1806,),
            name = 'test')
    >>> panel.add_track(test_track)
    >>> panel.save('test.png')




draw a SeqRecord

    >>> from biograpy.seqrecord import SeqRecordDrawer
    >>> from Bio import SeqIO
    >>> seqrec = SeqIO.read(open('biograpy/tests/test_uniprot.xml'),'uniprot-xml')
    >>> grseqrec = SeqRecordDrawer(seqrec)
    >>> grseqrec.save('biograpy/tests/test_uniprot.svg')

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.