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

A cloning strategy expressed in pydna is complete, unambiguous and stable. Pydna has been designed to be understandable for biologists with limited programming skills.

Pydna 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 IPython notebook format here.

There at the open access BMC Bioinformatics publication describing pydna:

abstr

Double stranded DNA sequence classes that make cut and paste cloning and PCR very simple is provided.

See an example of pydna usage at the command line below:

>>> 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 other than the primary sequence of the fragments.

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.

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.

Pydna was designed to semantically imitate how sub cloning experiments are typically documented in Scientific literature. Pydna code describing a sub cloning is reasonably compact and meant to be easily readable.

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.

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 might also be useful to automate the simulation of sub cloning experiments using python. This could be helpful to generate examples for teaching purposes. Read the documentation or the cookbook with example files for further information.

An on-line shell running Python with pydna is available for simple experimentation. It is slower than rinning pydna on your own computer.

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 on OSX-64 using travis icon1 and on Windows using appveyoricon2. Source distributions (gztar,zip) and a python wheel are built on drone icon3 and uploaded to pypi icon8 from which it has this monthly download count icon10. There is also a binstar package, wich is currently built offline. icon5. Documentation is built and displayed at readthedocs, icon7 code coverage is icon6 and there are a few stars on github icon9. Dependencies are monitored by versioneye icon11

Installation requirements

This package was developed on and for Python 2.7. Other versions have not been tested.

Requirements for running tests

Optional Requirements

Pydna has been designed to be used from the IPython notebook. If you have IPython installed, there are functions in pydna for importing ipython notebooks as modules among other things.

Python 3

This code has not been tried with Python 3. If there is sufficient interest, there might be a Python 3 version in the future.

Installation using conda on Anaconda

The best way of using Python in general is to use a free distribution such as Anaconda

There is a conda package available for pydna, which is easily installed at the command line using the conda package manager.

conda install -c https://conda.anaconda.org/bjornfjohansson pydna

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

Installation using pip

The second best way of installing pydna is with pip. Pip is the officially recommended tool for installation of Python packages from PyPi. Pip installs dependencies automatically.

Linux:

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

Windows:

C:\> pip install pydna

If you do not have pip, you can get it by following these instructions

Installation from Source

If you install from source, you need to install the dependencies separately (listed above). Download one of the source installers from the pypi site and extract the file. Open the pydna source code directory (containing the setup.py file) in terminal and type:

python setup.py install

Installation from binary distributions

There is a 64 bit windows executable and a windows wheel here. Note that these will not install required dependencies (see below).

Windows dependencies

Sometimes the dependecies can be difficult to install on windows, especially Biopython as a C compiler is necessary. If dependencies have to be installed separately, this can be done using the 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

networkx (32,64)

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

Source Code Repository

Pydna is developed on Github

TODO

  • [ ] IPython 4 (Jupyter) support

  • [ ] Add agarose gel electrophoresis simulation

Download files

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

Source Distributions

pydna-0.9.9.zip (2.1 MB view details)

Uploaded Source

pydna-0.9.9.tar.gz (2.1 MB view details)

Uploaded Source

Built Distribution

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

pydna-0.9.9-py2-none-any.whl (88.6 kB view details)

Uploaded Python 2

File details

Details for the file pydna-0.9.9.zip.

File metadata

  • Download URL: pydna-0.9.9.zip
  • Upload date:
  • Size: 2.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pydna-0.9.9.zip
Algorithm Hash digest
SHA256 7e8753e7870c3148321bd45b4e65b579426ecf2f256ddb9ac7167b620a76552e
MD5 b7be850e41f994409b7bdae09daea6d0
BLAKE2b-256 7c4751ee5147a979af08480eef770c0f616842513de1c5d07c6e8f79086a9ea3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for pydna-0.9.9.tar.gz
Algorithm Hash digest
SHA256 fb3f7a36d75fc90a50c4bbbdb50500ac7e7a187d808fa22c593a22f5a4854d76
MD5 268e3ec5ee112caf5b04e9562689e825
BLAKE2b-256 dac66bf3c063adf8861f26fb7a4ccf62052c98990bb7066beb3d38776d6c0509

See more details on using hashes here.

File details

Details for the file pydna-0.9.9-py2-none-any.whl.

File metadata

File hashes

Hashes for pydna-0.9.9-py2-none-any.whl
Algorithm Hash digest
SHA256 bea5523488bedfc7ddc78420b8286e21ea42543969ee0254ead89cd13ecce927
MD5 9ec75154025829780e080fbd6248b4f8
BLAKE2b-256 7c933d683ad877e6986d4e15f75929d5359460238700703f519819ae45bd62c0

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

1.1.0

2 files

1.0.2

3 files

1.0.1

3 files

1.0.0

3 files

This release

0.9.9 This release

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