Code Monkey home page Code Monkey logo

caravagene's Introduction

Caravagene logo

GitHub CI build status https://coveralls.io/repos/github/Edinburgh-Genome-Foundry/Caravagene/badge.svg?branch=master

Caravagene (full documentation here) is a Python library to plot schemas of DNA constructs from a list of parts:

from caravagene import Part, Construct, ConstructList

constructs = ConstructList([Construct([
    Part('promoter', label='my promoter'),
    Part('CDS', label='gene with a very very long name'),
    Part('terminator', label='PolyA'),
    Part('insulator', label='I1')
])])

constructs.to_image('construct.jpeg')

Here is another example producing this PDF showing multiple constructs:

from caravagene import Part, Construct, ConstructList

my_constructs = ConstructList(
    title="My constructs",
    constructs=[
        Construct(name="ASM1", parts=[
            Part(label='HA1', category='homology-arm'),
            Part(label='rc1', category='recombinase-recognition-sequence'),
            Part(label='my promoter', category='promoter'),
            Part(label='RNA stability', category='rna-stability-sequence'),
            Part(label='<i>acs</i>', category='CDS'),
            Part(label='PolyA', category='terminator'),
            Part(label='I1', category='insulator'),
        ]),
        Construct(name="ASM2", parts=[
            Part(label='my promoter', category='promoter'),
            Part(label='gene with a very very long name', category='CDS'),
            Part(label='PolyA', category='terminator'),
            Part(label='I1', category='insulator')
        ])
    ]
)
my_constructs.to_pdf('multiconstruct.pdf')

Note that ConstructList can be supplied with a font. It is also possible to extend Caravagene to support other categories/symbols, as follows:

from caravagene import SYMBOL_FILES
SYMBOL_FILES['my-new-category'] = 'path/to/some/symbol.svg'

Finally, here is an example using an Excel spreadsheet:

Spreadsheet:

Python code:

from caravagene import ConstructList
my_constructs = ConstructList("my_spreadsheet.xlsx")
my_constructs.to_pdf('my_schemas.pdf')

or command-line (one-time use):

caravagene my_spreadsheet.xlsx my_schemas.pdf

or command-line (re-render when the spreadsheet changes on disk):

caravagene my_spreadsheet.xlsx my_schemas.pdf --watch

Output:

Installation

Caravagene requires WkHTMLtoPDF to be installed. On Ubuntu, install it with:

(sudo) apt-get install wkhtmltopdf

You can install caravagene through PIP:

pip install caravagene

Alternatively, you can unzip the source code in a folder and type:

sudo python setup.py install

Licence

Caravagene is an open-source software originally written at the Edinburgh Genome Foundry by Zulko and released on Github under the MIT licence (Copyright 2017 Edinburgh Genome Foundry). Everyone is welcome to contribute!

caravagene's People

Contributors

veghp avatar zachcp avatar zulko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

sandyg05 zachcp

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.