Skip to main content

Planning genetic constructs with many parts, such as recombinant metabolic pathways is usually done manually using a DNA sequence editor, a task which quickly becomes unfeasible as scale and complexity of the constructions increase.

The Pydna python package provide a human-readable formal description of cloning and assembly strategies which also allows for automatic computer simulation and verification.

Pydna provides simulation of:

  • Restriction digestion

  • Ligation

  • PCR

  • Primer design

  • Gibson assembly

  • Homologous recombination

  • Gel electrophoresis of DNA (NEW Feature)

Pydna was designed to provide a form of executable documentation describing a subcloning or DNA assembly experiment. The pydna code unambiguously describe a sub cloning experiment, and can be executed to yield the sequence of the of the resulting DNA molecule. A cloning strategy expressed in pydna is complete, unambiguous and stable. Pydna has been designed to be understandable for biologists with some basic understanding of Python.

Pydna can formalize planning and sharing of cloning strategies and is especially useful for complex or combinatorial DNA molecule constructions.

Look at some assembly strategies made in the Jupyter notebook format here.

There is also an open access paper in BMC Bioinformatics describing pydna:

abstr

Please make a reference to the above paper if you publish work where pydna was used.

Most pydna functionality is implemented as methods for the double stranded DNA sequence record classes Dseq and Dseqrecord, which are subclasses of the Biopython Seq and SeqRecord classes.

These classes make cut and paste cloning and PCR very simple:

>>> import pydna
>>> seq = pydna.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!
>>>

Notably, homologous recombination and Gibson assembly between linear DNA fragments can be easily simulated without any additional information besides the primary sequence of the fragments.

Gel electrophoresis of DNA fragments can be simulated using the gel.py module by Bruno Silva:

simulated agarose gel

alt text

Look at an example notebook with a gel simulation here.

The nine 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.

import pydna

gb = pydna.Genbank("myself@email.com") # Tell Genbank who you are!

gene = gb.nucleotide("X06997") # Kluyveromyces lactis LAC12 gene for lactose permease.

primer_f,primer_r = pydna.parse(''' >760_KlLAC12_rv (20-mer)
                                    ttaaacagattctgcctctg

                                    >759_KlLAC12_fw (19-mer)
                                    aaatggcagatcattcgag
                                    ''', ds=False)

pcr_prod = pydna.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 is also be useful to automate the simulation of sub cloning experiments using python. This is helpful to generate examples for teaching purposes.

Read the documentation or the cookbook with example files for further information.

Please post a message in the google group for pydna if you have problems, questions or comments. Feedback in the form of questions, comments or criticism is very welcome!

Automatic testing and builds

The test suit is run automatically after each commit on:

  • OSX-64 using travis icon1

  • Windows using appveyor icon2.

  • Ubuntu using drone icon3

Documentation is built and displayed at readthedocs Documentation Status

Code coverage is Coverage Status

Dependencies are monitored by versioneye icon11

Github stars: GitHub stars

Github issues: GitHub issues

Minimal installation requirements

Pydna is currently developed on and for Python 3.5. Pydna versions before 1.0.0 were compatible with python 2.7 only. The list below is the minimal requirements for installing pydna. Biopython has c-extensions, but the other modules are pure python.

Optional Requirements

Pydna has been designed to be used from the Jupyter notebook. If IPython and Jupyter are installed, importing ipython notebooks as modules among are supported among other things.

If the modules listed below are installed, gel simulation functionality is available.

The pydna conda package installs all optional requirements, currently:

Requirements for running tests

Installation using conda on Anaconda

The absolutely best way of installing and using pydna is to use the free Anaconda python distribution.

Once Anaconda is installed, the conda package manager can be used to install pydna. Pydna and its dependencies are available from the conda-forge and BjornFJohansson Anaconda.org channels. The first step is to add the channels:

conda config --append channels conda-forge
conda config --append channels BjornFJohansson

Then pydna can be installed by simply:

conda install pydna

This works on Windows, MacOSX and Linux, and installs all necessary and optional dependencies automatically in one go.

Installation using pip

The second best way of installing pydna is with pip, the officially recommended tool.

Pip installs the minimal installation requirements automatically, but not the optional requirements (see above). These have to be installed manually.

Linux:

bjorn@bjorn-UL30A:~/pydna$ sudo pip install pydna

Windows:

C:\> pip install pydna

Installation from Source

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) in terminal and type:

python setup.py install

Windows dependencies

Sometimes dependencies can be difficult to install on windows, as a C compiler is necessary. If dependencies have to be installed separately, this can be done using these binary installers for Windows:

Dependency

link

Python (32,64)

http://www.python.org/download

Biopython (32)

http://biopython.org/wiki/Download

Biopython (64)

http://www.lfd.uci.edu/~gohlke/pythonlibs/#biopython

numpy (32,64)

http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

networkx (32,64)

http://www.lfd.uci.edu/~gohlke/pythonlibs/#networkx

pint

http://www.lfd.uci.edu/~gohlke/pythonlibs/Pint-0.6-py2.p y3-none-any.whl

scipy (32,64)

http://www.lfd.uci.edu/~gohlke/pythonlibs/#scipy

matplotlib (32,64)

http://www.lfd.uci.edu/~gohlke/pythonlibs/#matplotlib

ipython>=4.0

http://www.lfd.uci.edu/~gohlke/pythonlibs/#ipython

jupyter

http://www.lfd.uci.edu/~gohlke/pythonlibs/#jupyter

Source Code

Pydna is developed on Github.

Changelog

See the change log for recent changes.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydna-1.1.0.tar.gz (2.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydna-1.1.0.win-amd64.exe (351.7 kB view details)

Uploaded Source

File details

Details for the file pydna-1.1.0.tar.gz.

File metadata

  • Download URL: pydna-1.1.0.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pydna-1.1.0.tar.gz
Algorithm Hash digest
SHA256 6761823872e3aeb617c97144697d6105c188524754489bcd2ecf072f9b6dc1da
MD5 0f2de9565c04a554b6178c25793e3c50
BLAKE2b-256 cb246b130e92a5e7e0fed8fb0f0e8eb59d831e259cd5c6b78050ccfa7b532035

See more details on using hashes here.

File details

Details for the file pydna-1.1.0.win-amd64.exe.

File metadata

  • Download URL: pydna-1.1.0.win-amd64.exe
  • Upload date:
  • Size: 351.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pydna-1.1.0.win-amd64.exe
Algorithm Hash digest
SHA256 616da880c78cffa14888a3f2839e86005f72ba292dcdb91eb2a84a8a38a61f73
MD5 e85a48458f5fa4902b0efe30b0248f93
BLAKE2b-256 157b95425840d97c89754cd14198966304064607b95795299b40841998ade4bc

See more details on using hashes here.

Release history Release notifications | RSS feed

5.5.16

2 files

5.5.15

2 files

5.5.14

2 files

5.5.13

2 files

5.5.12

2 files

5.5.11

2 files

5.5.10

2 files

5.5.9

2 files

5.5.8

2 files

5.5.7

2 files

5.5.6

2 files

5.5.5

2 files

5.5.4

2 files

5.5.3

2 files

5.5.2

2 files

5.5.1

2 files

5.5.0

2 files

5.4.0

2 files

5.3.0

2 files

5.2.0

2 files

5.0.1

2 files

5.0.0

2 files

4.0.7

1 file

4.0.6

1 file

4.0.5

1 file

4.0.4

1 file

4.0.2

1 file

4.0.1

1 file

4.0.0

1 file

3.1.3

1 file

3.1.2

1 file

3.1.1

1 file

3.1.0

1 file

3.0.2

1 file

3.0.1

1 file

3.0.0

1 file

2.0.3

4 files

2.0.2

4 files

2.0.1

3 files

2.0.0

1 file

1.2.0

3 files

1.1.5

4 files

1.1.4

4 files

1.1.3a3

1.1.1

3 files

This release

1.1.0 This release

2 files

1.0.2

3 files

1.0.1

3 files

1.0.0

3 files

0.9.9

3 files

0.9.8

3 files

0.9.4

3 files

0.9.3

3 files

0.9.2

3 files

0.9.1

3 files

0.9.0

3 files

0.8.4

3 files

0.8.3

3 files

0.8.1

3 files

0.8.0

2 files

0.7.2

4 files

0.6.5

6 files

0.6.4

6 files

0.6.3

6 files

0.6.2

6 files

0.6.1

6 files

0.6.0

6 files

0.2.1

4 files

0.2.0

2 files

0.1.7

3 files

0.1.6

3 files

0.1.5

4 files

0.1.4

4 files

0.1.3

4 files

0.0.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page