Contains classes and code for representing double stranded DNA and functions for simulating homologous recombination between DNA molecules.
Project description
Pydna provide functions for molecular biology using python. Double stranded DNA sequence classes that make cut and paste cloning and PCR very simple is provided (see example 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.
Most 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 experimentation.
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 critisism is very welcome!
version |
date |
comment |
---|---|---|
0.6.4 |
2014-07-09 |
The pcr function and Anneal class can now deal with primers with ambiguous nucleotides like R = A or G. In the resulting PCR product, the ambiguous nucleotides are preserved in the tails i.e. the primer part not annealing. The annealing part will have the sequence corresponding to the template. |
0.6.3 |
2014-07-06 |
Dseqrecord.add_feature can now take a string or some other sequence as input. The assembly primers function can now produce primers for a circular assembly. |
0.6.2 |
2014-06-13 |
Dseqrecord gained three new methods: isorf() method returning True or False. list_features() method printa a lists all features in an ASCII table. extract_feature() extracts a feature in the form os a new Dseqrecord object. Changes to how the primer_design functions work, especially assembly primers. |
0.6.1 |
2014-04-25 |
Fixed a bug in the Dseqrecord synced method and removed the utils synced function. |
0.6.0 |
2014-04-18 |
Bugfixes and improvements in documentation. |
0.5.0 |
2013-12-16 |
Changes to how the amplify and assembly modules work the Amplicon and Assembly classes are now subclasses of Dseqrecord. |
0.2.2 |
2013-11-05 |
bugfix: changed the handling of compound features to fit with the new version of BioPython (1.62) which is now a requirement. |
0.2.1 |
2013-08-18 |
— |
0.1.8 |
2013-06-02 |
bugfix: changed the SeqFeatures added to PCR products in the amplify module to a dict of list of strings instead of a dict of strings. |
0.1.7 |
2013-05-29 |
Changed the code in amplify.Amplicon to handle features spanning the origin of circular sequences. |
0.1.6 |
2013-04-22 |
Changed the behaviour of the find method of the Dseq object to find substrings that span the origin. Slicing for circular Dseq objects now works slightly different. |
0.1.5 |
2013-04-18 |
Changed the setup.py script to permit installation of the source installer without access to a c compiler. |
0.1.4 |
2013-04-10 |
Cleaned up some docstrings Renamed Drecord -> Dseqrecord to be more consistent with Dseq and Biopython Seq/SeqRecord. Changed name of keyword argument for read and parse. ds=True returns Dseqrecord(s) while ds=False returns SeqRecords. |
0.1.3 |
2013-04-09 |
pydna created from Python-dna. |
System Requirements
Python 2.x
This package was developed on and for Python 2.7. Other versions have not been tested.
Python 3.x
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
PIP
The best way of installing pydna is with pip. Pip is the officially recommended tool for installaion 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.
Source
If you install from source, you need to install the dependencies (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
Binary distribution
Binary installers for 32 and 64 bit editions of MS Windows are provided.
The dependencies have to be installed separately. This can be done using the binary installers for Windows for those who are not comfortable at the command line:
Dependency |
Hyperlink |
---|---|
Python (32,64) |
|
Biopython (32) |
|
Biopython (64) |
|
networkx (32,64) |
Source Code Repository
Pydna is hosted by google code: http://code.google.com/p/pydna/
Distribution Structure
README.txt – This file.
LICENSE.txt – What you can do with the code.
setup.py – Installation file.
run_tests.py – run tests by “python run_tests.py”<enter>
pydna/ – The code.
docs/ – Documentation and cookbook.
scripts/ – Miscellaneous and perhaps useful scripts and examples.
tests/ – Testing code.
Todo
fix Dseq & Dseqrecord lower() methods so they return Dseq & Dseqrecord objects
inverse PCR on circular templates does not seem to preserve features of Dseqrecord objects
Add identification of each fragment in the Contig.small_figure method.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file pydna-0.6.4.zip
.
File metadata
- Download URL: pydna-0.6.4.zip
- Upload date:
- Size: 2.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b27e03ff7f868ac786656b65e0e2f85e21c3778165bded15a947546af2918531 |
|
MD5 | fdff010a7b5d085061fd8ef81ef71586 |
|
BLAKE2b-256 | c79b5f08372c95a659187ccd93dce3aaa3e1294588d4921d83cf6ecb5b3fc35d |
Provenance
File details
Details for the file pydna-0.6.4.tar.gz
.
File metadata
- Download URL: pydna-0.6.4.tar.gz
- Upload date:
- Size: 2.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7096a2c2bb90bd5bb40161c30b3b0a3ebe96ea3f61c8244e184833b01a59e3bd |
|
MD5 | 0248773f6a7fa2372790f285cf765795 |
|
BLAKE2b-256 | dbc0d6ea472000b508c9d688d4773e30d0994192024f0207b228b5dbe88af07c |
Provenance
File details
Details for the file pydna-0.6.4.win-amd64.exe
.
File metadata
- Download URL: pydna-0.6.4.win-amd64.exe
- Upload date:
- Size: 341.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49a0a995cf74ce5a87151c06678693cb7c9f4d4877265468c59d1d1efc56221f |
|
MD5 | 431cb3b8926891eb801fbc999130a968 |
|
BLAKE2b-256 | cdcc2852ed91d2b9f46a4c3b3731cb75db1ce4bdc8ea993919941f612b683543 |
Provenance
File details
Details for the file pydna-0.6.4.win32.exe
.
File metadata
- Download URL: pydna-0.6.4.win32.exe
- Upload date:
- Size: 313.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 32594478993d056001f64b9cdc9559ce4e437f27852ac1970f5692f531598075 |
|
MD5 | 483f22cf8d5272f188ce431e34a783a1 |
|
BLAKE2b-256 | 3894db24ca69d791c8a8297f487a49a1e06f96bc711b4598c9cc781d5f178daa |
Provenance
File details
Details for the file pydna-0.6.4-py2.7.egg
.
File metadata
- Download URL: pydna-0.6.4-py2.7.egg
- Upload date:
- Size: 229.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09705e12f8b6bdbbde60806d0f02619e6eaf9ae0a82478e8912408dda3ae6b85 |
|
MD5 | e9dd63443e2e141237bc592a9ede6a04 |
|
BLAKE2b-256 | dedb5132231563b22ed9bb97fe158485129f38d77fd5ef042b3b69eef70fcfa6 |
Provenance
File details
Details for the file pydna-0.6.4-py2-none-any.whl
.
File metadata
- Download URL: pydna-0.6.4-py2-none-any.whl
- Upload date:
- Size: 110.8 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5e53d0f53102cbb9aed5891124701ed058a25b5607c19bf3a088bfeb8ebd1c9 |
|
MD5 | ec9925b84feb5272298617c679020bf9 |
|
BLAKE2b-256 | 060526ce129b62642852627e4c8ac3b85be384c02f5979e6c1e318dd9d344bb9 |