• Stars
    star
    176
  • Rank 216,987 (Top 5 %)
  • Language
    Python
  • License
    MIT License
  • Created about 7 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

โœ๏ธ A versatile DNA sequence optimizer

DNA Chisel - a versatile sequence optimizer

DNA Chisel Logo

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

DNA Chisel (complete documentation here) is a Python library for optimizing DNA sequences with respect to a set of constraints and optimization objectives. It can also be used via a command-line interface, or a web application.

The library comes with over 15 classes of sequence specifications which can be composed to, for instance, codon-optimize genes, meet the constraints of a commercial DNA provider, avoid homologies between sequences, tune GC content, or all of this at once! Users can also define their own specifications using Python, making the library suitable for a large range of automated sequence design applications, and complex custom design projects.

Usage

Defining a problem via scripts

The example below will generate a random sequence and optimize it so that:

  • It will be rid of BsaI sites (on both strands).
  • GC content will be between 30% and 70% on every 50bp window.
  • The reading frame at position 500-1400 will be codon-optimized for E. coli.
from dnachisel import *

# DEFINE THE OPTIMIZATION PROBLEM

problem = DnaOptimizationProblem(
    sequence=random_dna_sequence(10000),
    constraints=[
        AvoidPattern("BsaI_site"),
        EnforceGCContent(mini=0.3, maxi=0.7, window=50),
        EnforceTranslation(location=(500, 1400))
    ],
    objectives=[CodonOptimize(species='e_coli', location=(500, 1400))]
)

# SOLVE THE CONSTRAINTS, OPTIMIZE WITH RESPECT TO THE OBJECTIVE

problem.resolve_constraints()
problem.optimize()

# PRINT SUMMARIES TO CHECK THAT CONSTRAINTS PASS

print(problem.constraints_text_summary())
print(problem.objectives_text_summary())

# GET THE FINAL SEQUENCE (AS STRING OR ANNOTATED BIOPYTHON RECORDS)

final_sequence = problem.sequence  # string
final_record = problem.to_record(with_sequence_edits=True)

Defining a problem via Genbank features

You can also define a problem by annotating directly a Genbank as follows:

report

Note that constraints (colored in blue in the illustration) are features of type misc_feature with a prefix @ followed by the name of the constraints and its parameters, which are the same as in python scripts. Optimization objectives (colored in yellow in the illustration) use prefix ~. See the Genbank API documentation for more details.

Genbank files with specification annotations can be directly fed to the web application or processed via the command line interface:

# Output the result to "optimized_record.gb"
dnachisel annotated_record.gb optimized_record.gb

Or via a Python script:

from dnachisel import DnaOptimizationProblem
problem = DnaOptimizationProblem.from_record("my_record.gb")
problem.optimize_with_report(target="report.zip")

By default, only the built-in specifications of DNA Chisel can be used in the annotations, however it is easy to add your own specifications to the Genbank parser, and build applications supporting custom specifications on top of DNA Chisel.

Reports

DNA Chisel also implements features for verification and troubleshooting. For instance by generating optimization reports:

problem = DnaOptimizationProblem(...)
problem.optimize_with_report(target="report.zip")

Here is an example of summary report:

report

How it works

DNA Chisel hunts down every constraint breach and suboptimal region by recreating local version of the problem around these regions. Each type of constraint can be locally reduced and solved in its own way, to ensure fast and reliable resolution.

Below is an animation of the algorithm in action:

DNA Chisel algorithm

Installation

DNA Chisel requires Python 3, and can be installed via a pip command:

pip install dnachisel     # <= minimal install without reports support
pip install 'dnachisel[reports]' # <= full install with all dependencies

The full installation using dnachisel[reports] downloads heavier libraries (Matplotlib, PDF reports, sequenticon) for report generation, but is highly recommended to use DNA Chisel interactively via Python scripts. Also install GeneBlocks and its dependencies if you wish to include a plot of sequence edits in the report.

Alternatively, you can unzip the sources in a folder and type

python setup.py install

Optionally, also install Bowtie to be able to use AvoidMatches (which removes short homologies with existing genomes). On Ubuntu:

sudo apt-get install bowtie

License = MIT

DNA Chisel 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!

More biology software

https://raw.githubusercontent.com/Edinburgh-Genome-Foundry/Edinburgh-Genome-Foundry.github.io/master/static/imgs/logos/egf-codon-horizontal.png

DNA Chisel is part of the EGF Codons synthetic biology software suite for DNA design, manufacturing and validation.

Related projects

(If you would like to see a DNA Chisel-related project advertized here, please open an issue or propose a PR)

  • Benchling uses DNA Chisel as part of its sequence optimization pipeline according to this webinar video.
  • dnachisel-dtailor-mode brings features from D-tailor to DNA Chisel, in particular for the generation of large collection of sequences covering the objectives fitness landscape (i.e. with sequences with are good at some objectives and bad at others, and vice versa).

More Repositories

1

DnaFeaturesViewer

๐Ÿ‘๏ธ Python library to plot DNA sequence features (e.g. from Genbank files)
Python
491
star
2

pdf_reports

๐Ÿ“• Python library and CSS theme to generate PDF reports from HTML/Pug
Python
190
star
3

Flametree

๐Ÿ”ฅ Python file and zip operations made easy
Python
147
star
4

Taskpacker

๐ŸŽ’ Simple schedule optimization library for Python
Python
135
star
5

blabel

๐Ÿท๏ธ Python label/sticker PDF generation. HTML templates, built-in barcodes, qr codes, and other goodies
Python
135
star
6

Proglog

๐Ÿ“ Logs and progress bars manager for Python
Python
93
star
7

lala

๐ŸŒŽ Analyze and generate reports of web logs (NGINX)
Python
60
star
8

DnaCauldron

โš—๏ธ Simple cloning simulator (Golden Gate etc.) for single and combinatorial assemblies
Python
44
star
9

sequenticon

๐Ÿ‘พ Generate identicons for DNA sequences with Python
Python
36
star
10

Plateo

๐Ÿค– Python biolab automation library: parsers, reports generators, picklists simulators, and more
Python
35
star
11

Primavera

๐ŸŒธ Python library for primer-based verification of DNA assemblies: primer selection, data analyis, etc.
Python
32
star
12

codon-usage-tables

๐Ÿ“Š Codon usage tables in code-friendly format + Python bindings
Python
31
star
13

Geneblocks

๐Ÿ’  Find common blocks and differences between DNA sequences
Python
28
star
14

crazydoc

Read DNA sequences from colourful Microsoft Word documents
Python
24
star
15

DnaWeaver

A route planner for DNA assembly
Python
22
star
16

Caravagene

๐ŸŽจ Python library to plot multi-part genetic constructs
Python
21
star
17

genome_collector

๐ŸŒ  Easily download genomes and build BLAST/Bowtie indexes in Python
Python
20
star
18

CAB

๐Ÿš– The friendly Computational App Boilerplate. Django + Vue.JS + Redis queues + NginX
Vue
20
star
19

CUBA

๐Ÿ–๏ธ The EGF Collection of Useful Bio Apps - Web demos of EGF software
Vue
19
star
20

BandWagon

๐ŸŽบ Plot DNA digestion band patterns with Python
Python
17
star
21

BandWitch

๐Ÿ’ซ Computer-aided DNA assembly validation and identification from restriction digests.
Python
15
star
22

SBOL-Visual-CSS

โžฐ Draw genetic elements with HTML & CSS
HTML
15
star
23

genedom

Batch domestication of genetic parts with Python
Python
13
star
24

Sequeduct

Sequencing analysis pipeline
Nextflow
12
star
25

bioprinter

๐Ÿ–จ๏ธ Print pictures with living micro-organisms !
Python
12
star
26

Minotaor

An amino acid sequence annotator
Python
11
star
27

tatapov

๐Ÿพ DNA overhang misannealing data for Python
Python
9
star
28

GoldenHinges

๐Ÿ”— Short overhangs design for DNA assembly
Python
9
star
29

zymp

โœ‚๏ธ Design compact restriction sites arrays (python utility)
Python
8
star
30

kappagate

๐Ÿ”ฎ Predict DNA assembly clone validity rates - powered by Kappa
Python
8
star
31

dab

๐Ÿ‘‰ EGF Design and Build, the Foundry's DNA design ordering portal
Vue
8
star
32

egf-shared-documents

๐Ÿ“š Shared slideshows, courses, etc. from the EGF
HTML
7
star
33

easy_dna

๐ŸŽ’ Python library to read, write, edit DNA sequences
Python
6
star
34

icebreaker

โ„๏ธ Python API for the JBEI-ICE sample manager
Python
6
star
35

Examples

Collection of Python modules and Jupyter notebook examples
HTML
5
star
36

topkappy

๐ŸŒ” Pythonic bindings for the Kappa model simulation language
Python
5
star
37

crecombio

A simple Cre, Flp and other site-specific recombination simulator
Python
4
star
38

HowTo

๐Ÿ“’ Short opinionated recipes, mostly for us.
Python
4
star
39

genedeals

Data on different commercial offers for gene-sized DNA
4
star
40

igem-registry-downloader

Download the full iGEM database of parts
Python
3
star
41

saboteurs

๐Ÿ’ฃ Identify elements impairing success accross group experiments.
Python
3
star
42

Ediacara

Python package for interpreting sequencing data of assembled DNA constructs (plasmids)
Python
3
star
43

DnaWeaver-online

A web app for DNA Weaver
Vue
2
star
44

trellab

Thin layer on top of pytrello for automating Trello organization-based tasks
Python
2
star
45

Polymera

Polymera is a Python package for representing ambiguous sequences written with complement alphabets.
Python
2
star
46

OT2Metclo

MSc project
Python
2
star
47

GeneAlloy

Python
2
star
48

Edinburgh-Genome-Foundry.github.io

๐Ÿ“š The EGF Software Website
HTML
1
star
49

tatapov_data

Data for the EGF Tatapov package
1
star
50

egf-codons-website

๐Ÿ“š Sources of the EGF Codons website, written with Vue.js
Vue
1
star
51

Overhang

Compendium of overhangs
Python
1
star
52

Plasmid_assessor

Plasmid assessment for Golden Gate cloning
Python
1
star
53

ImagesAnnotator

Simple web app to annotate images by hand - built with Vue.js
JavaScript
1
star
54

EGF_Docker_Jupyter

Docker Jupyter images with (almost) all EGF packages
Dockerfile
1
star