Package: pydna
pydnaPlanning genetic constructs with many parts and assembly steps, such as recombinant
metabolic pathways :petri_dish:, are often difficult toproperlydocument as is evident from the poor
state of documentation in the scientific literature :radioactive:.The pydna python package provide a human-readable formal descriptions of :dna: cloning and genetic assembly
strategies in Python :snake: which allow for simulation and verification.Pydna can be used asexecutable documentationfor cloning.A cloning strategy expressed in pydna iscomplete,unambiguousandstable.Pydna provides simulation of:Restriction digestionLigationPCRPrimer designGibson assemblyGolden gate assemblyHomologous recombinationGel electrophoresis of DNA with generation of gel imagesVirtually any sub-cloning experiment can be described in pydna, and its execution yield
the sequences of intermediate and final DNA molecules.Pydna has been designed with the goal of being 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 combinatorial
DNA molecule constructions.To get started, we have compiled somesimple examples.
For more elaborate use, look at some assembly strategies of D-xylose metabolic pathwaysMetabolicEngineeringGroupCBMA/ypk-xylose-pathways.UsageMost pydna functionality is implemented as methods for the double stranded DNA sequence record
classes Dseq and Dseqrecord, which are subclasses of theBiopythonSeqandSeqRecordclasses.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 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 included gel moduleJupyter 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 ofsub cloningexperiments using
python. This is helpful to generate examples for teaching purposes.Read the documentation (below) or thecookbookwith example files
for further information.Please post a message in thegoogle groupfor pydna if you need help or have problems, questions or comments :sos:.Feedback & suggestions are very welcome!Who is using pydna?Taylor, L. J., & Strebel, K. (2017).
Pyviko: an automated Python tool to design gene knockouts in complex viruses with overlapping genes.
BMC Microbiology, 17(1), 12.PubMedWang, Y., Xue, H., Pourcel, C., Du, Y., & Gautheret, D. (2021).
2-kupl: mapping-free variant detection from DNA-seq data of matched samples.
In Cold Spring Harbor Laboratory (p. 2021.01.17.427048).DOIPubMedAn Automated Protein Synthesis Pipeline with Transcriptic and Snakemakeand other projects ongithubThere 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.When using pydna.DocumentationDocumentation is built usingSphinxfromdocstringsin the code and displayed at readthedocsThenumpydocstring formatis used.Installation using pipPip is included in recent Python versions and is the
officiallyrecommendedtool.Pip installs the minimal installation requirements automatically, but not the optional requirements (see below).pip install pydnaor use the --pre switch to get the latest version of pydna.pip install pydna --prefor optional functionality do:pip install pydna[gel,download,express,gui]Remove options inside the square brackets as required, but be sure not to leave spaces as pip will not recognize the options. See below under "Optional dependencies".Windows: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 pydnaBy 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 pydnaSource CodePydna is developed onGithub:octocat:.Minimal installation dependenciesPydna 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.Python 3.8, 3.9, 3.10 or 3.11appdirs >=1.4.4biopython >= 1.80networkx >=2.8.8prettytable >=3.5.0pyperclip >=1.8.2pyfiglet >=0.8.post1Optional dependenciesIf the modules listed below in the first column are installed, they will provide the functionality listed in the second column.DependencyFunction in pydnascipy >=1.8.0gel simulation with pydna.gelmatplotlib >=3.4.3“pillow >=8.4.0“numpy"pyparsing >=2.4.7fix corrupt Genbank files with pydna.genbankfixerrequests >=2.26.0download sequences with pydna.downloadcai2 >=1.0.5codon adaptation index calculations in several modulespyqt5 >=5.15.0codon adaptation index calculations in several modulesRequirements for running tests and analyzing code coveragepytestpytest-covpytest-doctestpluscoveragenbvalrequests-mockReleasesSee thereleasesfor changes and releases.Automatic testing & Release processThere are three github actions associated with this package:pydna_test_and_coverage_workflow.ymlThepydna_test_and_coverage_workflow.ymlis 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 versions
on Linux, Windows and macOS.These are triggered by publishing a github release manually from the github interface.Building a PyPI package withPoetryCommit changes to gitTag the commit according to theSemantic Versioningformat, for example "v2.0.1a3". Do not forget the "v" or poetry will not recognize the tag.git tag v2.0.1a3Pydna uses the poetrypoetry-dynamic-versioningplugin.poetry dynamic-versioning # This sets the version number in the source filesVerify the versionpoetry versionBuild package:poetry build # run this command in the root directory where the pyproject.toml file is locatedVerify the filename of the files in the dist/ folder, they should matchPublish to pypipoetry publishHistoryPydna was made public in 2012 onGoogle code.:microbe::portugal: