Planning genetic constructs with many parts and assembly steps, such as recombinantmetabolic pathways
The pydna python package provide a human-readable formal descriptions of
Pydna can be though of as executable documentation for cloning.
A cloning strategy expressed in pydna is complete, unambiguous and stable.
Pydna provides simulation of:
Virtually any sub-cloning experiment can be described in pydna, and its execution yieldthe sequence of the of intermediate and final resulting DNA molecule(s).
Pydna has been designed to be understandable for biologists with only some basic understanding of Python.
Pydna can formalize planning and sharing of cloning strategies and is especially useful for complex or combinatorialDNA molecule constructions.
Look at some assembly strategies of D-xylose metabolic pathways made in the Jupyter notebookformat MetabolicEngineeringGroupCBMA/ypk-xylose-pathways.
There is an open access paper in BMC Bioinformatics describing pydna:
Please reference the above paper:
Pereira, F., Azevedo, F., Carvalho, Â., Ribeiro, G. F., Budde, M. W., & Johansson, B. (2015). Pydna: a simulation and documentation tool for DNA assembly strategies using python. BMC Bioinformatics, 16(142), 142.
if using pydna in a scientific publication.
Most pydna functionality is implemented as methods for the double stranded DNA sequence recordclasses Dseq and Dseqrecord, which are subclasses of the Biopython Seq and SeqRecord classes.
These classes make cut and paste cloning and PCR very simple:
::
>>> from pydna.dseq import Dseq
>>> seq = Dseq("GGATCCAAA","TTTGGATCC",ovhg=0)
>>> seq
Dseq(-9)
GGATCCAAA
CCTAGGTTT
>>> from Bio.Restriction import BamHI
>>> a,b = seq.cut(BamHI)
>>> a
Dseq(-5)
G
CCTAG
>>> b
Dseq(-8)
GATCCAAA
GTTT
>>> a+b
Dseq(-9)
GGATCCAAA
CCTAGGTTT
>>> b+a
Dseq(-13)
GATCCAAAG
GTTTCCTAG
>>> b+a+b
Dseq(-17)
GATCCAAAGGATCCAAA
GTTTCCTAGGTTT
>>> b+a+a
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/pydna/dsdna.py", line 217, in __add__
raise TypeError("sticky ends not compatible!")
TypeError: sticky ends not compatible!
>>>
As the example above shows, pydna keeps track of sticky ends.
Notably, homologous recombination and Gibson assembly between linear DNA fragmentscan be easily simulated without any additional information besides the primary sequence of the fragments.
Gel electrophoresis of DNA fragments can be simulated using the included gel module
Jupyter QtConsole 4.7.7
Python 3.8.5 | packaged by conda-forge | (default, Aug 29 2020, 01:22:49)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.18.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: from pydna.gel import gel
In [2]: from pydna.ladders import PennStateLadder
In [3]: from pydna.dseqrecord import Dseqrecord
In [4]: gel([PennStateLadder,[Dseqrecord("A"*2000)]])
Out[4]:
Pydna can be very compact. The eleven lines of Python below simulates the construction of a recombinant plasmid.DNA sequences are downloaded from Genbank by accession numbers that are guaranteed to be stable over time.
from pydna.genbank import Genbank
gb = Genbank("myself@email.com") # Tell Genbank who you are!
gene = gb.nucleotide("X06997") # Kluyveromyces lactis LAC12 gene for lactose permease.
from pydna.parsers import parse_primers
primer_f,primer_r = parse_primers(''' >760_KlLAC12_rv (20-mer)
ttaaacagattctgcctctg
>759_KlLAC12_fw (19-mer)
aaatggcagatcattcgag ''')
from pydna.amplify import pcr
pcr_prod = pcr(primer_f,primer_r, gene)
vector = gb.nucleotide("AJ001614") # pCAPs cloning vector
from Bio.Restriction import EcoRV
lin_vector = vector.linearize(EcoRV)
rec_vec = ( lin_vector + pcr_prod ).looped()
Pydna can automate the simulation of sub cloning experiments usingpython. This is helpful to generate examples for teaching purposes.
Read the documentation (below) or the cookbook with example filesfor further information.
Please post a message in the google groupfor pydna if you need help or have problems, questions or comments
Feedback & suggestions are very welcome!
An Automated Protein Synthesis Pipeline with Transcriptic and Snakemake
Pyviko: an automated Python tool to design gene knockouts in complex viruses with overlapping genes
and others
Documentation is built using Sphinx from docstringsin the code and displayed at readthedocs
The numpy docstring format is used.
The absolutely best way of installing and using pydna is to use thefree Anaconda or Miniconda python distributions.
Anaconda is a large download (about 400 Mb) while Miniconda is about 40-50 Mb.
Once Anaconda (or Miniconda) is installed, the conda package manager can be used to install pydna.
Type the command below followed by return:
conda install -c bjornfjohansson pydna
This works on Windows, MacOSX and Linux, and installs all necessary and optional dependenciesautomatically (see below).
The conda install command will install the latest version, even if this is an alpha version.
Other versions of pydna are available from the BjornFJohansson package channel.
The second best way of installing pydna is with pip, theofficially recommended tool.
Pip is included in recent Python versions.
Pip installs the minimal installation requirements automatically, but not the optional requirements (see below).
::
sudo pip install pydna --pre
Use the --pre switch to get the latest version of pydna.
You should be able to pip install pydna from the Windows terminal as biopython now can be installed with pip as well.
C:\> pip install pydna --pre
By default python and pip are not on the PATH. You can re-install Python and select this option during installation,or give the full path for pip. Try something like this, depending on where your copy of Python is installed:
C:\Python37\Scripts\pip install pydna --pre
If you install from source, you need to install all dependencies separately (listed above).Download one of the source installers from the pypi site or from Github and extract the file.Open the pydna source code directory (containing the setup.py file) interminal and type:
python setup.py install
Pydna is developed on Github .
Pydna is currently developed on and for Python 3.6 - 3.9. Pydna versions before 1.0.0 were compatible withpython 2.7 only.The list below is the minimal requirements for installing pydna. Biopython has c-extensions, but the othermodules are pure python.
Pydna has been designed to be used from the Jupyter notebook. If IPythonand Jupyter are installed, importing ipython notebooks as modules among aresupported among other things.
If the modules listed below are installed, gel simulation functionality will be available.
The pydna conda package installs the optional requirements listed above as well as:
The test suit is run automatically after each commit on Linux, macOS and Windows using a GitHub action.
See the change log for recent changes.
There are three github actions associated with this package:
The `pydna_test_and_coverage_workflow.yml is triggered on all pushed non-tagged commits.This workflow run tests, doctests and a series of Jupyter notebooks using pytest.
The two other workflows build a setuptools wheel and packages for different Python versionson Linux, Windows and macOS. These are triggered by publishing a github release manuallyfrom the github interface.