Welcome to Pydna’s documentation!

Module contents

copyright:Copyright 2013 - 2018 by Björn Johansson. All rights reserved.
license:This code is part of the pydna package, governed by the license in LICENSE.txt that should be included as part of this package.

pydna

Pydna is a python package providing code for simulation of the creation of recombinant DNA molecules using molecular biology techniques.

Provided:
  1. PCR simulation
  2. Assembly simulation based on shared identical sequences
  3. Primer design for amplification of a given sequence
  4. Automatic design of primer tails for Gibson assembly or homologous recombination.
  5. Restriction digestion and cut&paste cloning
  6. Agarose gel simulation
  7. Download sequences from Genbank
  8. Parsing various sequence formats including the capacity to handle broken Genbank format

pydna package layout

The most important modules and how to import functions or classes from them are listed below. Class names starts with a capital letter, functions with a lowercase letter:

from pydna.module import function
from pydna.module import Class
      
Example: from pydna.gel import Gel

pydna
   ├── amplify
   │         ├── Anneal
   │         └── pcr
   ├── assembly
   │          └── Assembly
   ├── design
   │        ├── assembly_fragments
   │        └── primer_design
   ├── download
   │          └── download_text
   ├── dseqrecord
   │            └── Dseqrecord
   ├── gel
   │     └── Gel
   ├── genbank
   │         ├── genbank
   │         └── Genbank
   ├── parsers
   │         ├── parse
   │         └── parse_primers
   └── readers
             ├── read
             └── read_primers

How to use the documentation

Documentation is available as docstrings provided in the source code for each module. These docstrings can be inspected by reading the source code directly. See further below on how to obtain the code for pydna.

In the python shell, use the built-in help function to view a function’s docstring:

>>> from pydna import readers
>>> help(readers.read)
... 

The doctrings are also used to provide an automaticly generated reference manual available online at read the docs.

Docstrings can be explored using IPython, an advanced Python shell with TAB-completion and introspection capabilities. To see which functions are available in pydna, type pydna.<TAB> (where <TAB> refers to the TAB key). Use pydna.open_config_folder?<ENTER>`to view the docstring or `pydna.open_config_folder??<ENTER> to view the source code.

In the Spyder IDE it is possible to place the cursor immediately before the name of a module,class or function and press ctrl+i to bring up docstrings in a separate window in Spyder

Code snippets are indicated by three greater-than signs:

>>> x=41
>>> x=x+1
>>> x
42

pydna source code

The pydna source code is available on Github.

How to get more help

Please join the Google grooup for pydna, this is the preferred location for help. If you find bugs in pydna itself, open an issue at the Github repository.

Examples of pydna in use

See this repository for a collection of examples.

pydna.get_env()[source]

Calling this function prints a an ascii table containing all environmental variables set by pydna and their values. Pydna related variables have names that starts with pydna_

This function prints the ascii logotype of pydna.

>>> import pydna
>>> print(pydna.logo())
                 _             
                | |            
 ____  _   _  __| |___   __ ___
|  _ \| | | |/ _  |  _ \(____ |
| |_| | |_| ( (_| | | | / ___ |
|  __/ \__  |\____|_| |_\_____|
|_|   (____/                   
pydna.open_cache_folder()[source]

Calling this function opens the pydna cache folder in the default file manager. The location for this folder is stored in the pydna_data_dir environmental variable.

pydna.open_config_folder()[source]

Calling this function opens the pydna configuration folder in the default file manager. The location for this folder is stored in the pydna_config_dir environmental variable.

The pydna.ini file can be edited to make pydna quicker to use. See the documentation of the :class:configparser.ConfigParser´ class.

Below is the content of a typical pydna.ini file on a Linux system.

[main]
loglevel=30
email=myemail@example.org
data_dir=/home/bjorn/.local/share/pydna
log_dir=/home/bjorn/.cache/pydna/log
ape=tclsh /home/bjorn/.ApE/apeextractor/ApE.vfs/lib/app-AppMain/AppMain.tcl
cached_funcs=Genbank_nucleotide
primers=/home/bjorn/Dropbox/wikidata/PRIMERS.txt
enzymes=/home/bjorn/Dropbox/wikidata/RestrictionEnzymes.txt

The email address is set to someone@example.com by default. If you change this to you own address, the pydna.genbank.genbank() function can be used to download sequences from Genbank directly without having to explicitly add the email address.

Pydna can cache results from the following functions or methods:

These can be added separated by a comma to the cached_funcs entry in pydna.ini file or the pydna_cached_funcs environment variable.

pydna.open_current_folder()[source]

Calling this function opens the current working directory in the default file manager. The location for this folder is given by the os.getcwd() function

pydna.open_log_folder()[source]

pydna.dseq module

Provides the Dseq class for handling double stranded DNA sequences. Dseq is a subclass of Bio.Seq.Seq. The Dseq class is mostly useful as a part of the pydna.dseqrecord.Dseqrecord class which can hold more meta data.

The Dseq class support the notion of circular and linear DNA topology.

class pydna.dseq.Dseq(watson, crick=None, ovhg=None, linear=None, circular=None, pos=0, alphabet=IUPACAmbiguousDNA())[source]

Bases: Bio.Seq.Seq

Dseq is a class designed to hold information for a double stranded DNA fragment. Dseq also holds information describing the topology of the DNA fragment (linear or circular).

Parameters:
watson : str

a string representing the watson (sense) DNA strand.

crick : str, optional

a string representing the crick (antisense) DNA strand.

ovhg : int, optional

A positive or negative number to describe the stagger between the watson and crick strands. see below for a detailed explanation.

linear : bool, optional

True indicates that sequence is linear, False that it is circular.

circular : bool, optional

True indicates that sequence is circular, False that it is linear.

alphabet : Bio.Alphabet, optional

Bio.Alphabet.IUPAC.IUPACAmbiguousDNA from the Biopython package is set as default.

Examples

Dseq is a subclass of the Biopython Seq object. It stores two strings representing the watson (sense) and crick(antisense) strands. two properties called linear and circular, and a numeric value ovhg (overhang) describing the stagger for the watson and crick strand in the 5’ end of the fragment.

The most common usage is probably to create a Dseq object as a part of a Dseqrecord object (see pydna.dseqrecord.Dseqrecord).

There are three ways of creating a Dseq object directly:

Only one argument (string):

>>> from pydna.dseq import Dseq
>>> Dseq("aaa")
Dseq(-3)
aaa
ttt

The given string will be interpreted as the watson strand of a blunt, linear double stranded sequence object. The crick strand is created automatically from the watson strand.

Two arguments (string, string):

>>> from pydna.dseq import Dseq
>>> Dseq("gggaaat","ttt")
Dseq(-7)
gggaaat
   ttt

If both watson and crick are given, but not ovhg an attempt will be made to find the best annealing between the strands. There are limitations to this! For long fragments it is quite slow. The length of the annealing sequences have to be at least half the length of the shortest of the strands.

Three arguments (string, string, ovhg=int):

The ovhg parameter controls the stagger at the five prime end:

ovhg = -2

XXXXX
  XXX

ovhg = -1

XXXXX
 XXXX

ovhg = 0

XXXXX
XXXXX

ovhg = 1

 XXXX
XXXXX

ovhg = 2

  XXX
XXXXX                          

Example of creating Dseq objects with different amounts of stagger:

>>> Dseq(watson="agt",crick="actta",ovhg=-2)
Dseq(-7)
agt
  attca
>>> Dseq(watson="agt",crick="actta",ovhg=-1)
Dseq(-6)
agt
 attca
>>> Dseq(watson="agt",crick="actta",ovhg=0)
Dseq(-5)
agt
attca
>>> Dseq(watson="agt",crick="actta",ovhg=1)
Dseq(-5)
 agt
attca
>>> Dseq(watson="agt",crick="actta",ovhg=2)
Dseq(-5)
  agt
attca

If the ovhg parameter is specified a crick strand also needs to be supplied, otherwise an exception is raised.

>>> Dseq(watson="agt",ovhg=2)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pydna_/dsdna.py", line 169, in __init__
    else:
ValueError: ovhg defined without crick strand!

The default alphabet is set to Biopython IUPACAmbiguousDNA

The shape of the fragment is set by either:

  1. linear = False, True
  2. circular = True, False

Note that both ends of the DNA fragment has to be compatible to set circular = True (or linear = False).

>>> Dseq("aaa","ttt")
Dseq(-3)
aaa
ttt
>>> Dseq("aaa","ttt",ovhg=0)
Dseq(-3)
aaa
ttt
>>> Dseq("aaa","ttt",ovhg=1)
Dseq(-4)
 aaa
ttt
>>> Dseq("aaa","ttt",ovhg=-1)
Dseq(-4)
aaa
 ttt
>>> Dseq("aaa", "ttt", linear = False ,ovhg=0)
Dseq(o3)
aaa
ttt
>>> Dseq("aaa", "ttt", circular = True , ovhg=0)
Dseq(o3)
aaa
ttt
>>> a=Dseq("tttcccc","aaacccc")
>>> a
Dseq(-11)
    tttcccc
ccccaaa
>>> a.ovhg
4
>>>   
>>> b=Dseq("ccccttt","ccccaaa")
>>> b
Dseq(-11)
ccccttt
    aaacccc
>>> b.ovhg
-4
>>>   

Coercing to string

>>> _pretty_str(a)
'ggggtttcccc'

A Dseq object can be longer that either the watson or crick strands.

<-- length -->
GATCCTTT
     AAAGCCTAG

<-- length -->
      GATCCTTT
AAAGCCCTA

The slicing of a linear Dseq object works mostly as it does for a string.

>>> s="ggatcc"
>>> s[2:3]
'a'
>>> s[2:4]
'at'
>>> s[2:4:-1]
''
>>> s[::2]
'gac'
>>> from pydna.dseq import Dseq
>>> d=Dseq(s, linear=True)
>>> d[2:3]
Dseq(-1)
a
t
>>> d[2:4]
Dseq(-2)
at
ta
>>> d[2:4:-1]
Dseq(-0)


>>> d[::2]
Dseq(-3)
gac
ctg

The slicing of a circular Dseq object has a slightly different meaning.

>>> s="ggAtCc"
>>> d=Dseq(s, circular=True)
>>> d
Dseq(o6)
ggAtCc
ccTaGg
>>> d[4:3]
Dseq(-5)
CcggA
GgccT

The slice [X:X] produces an empty slice for a string, while this will return the linearized sequence starting at X:

>>> s="ggatcc"
>>> d=Dseq(s, circular=True)
>>> d
Dseq(o6)
ggatcc
cctagg
>>> d[3:3]
Dseq(-6)
tccgga
aggcct
>>>
T4(nucleotides=None)[source]

Fill in five prime protruding ends and chewing back three prime protruding ends by a DNA polymerase providing both 5’-3’ DNA polymerase activity and 3’-5’ nuclease acitivty (such as T4 DNA polymerase). This can be done in presence of any combination of the four A, G, C or T. Default are all four nucleotides together.

Parameters:
nucleotides : str

Examples

>>> from pydna.dseq import Dseq
>>> a=Dseq("gatcgatc")
>>> a
Dseq(-8)
gatcgatc
ctagctag
>>> a.T4()
Dseq(-8)
gatcgatc
ctagctag
>>> a.T4("t")
Dseq(-8)
gatcgat
 tagctag
>>> a.T4("a")
Dseq(-8)
gatcga
  agctag
>>> a.T4("g")
Dseq(-8)
gatcg
   gctag
>>>
circular

The circular property can not be set directly. Use looped() to create a circular Dseq object

cut(*enzymes)[source]

Returns a list of linear Dseq fragments produced in the digestion. If there are no cuts, an empty list is returned.

Parameters:
enzymes : enzyme object or iterable of such objects

A Bio.Restriction.XXX restriction objects or iterable.

Returns:
frags : list

list of Dseq objects formed by the digestion

Examples

>>> from pydna.dseq import Dseq
>>> seq=Dseq("ggatccnnngaattc")
>>> seq
Dseq(-15)
ggatccnnngaattc
cctaggnnncttaag
>>> from Bio.Restriction import BamHI,EcoRI
>>> type(seq.cut(BamHI))
<class 'tuple'>
>>> for frag in seq.cut(BamHI): print(repr(frag))
Dseq(-5)
g
cctag
Dseq(-14)
gatccnnngaattc
    gnnncttaag
>>> seq.cut(EcoRI, BamHI) ==  seq.cut(BamHI, EcoRI)
True
>>> a,b,c = seq.cut(EcoRI, BamHI)
>>> a+b+c
Dseq(-15)
ggatccnnngaattc
cctaggnnncttaag
>>>
cutters(batch=RestrictionBatch(['AanI', 'AarI', 'AasI', 'AatII', 'AbaSI', 'AbsI', 'Acc16I', 'Acc36I', 'Acc65I', 'AccB1I', 'AccB7I', 'AccBSI', 'AccI', 'AccII', 'AccIII', 'AciI', 'AclI', 'AclWI', 'AcoI', 'AcsI', 'AcuI', 'AcvI', 'AcyI', 'AdeI', 'AfaI', 'AfeI', 'AfiI', 'AflII', 'AflIII', 'AgeI', 'AgsI', 'AhdI', 'AhlI', 'AjiI', 'AjnI', 'AjuI', 'AleI', 'AloI', 'AluBI', 'AluI', 'Alw21I', 'Alw26I', 'Alw44I', 'AlwI', 'AlwNI', 'Ama87I', 'Aor13HI', 'Aor51HI', 'AoxI', 'ApaI', 'ApaLI', 'ApeKI', 'ApoI', 'ArsI', 'AscI', 'AseI', 'AsiGI', 'AsiSI', 'Asp700I', 'Asp718I', 'AspA2I', 'AspLEI', 'AspS9I', 'AsuC2I', 'AsuHPI', 'AsuII', 'AsuNHI', 'AvaI', 'AvaII', 'AvrII', 'AxyI', 'BaeGI', 'BaeI', 'BalI', 'BamHI', 'BanI', 'BanII', 'BarI', 'BauI', 'BbrPI', 'BbsI', 'Bbv12I', 'BbvCI', 'BbvI', 'BccI', 'BceAI', 'BcgI', 'BciT130I', 'BciVI', 'BclI', 'BcnI', 'BcoDI', 'BcuI', 'BfaI', 'BfmI', 'BfoI', 'BfrI', 'BfuAI', 'BfuI', 'BglI', 'BglII', 'BisI', 'BlnI', 'BlpI', 'BlsI', 'BmcAI', 'Bme1390I', 'Bme18I', 'BmeRI', 'BmeT110I', 'BmgBI', 'BmgT120I', 'BmiI', 'BmrFI', 'BmrI', 'BmsI', 'BmtI', 'BmuI', 'BoxI', 'BpiI', 'BplI', 'BpmI', 'Bpu10I', 'Bpu1102I', 'Bpu14I', 'BpuEI', 'BpuMI', 'Bsa29I', 'BsaAI', 'BsaBI', 'BsaHI', 'BsaI', 'BsaJI', 'BsaWI', 'BsaXI', 'Bsc4I', 'Bse118I', 'Bse1I', 'Bse21I', 'Bse3DI', 'Bse8I', 'BseAI', 'BseBI', 'BseCI', 'BseDI', 'BseGI', 'BseJI', 'BseLI', 'BseMI', 'BseMII', 'BseNI', 'BsePI', 'BseRI', 'BseSI', 'BseX3I', 'BseXI', 'BseYI', 'BsgI', 'Bsh1236I', 'Bsh1285I', 'BshFI', 'BshNI', 'BshTI', 'BshVI', 'BsiEI', 'BsiHKAI', 'BsiHKCI', 'BsiSI', 'BsiWI', 'BslFI', 'BslI', 'BsmAI', 'BsmBI', 'BsmFI', 'BsmI', 'BsnI', 'Bso31I', 'BsoBI', 'Bsp119I', 'Bsp120I', 'Bsp1286I', 'Bsp13I', 'Bsp1407I', 'Bsp143I', 'Bsp1720I', 'Bsp19I', 'Bsp68I', 'BspACI', 'BspANI', 'BspCNI', 'BspDI', 'BspEI', 'BspFNI', 'BspHI', 'BspLI', 'BspMAI', 'BspMI', 'BspOI', 'BspPI', 'BspQI', 'BspT104I', 'BspT107I', 'BspTI', 'BspTNI', 'BsrBI', 'BsrDI', 'BsrFI', 'BsrGI', 'BsrI', 'BssAI', 'BssECI', 'BssHII', 'BssMI', 'BssNAI', 'BssNI', 'BssSI', 'BssT1I', 'Bst1107I', 'Bst2BI', 'Bst2UI', 'Bst4CI', 'Bst6I', 'BstACI', 'BstAFI', 'BstAPI', 'BstAUI', 'BstBAI', 'BstBI', 'BstC8I', 'BstDEI', 'BstDSI', 'BstEII', 'BstENI', 'BstF5I', 'BstFNI', 'BstH2I', 'BstHHI', 'BstKTI', 'BstMAI', 'BstMBI', 'BstMCI', 'BstMWI', 'BstNI', 'BstNSI', 'BstPAI', 'BstPI', 'BstSCI', 'BstSFI', 'BstSLI', 'BstSNI', 'BstUI', 'BstV1I', 'BstV2I', 'BstX2I', 'BstXI', 'BstYI', 'BstZ17I', 'BstZI', 'Bsu15I', 'Bsu36I', 'BsuI', 'BsuRI', 'BsuTUI', 'BtgI', 'BtgZI', 'BtrI', 'BtsCI', 'BtsI', 'BtsIMutI', 'BtuMI', 'BveI', 'Cac8I', 'CaiI', 'CciI', 'CciNI', 'CfoI', 'Cfr10I', 'Cfr13I', 'Cfr42I', 'Cfr9I', 'ClaI', 'CpoI', 'CseI', 'CsiI', 'Csp6I', 'CspAI', 'CspCI', 'CspI', 'CviAII', 'CviJI', 'CviKI_1', 'CviQI', 'DdeI', 'DinI', 'DpnI', 'DpnII', 'DraI', 'DraIII', 'DrdI', 'DriI', 'DseDI', 'EaeI', 'EagI', 'Eam1104I', 'Eam1105I', 'EarI', 'EciI', 'Ecl136II', 'EclXI', 'Eco105I', 'Eco130I', 'Eco147I', 'Eco24I', 'Eco31I', 'Eco32I', 'Eco47I', 'Eco47III', 'Eco52I', 'Eco53kI', 'Eco57I', 'Eco72I', 'Eco81I', 'Eco88I', 'Eco91I', 'EcoICRI', 'EcoNI', 'EcoO109I', 'EcoO65I', 'EcoRI', 'EcoRII', 'EcoRV', 'EcoT14I', 'EcoT22I', 'EcoT38I', 'EgeI', 'EheI', 'ErhI', 'Esp3I', 'FaeI', 'FaiI', 'FalI', 'FaqI', 'FatI', 'FauI', 'FauNDI', 'FbaI', 'FblI', 'Fnu4HI', 'FokI', 'FriOI', 'FseI', 'Fsp4HI', 'FspAI', 'FspBI', 'FspEI', 'FspI', 'GlaI', 'GluI', 'GsaI', 'GsuI', 'HaeII', 'HaeIII', 'HapII', 'HgaI', 'HhaI', 'Hin1I', 'Hin1II', 'Hin6I', 'HinP1I', 'HincII', 'HindII', 'HindIII', 'HinfI', 'HpaI', 'HpaII', 'HphI', 'Hpy166II', 'Hpy188I', 'Hpy188III', 'Hpy8I', 'Hpy99I', 'HpyAV', 'HpyCH4III', 'HpyCH4IV', 'HpyCH4V', 'HpyF10VI', 'HpyF3I', 'HpySE526I', 'Hsp92I', 'Hsp92II', 'HspAI', 'KasI', 'KflI', 'Kpn2I', 'KpnI', 'KroI', 'Ksp22I', 'KspAI', 'KspI', 'Kzo9I', 'LguI', 'LmnI', 'LpnPI', 'Lsp1109I', 'LweI', 'MabI', 'MaeI', 'MaeII', 'MaeIII', 'MalI', 'MauBI', 'MbiI', 'MboI', 'MboII', 'MfeI', 'MflI', 'MhlI', 'MlsI', 'MluCI', 'MluI', 'MluNI', 'Mly113I', 'MlyI', 'MmeI', 'MnlI', 'Mox20I', 'Mph1103I', 'MreI', 'MroI', 'MroNI', 'MroXI', 'MscI', 'MseI', 'MslI', 'Msp20I', 'MspA1I', 'MspCI', 'MspI', 'MspJI', 'MspR9I', 'MssI', 'MteI', 'MunI', 'Mva1269I', 'MvaI', 'MvnI', 'MwoI', 'NaeI', 'NarI', 'NciI', 'NcoI', 'NdeI', 'NdeII', 'NgoMIV', 'NheI', 'NlaIII', 'NlaIV', 'NmeAIII', 'NmuCI', 'NotI', 'NruI', 'NsbI', 'NsiI', 'NspI', 'NspV', 'OliI', 'PacI', 'PaeI', 'PaeR7I', 'PagI', 'PalAI', 'PasI', 'PauI', 'PceI', 'PciI', 'PciSI', 'PcsI', 'PctI', 'PdiI', 'PdmI', 'PfeI', 'Pfl23II', 'PflFI', 'PflMI', 'PfoI', 'PinAI', 'PkrI', 'Ple19I', 'PleI', 'PluTI', 'PmaCI', 'PmeI', 'PmlI', 'PpsI', 'Ppu21I', 'PpuMI', 'PscI', 'PshAI', 'PshBI', 'PsiI', 'Psp124BI', 'Psp1406I', 'Psp5II', 'Psp6I', 'PspCI', 'PspEI', 'PspFI', 'PspGI', 'PspLI', 'PspN4I', 'PspOMI', 'PspPI', 'PspPPI', 'PspXI', 'PsrI', 'PstI', 'PstNI', 'PsuI', 'PsyI', 'PteI', 'PvuI', 'PvuII', 'RgaI', 'RigI', 'RruI', 'RsaI', 'RsaNI', 'RseI', 'Rsr2I', 'RsrII', 'SacI', 'SacII', 'SalI', 'SapI', 'SaqAI', 'SatI', 'Sau3AI', 'Sau96I', 'SbfI', 'ScaI', 'SchI', 'ScrFI', 'SdaI', 'SduI', 'SetI', 'SexAI', 'SfaAI', 'SfaNI', 'SfcI', 'SfiI', 'SfoI', 'Sfr274I', 'Sfr303I', 'SfuI', 'SgeI', 'SgfI', 'SgrAI', 'SgrBI', 'SgrDI', 'SgsI', 'SinI', 'SlaI', 'SmaI', 'SmiI', 'SmiMI', 'SmlI', 'SmoI', 'SnaBI', 'SpeI', 'SphI', 'SrfI', 'Sse8387I', 'Sse9I', 'SseBI', 'SsiI', 'SspDI', 'SspI', 'SspMI', 'SstI', 'StuI', 'StyD4I', 'StyI', 'SwaI', 'TaaI', 'TaiI', 'TaqI', 'TaqII', 'TasI', 'TatI', 'TauI', 'TfiI', 'Tru1I', 'Tru9I', 'TscAI', 'TseFI', 'TseI', 'Tsp45I', 'TspDTI', 'TspGWI', 'TspMI', 'TspRI', 'Tth111I', 'Van91I', 'Vha464I', 'VneI', 'VpaK11BI', 'VspI', 'XagI', 'XapI', 'XbaI', 'XceI', 'XcmI', 'XhoI', 'XmaI', 'XmaJI', 'XmiI', 'XmnI', 'XspI', 'ZraI', 'ZrmI', 'Zsp2I']))[source]

Returns the enzymes in a RestrictionBatch that cut the sequence at least once.

fill_in(nucleotides=None)[source]

Fill in of five prime protruding end with a DNA polymerase that has only DNA polymerase activity (such as exo-klenow [1]) and any combination of A, G, C or T. Default are all four nucleotides together.

Parameters:
nucleotides : str

References

[1]http://en.wikipedia.org/wiki/Klenow_fragment#The_exo-_Klenow_fragment

Examples

>>> from pydna.dseq import Dseq
>>> a=Dseq("aaa", "ttt")
>>> a
Dseq(-3)
aaa
ttt
>>> a.fill_in()
Dseq(-3)
aaa
ttt
>>> b=Dseq("caaa", "cttt")
>>> b
Dseq(-5)
caaa
 tttc
>>> b.fill_in()
Dseq(-5)
caaag
gtttc
>>> b.fill_in("g")
Dseq(-5)
caaag
gtttc
>>> b.fill_in("tac")
Dseq(-5)
caaa
 tttc
>>> c=Dseq("aaac", "tttg")
>>> c
Dseq(-5)
 aaac
gttt
>>> c.fill_in()
Dseq(-5)
 aaac
gttt
>>>
find(sub, start=0, end=9223372036854775807)[source]

This method behaves like the python string method of the same name.

Returns an integer, the index of the first occurrence of substring argument sub in the (sub)sequence given by [start:end].

Returns -1 if the subsequence is NOT found.

Parameters:
sub : string or Seq object

a string or another Seq object to look for.

start : int, optional

slice start.

end : int, optional

slice end.

Examples

>>> from pydna.dseq import Dseq
>>> seq = Dseq("atcgactgacgtgtt")
>>> seq
Dseq(-15)
atcgactgacgtgtt
tagctgactgcacaa
>>> seq.find("gac")
3
>>> seq = Dseq(watson="agt",crick="actta",ovhg=-2)
>>> seq
Dseq(-7)
agt
  attca
>>> seq.find("taa")
2
five_prime_end()[source]

Returns a tuple describing the structure of the 5’ end of the DNA fragment

Examples

>>> from pydna.dseq import Dseq
>>> a=Dseq("aaa", "ttt")
>>> a
Dseq(-3)
aaa
ttt
>>> a.five_prime_end()
('blunt', '')
>>> a=Dseq("aaa", "ttt", ovhg=1)
>>> a
Dseq(-4)
 aaa
ttt
>>> a.five_prime_end()
("3'", 't')
>>> a=Dseq("aaa", "ttt", ovhg=-1)
>>> a
Dseq(-4)
aaa
 ttt
>>> a.five_prime_end()
("5'", 'a')
>>>
linear

The linear property can not be set directly. Use an empty slice [:] to create a linear object.

looped()[source]

Returns a circularized Dseq object. This can only be done if the two ends are compatible, otherwise a TypeError is raised.

Examples

>>> from pydna.dseq import Dseq
>>> a=Dseq("catcgatc")
>>> a
Dseq(-8)
catcgatc
gtagctag
>>> a.looped()
Dseq(o8)
catcgatc
gtagctag
>>> a.T4("t")
Dseq(-8)
catcgat
 tagctag
>>> a.T4("t").looped()
Dseq(o7)
catcgat
gtagcta
>>> a.T4("a")
Dseq(-8)
catcga
  agctag
>>> a.T4("a").looped()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pydna/dsdna.py", line 357, in looped
    if type5 == type3 and str(sticky5) == str(rc(sticky3)):
TypeError: DNA cannot be circularized.
5' and 3' sticky ends not compatible!
>>>
mung()[source]

Simulates treatment a nuclease with 5’-3’ and 3’-5’ single strand specific exonuclease activity (such as mung bean nuclease [2])

    ggatcc    ->     gatcc
     ctaggg          ctagg

     ggatcc   ->      ggatc
    tcctag            cctag

>>> from pydna.dseq import Dseq
>>> b=Dseq("caaa", "cttt")
>>> b
Dseq(-5)
caaa
 tttc
>>> b.mung()
Dseq(-3)
aaa
ttt
>>> c=Dseq("aaac", "tttg")
>>> c
Dseq(-5)
 aaac
gttt
>>> c.mung()
Dseq(-3)
aaa
ttt

References

[2]http://en.wikipedia.org/wiki/Mung_bean_nuclease
mw()[source]

This method returns the molecular weight of the DNA molecule in g/mol. The following formula is used:

MW = (A x 313.2) + (T x 304.2) + 
     (C x 289.2) + (G x 329.2) + 
     (N x 308.9) + 79.0
n_cutters(n=3, batch=RestrictionBatch(['AanI', 'AarI', 'AasI', 'AatII', 'AbaSI', 'AbsI', 'Acc16I', 'Acc36I', 'Acc65I', 'AccB1I', 'AccB7I', 'AccBSI', 'AccI', 'AccII', 'AccIII', 'AciI', 'AclI', 'AclWI', 'AcoI', 'AcsI', 'AcuI', 'AcvI', 'AcyI', 'AdeI', 'AfaI', 'AfeI', 'AfiI', 'AflII', 'AflIII', 'AgeI', 'AgsI', 'AhdI', 'AhlI', 'AjiI', 'AjnI', 'AjuI', 'AleI', 'AloI', 'AluBI', 'AluI', 'Alw21I', 'Alw26I', 'Alw44I', 'AlwI', 'AlwNI', 'Ama87I', 'Aor13HI', 'Aor51HI', 'AoxI', 'ApaI', 'ApaLI', 'ApeKI', 'ApoI', 'ArsI', 'AscI', 'AseI', 'AsiGI', 'AsiSI', 'Asp700I', 'Asp718I', 'AspA2I', 'AspLEI', 'AspS9I', 'AsuC2I', 'AsuHPI', 'AsuII', 'AsuNHI', 'AvaI', 'AvaII', 'AvrII', 'AxyI', 'BaeGI', 'BaeI', 'BalI', 'BamHI', 'BanI', 'BanII', 'BarI', 'BauI', 'BbrPI', 'BbsI', 'Bbv12I', 'BbvCI', 'BbvI', 'BccI', 'BceAI', 'BcgI', 'BciT130I', 'BciVI', 'BclI', 'BcnI', 'BcoDI', 'BcuI', 'BfaI', 'BfmI', 'BfoI', 'BfrI', 'BfuAI', 'BfuI', 'BglI', 'BglII', 'BisI', 'BlnI', 'BlpI', 'BlsI', 'BmcAI', 'Bme1390I', 'Bme18I', 'BmeRI', 'BmeT110I', 'BmgBI', 'BmgT120I', 'BmiI', 'BmrFI', 'BmrI', 'BmsI', 'BmtI', 'BmuI', 'BoxI', 'BpiI', 'BplI', 'BpmI', 'Bpu10I', 'Bpu1102I', 'Bpu14I', 'BpuEI', 'BpuMI', 'Bsa29I', 'BsaAI', 'BsaBI', 'BsaHI', 'BsaI', 'BsaJI', 'BsaWI', 'BsaXI', 'Bsc4I', 'Bse118I', 'Bse1I', 'Bse21I', 'Bse3DI', 'Bse8I', 'BseAI', 'BseBI', 'BseCI', 'BseDI', 'BseGI', 'BseJI', 'BseLI', 'BseMI', 'BseMII', 'BseNI', 'BsePI', 'BseRI', 'BseSI', 'BseX3I', 'BseXI', 'BseYI', 'BsgI', 'Bsh1236I', 'Bsh1285I', 'BshFI', 'BshNI', 'BshTI', 'BshVI', 'BsiEI', 'BsiHKAI', 'BsiHKCI', 'BsiSI', 'BsiWI', 'BslFI', 'BslI', 'BsmAI', 'BsmBI', 'BsmFI', 'BsmI', 'BsnI', 'Bso31I', 'BsoBI', 'Bsp119I', 'Bsp120I', 'Bsp1286I', 'Bsp13I', 'Bsp1407I', 'Bsp143I', 'Bsp1720I', 'Bsp19I', 'Bsp68I', 'BspACI', 'BspANI', 'BspCNI', 'BspDI', 'BspEI', 'BspFNI', 'BspHI', 'BspLI', 'BspMAI', 'BspMI', 'BspOI', 'BspPI', 'BspQI', 'BspT104I', 'BspT107I', 'BspTI', 'BspTNI', 'BsrBI', 'BsrDI', 'BsrFI', 'BsrGI', 'BsrI', 'BssAI', 'BssECI', 'BssHII', 'BssMI', 'BssNAI', 'BssNI', 'BssSI', 'BssT1I', 'Bst1107I', 'Bst2BI', 'Bst2UI', 'Bst4CI', 'Bst6I', 'BstACI', 'BstAFI', 'BstAPI', 'BstAUI', 'BstBAI', 'BstBI', 'BstC8I', 'BstDEI', 'BstDSI', 'BstEII', 'BstENI', 'BstF5I', 'BstFNI', 'BstH2I', 'BstHHI', 'BstKTI', 'BstMAI', 'BstMBI', 'BstMCI', 'BstMWI', 'BstNI', 'BstNSI', 'BstPAI', 'BstPI', 'BstSCI', 'BstSFI', 'BstSLI', 'BstSNI', 'BstUI', 'BstV1I', 'BstV2I', 'BstX2I', 'BstXI', 'BstYI', 'BstZ17I', 'BstZI', 'Bsu15I', 'Bsu36I', 'BsuI', 'BsuRI', 'BsuTUI', 'BtgI', 'BtgZI', 'BtrI', 'BtsCI', 'BtsI', 'BtsIMutI', 'BtuMI', 'BveI', 'Cac8I', 'CaiI', 'CciI', 'CciNI', 'CfoI', 'Cfr10I', 'Cfr13I', 'Cfr42I', 'Cfr9I', 'ClaI', 'CpoI', 'CseI', 'CsiI', 'Csp6I', 'CspAI', 'CspCI', 'CspI', 'CviAII', 'CviJI', 'CviKI_1', 'CviQI', 'DdeI', 'DinI', 'DpnI', 'DpnII', 'DraI', 'DraIII', 'DrdI', 'DriI', 'DseDI', 'EaeI', 'EagI', 'Eam1104I', 'Eam1105I', 'EarI', 'EciI', 'Ecl136II', 'EclXI', 'Eco105I', 'Eco130I', 'Eco147I', 'Eco24I', 'Eco31I', 'Eco32I', 'Eco47I', 'Eco47III', 'Eco52I', 'Eco53kI', 'Eco57I', 'Eco72I', 'Eco81I', 'Eco88I', 'Eco91I', 'EcoICRI', 'EcoNI', 'EcoO109I', 'EcoO65I', 'EcoRI', 'EcoRII', 'EcoRV', 'EcoT14I', 'EcoT22I', 'EcoT38I', 'EgeI', 'EheI', 'ErhI', 'Esp3I', 'FaeI', 'FaiI', 'FalI', 'FaqI', 'FatI', 'FauI', 'FauNDI', 'FbaI', 'FblI', 'Fnu4HI', 'FokI', 'FriOI', 'FseI', 'Fsp4HI', 'FspAI', 'FspBI', 'FspEI', 'FspI', 'GlaI', 'GluI', 'GsaI', 'GsuI', 'HaeII', 'HaeIII', 'HapII', 'HgaI', 'HhaI', 'Hin1I', 'Hin1II', 'Hin6I', 'HinP1I', 'HincII', 'HindII', 'HindIII', 'HinfI', 'HpaI', 'HpaII', 'HphI', 'Hpy166II', 'Hpy188I', 'Hpy188III', 'Hpy8I', 'Hpy99I', 'HpyAV', 'HpyCH4III', 'HpyCH4IV', 'HpyCH4V', 'HpyF10VI', 'HpyF3I', 'HpySE526I', 'Hsp92I', 'Hsp92II', 'HspAI', 'KasI', 'KflI', 'Kpn2I', 'KpnI', 'KroI', 'Ksp22I', 'KspAI', 'KspI', 'Kzo9I', 'LguI', 'LmnI', 'LpnPI', 'Lsp1109I', 'LweI', 'MabI', 'MaeI', 'MaeII', 'MaeIII', 'MalI', 'MauBI', 'MbiI', 'MboI', 'MboII', 'MfeI', 'MflI', 'MhlI', 'MlsI', 'MluCI', 'MluI', 'MluNI', 'Mly113I', 'MlyI', 'MmeI', 'MnlI', 'Mox20I', 'Mph1103I', 'MreI', 'MroI', 'MroNI', 'MroXI', 'MscI', 'MseI', 'MslI', 'Msp20I', 'MspA1I', 'MspCI', 'MspI', 'MspJI', 'MspR9I', 'MssI', 'MteI', 'MunI', 'Mva1269I', 'MvaI', 'MvnI', 'MwoI', 'NaeI', 'NarI', 'NciI', 'NcoI', 'NdeI', 'NdeII', 'NgoMIV', 'NheI', 'NlaIII', 'NlaIV', 'NmeAIII', 'NmuCI', 'NotI', 'NruI', 'NsbI', 'NsiI', 'NspI', 'NspV', 'OliI', 'PacI', 'PaeI', 'PaeR7I', 'PagI', 'PalAI', 'PasI', 'PauI', 'PceI', 'PciI', 'PciSI', 'PcsI', 'PctI', 'PdiI', 'PdmI', 'PfeI', 'Pfl23II', 'PflFI', 'PflMI', 'PfoI', 'PinAI', 'PkrI', 'Ple19I', 'PleI', 'PluTI', 'PmaCI', 'PmeI', 'PmlI', 'PpsI', 'Ppu21I', 'PpuMI', 'PscI', 'PshAI', 'PshBI', 'PsiI', 'Psp124BI', 'Psp1406I', 'Psp5II', 'Psp6I', 'PspCI', 'PspEI', 'PspFI', 'PspGI', 'PspLI', 'PspN4I', 'PspOMI', 'PspPI', 'PspPPI', 'PspXI', 'PsrI', 'PstI', 'PstNI', 'PsuI', 'PsyI', 'PteI', 'PvuI', 'PvuII', 'RgaI', 'RigI', 'RruI', 'RsaI', 'RsaNI', 'RseI', 'Rsr2I', 'RsrII', 'SacI', 'SacII', 'SalI', 'SapI', 'SaqAI', 'SatI', 'Sau3AI', 'Sau96I', 'SbfI', 'ScaI', 'SchI', 'ScrFI', 'SdaI', 'SduI', 'SetI', 'SexAI', 'SfaAI', 'SfaNI', 'SfcI', 'SfiI', 'SfoI', 'Sfr274I', 'Sfr303I', 'SfuI', 'SgeI', 'SgfI', 'SgrAI', 'SgrBI', 'SgrDI', 'SgsI', 'SinI', 'SlaI', 'SmaI', 'SmiI', 'SmiMI', 'SmlI', 'SmoI', 'SnaBI', 'SpeI', 'SphI', 'SrfI', 'Sse8387I', 'Sse9I', 'SseBI', 'SsiI', 'SspDI', 'SspI', 'SspMI', 'SstI', 'StuI', 'StyD4I', 'StyI', 'SwaI', 'TaaI', 'TaiI', 'TaqI', 'TaqII', 'TasI', 'TatI', 'TauI', 'TfiI', 'Tru1I', 'Tru9I', 'TscAI', 'TseFI', 'TseI', 'Tsp45I', 'TspDTI', 'TspGWI', 'TspMI', 'TspRI', 'Tth111I', 'Van91I', 'Vha464I', 'VneI', 'VpaK11BI', 'VspI', 'XagI', 'XapI', 'XbaI', 'XceI', 'XcmI', 'XhoI', 'XmaI', 'XmaJI', 'XmiI', 'XmnI', 'XspI', 'ZraI', 'ZrmI', 'Zsp2I']))[source]

Returns the enzymes in a RestrictionBatch that cut the sequence n times.

no_cutters(batch=RestrictionBatch(['AanI', 'AarI', 'AasI', 'AatII', 'AbaSI', 'AbsI', 'Acc16I', 'Acc36I', 'Acc65I', 'AccB1I', 'AccB7I', 'AccBSI', 'AccI', 'AccII', 'AccIII', 'AciI', 'AclI', 'AclWI', 'AcoI', 'AcsI', 'AcuI', 'AcvI', 'AcyI', 'AdeI', 'AfaI', 'AfeI', 'AfiI', 'AflII', 'AflIII', 'AgeI', 'AgsI', 'AhdI', 'AhlI', 'AjiI', 'AjnI', 'AjuI', 'AleI', 'AloI', 'AluBI', 'AluI', 'Alw21I', 'Alw26I', 'Alw44I', 'AlwI', 'AlwNI', 'Ama87I', 'Aor13HI', 'Aor51HI', 'AoxI', 'ApaI', 'ApaLI', 'ApeKI', 'ApoI', 'ArsI', 'AscI', 'AseI', 'AsiGI', 'AsiSI', 'Asp700I', 'Asp718I', 'AspA2I', 'AspLEI', 'AspS9I', 'AsuC2I', 'AsuHPI', 'AsuII', 'AsuNHI', 'AvaI', 'AvaII', 'AvrII', 'AxyI', 'BaeGI', 'BaeI', 'BalI', 'BamHI', 'BanI', 'BanII', 'BarI', 'BauI', 'BbrPI', 'BbsI', 'Bbv12I', 'BbvCI', 'BbvI', 'BccI', 'BceAI', 'BcgI', 'BciT130I', 'BciVI', 'BclI', 'BcnI', 'BcoDI', 'BcuI', 'BfaI', 'BfmI', 'BfoI', 'BfrI', 'BfuAI', 'BfuI', 'BglI', 'BglII', 'BisI', 'BlnI', 'BlpI', 'BlsI', 'BmcAI', 'Bme1390I', 'Bme18I', 'BmeRI', 'BmeT110I', 'BmgBI', 'BmgT120I', 'BmiI', 'BmrFI', 'BmrI', 'BmsI', 'BmtI', 'BmuI', 'BoxI', 'BpiI', 'BplI', 'BpmI', 'Bpu10I', 'Bpu1102I', 'Bpu14I', 'BpuEI', 'BpuMI', 'Bsa29I', 'BsaAI', 'BsaBI', 'BsaHI', 'BsaI', 'BsaJI', 'BsaWI', 'BsaXI', 'Bsc4I', 'Bse118I', 'Bse1I', 'Bse21I', 'Bse3DI', 'Bse8I', 'BseAI', 'BseBI', 'BseCI', 'BseDI', 'BseGI', 'BseJI', 'BseLI', 'BseMI', 'BseMII', 'BseNI', 'BsePI', 'BseRI', 'BseSI', 'BseX3I', 'BseXI', 'BseYI', 'BsgI', 'Bsh1236I', 'Bsh1285I', 'BshFI', 'BshNI', 'BshTI', 'BshVI', 'BsiEI', 'BsiHKAI', 'BsiHKCI', 'BsiSI', 'BsiWI', 'BslFI', 'BslI', 'BsmAI', 'BsmBI', 'BsmFI', 'BsmI', 'BsnI', 'Bso31I', 'BsoBI', 'Bsp119I', 'Bsp120I', 'Bsp1286I', 'Bsp13I', 'Bsp1407I', 'Bsp143I', 'Bsp1720I', 'Bsp19I', 'Bsp68I', 'BspACI', 'BspANI', 'BspCNI', 'BspDI', 'BspEI', 'BspFNI', 'BspHI', 'BspLI', 'BspMAI', 'BspMI', 'BspOI', 'BspPI', 'BspQI', 'BspT104I', 'BspT107I', 'BspTI', 'BspTNI', 'BsrBI', 'BsrDI', 'BsrFI', 'BsrGI', 'BsrI', 'BssAI', 'BssECI', 'BssHII', 'BssMI', 'BssNAI', 'BssNI', 'BssSI', 'BssT1I', 'Bst1107I', 'Bst2BI', 'Bst2UI', 'Bst4CI', 'Bst6I', 'BstACI', 'BstAFI', 'BstAPI', 'BstAUI', 'BstBAI', 'BstBI', 'BstC8I', 'BstDEI', 'BstDSI', 'BstEII', 'BstENI', 'BstF5I', 'BstFNI', 'BstH2I', 'BstHHI', 'BstKTI', 'BstMAI', 'BstMBI', 'BstMCI', 'BstMWI', 'BstNI', 'BstNSI', 'BstPAI', 'BstPI', 'BstSCI', 'BstSFI', 'BstSLI', 'BstSNI', 'BstUI', 'BstV1I', 'BstV2I', 'BstX2I', 'BstXI', 'BstYI', 'BstZ17I', 'BstZI', 'Bsu15I', 'Bsu36I', 'BsuI', 'BsuRI', 'BsuTUI', 'BtgI', 'BtgZI', 'BtrI', 'BtsCI', 'BtsI', 'BtsIMutI', 'BtuMI', 'BveI', 'Cac8I', 'CaiI', 'CciI', 'CciNI', 'CfoI', 'Cfr10I', 'Cfr13I', 'Cfr42I', 'Cfr9I', 'ClaI', 'CpoI', 'CseI', 'CsiI', 'Csp6I', 'CspAI', 'CspCI', 'CspI', 'CviAII', 'CviJI', 'CviKI_1', 'CviQI', 'DdeI', 'DinI', 'DpnI', 'DpnII', 'DraI', 'DraIII', 'DrdI', 'DriI', 'DseDI', 'EaeI', 'EagI', 'Eam1104I', 'Eam1105I', 'EarI', 'EciI', 'Ecl136II', 'EclXI', 'Eco105I', 'Eco130I', 'Eco147I', 'Eco24I', 'Eco31I', 'Eco32I', 'Eco47I', 'Eco47III', 'Eco52I', 'Eco53kI', 'Eco57I', 'Eco72I', 'Eco81I', 'Eco88I', 'Eco91I', 'EcoICRI', 'EcoNI', 'EcoO109I', 'EcoO65I', 'EcoRI', 'EcoRII', 'EcoRV', 'EcoT14I', 'EcoT22I', 'EcoT38I', 'EgeI', 'EheI', 'ErhI', 'Esp3I', 'FaeI', 'FaiI', 'FalI', 'FaqI', 'FatI', 'FauI', 'FauNDI', 'FbaI', 'FblI', 'Fnu4HI', 'FokI', 'FriOI', 'FseI', 'Fsp4HI', 'FspAI', 'FspBI', 'FspEI', 'FspI', 'GlaI', 'GluI', 'GsaI', 'GsuI', 'HaeII', 'HaeIII', 'HapII', 'HgaI', 'HhaI', 'Hin1I', 'Hin1II', 'Hin6I', 'HinP1I', 'HincII', 'HindII', 'HindIII', 'HinfI', 'HpaI', 'HpaII', 'HphI', 'Hpy166II', 'Hpy188I', 'Hpy188III', 'Hpy8I', 'Hpy99I', 'HpyAV', 'HpyCH4III', 'HpyCH4IV', 'HpyCH4V', 'HpyF10VI', 'HpyF3I', 'HpySE526I', 'Hsp92I', 'Hsp92II', 'HspAI', 'KasI', 'KflI', 'Kpn2I', 'KpnI', 'KroI', 'Ksp22I', 'KspAI', 'KspI', 'Kzo9I', 'LguI', 'LmnI', 'LpnPI', 'Lsp1109I', 'LweI', 'MabI', 'MaeI', 'MaeII', 'MaeIII', 'MalI', 'MauBI', 'MbiI', 'MboI', 'MboII', 'MfeI', 'MflI', 'MhlI', 'MlsI', 'MluCI', 'MluI', 'MluNI', 'Mly113I', 'MlyI', 'MmeI', 'MnlI', 'Mox20I', 'Mph1103I', 'MreI', 'MroI', 'MroNI', 'MroXI', 'MscI', 'MseI', 'MslI', 'Msp20I', 'MspA1I', 'MspCI', 'MspI', 'MspJI', 'MspR9I', 'MssI', 'MteI', 'MunI', 'Mva1269I', 'MvaI', 'MvnI', 'MwoI', 'NaeI', 'NarI', 'NciI', 'NcoI', 'NdeI', 'NdeII', 'NgoMIV', 'NheI', 'NlaIII', 'NlaIV', 'NmeAIII', 'NmuCI', 'NotI', 'NruI', 'NsbI', 'NsiI', 'NspI', 'NspV', 'OliI', 'PacI', 'PaeI', 'PaeR7I', 'PagI', 'PalAI', 'PasI', 'PauI', 'PceI', 'PciI', 'PciSI', 'PcsI', 'PctI', 'PdiI', 'PdmI', 'PfeI', 'Pfl23II', 'PflFI', 'PflMI', 'PfoI', 'PinAI', 'PkrI', 'Ple19I', 'PleI', 'PluTI', 'PmaCI', 'PmeI', 'PmlI', 'PpsI', 'Ppu21I', 'PpuMI', 'PscI', 'PshAI', 'PshBI', 'PsiI', 'Psp124BI', 'Psp1406I', 'Psp5II', 'Psp6I', 'PspCI', 'PspEI', 'PspFI', 'PspGI', 'PspLI', 'PspN4I', 'PspOMI', 'PspPI', 'PspPPI', 'PspXI', 'PsrI', 'PstI', 'PstNI', 'PsuI', 'PsyI', 'PteI', 'PvuI', 'PvuII', 'RgaI', 'RigI', 'RruI', 'RsaI', 'RsaNI', 'RseI', 'Rsr2I', 'RsrII', 'SacI', 'SacII', 'SalI', 'SapI', 'SaqAI', 'SatI', 'Sau3AI', 'Sau96I', 'SbfI', 'ScaI', 'SchI', 'ScrFI', 'SdaI', 'SduI', 'SetI', 'SexAI', 'SfaAI', 'SfaNI', 'SfcI', 'SfiI', 'SfoI', 'Sfr274I', 'Sfr303I', 'SfuI', 'SgeI', 'SgfI', 'SgrAI', 'SgrBI', 'SgrDI', 'SgsI', 'SinI', 'SlaI', 'SmaI', 'SmiI', 'SmiMI', 'SmlI', 'SmoI', 'SnaBI', 'SpeI', 'SphI', 'SrfI', 'Sse8387I', 'Sse9I', 'SseBI', 'SsiI', 'SspDI', 'SspI', 'SspMI', 'SstI', 'StuI', 'StyD4I', 'StyI', 'SwaI', 'TaaI', 'TaiI', 'TaqI', 'TaqII', 'TasI', 'TatI', 'TauI', 'TfiI', 'Tru1I', 'Tru9I', 'TscAI', 'TseFI', 'TseI', 'Tsp45I', 'TspDTI', 'TspGWI', 'TspMI', 'TspRI', 'Tth111I', 'Van91I', 'Vha464I', 'VneI', 'VpaK11BI', 'VspI', 'XagI', 'XapI', 'XbaI', 'XceI', 'XcmI', 'XhoI', 'XmaI', 'XmaJI', 'XmiI', 'XmnI', 'XspI', 'ZraI', 'ZrmI', 'Zsp2I']))[source]

Returns the enzymes in a RestrictionBatch that do not cut the sequence.

once_cutters(batch=RestrictionBatch(['AanI', 'AarI', 'AasI', 'AatII', 'AbaSI', 'AbsI', 'Acc16I', 'Acc36I', 'Acc65I', 'AccB1I', 'AccB7I', 'AccBSI', 'AccI', 'AccII', 'AccIII', 'AciI', 'AclI', 'AclWI', 'AcoI', 'AcsI', 'AcuI', 'AcvI', 'AcyI', 'AdeI', 'AfaI', 'AfeI', 'AfiI', 'AflII', 'AflIII', 'AgeI', 'AgsI', 'AhdI', 'AhlI', 'AjiI', 'AjnI', 'AjuI', 'AleI', 'AloI', 'AluBI', 'AluI', 'Alw21I', 'Alw26I', 'Alw44I', 'AlwI', 'AlwNI', 'Ama87I', 'Aor13HI', 'Aor51HI', 'AoxI', 'ApaI', 'ApaLI', 'ApeKI', 'ApoI', 'ArsI', 'AscI', 'AseI', 'AsiGI', 'AsiSI', 'Asp700I', 'Asp718I', 'AspA2I', 'AspLEI', 'AspS9I', 'AsuC2I', 'AsuHPI', 'AsuII', 'AsuNHI', 'AvaI', 'AvaII', 'AvrII', 'AxyI', 'BaeGI', 'BaeI', 'BalI', 'BamHI', 'BanI', 'BanII', 'BarI', 'BauI', 'BbrPI', 'BbsI', 'Bbv12I', 'BbvCI', 'BbvI', 'BccI', 'BceAI', 'BcgI', 'BciT130I', 'BciVI', 'BclI', 'BcnI', 'BcoDI', 'BcuI', 'BfaI', 'BfmI', 'BfoI', 'BfrI', 'BfuAI', 'BfuI', 'BglI', 'BglII', 'BisI', 'BlnI', 'BlpI', 'BlsI', 'BmcAI', 'Bme1390I', 'Bme18I', 'BmeRI', 'BmeT110I', 'BmgBI', 'BmgT120I', 'BmiI', 'BmrFI', 'BmrI', 'BmsI', 'BmtI', 'BmuI', 'BoxI', 'BpiI', 'BplI', 'BpmI', 'Bpu10I', 'Bpu1102I', 'Bpu14I', 'BpuEI', 'BpuMI', 'Bsa29I', 'BsaAI', 'BsaBI', 'BsaHI', 'BsaI', 'BsaJI', 'BsaWI', 'BsaXI', 'Bsc4I', 'Bse118I', 'Bse1I', 'Bse21I', 'Bse3DI', 'Bse8I', 'BseAI', 'BseBI', 'BseCI', 'BseDI', 'BseGI', 'BseJI', 'BseLI', 'BseMI', 'BseMII', 'BseNI', 'BsePI', 'BseRI', 'BseSI', 'BseX3I', 'BseXI', 'BseYI', 'BsgI', 'Bsh1236I', 'Bsh1285I', 'BshFI', 'BshNI', 'BshTI', 'BshVI', 'BsiEI', 'BsiHKAI', 'BsiHKCI', 'BsiSI', 'BsiWI', 'BslFI', 'BslI', 'BsmAI', 'BsmBI', 'BsmFI', 'BsmI', 'BsnI', 'Bso31I', 'BsoBI', 'Bsp119I', 'Bsp120I', 'Bsp1286I', 'Bsp13I', 'Bsp1407I', 'Bsp143I', 'Bsp1720I', 'Bsp19I', 'Bsp68I', 'BspACI', 'BspANI', 'BspCNI', 'BspDI', 'BspEI', 'BspFNI', 'BspHI', 'BspLI', 'BspMAI', 'BspMI', 'BspOI', 'BspPI', 'BspQI', 'BspT104I', 'BspT107I', 'BspTI', 'BspTNI', 'BsrBI', 'BsrDI', 'BsrFI', 'BsrGI', 'BsrI', 'BssAI', 'BssECI', 'BssHII', 'BssMI', 'BssNAI', 'BssNI', 'BssSI', 'BssT1I', 'Bst1107I', 'Bst2BI', 'Bst2UI', 'Bst4CI', 'Bst6I', 'BstACI', 'BstAFI', 'BstAPI', 'BstAUI', 'BstBAI', 'BstBI', 'BstC8I', 'BstDEI', 'BstDSI', 'BstEII', 'BstENI', 'BstF5I', 'BstFNI', 'BstH2I', 'BstHHI', 'BstKTI', 'BstMAI', 'BstMBI', 'BstMCI', 'BstMWI', 'BstNI', 'BstNSI', 'BstPAI', 'BstPI', 'BstSCI', 'BstSFI', 'BstSLI', 'BstSNI', 'BstUI', 'BstV1I', 'BstV2I', 'BstX2I', 'BstXI', 'BstYI', 'BstZ17I', 'BstZI', 'Bsu15I', 'Bsu36I', 'BsuI', 'BsuRI', 'BsuTUI', 'BtgI', 'BtgZI', 'BtrI', 'BtsCI', 'BtsI', 'BtsIMutI', 'BtuMI', 'BveI', 'Cac8I', 'CaiI', 'CciI', 'CciNI', 'CfoI', 'Cfr10I', 'Cfr13I', 'Cfr42I', 'Cfr9I', 'ClaI', 'CpoI', 'CseI', 'CsiI', 'Csp6I', 'CspAI', 'CspCI', 'CspI', 'CviAII', 'CviJI', 'CviKI_1', 'CviQI', 'DdeI', 'DinI', 'DpnI', 'DpnII', 'DraI', 'DraIII', 'DrdI', 'DriI', 'DseDI', 'EaeI', 'EagI', 'Eam1104I', 'Eam1105I', 'EarI', 'EciI', 'Ecl136II', 'EclXI', 'Eco105I', 'Eco130I', 'Eco147I', 'Eco24I', 'Eco31I', 'Eco32I', 'Eco47I', 'Eco47III', 'Eco52I', 'Eco53kI', 'Eco57I', 'Eco72I', 'Eco81I', 'Eco88I', 'Eco91I', 'EcoICRI', 'EcoNI', 'EcoO109I', 'EcoO65I', 'EcoRI', 'EcoRII', 'EcoRV', 'EcoT14I', 'EcoT22I', 'EcoT38I', 'EgeI', 'EheI', 'ErhI', 'Esp3I', 'FaeI', 'FaiI', 'FalI', 'FaqI', 'FatI', 'FauI', 'FauNDI', 'FbaI', 'FblI', 'Fnu4HI', 'FokI', 'FriOI', 'FseI', 'Fsp4HI', 'FspAI', 'FspBI', 'FspEI', 'FspI', 'GlaI', 'GluI', 'GsaI', 'GsuI', 'HaeII', 'HaeIII', 'HapII', 'HgaI', 'HhaI', 'Hin1I', 'Hin1II', 'Hin6I', 'HinP1I', 'HincII', 'HindII', 'HindIII', 'HinfI', 'HpaI', 'HpaII', 'HphI', 'Hpy166II', 'Hpy188I', 'Hpy188III', 'Hpy8I', 'Hpy99I', 'HpyAV', 'HpyCH4III', 'HpyCH4IV', 'HpyCH4V', 'HpyF10VI', 'HpyF3I', 'HpySE526I', 'Hsp92I', 'Hsp92II', 'HspAI', 'KasI', 'KflI', 'Kpn2I', 'KpnI', 'KroI', 'Ksp22I', 'KspAI', 'KspI', 'Kzo9I', 'LguI', 'LmnI', 'LpnPI', 'Lsp1109I', 'LweI', 'MabI', 'MaeI', 'MaeII', 'MaeIII', 'MalI', 'MauBI', 'MbiI', 'MboI', 'MboII', 'MfeI', 'MflI', 'MhlI', 'MlsI', 'MluCI', 'MluI', 'MluNI', 'Mly113I', 'MlyI', 'MmeI', 'MnlI', 'Mox20I', 'Mph1103I', 'MreI', 'MroI', 'MroNI', 'MroXI', 'MscI', 'MseI', 'MslI', 'Msp20I', 'MspA1I', 'MspCI', 'MspI', 'MspJI', 'MspR9I', 'MssI', 'MteI', 'MunI', 'Mva1269I', 'MvaI', 'MvnI', 'MwoI', 'NaeI', 'NarI', 'NciI', 'NcoI', 'NdeI', 'NdeII', 'NgoMIV', 'NheI', 'NlaIII', 'NlaIV', 'NmeAIII', 'NmuCI', 'NotI', 'NruI', 'NsbI', 'NsiI', 'NspI', 'NspV', 'OliI', 'PacI', 'PaeI', 'PaeR7I', 'PagI', 'PalAI', 'PasI', 'PauI', 'PceI', 'PciI', 'PciSI', 'PcsI', 'PctI', 'PdiI', 'PdmI', 'PfeI', 'Pfl23II', 'PflFI', 'PflMI', 'PfoI', 'PinAI', 'PkrI', 'Ple19I', 'PleI', 'PluTI', 'PmaCI', 'PmeI', 'PmlI', 'PpsI', 'Ppu21I', 'PpuMI', 'PscI', 'PshAI', 'PshBI', 'PsiI', 'Psp124BI', 'Psp1406I', 'Psp5II', 'Psp6I', 'PspCI', 'PspEI', 'PspFI', 'PspGI', 'PspLI', 'PspN4I', 'PspOMI', 'PspPI', 'PspPPI', 'PspXI', 'PsrI', 'PstI', 'PstNI', 'PsuI', 'PsyI', 'PteI', 'PvuI', 'PvuII', 'RgaI', 'RigI', 'RruI', 'RsaI', 'RsaNI', 'RseI', 'Rsr2I', 'RsrII', 'SacI', 'SacII', 'SalI', 'SapI', 'SaqAI', 'SatI', 'Sau3AI', 'Sau96I', 'SbfI', 'ScaI', 'SchI', 'ScrFI', 'SdaI', 'SduI', 'SetI', 'SexAI', 'SfaAI', 'SfaNI', 'SfcI', 'SfiI', 'SfoI', 'Sfr274I', 'Sfr303I', 'SfuI', 'SgeI', 'SgfI', 'SgrAI', 'SgrBI', 'SgrDI', 'SgsI', 'SinI', 'SlaI', 'SmaI', 'SmiI', 'SmiMI', 'SmlI', 'SmoI', 'SnaBI', 'SpeI', 'SphI', 'SrfI', 'Sse8387I', 'Sse9I', 'SseBI', 'SsiI', 'SspDI', 'SspI', 'SspMI', 'SstI', 'StuI', 'StyD4I', 'StyI', 'SwaI', 'TaaI', 'TaiI', 'TaqI', 'TaqII', 'TasI', 'TatI', 'TauI', 'TfiI', 'Tru1I', 'Tru9I', 'TscAI', 'TseFI', 'TseI', 'Tsp45I', 'TspDTI', 'TspGWI', 'TspMI', 'TspRI', 'Tth111I', 'Van91I', 'Vha464I', 'VneI', 'VpaK11BI', 'VspI', 'XagI', 'XapI', 'XbaI', 'XceI', 'XcmI', 'XhoI', 'XmaI', 'XmaJI', 'XmiI', 'XmnI', 'XspI', 'ZraI', 'ZrmI', 'Zsp2I']))

Returns the enzymes in a RestrictionBatch that cut the sequence exactly once.

ovhg

The ovhg property. This cannot be set directly, but is a consequence of how the watson and crick strands anneal to each other

rc()

Returns a Dseq object where watson and crick have switched places. This represents the same double stranded sequence.

Examples

>>> from pydna.dseq import Dseq
>>> a=Dseq("catcgatc")
>>> a
Dseq(-8)
catcgatc
gtagctag
>>> b=a.reverse_complement()
>>> b
Dseq(-8)
gatcgatg
ctagctac
>>>
reverse_complement()[source]

Returns a Dseq object where watson and crick have switched places. This represents the same double stranded sequence.

Examples

>>> from pydna.dseq import Dseq
>>> a=Dseq("catcgatc")
>>> a
Dseq(-8)
catcgatc
gtagctag
>>> b=a.reverse_complement()
>>> b
Dseq(-8)
gatcgatg
ctagctac
>>>
seguid()[source]

Returns the SEGUID for the Dseq. The definition varies with the amount of stagger between the sequences.

shifted(shift)[source]

Returns a shifted version of a circular Dseq object.

t4(nucleotides=None)

Fill in five prime protruding ends and chewing back three prime protruding ends by a DNA polymerase providing both 5’-3’ DNA polymerase activity and 3’-5’ nuclease acitivty (such as T4 DNA polymerase). This can be done in presence of any combination of the four A, G, C or T. Default are all four nucleotides together.

Parameters:
nucleotides : str

Examples

>>> from pydna.dseq import Dseq
>>> a=Dseq("gatcgatc")
>>> a
Dseq(-8)
gatcgatc
ctagctag
>>> a.T4()
Dseq(-8)
gatcgatc
ctagctag
>>> a.T4("t")
Dseq(-8)
gatcgat
 tagctag
>>> a.T4("a")
Dseq(-8)
gatcga
  agctag
>>> a.T4("g")
Dseq(-8)
gatcg
   gctag
>>>
three_prime_end()[source]

Returns a tuple describing the structure of the 5’ end of the DNA fragment

>>> from pydna.dseq import Dseq
>>> a=Dseq("aaa", "ttt")
>>> a
Dseq(-3)
aaa
ttt
>>> a.three_prime_end()
('blunt', '')
>>> a=Dseq("aaa", "ttt", ovhg=1)
>>> a
Dseq(-4)
 aaa
ttt
>>> a.three_prime_end()
("3'", 'a')
>>> a=Dseq("aaa", "ttt", ovhg=-1)
>>> a
Dseq(-4)
aaa
 ttt
>>> a.three_prime_end()
("5'", 't')
>>>
tolinear()[source]

Returns a blunt, linear copy of a circular Dseq object. This can only be done if the Dseq object is circular, otherwise a TypeError is raised.

This method is deprecated, use slicing instead. See example below.

Examples

>>> from pydna.dseq import Dseq
>>> a=Dseq("catcgatc", circular=True)
>>> a
Dseq(o8)
catcgatc
gtagctag
>>> a[:]
Dseq(-8)
catcgatc
gtagctag
>>>
twice_cutters(batch=RestrictionBatch(['AanI', 'AarI', 'AasI', 'AatII', 'AbaSI', 'AbsI', 'Acc16I', 'Acc36I', 'Acc65I', 'AccB1I', 'AccB7I', 'AccBSI', 'AccI', 'AccII', 'AccIII', 'AciI', 'AclI', 'AclWI', 'AcoI', 'AcsI', 'AcuI', 'AcvI', 'AcyI', 'AdeI', 'AfaI', 'AfeI', 'AfiI', 'AflII', 'AflIII', 'AgeI', 'AgsI', 'AhdI', 'AhlI', 'AjiI', 'AjnI', 'AjuI', 'AleI', 'AloI', 'AluBI', 'AluI', 'Alw21I', 'Alw26I', 'Alw44I', 'AlwI', 'AlwNI', 'Ama87I', 'Aor13HI', 'Aor51HI', 'AoxI', 'ApaI', 'ApaLI', 'ApeKI', 'ApoI', 'ArsI', 'AscI', 'AseI', 'AsiGI', 'AsiSI', 'Asp700I', 'Asp718I', 'AspA2I', 'AspLEI', 'AspS9I', 'AsuC2I', 'AsuHPI', 'AsuII', 'AsuNHI', 'AvaI', 'AvaII', 'AvrII', 'AxyI', 'BaeGI', 'BaeI', 'BalI', 'BamHI', 'BanI', 'BanII', 'BarI', 'BauI', 'BbrPI', 'BbsI', 'Bbv12I', 'BbvCI', 'BbvI', 'BccI', 'BceAI', 'BcgI', 'BciT130I', 'BciVI', 'BclI', 'BcnI', 'BcoDI', 'BcuI', 'BfaI', 'BfmI', 'BfoI', 'BfrI', 'BfuAI', 'BfuI', 'BglI', 'BglII', 'BisI', 'BlnI', 'BlpI', 'BlsI', 'BmcAI', 'Bme1390I', 'Bme18I', 'BmeRI', 'BmeT110I', 'BmgBI', 'BmgT120I', 'BmiI', 'BmrFI', 'BmrI', 'BmsI', 'BmtI', 'BmuI', 'BoxI', 'BpiI', 'BplI', 'BpmI', 'Bpu10I', 'Bpu1102I', 'Bpu14I', 'BpuEI', 'BpuMI', 'Bsa29I', 'BsaAI', 'BsaBI', 'BsaHI', 'BsaI', 'BsaJI', 'BsaWI', 'BsaXI', 'Bsc4I', 'Bse118I', 'Bse1I', 'Bse21I', 'Bse3DI', 'Bse8I', 'BseAI', 'BseBI', 'BseCI', 'BseDI', 'BseGI', 'BseJI', 'BseLI', 'BseMI', 'BseMII', 'BseNI', 'BsePI', 'BseRI', 'BseSI', 'BseX3I', 'BseXI', 'BseYI', 'BsgI', 'Bsh1236I', 'Bsh1285I', 'BshFI', 'BshNI', 'BshTI', 'BshVI', 'BsiEI', 'BsiHKAI', 'BsiHKCI', 'BsiSI', 'BsiWI', 'BslFI', 'BslI', 'BsmAI', 'BsmBI', 'BsmFI', 'BsmI', 'BsnI', 'Bso31I', 'BsoBI', 'Bsp119I', 'Bsp120I', 'Bsp1286I', 'Bsp13I', 'Bsp1407I', 'Bsp143I', 'Bsp1720I', 'Bsp19I', 'Bsp68I', 'BspACI', 'BspANI', 'BspCNI', 'BspDI', 'BspEI', 'BspFNI', 'BspHI', 'BspLI', 'BspMAI', 'BspMI', 'BspOI', 'BspPI', 'BspQI', 'BspT104I', 'BspT107I', 'BspTI', 'BspTNI', 'BsrBI', 'BsrDI', 'BsrFI', 'BsrGI', 'BsrI', 'BssAI', 'BssECI', 'BssHII', 'BssMI', 'BssNAI', 'BssNI', 'BssSI', 'BssT1I', 'Bst1107I', 'Bst2BI', 'Bst2UI', 'Bst4CI', 'Bst6I', 'BstACI', 'BstAFI', 'BstAPI', 'BstAUI', 'BstBAI', 'BstBI', 'BstC8I', 'BstDEI', 'BstDSI', 'BstEII', 'BstENI', 'BstF5I', 'BstFNI', 'BstH2I', 'BstHHI', 'BstKTI', 'BstMAI', 'BstMBI', 'BstMCI', 'BstMWI', 'BstNI', 'BstNSI', 'BstPAI', 'BstPI', 'BstSCI', 'BstSFI', 'BstSLI', 'BstSNI', 'BstUI', 'BstV1I', 'BstV2I', 'BstX2I', 'BstXI', 'BstYI', 'BstZ17I', 'BstZI', 'Bsu15I', 'Bsu36I', 'BsuI', 'BsuRI', 'BsuTUI', 'BtgI', 'BtgZI', 'BtrI', 'BtsCI', 'BtsI', 'BtsIMutI', 'BtuMI', 'BveI', 'Cac8I', 'CaiI', 'CciI', 'CciNI', 'CfoI', 'Cfr10I', 'Cfr13I', 'Cfr42I', 'Cfr9I', 'ClaI', 'CpoI', 'CseI', 'CsiI', 'Csp6I', 'CspAI', 'CspCI', 'CspI', 'CviAII', 'CviJI', 'CviKI_1', 'CviQI', 'DdeI', 'DinI', 'DpnI', 'DpnII', 'DraI', 'DraIII', 'DrdI', 'DriI', 'DseDI', 'EaeI', 'EagI', 'Eam1104I', 'Eam1105I', 'EarI', 'EciI', 'Ecl136II', 'EclXI', 'Eco105I', 'Eco130I', 'Eco147I', 'Eco24I', 'Eco31I', 'Eco32I', 'Eco47I', 'Eco47III', 'Eco52I', 'Eco53kI', 'Eco57I', 'Eco72I', 'Eco81I', 'Eco88I', 'Eco91I', 'EcoICRI', 'EcoNI', 'EcoO109I', 'EcoO65I', 'EcoRI', 'EcoRII', 'EcoRV', 'EcoT14I', 'EcoT22I', 'EcoT38I', 'EgeI', 'EheI', 'ErhI', 'Esp3I', 'FaeI', 'FaiI', 'FalI', 'FaqI', 'FatI', 'FauI', 'FauNDI', 'FbaI', 'FblI', 'Fnu4HI', 'FokI', 'FriOI', 'FseI', 'Fsp4HI', 'FspAI', 'FspBI', 'FspEI', 'FspI', 'GlaI', 'GluI', 'GsaI', 'GsuI', 'HaeII', 'HaeIII', 'HapII', 'HgaI', 'HhaI', 'Hin1I', 'Hin1II', 'Hin6I', 'HinP1I', 'HincII', 'HindII', 'HindIII', 'HinfI', 'HpaI', 'HpaII', 'HphI', 'Hpy166II', 'Hpy188I', 'Hpy188III', 'Hpy8I', 'Hpy99I', 'HpyAV', 'HpyCH4III', 'HpyCH4IV', 'HpyCH4V', 'HpyF10VI', 'HpyF3I', 'HpySE526I', 'Hsp92I', 'Hsp92II', 'HspAI', 'KasI', 'KflI', 'Kpn2I', 'KpnI', 'KroI', 'Ksp22I', 'KspAI', 'KspI', 'Kzo9I', 'LguI', 'LmnI', 'LpnPI', 'Lsp1109I', 'LweI', 'MabI', 'MaeI', 'MaeII', 'MaeIII', 'MalI', 'MauBI', 'MbiI', 'MboI', 'MboII', 'MfeI', 'MflI', 'MhlI', 'MlsI', 'MluCI', 'MluI', 'MluNI', 'Mly113I', 'MlyI', 'MmeI', 'MnlI', 'Mox20I', 'Mph1103I', 'MreI', 'MroI', 'MroNI', 'MroXI', 'MscI', 'MseI', 'MslI', 'Msp20I', 'MspA1I', 'MspCI', 'MspI', 'MspJI', 'MspR9I', 'MssI', 'MteI', 'MunI', 'Mva1269I', 'MvaI', 'MvnI', 'MwoI', 'NaeI', 'NarI', 'NciI', 'NcoI', 'NdeI', 'NdeII', 'NgoMIV', 'NheI', 'NlaIII', 'NlaIV', 'NmeAIII', 'NmuCI', 'NotI', 'NruI', 'NsbI', 'NsiI', 'NspI', 'NspV', 'OliI', 'PacI', 'PaeI', 'PaeR7I', 'PagI', 'PalAI', 'PasI', 'PauI', 'PceI', 'PciI', 'PciSI', 'PcsI', 'PctI', 'PdiI', 'PdmI', 'PfeI', 'Pfl23II', 'PflFI', 'PflMI', 'PfoI', 'PinAI', 'PkrI', 'Ple19I', 'PleI', 'PluTI', 'PmaCI', 'PmeI', 'PmlI', 'PpsI', 'Ppu21I', 'PpuMI', 'PscI', 'PshAI', 'PshBI', 'PsiI', 'Psp124BI', 'Psp1406I', 'Psp5II', 'Psp6I', 'PspCI', 'PspEI', 'PspFI', 'PspGI', 'PspLI', 'PspN4I', 'PspOMI', 'PspPI', 'PspPPI', 'PspXI', 'PsrI', 'PstI', 'PstNI', 'PsuI', 'PsyI', 'PteI', 'PvuI', 'PvuII', 'RgaI', 'RigI', 'RruI', 'RsaI', 'RsaNI', 'RseI', 'Rsr2I', 'RsrII', 'SacI', 'SacII', 'SalI', 'SapI', 'SaqAI', 'SatI', 'Sau3AI', 'Sau96I', 'SbfI', 'ScaI', 'SchI', 'ScrFI', 'SdaI', 'SduI', 'SetI', 'SexAI', 'SfaAI', 'SfaNI', 'SfcI', 'SfiI', 'SfoI', 'Sfr274I', 'Sfr303I', 'SfuI', 'SgeI', 'SgfI', 'SgrAI', 'SgrBI', 'SgrDI', 'SgsI', 'SinI', 'SlaI', 'SmaI', 'SmiI', 'SmiMI', 'SmlI', 'SmoI', 'SnaBI', 'SpeI', 'SphI', 'SrfI', 'Sse8387I', 'Sse9I', 'SseBI', 'SsiI', 'SspDI', 'SspI', 'SspMI', 'SstI', 'StuI', 'StyD4I', 'StyI', 'SwaI', 'TaaI', 'TaiI', 'TaqI', 'TaqII', 'TasI', 'TatI', 'TauI', 'TfiI', 'Tru1I', 'Tru9I', 'TscAI', 'TseFI', 'TseI', 'Tsp45I', 'TspDTI', 'TspGWI', 'TspMI', 'TspRI', 'Tth111I', 'Van91I', 'Vha464I', 'VneI', 'VpaK11BI', 'VspI', 'XagI', 'XapI', 'XbaI', 'XceI', 'XcmI', 'XhoI', 'XmaI', 'XmaJI', 'XmiI', 'XmnI', 'XspI', 'ZraI', 'ZrmI', 'Zsp2I']))[source]

Returns the enzymes in a RestrictionBatch that cut the sequence exactly twice.

unique_cutters(batch=RestrictionBatch(['AanI', 'AarI', 'AasI', 'AatII', 'AbaSI', 'AbsI', 'Acc16I', 'Acc36I', 'Acc65I', 'AccB1I', 'AccB7I', 'AccBSI', 'AccI', 'AccII', 'AccIII', 'AciI', 'AclI', 'AclWI', 'AcoI', 'AcsI', 'AcuI', 'AcvI', 'AcyI', 'AdeI', 'AfaI', 'AfeI', 'AfiI', 'AflII', 'AflIII', 'AgeI', 'AgsI', 'AhdI', 'AhlI', 'AjiI', 'AjnI', 'AjuI', 'AleI', 'AloI', 'AluBI', 'AluI', 'Alw21I', 'Alw26I', 'Alw44I', 'AlwI', 'AlwNI', 'Ama87I', 'Aor13HI', 'Aor51HI', 'AoxI', 'ApaI', 'ApaLI', 'ApeKI', 'ApoI', 'ArsI', 'AscI', 'AseI', 'AsiGI', 'AsiSI', 'Asp700I', 'Asp718I', 'AspA2I', 'AspLEI', 'AspS9I', 'AsuC2I', 'AsuHPI', 'AsuII', 'AsuNHI', 'AvaI', 'AvaII', 'AvrII', 'AxyI', 'BaeGI', 'BaeI', 'BalI', 'BamHI', 'BanI', 'BanII', 'BarI', 'BauI', 'BbrPI', 'BbsI', 'Bbv12I', 'BbvCI', 'BbvI', 'BccI', 'BceAI', 'BcgI', 'BciT130I', 'BciVI', 'BclI', 'BcnI', 'BcoDI', 'BcuI', 'BfaI', 'BfmI', 'BfoI', 'BfrI', 'BfuAI', 'BfuI', 'BglI', 'BglII', 'BisI', 'BlnI', 'BlpI', 'BlsI', 'BmcAI', 'Bme1390I', 'Bme18I', 'BmeRI', 'BmeT110I', 'BmgBI', 'BmgT120I', 'BmiI', 'BmrFI', 'BmrI', 'BmsI', 'BmtI', 'BmuI', 'BoxI', 'BpiI', 'BplI', 'BpmI', 'Bpu10I', 'Bpu1102I', 'Bpu14I', 'BpuEI', 'BpuMI', 'Bsa29I', 'BsaAI', 'BsaBI', 'BsaHI', 'BsaI', 'BsaJI', 'BsaWI', 'BsaXI', 'Bsc4I', 'Bse118I', 'Bse1I', 'Bse21I', 'Bse3DI', 'Bse8I', 'BseAI', 'BseBI', 'BseCI', 'BseDI', 'BseGI', 'BseJI', 'BseLI', 'BseMI', 'BseMII', 'BseNI', 'BsePI', 'BseRI', 'BseSI', 'BseX3I', 'BseXI', 'BseYI', 'BsgI', 'Bsh1236I', 'Bsh1285I', 'BshFI', 'BshNI', 'BshTI', 'BshVI', 'BsiEI', 'BsiHKAI', 'BsiHKCI', 'BsiSI', 'BsiWI', 'BslFI', 'BslI', 'BsmAI', 'BsmBI', 'BsmFI', 'BsmI', 'BsnI', 'Bso31I', 'BsoBI', 'Bsp119I', 'Bsp120I', 'Bsp1286I', 'Bsp13I', 'Bsp1407I', 'Bsp143I', 'Bsp1720I', 'Bsp19I', 'Bsp68I', 'BspACI', 'BspANI', 'BspCNI', 'BspDI', 'BspEI', 'BspFNI', 'BspHI', 'BspLI', 'BspMAI', 'BspMI', 'BspOI', 'BspPI', 'BspQI', 'BspT104I', 'BspT107I', 'BspTI', 'BspTNI', 'BsrBI', 'BsrDI', 'BsrFI', 'BsrGI', 'BsrI', 'BssAI', 'BssECI', 'BssHII', 'BssMI', 'BssNAI', 'BssNI', 'BssSI', 'BssT1I', 'Bst1107I', 'Bst2BI', 'Bst2UI', 'Bst4CI', 'Bst6I', 'BstACI', 'BstAFI', 'BstAPI', 'BstAUI', 'BstBAI', 'BstBI', 'BstC8I', 'BstDEI', 'BstDSI', 'BstEII', 'BstENI', 'BstF5I', 'BstFNI', 'BstH2I', 'BstHHI', 'BstKTI', 'BstMAI', 'BstMBI', 'BstMCI', 'BstMWI', 'BstNI', 'BstNSI', 'BstPAI', 'BstPI', 'BstSCI', 'BstSFI', 'BstSLI', 'BstSNI', 'BstUI', 'BstV1I', 'BstV2I', 'BstX2I', 'BstXI', 'BstYI', 'BstZ17I', 'BstZI', 'Bsu15I', 'Bsu36I', 'BsuI', 'BsuRI', 'BsuTUI', 'BtgI', 'BtgZI', 'BtrI', 'BtsCI', 'BtsI', 'BtsIMutI', 'BtuMI', 'BveI', 'Cac8I', 'CaiI', 'CciI', 'CciNI', 'CfoI', 'Cfr10I', 'Cfr13I', 'Cfr42I', 'Cfr9I', 'ClaI', 'CpoI', 'CseI', 'CsiI', 'Csp6I', 'CspAI', 'CspCI', 'CspI', 'CviAII', 'CviJI', 'CviKI_1', 'CviQI', 'DdeI', 'DinI', 'DpnI', 'DpnII', 'DraI', 'DraIII', 'DrdI', 'DriI', 'DseDI', 'EaeI', 'EagI', 'Eam1104I', 'Eam1105I', 'EarI', 'EciI', 'Ecl136II', 'EclXI', 'Eco105I', 'Eco130I', 'Eco147I', 'Eco24I', 'Eco31I', 'Eco32I', 'Eco47I', 'Eco47III', 'Eco52I', 'Eco53kI', 'Eco57I', 'Eco72I', 'Eco81I', 'Eco88I', 'Eco91I', 'EcoICRI', 'EcoNI', 'EcoO109I', 'EcoO65I', 'EcoRI', 'EcoRII', 'EcoRV', 'EcoT14I', 'EcoT22I', 'EcoT38I', 'EgeI', 'EheI', 'ErhI', 'Esp3I', 'FaeI', 'FaiI', 'FalI', 'FaqI', 'FatI', 'FauI', 'FauNDI', 'FbaI', 'FblI', 'Fnu4HI', 'FokI', 'FriOI', 'FseI', 'Fsp4HI', 'FspAI', 'FspBI', 'FspEI', 'FspI', 'GlaI', 'GluI', 'GsaI', 'GsuI', 'HaeII', 'HaeIII', 'HapII', 'HgaI', 'HhaI', 'Hin1I', 'Hin1II', 'Hin6I', 'HinP1I', 'HincII', 'HindII', 'HindIII', 'HinfI', 'HpaI', 'HpaII', 'HphI', 'Hpy166II', 'Hpy188I', 'Hpy188III', 'Hpy8I', 'Hpy99I', 'HpyAV', 'HpyCH4III', 'HpyCH4IV', 'HpyCH4V', 'HpyF10VI', 'HpyF3I', 'HpySE526I', 'Hsp92I', 'Hsp92II', 'HspAI', 'KasI', 'KflI', 'Kpn2I', 'KpnI', 'KroI', 'Ksp22I', 'KspAI', 'KspI', 'Kzo9I', 'LguI', 'LmnI', 'LpnPI', 'Lsp1109I', 'LweI', 'MabI', 'MaeI', 'MaeII', 'MaeIII', 'MalI', 'MauBI', 'MbiI', 'MboI', 'MboII', 'MfeI', 'MflI', 'MhlI', 'MlsI', 'MluCI', 'MluI', 'MluNI', 'Mly113I', 'MlyI', 'MmeI', 'MnlI', 'Mox20I', 'Mph1103I', 'MreI', 'MroI', 'MroNI', 'MroXI', 'MscI', 'MseI', 'MslI', 'Msp20I', 'MspA1I', 'MspCI', 'MspI', 'MspJI', 'MspR9I', 'MssI', 'MteI', 'MunI', 'Mva1269I', 'MvaI', 'MvnI', 'MwoI', 'NaeI', 'NarI', 'NciI', 'NcoI', 'NdeI', 'NdeII', 'NgoMIV', 'NheI', 'NlaIII', 'NlaIV', 'NmeAIII', 'NmuCI', 'NotI', 'NruI', 'NsbI', 'NsiI', 'NspI', 'NspV', 'OliI', 'PacI', 'PaeI', 'PaeR7I', 'PagI', 'PalAI', 'PasI', 'PauI', 'PceI', 'PciI', 'PciSI', 'PcsI', 'PctI', 'PdiI', 'PdmI', 'PfeI', 'Pfl23II', 'PflFI', 'PflMI', 'PfoI', 'PinAI', 'PkrI', 'Ple19I', 'PleI', 'PluTI', 'PmaCI', 'PmeI', 'PmlI', 'PpsI', 'Ppu21I', 'PpuMI', 'PscI', 'PshAI', 'PshBI', 'PsiI', 'Psp124BI', 'Psp1406I', 'Psp5II', 'Psp6I', 'PspCI', 'PspEI', 'PspFI', 'PspGI', 'PspLI', 'PspN4I', 'PspOMI', 'PspPI', 'PspPPI', 'PspXI', 'PsrI', 'PstI', 'PstNI', 'PsuI', 'PsyI', 'PteI', 'PvuI', 'PvuII', 'RgaI', 'RigI', 'RruI', 'RsaI', 'RsaNI', 'RseI', 'Rsr2I', 'RsrII', 'SacI', 'SacII', 'SalI', 'SapI', 'SaqAI', 'SatI', 'Sau3AI', 'Sau96I', 'SbfI', 'ScaI', 'SchI', 'ScrFI', 'SdaI', 'SduI', 'SetI', 'SexAI', 'SfaAI', 'SfaNI', 'SfcI', 'SfiI', 'SfoI', 'Sfr274I', 'Sfr303I', 'SfuI', 'SgeI', 'SgfI', 'SgrAI', 'SgrBI', 'SgrDI', 'SgsI', 'SinI', 'SlaI', 'SmaI', 'SmiI', 'SmiMI', 'SmlI', 'SmoI', 'SnaBI', 'SpeI', 'SphI', 'SrfI', 'Sse8387I', 'Sse9I', 'SseBI', 'SsiI', 'SspDI', 'SspI', 'SspMI', 'SstI', 'StuI', 'StyD4I', 'StyI', 'SwaI', 'TaaI', 'TaiI', 'TaqI', 'TaqII', 'TasI', 'TatI', 'TauI', 'TfiI', 'Tru1I', 'Tru9I', 'TscAI', 'TseFI', 'TseI', 'Tsp45I', 'TspDTI', 'TspGWI', 'TspMI', 'TspRI', 'Tth111I', 'Van91I', 'Vha464I', 'VneI', 'VpaK11BI', 'VspI', 'XagI', 'XapI', 'XbaI', 'XceI', 'XcmI', 'XhoI', 'XmaI', 'XmaJI', 'XmiI', 'XmnI', 'XspI', 'ZraI', 'ZrmI', 'Zsp2I']))[source]

Returns the enzymes in a RestrictionBatch that cut the sequence exactly once.

pydna.dseqrecord module

This module provides the Dseqrecord class, for handling double stranded DNA sequences. The Dseqrecord holds sequence information in the form of a pydna.dseq.Dseq object. The Dseq and Dseqrecord classes are subclasses of Biopythons Seq and SeqRecord classes, respectively.

The Dseq and Dseqrecord classes support the notion of circular and linear DNA topology.

class pydna.dseqrecord.Dseqrecord(record, *args, linear=None, circular=None, n=5e-14, **kwargs)[source]

Bases: pydna.seqrecord.SeqRecord

Dseqrecord is a double stranded version of the Biopython SeqRecord [3] class. The Dseqrecord object holds a Dseq object describing the sequence. Additionally, Dseqrecord hold meta information about the sequence in the from of a list of SeqFeatures, in the same way as the SeqRecord does.

The Dseqrecord can be initialized with a string, Seq, Dseq, SeqRecord or another Dseqrecord. The sequence information will be stored in a Dseq object in all cases.

Dseqrecord objects can be read or parsed from sequences in FASTA, EMBL or Genbank formats. See the pydna.readers and pydna.parsers modules for further information.

There is a short representation associated with the Dseqrecord. Dseqrecord(-3) represents a linear sequence of length 2 while Dseqrecord(o7) represents a circular sequence of length 7.

Dseqrecord and Dseq share the same concept of length. This length can be larger than each strand alone if they are staggered as in the example below.

<-- length -->
GATCCTTT
     AAAGCCTAG
Parameters:
record : string, Seq, SeqRecord, Dseq or other Dseqrecord object

This data will be used to form the seq property

circular : bool, optional

True or False reflecting the shape of the DNA molecule

linear : bool, optional

True or False reflecting the shape of the DNA molecule

References

[3]http://biopython.org/wiki/SeqRecord

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> a=Dseqrecord("aaa")
>>> a
Dseqrecord(-3)
>>> a.seq
Dseq(-3)
aaa
ttt
>>> from Bio.Seq import Seq
>>> b=Dseqrecord(Seq("aaa"))
>>> b
Dseqrecord(-3)
>>> b.seq
Dseq(-3)
aaa
ttt
>>> from Bio.SeqRecord import SeqRecord
>>> c=Dseqrecord(SeqRecord(Seq("aaa")))
>>> c
Dseqrecord(-3)
>>> c.seq
Dseq(-3)
aaa
ttt
>>> a.seq.alphabet
IUPACAmbiguousDNA()
>>> b.seq.alphabet
IUPACAmbiguousDNA()
>>> c.seq.alphabet
IUPACAmbiguousDNA()
>>>
circular

The circular property can not be set directly. Use looped() or tolinear()

cseguid()[source]

Returns the url safe cSEGUID for the sequence.

Only defined for circular sequences.

The cSEGUID checksum uniquely identifies a circular sequence regardless of where the origin is set. The two Dseqrecord objects below are circular permutations.

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> a=Dseqrecord("agtatcgtacatg", circular=True)
>>> a.cseguid() # cseguid is CTJbs6Fat8kLQxHj+/SC0kGEiYs
'CTJbs6Fat8kLQxHj-_SC0kGEiYs'
>>> a=Dseqrecord("gagtatcgtacat", circular=True)
>>> a.cseguid()
'CTJbs6Fat8kLQxHj-_SC0kGEiYs'
cut(*enzymes)[source]

Digest the Dseqrecord object with one or more restriction enzymes. returns a list of linear Dseqrecords. If there are no cuts, an empty list is returned.

See also Dseq.cut()

Parameters:
enzymes : enzyme object or iterable of such objects

A Bio.Restriction.XXX restriction object or iterable of such.

Returns:
Dseqrecord_frags : list

list of Dseqrecord objects formed by the digestion

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> a=Dseqrecord("ggatcc")
>>> from Bio.Restriction import BamHI
>>> a.cut(BamHI)
(Dseqrecord(-5), Dseqrecord(-5))
>>> frag1, frag2 = a.cut(BamHI)
>>> frag1.seq
Dseq(-5)
g
cctag
>>> frag2.seq
Dseq(-5)
gatcc
    g
cutters(batch=RestrictionBatch(['AanI', 'AarI', 'AasI', 'AatII', 'AbaSI', 'AbsI', 'Acc16I', 'Acc36I', 'Acc65I', 'AccB1I', 'AccB7I', 'AccBSI', 'AccI', 'AccII', 'AccIII', 'AciI', 'AclI', 'AclWI', 'AcoI', 'AcsI', 'AcuI', 'AcvI', 'AcyI', 'AdeI', 'AfaI', 'AfeI', 'AfiI', 'AflII', 'AflIII', 'AgeI', 'AgsI', 'AhdI', 'AhlI', 'AjiI', 'AjnI', 'AjuI', 'AleI', 'AloI', 'AluBI', 'AluI', 'Alw21I', 'Alw26I', 'Alw44I', 'AlwI', 'AlwNI', 'Ama87I', 'Aor13HI', 'Aor51HI', 'AoxI', 'ApaI', 'ApaLI', 'ApeKI', 'ApoI', 'ArsI', 'AscI', 'AseI', 'AsiGI', 'AsiSI', 'Asp700I', 'Asp718I', 'AspA2I', 'AspLEI', 'AspS9I', 'AsuC2I', 'AsuHPI', 'AsuII', 'AsuNHI', 'AvaI', 'AvaII', 'AvrII', 'AxyI', 'BaeGI', 'BaeI', 'BalI', 'BamHI', 'BanI', 'BanII', 'BarI', 'BauI', 'BbrPI', 'BbsI', 'Bbv12I', 'BbvCI', 'BbvI', 'BccI', 'BceAI', 'BcgI', 'BciT130I', 'BciVI', 'BclI', 'BcnI', 'BcoDI', 'BcuI', 'BfaI', 'BfmI', 'BfoI', 'BfrI', 'BfuAI', 'BfuI', 'BglI', 'BglII', 'BisI', 'BlnI', 'BlpI', 'BlsI', 'BmcAI', 'Bme1390I', 'Bme18I', 'BmeRI', 'BmeT110I', 'BmgBI', 'BmgT120I', 'BmiI', 'BmrFI', 'BmrI', 'BmsI', 'BmtI', 'BmuI', 'BoxI', 'BpiI', 'BplI', 'BpmI', 'Bpu10I', 'Bpu1102I', 'Bpu14I', 'BpuEI', 'BpuMI', 'Bsa29I', 'BsaAI', 'BsaBI', 'BsaHI', 'BsaI', 'BsaJI', 'BsaWI', 'BsaXI', 'Bsc4I', 'Bse118I', 'Bse1I', 'Bse21I', 'Bse3DI', 'Bse8I', 'BseAI', 'BseBI', 'BseCI', 'BseDI', 'BseGI', 'BseJI', 'BseLI', 'BseMI', 'BseMII', 'BseNI', 'BsePI', 'BseRI', 'BseSI', 'BseX3I', 'BseXI', 'BseYI', 'BsgI', 'Bsh1236I', 'Bsh1285I', 'BshFI', 'BshNI', 'BshTI', 'BshVI', 'BsiEI', 'BsiHKAI', 'BsiHKCI', 'BsiSI', 'BsiWI', 'BslFI', 'BslI', 'BsmAI', 'BsmBI', 'BsmFI', 'BsmI', 'BsnI', 'Bso31I', 'BsoBI', 'Bsp119I', 'Bsp120I', 'Bsp1286I', 'Bsp13I', 'Bsp1407I', 'Bsp143I', 'Bsp1720I', 'Bsp19I', 'Bsp68I', 'BspACI', 'BspANI', 'BspCNI', 'BspDI', 'BspEI', 'BspFNI', 'BspHI', 'BspLI', 'BspMAI', 'BspMI', 'BspOI', 'BspPI', 'BspQI', 'BspT104I', 'BspT107I', 'BspTI', 'BspTNI', 'BsrBI', 'BsrDI', 'BsrFI', 'BsrGI', 'BsrI', 'BssAI', 'BssECI', 'BssHII', 'BssMI', 'BssNAI', 'BssNI', 'BssSI', 'BssT1I', 'Bst1107I', 'Bst2BI', 'Bst2UI', 'Bst4CI', 'Bst6I', 'BstACI', 'BstAFI', 'BstAPI', 'BstAUI', 'BstBAI', 'BstBI', 'BstC8I', 'BstDEI', 'BstDSI', 'BstEII', 'BstENI', 'BstF5I', 'BstFNI', 'BstH2I', 'BstHHI', 'BstKTI', 'BstMAI', 'BstMBI', 'BstMCI', 'BstMWI', 'BstNI', 'BstNSI', 'BstPAI', 'BstPI', 'BstSCI', 'BstSFI', 'BstSLI', 'BstSNI', 'BstUI', 'BstV1I', 'BstV2I', 'BstX2I', 'BstXI', 'BstYI', 'BstZ17I', 'BstZI', 'Bsu15I', 'Bsu36I', 'BsuI', 'BsuRI', 'BsuTUI', 'BtgI', 'BtgZI', 'BtrI', 'BtsCI', 'BtsI', 'BtsIMutI', 'BtuMI', 'BveI', 'Cac8I', 'CaiI', 'CciI', 'CciNI', 'CfoI', 'Cfr10I', 'Cfr13I', 'Cfr42I', 'Cfr9I', 'ClaI', 'CpoI', 'CseI', 'CsiI', 'Csp6I', 'CspAI', 'CspCI', 'CspI', 'CviAII', 'CviJI', 'CviKI_1', 'CviQI', 'DdeI', 'DinI', 'DpnI', 'DpnII', 'DraI', 'DraIII', 'DrdI', 'DriI', 'DseDI', 'EaeI', 'EagI', 'Eam1104I', 'Eam1105I', 'EarI', 'EciI', 'Ecl136II', 'EclXI', 'Eco105I', 'Eco130I', 'Eco147I', 'Eco24I', 'Eco31I', 'Eco32I', 'Eco47I', 'Eco47III', 'Eco52I', 'Eco53kI', 'Eco57I', 'Eco72I', 'Eco81I', 'Eco88I', 'Eco91I', 'EcoICRI', 'EcoNI', 'EcoO109I', 'EcoO65I', 'EcoRI', 'EcoRII', 'EcoRV', 'EcoT14I', 'EcoT22I', 'EcoT38I', 'EgeI', 'EheI', 'ErhI', 'Esp3I', 'FaeI', 'FaiI', 'FalI', 'FaqI', 'FatI', 'FauI', 'FauNDI', 'FbaI', 'FblI', 'Fnu4HI', 'FokI', 'FriOI', 'FseI', 'Fsp4HI', 'FspAI', 'FspBI', 'FspEI', 'FspI', 'GlaI', 'GluI', 'GsaI', 'GsuI', 'HaeII', 'HaeIII', 'HapII', 'HgaI', 'HhaI', 'Hin1I', 'Hin1II', 'Hin6I', 'HinP1I', 'HincII', 'HindII', 'HindIII', 'HinfI', 'HpaI', 'HpaII', 'HphI', 'Hpy166II', 'Hpy188I', 'Hpy188III', 'Hpy8I', 'Hpy99I', 'HpyAV', 'HpyCH4III', 'HpyCH4IV', 'HpyCH4V', 'HpyF10VI', 'HpyF3I', 'HpySE526I', 'Hsp92I', 'Hsp92II', 'HspAI', 'KasI', 'KflI', 'Kpn2I', 'KpnI', 'KroI', 'Ksp22I', 'KspAI', 'KspI', 'Kzo9I', 'LguI', 'LmnI', 'LpnPI', 'Lsp1109I', 'LweI', 'MabI', 'MaeI', 'MaeII', 'MaeIII', 'MalI', 'MauBI', 'MbiI', 'MboI', 'MboII', 'MfeI', 'MflI', 'MhlI', 'MlsI', 'MluCI', 'MluI', 'MluNI', 'Mly113I', 'MlyI', 'MmeI', 'MnlI', 'Mox20I', 'Mph1103I', 'MreI', 'MroI', 'MroNI', 'MroXI', 'MscI', 'MseI', 'MslI', 'Msp20I', 'MspA1I', 'MspCI', 'MspI', 'MspJI', 'MspR9I', 'MssI', 'MteI', 'MunI', 'Mva1269I', 'MvaI', 'MvnI', 'MwoI', 'NaeI', 'NarI', 'NciI', 'NcoI', 'NdeI', 'NdeII', 'NgoMIV', 'NheI', 'NlaIII', 'NlaIV', 'NmeAIII', 'NmuCI', 'NotI', 'NruI', 'NsbI', 'NsiI', 'NspI', 'NspV', 'OliI', 'PacI', 'PaeI', 'PaeR7I', 'PagI', 'PalAI', 'PasI', 'PauI', 'PceI', 'PciI', 'PciSI', 'PcsI', 'PctI', 'PdiI', 'PdmI', 'PfeI', 'Pfl23II', 'PflFI', 'PflMI', 'PfoI', 'PinAI', 'PkrI', 'Ple19I', 'PleI', 'PluTI', 'PmaCI', 'PmeI', 'PmlI', 'PpsI', 'Ppu21I', 'PpuMI', 'PscI', 'PshAI', 'PshBI', 'PsiI', 'Psp124BI', 'Psp1406I', 'Psp5II', 'Psp6I', 'PspCI', 'PspEI', 'PspFI', 'PspGI', 'PspLI', 'PspN4I', 'PspOMI', 'PspPI', 'PspPPI', 'PspXI', 'PsrI', 'PstI', 'PstNI', 'PsuI', 'PsyI', 'PteI', 'PvuI', 'PvuII', 'RgaI', 'RigI', 'RruI', 'RsaI', 'RsaNI', 'RseI', 'Rsr2I', 'RsrII', 'SacI', 'SacII', 'SalI', 'SapI', 'SaqAI', 'SatI', 'Sau3AI', 'Sau96I', 'SbfI', 'ScaI', 'SchI', 'ScrFI', 'SdaI', 'SduI', 'SetI', 'SexAI', 'SfaAI', 'SfaNI', 'SfcI', 'SfiI', 'SfoI', 'Sfr274I', 'Sfr303I', 'SfuI', 'SgeI', 'SgfI', 'SgrAI', 'SgrBI', 'SgrDI', 'SgsI', 'SinI', 'SlaI', 'SmaI', 'SmiI', 'SmiMI', 'SmlI', 'SmoI', 'SnaBI', 'SpeI', 'SphI', 'SrfI', 'Sse8387I', 'Sse9I', 'SseBI', 'SsiI', 'SspDI', 'SspI', 'SspMI', 'SstI', 'StuI', 'StyD4I', 'StyI', 'SwaI', 'TaaI', 'TaiI', 'TaqI', 'TaqII', 'TasI', 'TatI', 'TauI', 'TfiI', 'Tru1I', 'Tru9I', 'TscAI', 'TseFI', 'TseI', 'Tsp45I', 'TspDTI', 'TspGWI', 'TspMI', 'TspRI', 'Tth111I', 'Van91I', 'Vha464I', 'VneI', 'VpaK11BI', 'VspI', 'XagI', 'XapI', 'XbaI', 'XceI', 'XcmI', 'XhoI', 'XmaI', 'XmaJI', 'XmiI', 'XmnI', 'XspI', 'ZraI', 'ZrmI', 'Zsp2I']))[source]
extract_feature(n)[source]

Extracts a feature and creates a new Dseqrecord object.

Parameters:
n : int

Indicates the feature to extract

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> a=Dseqrecord("atgtaa")
>>> a.add_feature(2,4)
>>> b=a.extract_feature(0)
>>> b
Dseqrecord(-2)
>>> b.seq
Dseq(-2)
gt
ca
find(other)[source]
find_aa(other)
>>> from pydna.dseqrecord import Dseqrecord
>>> s=Dseqrecord("atgtacgatcgtatgctggttatattttag")
>>> s.seq.translate()
Seq('MYDRMLVIF*', HasStopCodon(ExtendedIUPACProtein(), '*'))
>>> "RML" in s
True
>>> "MMM" in s
False
>>> s.seq.rc().translate()
Seq('LKYNQHTIVH', ExtendedIUPACProtein())
>>> "QHT" in s.rc()
True
>>> "QHT" in s
False
>>> slc = s.find_aa("RML")
>>> slc
slice(9, 18, None)
>>> s[slc]
Dseqrecord(-9)
>>> code = s[slc].seq
>>> code
Dseq(-9)
cgtatgctg
gcatacgac
>>> code.translate()
Seq('RML', ExtendedIUPACProtein())
find_aminoacids(other)[source]
>>> from pydna.dseqrecord import Dseqrecord
>>> s=Dseqrecord("atgtacgatcgtatgctggttatattttag")
>>> s.seq.translate()
Seq('MYDRMLVIF*', HasStopCodon(ExtendedIUPACProtein(), '*'))
>>> "RML" in s
True
>>> "MMM" in s
False
>>> s.seq.rc().translate()
Seq('LKYNQHTIVH', ExtendedIUPACProtein())
>>> "QHT" in s.rc()
True
>>> "QHT" in s
False
>>> slc = s.find_aa("RML")
>>> slc
slice(9, 18, None)
>>> s[slc]
Dseqrecord(-9)
>>> code = s[slc].seq
>>> code
Dseq(-9)
cgtatgctg
gcatacgac
>>> code.translate()
Seq('RML', ExtendedIUPACProtein())
format(f='gb')[source]

Returns the sequence as a string using a format supported by Biopython SeqIO [4]. Default is “gb” which is short for Genbank.

References

[4]http://biopython.org/wiki/SeqIO

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> x=Dseqrecord("aaa")
>>> x.annotations['date'] = '02-FEB-2013'
>>> x
Dseqrecord(-3)
>>> print(x.format("gb"))
LOCUS       name                       3 bp    DNA     linear   UNK 02-FEB-2013
DEFINITION  description.
ACCESSION   id
VERSION     id
KEYWORDS    .
SOURCE      .
  ORGANISM  .
            .
FEATURES             Location/Qualifiers
ORIGIN
        1 aaa
//
linear

The linear property can not be set directly. Use looped() or tolinear()

linearize(*enzymes)[source]

This method is similar to cut() but throws an exception if there is not excactly one cut i.e. none or more than one digestion products.

looped()[source]

Returns a circular version of the Dseqrecord object. The underlying Dseq object has to have compatible ends.

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> a=Dseqrecord("aaa")
>>> a
Dseqrecord(-3)
>>> b=a.looped()
>>> b
Dseqrecord(o3)
>>>
lseguid()[source]

Returns the url safe lSEGUID for the sequence.

Only defined for linear double stranded sequences.

The lSEGUID checksum uniquely identifies a linear sequence independent of the direction. The two Dseqrecord objects below are each others reverse complements, so they do in fact refer to the same molecule.

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> a=Dseqrecord("agtatcgtacatg")
>>> a.lseguid()
'DPshMN4KeAjMovEjGEV4Kzj18lU'
>>> b=Dseqrecord("catgtacgatact")
>>> a.lseguid()
'DPshMN4KeAjMovEjGEV4Kzj18lU'
m()[source]

This method returns the mass of the DNA molecule in grams. This is calculated as the product between the molecular weight of the Dseq object and the

map_trace_files(pth)[source]
n_cutters(n=3, batch=RestrictionBatch(['AanI', 'AarI', 'AasI', 'AatII', 'AbaSI', 'AbsI', 'Acc16I', 'Acc36I', 'Acc65I', 'AccB1I', 'AccB7I', 'AccBSI', 'AccI', 'AccII', 'AccIII', 'AciI', 'AclI', 'AclWI', 'AcoI', 'AcsI', 'AcuI', 'AcvI', 'AcyI', 'AdeI', 'AfaI', 'AfeI', 'AfiI', 'AflII', 'AflIII', 'AgeI', 'AgsI', 'AhdI', 'AhlI', 'AjiI', 'AjnI', 'AjuI', 'AleI', 'AloI', 'AluBI', 'AluI', 'Alw21I', 'Alw26I', 'Alw44I', 'AlwI', 'AlwNI', 'Ama87I', 'Aor13HI', 'Aor51HI', 'AoxI', 'ApaI', 'ApaLI', 'ApeKI', 'ApoI', 'ArsI', 'AscI', 'AseI', 'AsiGI', 'AsiSI', 'Asp700I', 'Asp718I', 'AspA2I', 'AspLEI', 'AspS9I', 'AsuC2I', 'AsuHPI', 'AsuII', 'AsuNHI', 'AvaI', 'AvaII', 'AvrII', 'AxyI', 'BaeGI', 'BaeI', 'BalI', 'BamHI', 'BanI', 'BanII', 'BarI', 'BauI', 'BbrPI', 'BbsI', 'Bbv12I', 'BbvCI', 'BbvI', 'BccI', 'BceAI', 'BcgI', 'BciT130I', 'BciVI', 'BclI', 'BcnI', 'BcoDI', 'BcuI', 'BfaI', 'BfmI', 'BfoI', 'BfrI', 'BfuAI', 'BfuI', 'BglI', 'BglII', 'BisI', 'BlnI', 'BlpI', 'BlsI', 'BmcAI', 'Bme1390I', 'Bme18I', 'BmeRI', 'BmeT110I', 'BmgBI', 'BmgT120I', 'BmiI', 'BmrFI', 'BmrI', 'BmsI', 'BmtI', 'BmuI', 'BoxI', 'BpiI', 'BplI', 'BpmI', 'Bpu10I', 'Bpu1102I', 'Bpu14I', 'BpuEI', 'BpuMI', 'Bsa29I', 'BsaAI', 'BsaBI', 'BsaHI', 'BsaI', 'BsaJI', 'BsaWI', 'BsaXI', 'Bsc4I', 'Bse118I', 'Bse1I', 'Bse21I', 'Bse3DI', 'Bse8I', 'BseAI', 'BseBI', 'BseCI', 'BseDI', 'BseGI', 'BseJI', 'BseLI', 'BseMI', 'BseMII', 'BseNI', 'BsePI', 'BseRI', 'BseSI', 'BseX3I', 'BseXI', 'BseYI', 'BsgI', 'Bsh1236I', 'Bsh1285I', 'BshFI', 'BshNI', 'BshTI', 'BshVI', 'BsiEI', 'BsiHKAI', 'BsiHKCI', 'BsiSI', 'BsiWI', 'BslFI', 'BslI', 'BsmAI', 'BsmBI', 'BsmFI', 'BsmI', 'BsnI', 'Bso31I', 'BsoBI', 'Bsp119I', 'Bsp120I', 'Bsp1286I', 'Bsp13I', 'Bsp1407I', 'Bsp143I', 'Bsp1720I', 'Bsp19I', 'Bsp68I', 'BspACI', 'BspANI', 'BspCNI', 'BspDI', 'BspEI', 'BspFNI', 'BspHI', 'BspLI', 'BspMAI', 'BspMI', 'BspOI', 'BspPI', 'BspQI', 'BspT104I', 'BspT107I', 'BspTI', 'BspTNI', 'BsrBI', 'BsrDI', 'BsrFI', 'BsrGI', 'BsrI', 'BssAI', 'BssECI', 'BssHII', 'BssMI', 'BssNAI', 'BssNI', 'BssSI', 'BssT1I', 'Bst1107I', 'Bst2BI', 'Bst2UI', 'Bst4CI', 'Bst6I', 'BstACI', 'BstAFI', 'BstAPI', 'BstAUI', 'BstBAI', 'BstBI', 'BstC8I', 'BstDEI', 'BstDSI', 'BstEII', 'BstENI', 'BstF5I', 'BstFNI', 'BstH2I', 'BstHHI', 'BstKTI', 'BstMAI', 'BstMBI', 'BstMCI', 'BstMWI', 'BstNI', 'BstNSI', 'BstPAI', 'BstPI', 'BstSCI', 'BstSFI', 'BstSLI', 'BstSNI', 'BstUI', 'BstV1I', 'BstV2I', 'BstX2I', 'BstXI', 'BstYI', 'BstZ17I', 'BstZI', 'Bsu15I', 'Bsu36I', 'BsuI', 'BsuRI', 'BsuTUI', 'BtgI', 'BtgZI', 'BtrI', 'BtsCI', 'BtsI', 'BtsIMutI', 'BtuMI', 'BveI', 'Cac8I', 'CaiI', 'CciI', 'CciNI', 'CfoI', 'Cfr10I', 'Cfr13I', 'Cfr42I', 'Cfr9I', 'ClaI', 'CpoI', 'CseI', 'CsiI', 'Csp6I', 'CspAI', 'CspCI', 'CspI', 'CviAII', 'CviJI', 'CviKI_1', 'CviQI', 'DdeI', 'DinI', 'DpnI', 'DpnII', 'DraI', 'DraIII', 'DrdI', 'DriI', 'DseDI', 'EaeI', 'EagI', 'Eam1104I', 'Eam1105I', 'EarI', 'EciI', 'Ecl136II', 'EclXI', 'Eco105I', 'Eco130I', 'Eco147I', 'Eco24I', 'Eco31I', 'Eco32I', 'Eco47I', 'Eco47III', 'Eco52I', 'Eco53kI', 'Eco57I', 'Eco72I', 'Eco81I', 'Eco88I', 'Eco91I', 'EcoICRI', 'EcoNI', 'EcoO109I', 'EcoO65I', 'EcoRI', 'EcoRII', 'EcoRV', 'EcoT14I', 'EcoT22I', 'EcoT38I', 'EgeI', 'EheI', 'ErhI', 'Esp3I', 'FaeI', 'FaiI', 'FalI', 'FaqI', 'FatI', 'FauI', 'FauNDI', 'FbaI', 'FblI', 'Fnu4HI', 'FokI', 'FriOI', 'FseI', 'Fsp4HI', 'FspAI', 'FspBI', 'FspEI', 'FspI', 'GlaI', 'GluI', 'GsaI', 'GsuI', 'HaeII', 'HaeIII', 'HapII', 'HgaI', 'HhaI', 'Hin1I', 'Hin1II', 'Hin6I', 'HinP1I', 'HincII', 'HindII', 'HindIII', 'HinfI', 'HpaI', 'HpaII', 'HphI', 'Hpy166II', 'Hpy188I', 'Hpy188III', 'Hpy8I', 'Hpy99I', 'HpyAV', 'HpyCH4III', 'HpyCH4IV', 'HpyCH4V', 'HpyF10VI', 'HpyF3I', 'HpySE526I', 'Hsp92I', 'Hsp92II', 'HspAI', 'KasI', 'KflI', 'Kpn2I', 'KpnI', 'KroI', 'Ksp22I', 'KspAI', 'KspI', 'Kzo9I', 'LguI', 'LmnI', 'LpnPI', 'Lsp1109I', 'LweI', 'MabI', 'MaeI', 'MaeII', 'MaeIII', 'MalI', 'MauBI', 'MbiI', 'MboI', 'MboII', 'MfeI', 'MflI', 'MhlI', 'MlsI', 'MluCI', 'MluI', 'MluNI', 'Mly113I', 'MlyI', 'MmeI', 'MnlI', 'Mox20I', 'Mph1103I', 'MreI', 'MroI', 'MroNI', 'MroXI', 'MscI', 'MseI', 'MslI', 'Msp20I', 'MspA1I', 'MspCI', 'MspI', 'MspJI', 'MspR9I', 'MssI', 'MteI', 'MunI', 'Mva1269I', 'MvaI', 'MvnI', 'MwoI', 'NaeI', 'NarI', 'NciI', 'NcoI', 'NdeI', 'NdeII', 'NgoMIV', 'NheI', 'NlaIII', 'NlaIV', 'NmeAIII', 'NmuCI', 'NotI', 'NruI', 'NsbI', 'NsiI', 'NspI', 'NspV', 'OliI', 'PacI', 'PaeI', 'PaeR7I', 'PagI', 'PalAI', 'PasI', 'PauI', 'PceI', 'PciI', 'PciSI', 'PcsI', 'PctI', 'PdiI', 'PdmI', 'PfeI', 'Pfl23II', 'PflFI', 'PflMI', 'PfoI', 'PinAI', 'PkrI', 'Ple19I', 'PleI', 'PluTI', 'PmaCI', 'PmeI', 'PmlI', 'PpsI', 'Ppu21I', 'PpuMI', 'PscI', 'PshAI', 'PshBI', 'PsiI', 'Psp124BI', 'Psp1406I', 'Psp5II', 'Psp6I', 'PspCI', 'PspEI', 'PspFI', 'PspGI', 'PspLI', 'PspN4I', 'PspOMI', 'PspPI', 'PspPPI', 'PspXI', 'PsrI', 'PstI', 'PstNI', 'PsuI', 'PsyI', 'PteI', 'PvuI', 'PvuII', 'RgaI', 'RigI', 'RruI', 'RsaI', 'RsaNI', 'RseI', 'Rsr2I', 'RsrII', 'SacI', 'SacII', 'SalI', 'SapI', 'SaqAI', 'SatI', 'Sau3AI', 'Sau96I', 'SbfI', 'ScaI', 'SchI', 'ScrFI', 'SdaI', 'SduI', 'SetI', 'SexAI', 'SfaAI', 'SfaNI', 'SfcI', 'SfiI', 'SfoI', 'Sfr274I', 'Sfr303I', 'SfuI', 'SgeI', 'SgfI', 'SgrAI', 'SgrBI', 'SgrDI', 'SgsI', 'SinI', 'SlaI', 'SmaI', 'SmiI', 'SmiMI', 'SmlI', 'SmoI', 'SnaBI', 'SpeI', 'SphI', 'SrfI', 'Sse8387I', 'Sse9I', 'SseBI', 'SsiI', 'SspDI', 'SspI', 'SspMI', 'SstI', 'StuI', 'StyD4I', 'StyI', 'SwaI', 'TaaI', 'TaiI', 'TaqI', 'TaqII', 'TasI', 'TatI', 'TauI', 'TfiI', 'Tru1I', 'Tru9I', 'TscAI', 'TseFI', 'TseI', 'Tsp45I', 'TspDTI', 'TspGWI', 'TspMI', 'TspRI', 'Tth111I', 'Van91I', 'Vha464I', 'VneI', 'VpaK11BI', 'VspI', 'XagI', 'XapI', 'XbaI', 'XceI', 'XcmI', 'XhoI', 'XmaI', 'XmaJI', 'XmiI', 'XmnI', 'XspI', 'ZraI', 'ZrmI', 'Zsp2I']))[source]
no_cutters(batch=RestrictionBatch(['AanI', 'AarI', 'AasI', 'AatII', 'AbaSI', 'AbsI', 'Acc16I', 'Acc36I', 'Acc65I', 'AccB1I', 'AccB7I', 'AccBSI', 'AccI', 'AccII', 'AccIII', 'AciI', 'AclI', 'AclWI', 'AcoI', 'AcsI', 'AcuI', 'AcvI', 'AcyI', 'AdeI', 'AfaI', 'AfeI', 'AfiI', 'AflII', 'AflIII', 'AgeI', 'AgsI', 'AhdI', 'AhlI', 'AjiI', 'AjnI', 'AjuI', 'AleI', 'AloI', 'AluBI', 'AluI', 'Alw21I', 'Alw26I', 'Alw44I', 'AlwI', 'AlwNI', 'Ama87I', 'Aor13HI', 'Aor51HI', 'AoxI', 'ApaI', 'ApaLI', 'ApeKI', 'ApoI', 'ArsI', 'AscI', 'AseI', 'AsiGI', 'AsiSI', 'Asp700I', 'Asp718I', 'AspA2I', 'AspLEI', 'AspS9I', 'AsuC2I', 'AsuHPI', 'AsuII', 'AsuNHI', 'AvaI', 'AvaII', 'AvrII', 'AxyI', 'BaeGI', 'BaeI', 'BalI', 'BamHI', 'BanI', 'BanII', 'BarI', 'BauI', 'BbrPI', 'BbsI', 'Bbv12I', 'BbvCI', 'BbvI', 'BccI', 'BceAI', 'BcgI', 'BciT130I', 'BciVI', 'BclI', 'BcnI', 'BcoDI', 'BcuI', 'BfaI', 'BfmI', 'BfoI', 'BfrI', 'BfuAI', 'BfuI', 'BglI', 'BglII', 'BisI', 'BlnI', 'BlpI', 'BlsI', 'BmcAI', 'Bme1390I', 'Bme18I', 'BmeRI', 'BmeT110I', 'BmgBI', 'BmgT120I', 'BmiI', 'BmrFI', 'BmrI', 'BmsI', 'BmtI', 'BmuI', 'BoxI', 'BpiI', 'BplI', 'BpmI', 'Bpu10I', 'Bpu1102I', 'Bpu14I', 'BpuEI', 'BpuMI', 'Bsa29I', 'BsaAI', 'BsaBI', 'BsaHI', 'BsaI', 'BsaJI', 'BsaWI', 'BsaXI', 'Bsc4I', 'Bse118I', 'Bse1I', 'Bse21I', 'Bse3DI', 'Bse8I', 'BseAI', 'BseBI', 'BseCI', 'BseDI', 'BseGI', 'BseJI', 'BseLI', 'BseMI', 'BseMII', 'BseNI', 'BsePI', 'BseRI', 'BseSI', 'BseX3I', 'BseXI', 'BseYI', 'BsgI', 'Bsh1236I', 'Bsh1285I', 'BshFI', 'BshNI', 'BshTI', 'BshVI', 'BsiEI', 'BsiHKAI', 'BsiHKCI', 'BsiSI', 'BsiWI', 'BslFI', 'BslI', 'BsmAI', 'BsmBI', 'BsmFI', 'BsmI', 'BsnI', 'Bso31I', 'BsoBI', 'Bsp119I', 'Bsp120I', 'Bsp1286I', 'Bsp13I', 'Bsp1407I', 'Bsp143I', 'Bsp1720I', 'Bsp19I', 'Bsp68I', 'BspACI', 'BspANI', 'BspCNI', 'BspDI', 'BspEI', 'BspFNI', 'BspHI', 'BspLI', 'BspMAI', 'BspMI', 'BspOI', 'BspPI', 'BspQI', 'BspT104I', 'BspT107I', 'BspTI', 'BspTNI', 'BsrBI', 'BsrDI', 'BsrFI', 'BsrGI', 'BsrI', 'BssAI', 'BssECI', 'BssHII', 'BssMI', 'BssNAI', 'BssNI', 'BssSI', 'BssT1I', 'Bst1107I', 'Bst2BI', 'Bst2UI', 'Bst4CI', 'Bst6I', 'BstACI', 'BstAFI', 'BstAPI', 'BstAUI', 'BstBAI', 'BstBI', 'BstC8I', 'BstDEI', 'BstDSI', 'BstEII', 'BstENI', 'BstF5I', 'BstFNI', 'BstH2I', 'BstHHI', 'BstKTI', 'BstMAI', 'BstMBI', 'BstMCI', 'BstMWI', 'BstNI', 'BstNSI', 'BstPAI', 'BstPI', 'BstSCI', 'BstSFI', 'BstSLI', 'BstSNI', 'BstUI', 'BstV1I', 'BstV2I', 'BstX2I', 'BstXI', 'BstYI', 'BstZ17I', 'BstZI', 'Bsu15I', 'Bsu36I', 'BsuI', 'BsuRI', 'BsuTUI', 'BtgI', 'BtgZI', 'BtrI', 'BtsCI', 'BtsI', 'BtsIMutI', 'BtuMI', 'BveI', 'Cac8I', 'CaiI', 'CciI', 'CciNI', 'CfoI', 'Cfr10I', 'Cfr13I', 'Cfr42I', 'Cfr9I', 'ClaI', 'CpoI', 'CseI', 'CsiI', 'Csp6I', 'CspAI', 'CspCI', 'CspI', 'CviAII', 'CviJI', 'CviKI_1', 'CviQI', 'DdeI', 'DinI', 'DpnI', 'DpnII', 'DraI', 'DraIII', 'DrdI', 'DriI', 'DseDI', 'EaeI', 'EagI', 'Eam1104I', 'Eam1105I', 'EarI', 'EciI', 'Ecl136II', 'EclXI', 'Eco105I', 'Eco130I', 'Eco147I', 'Eco24I', 'Eco31I', 'Eco32I', 'Eco47I', 'Eco47III', 'Eco52I', 'Eco53kI', 'Eco57I', 'Eco72I', 'Eco81I', 'Eco88I', 'Eco91I', 'EcoICRI', 'EcoNI', 'EcoO109I', 'EcoO65I', 'EcoRI', 'EcoRII', 'EcoRV', 'EcoT14I', 'EcoT22I', 'EcoT38I', 'EgeI', 'EheI', 'ErhI', 'Esp3I', 'FaeI', 'FaiI', 'FalI', 'FaqI', 'FatI', 'FauI', 'FauNDI', 'FbaI', 'FblI', 'Fnu4HI', 'FokI', 'FriOI', 'FseI', 'Fsp4HI', 'FspAI', 'FspBI', 'FspEI', 'FspI', 'GlaI', 'GluI', 'GsaI', 'GsuI', 'HaeII', 'HaeIII', 'HapII', 'HgaI', 'HhaI', 'Hin1I', 'Hin1II', 'Hin6I', 'HinP1I', 'HincII', 'HindII', 'HindIII', 'HinfI', 'HpaI', 'HpaII', 'HphI', 'Hpy166II', 'Hpy188I', 'Hpy188III', 'Hpy8I', 'Hpy99I', 'HpyAV', 'HpyCH4III', 'HpyCH4IV', 'HpyCH4V', 'HpyF10VI', 'HpyF3I', 'HpySE526I', 'Hsp92I', 'Hsp92II', 'HspAI', 'KasI', 'KflI', 'Kpn2I', 'KpnI', 'KroI', 'Ksp22I', 'KspAI', 'KspI', 'Kzo9I', 'LguI', 'LmnI', 'LpnPI', 'Lsp1109I', 'LweI', 'MabI', 'MaeI', 'MaeII', 'MaeIII', 'MalI', 'MauBI', 'MbiI', 'MboI', 'MboII', 'MfeI', 'MflI', 'MhlI', 'MlsI', 'MluCI', 'MluI', 'MluNI', 'Mly113I', 'MlyI', 'MmeI', 'MnlI', 'Mox20I', 'Mph1103I', 'MreI', 'MroI', 'MroNI', 'MroXI', 'MscI', 'MseI', 'MslI', 'Msp20I', 'MspA1I', 'MspCI', 'MspI', 'MspJI', 'MspR9I', 'MssI', 'MteI', 'MunI', 'Mva1269I', 'MvaI', 'MvnI', 'MwoI', 'NaeI', 'NarI', 'NciI', 'NcoI', 'NdeI', 'NdeII', 'NgoMIV', 'NheI', 'NlaIII', 'NlaIV', 'NmeAIII', 'NmuCI', 'NotI', 'NruI', 'NsbI', 'NsiI', 'NspI', 'NspV', 'OliI', 'PacI', 'PaeI', 'PaeR7I', 'PagI', 'PalAI', 'PasI', 'PauI', 'PceI', 'PciI', 'PciSI', 'PcsI', 'PctI', 'PdiI', 'PdmI', 'PfeI', 'Pfl23II', 'PflFI', 'PflMI', 'PfoI', 'PinAI', 'PkrI', 'Ple19I', 'PleI', 'PluTI', 'PmaCI', 'PmeI', 'PmlI', 'PpsI', 'Ppu21I', 'PpuMI', 'PscI', 'PshAI', 'PshBI', 'PsiI', 'Psp124BI', 'Psp1406I', 'Psp5II', 'Psp6I', 'PspCI', 'PspEI', 'PspFI', 'PspGI', 'PspLI', 'PspN4I', 'PspOMI', 'PspPI', 'PspPPI', 'PspXI', 'PsrI', 'PstI', 'PstNI', 'PsuI', 'PsyI', 'PteI', 'PvuI', 'PvuII', 'RgaI', 'RigI', 'RruI', 'RsaI', 'RsaNI', 'RseI', 'Rsr2I', 'RsrII', 'SacI', 'SacII', 'SalI', 'SapI', 'SaqAI', 'SatI', 'Sau3AI', 'Sau96I', 'SbfI', 'ScaI', 'SchI', 'ScrFI', 'SdaI', 'SduI', 'SetI', 'SexAI', 'SfaAI', 'SfaNI', 'SfcI', 'SfiI', 'SfoI', 'Sfr274I', 'Sfr303I', 'SfuI', 'SgeI', 'SgfI', 'SgrAI', 'SgrBI', 'SgrDI', 'SgsI', 'SinI', 'SlaI', 'SmaI', 'SmiI', 'SmiMI', 'SmlI', 'SmoI', 'SnaBI', 'SpeI', 'SphI', 'SrfI', 'Sse8387I', 'Sse9I', 'SseBI', 'SsiI', 'SspDI', 'SspI', 'SspMI', 'SstI', 'StuI', 'StyD4I', 'StyI', 'SwaI', 'TaaI', 'TaiI', 'TaqI', 'TaqII', 'TasI', 'TatI', 'TauI', 'TfiI', 'Tru1I', 'Tru9I', 'TscAI', 'TseFI', 'TseI', 'Tsp45I', 'TspDTI', 'TspGWI', 'TspMI', 'TspRI', 'Tth111I', 'Van91I', 'Vha464I', 'VneI', 'VpaK11BI', 'VspI', 'XagI', 'XapI', 'XbaI', 'XceI', 'XcmI', 'XhoI', 'XmaI', 'XmaJI', 'XmiI', 'XmnI', 'XspI', 'ZraI', 'ZrmI', 'Zsp2I']))[source]

See

number_of_cuts(*enzymes)[source]

This method returns the number of cuts by digestion with the Restriction enzymes contained in the iterable.

once_cutters(batch=RestrictionBatch(['AanI', 'AarI', 'AasI', 'AatII', 'AbaSI', 'AbsI', 'Acc16I', 'Acc36I', 'Acc65I', 'AccB1I', 'AccB7I', 'AccBSI', 'AccI', 'AccII', 'AccIII', 'AciI', 'AclI', 'AclWI', 'AcoI', 'AcsI', 'AcuI', 'AcvI', 'AcyI', 'AdeI', 'AfaI', 'AfeI', 'AfiI', 'AflII', 'AflIII', 'AgeI', 'AgsI', 'AhdI', 'AhlI', 'AjiI', 'AjnI', 'AjuI', 'AleI', 'AloI', 'AluBI', 'AluI', 'Alw21I', 'Alw26I', 'Alw44I', 'AlwI', 'AlwNI', 'Ama87I', 'Aor13HI', 'Aor51HI', 'AoxI', 'ApaI', 'ApaLI', 'ApeKI', 'ApoI', 'ArsI', 'AscI', 'AseI', 'AsiGI', 'AsiSI', 'Asp700I', 'Asp718I', 'AspA2I', 'AspLEI', 'AspS9I', 'AsuC2I', 'AsuHPI', 'AsuII', 'AsuNHI', 'AvaI', 'AvaII', 'AvrII', 'AxyI', 'BaeGI', 'BaeI', 'BalI', 'BamHI', 'BanI', 'BanII', 'BarI', 'BauI', 'BbrPI', 'BbsI', 'Bbv12I', 'BbvCI', 'BbvI', 'BccI', 'BceAI', 'BcgI', 'BciT130I', 'BciVI', 'BclI', 'BcnI', 'BcoDI', 'BcuI', 'BfaI', 'BfmI', 'BfoI', 'BfrI', 'BfuAI', 'BfuI', 'BglI', 'BglII', 'BisI', 'BlnI', 'BlpI', 'BlsI', 'BmcAI', 'Bme1390I', 'Bme18I', 'BmeRI', 'BmeT110I', 'BmgBI', 'BmgT120I', 'BmiI', 'BmrFI', 'BmrI', 'BmsI', 'BmtI', 'BmuI', 'BoxI', 'BpiI', 'BplI', 'BpmI', 'Bpu10I', 'Bpu1102I', 'Bpu14I', 'BpuEI', 'BpuMI', 'Bsa29I', 'BsaAI', 'BsaBI', 'BsaHI', 'BsaI', 'BsaJI', 'BsaWI', 'BsaXI', 'Bsc4I', 'Bse118I', 'Bse1I', 'Bse21I', 'Bse3DI', 'Bse8I', 'BseAI', 'BseBI', 'BseCI', 'BseDI', 'BseGI', 'BseJI', 'BseLI', 'BseMI', 'BseMII', 'BseNI', 'BsePI', 'BseRI', 'BseSI', 'BseX3I', 'BseXI', 'BseYI', 'BsgI', 'Bsh1236I', 'Bsh1285I', 'BshFI', 'BshNI', 'BshTI', 'BshVI', 'BsiEI', 'BsiHKAI', 'BsiHKCI', 'BsiSI', 'BsiWI', 'BslFI', 'BslI', 'BsmAI', 'BsmBI', 'BsmFI', 'BsmI', 'BsnI', 'Bso31I', 'BsoBI', 'Bsp119I', 'Bsp120I', 'Bsp1286I', 'Bsp13I', 'Bsp1407I', 'Bsp143I', 'Bsp1720I', 'Bsp19I', 'Bsp68I', 'BspACI', 'BspANI', 'BspCNI', 'BspDI', 'BspEI', 'BspFNI', 'BspHI', 'BspLI', 'BspMAI', 'BspMI', 'BspOI', 'BspPI', 'BspQI', 'BspT104I', 'BspT107I', 'BspTI', 'BspTNI', 'BsrBI', 'BsrDI', 'BsrFI', 'BsrGI', 'BsrI', 'BssAI', 'BssECI', 'BssHII', 'BssMI', 'BssNAI', 'BssNI', 'BssSI', 'BssT1I', 'Bst1107I', 'Bst2BI', 'Bst2UI', 'Bst4CI', 'Bst6I', 'BstACI', 'BstAFI', 'BstAPI', 'BstAUI', 'BstBAI', 'BstBI', 'BstC8I', 'BstDEI', 'BstDSI', 'BstEII', 'BstENI', 'BstF5I', 'BstFNI', 'BstH2I', 'BstHHI', 'BstKTI', 'BstMAI', 'BstMBI', 'BstMCI', 'BstMWI', 'BstNI', 'BstNSI', 'BstPAI', 'BstPI', 'BstSCI', 'BstSFI', 'BstSLI', 'BstSNI', 'BstUI', 'BstV1I', 'BstV2I', 'BstX2I', 'BstXI', 'BstYI', 'BstZ17I', 'BstZI', 'Bsu15I', 'Bsu36I', 'BsuI', 'BsuRI', 'BsuTUI', 'BtgI', 'BtgZI', 'BtrI', 'BtsCI', 'BtsI', 'BtsIMutI', 'BtuMI', 'BveI', 'Cac8I', 'CaiI', 'CciI', 'CciNI', 'CfoI', 'Cfr10I', 'Cfr13I', 'Cfr42I', 'Cfr9I', 'ClaI', 'CpoI', 'CseI', 'CsiI', 'Csp6I', 'CspAI', 'CspCI', 'CspI', 'CviAII', 'CviJI', 'CviKI_1', 'CviQI', 'DdeI', 'DinI', 'DpnI', 'DpnII', 'DraI', 'DraIII', 'DrdI', 'DriI', 'DseDI', 'EaeI', 'EagI', 'Eam1104I', 'Eam1105I', 'EarI', 'EciI', 'Ecl136II', 'EclXI', 'Eco105I', 'Eco130I', 'Eco147I', 'Eco24I', 'Eco31I', 'Eco32I', 'Eco47I', 'Eco47III', 'Eco52I', 'Eco53kI', 'Eco57I', 'Eco72I', 'Eco81I', 'Eco88I', 'Eco91I', 'EcoICRI', 'EcoNI', 'EcoO109I', 'EcoO65I', 'EcoRI', 'EcoRII', 'EcoRV', 'EcoT14I', 'EcoT22I', 'EcoT38I', 'EgeI', 'EheI', 'ErhI', 'Esp3I', 'FaeI', 'FaiI', 'FalI', 'FaqI', 'FatI', 'FauI', 'FauNDI', 'FbaI', 'FblI', 'Fnu4HI', 'FokI', 'FriOI', 'FseI', 'Fsp4HI', 'FspAI', 'FspBI', 'FspEI', 'FspI', 'GlaI', 'GluI', 'GsaI', 'GsuI', 'HaeII', 'HaeIII', 'HapII', 'HgaI', 'HhaI', 'Hin1I', 'Hin1II', 'Hin6I', 'HinP1I', 'HincII', 'HindII', 'HindIII', 'HinfI', 'HpaI', 'HpaII', 'HphI', 'Hpy166II', 'Hpy188I', 'Hpy188III', 'Hpy8I', 'Hpy99I', 'HpyAV', 'HpyCH4III', 'HpyCH4IV', 'HpyCH4V', 'HpyF10VI', 'HpyF3I', 'HpySE526I', 'Hsp92I', 'Hsp92II', 'HspAI', 'KasI', 'KflI', 'Kpn2I', 'KpnI', 'KroI', 'Ksp22I', 'KspAI', 'KspI', 'Kzo9I', 'LguI', 'LmnI', 'LpnPI', 'Lsp1109I', 'LweI', 'MabI', 'MaeI', 'MaeII', 'MaeIII', 'MalI', 'MauBI', 'MbiI', 'MboI', 'MboII', 'MfeI', 'MflI', 'MhlI', 'MlsI', 'MluCI', 'MluI', 'MluNI', 'Mly113I', 'MlyI', 'MmeI', 'MnlI', 'Mox20I', 'Mph1103I', 'MreI', 'MroI', 'MroNI', 'MroXI', 'MscI', 'MseI', 'MslI', 'Msp20I', 'MspA1I', 'MspCI', 'MspI', 'MspJI', 'MspR9I', 'MssI', 'MteI', 'MunI', 'Mva1269I', 'MvaI', 'MvnI', 'MwoI', 'NaeI', 'NarI', 'NciI', 'NcoI', 'NdeI', 'NdeII', 'NgoMIV', 'NheI', 'NlaIII', 'NlaIV', 'NmeAIII', 'NmuCI', 'NotI', 'NruI', 'NsbI', 'NsiI', 'NspI', 'NspV', 'OliI', 'PacI', 'PaeI', 'PaeR7I', 'PagI', 'PalAI', 'PasI', 'PauI', 'PceI', 'PciI', 'PciSI', 'PcsI', 'PctI', 'PdiI', 'PdmI', 'PfeI', 'Pfl23II', 'PflFI', 'PflMI', 'PfoI', 'PinAI', 'PkrI', 'Ple19I', 'PleI', 'PluTI', 'PmaCI', 'PmeI', 'PmlI', 'PpsI', 'Ppu21I', 'PpuMI', 'PscI', 'PshAI', 'PshBI', 'PsiI', 'Psp124BI', 'Psp1406I', 'Psp5II', 'Psp6I', 'PspCI', 'PspEI', 'PspFI', 'PspGI', 'PspLI', 'PspN4I', 'PspOMI', 'PspPI', 'PspPPI', 'PspXI', 'PsrI', 'PstI', 'PstNI', 'PsuI', 'PsyI', 'PteI', 'PvuI', 'PvuII', 'RgaI', 'RigI', 'RruI', 'RsaI', 'RsaNI', 'RseI', 'Rsr2I', 'RsrII', 'SacI', 'SacII', 'SalI', 'SapI', 'SaqAI', 'SatI', 'Sau3AI', 'Sau96I', 'SbfI', 'ScaI', 'SchI', 'ScrFI', 'SdaI', 'SduI', 'SetI', 'SexAI', 'SfaAI', 'SfaNI', 'SfcI', 'SfiI', 'SfoI', 'Sfr274I', 'Sfr303I', 'SfuI', 'SgeI', 'SgfI', 'SgrAI', 'SgrBI', 'SgrDI', 'SgsI', 'SinI', 'SlaI', 'SmaI', 'SmiI', 'SmiMI', 'SmlI', 'SmoI', 'SnaBI', 'SpeI', 'SphI', 'SrfI', 'Sse8387I', 'Sse9I', 'SseBI', 'SsiI', 'SspDI', 'SspI', 'SspMI', 'SstI', 'StuI', 'StyD4I', 'StyI', 'SwaI', 'TaaI', 'TaiI', 'TaqI', 'TaqII', 'TasI', 'TatI', 'TauI', 'TfiI', 'Tru1I', 'Tru9I', 'TscAI', 'TseFI', 'TseI', 'Tsp45I', 'TspDTI', 'TspGWI', 'TspMI', 'TspRI', 'Tth111I', 'Van91I', 'Vha464I', 'VneI', 'VpaK11BI', 'VspI', 'XagI', 'XapI', 'XbaI', 'XceI', 'XcmI', 'XhoI', 'XmaI', 'XmaJI', 'XmiI', 'XmnI', 'XspI', 'ZraI', 'ZrmI', 'Zsp2I']))[source]
rc()

Returns the reverse complement.

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> a=Dseqrecord("ggaatt")
>>> a
Dseqrecord(-6)
>>> a.seq
Dseq(-6)
ggaatt
ccttaa
>>> a.reverse_complement().seq
Dseq(-6)
aattcc
ttaagg
>>>
reverse_complement()[source]

Returns the reverse complement.

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> a=Dseqrecord("ggaatt")
>>> a
Dseqrecord(-6)
>>> a.seq
Dseq(-6)
ggaatt
ccttaa
>>> a.reverse_complement().seq
Dseq(-6)
aattcc
ttaagg
>>>
shifted(shift)[source]

Returns a circular Dseqrecord with a new origin <shift>. This only works on circular Dseqrecords. If we consider the following circular sequence:

GAAAT   <-- watson strand
CTTTA   <-- crick strand

The T and the G on the watson strand are linked together as well as the A and the C of the of the crick strand.

if shift is 1, this indicates a new origin at position 1:

new origin at the | symbol:

G|AAAT
C|TTTA

new sequence:

AAATG
TTTAC

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> a=Dseqrecord("aaat",circular=True)
>>> a
Dseqrecord(o4)
>>> a.seq
Dseq(o4)
aaat
ttta
>>> b=a.shifted(1)
>>> b
Dseqrecord(o4)
>>> b.seq
Dseq(o4)
aata
ttat
stamp()[source]

Adds a SEGUID or cSEGUID checksum and a datestring to the description property. This will show in the genbank format.

For linear sequences:

SEGUID_<seguid>_<datestring>

For circular sequences:

cSEGUID_<seguid>_<datestring>

See also

pydna.dseqrecord.Dseqrecord.verify_stamp

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> a=Dseqrecord("aaa")
>>> a.stamp()
'SEGUID_YG7G6b2Kj_KtFOX63j8mRHHoIlE...'
>>> a.description
'SEGUID_YG7G6b2Kj_KtFOX63j8mRHHoIlE...'
synced(**kwargs)
tolinear()[source]

Returns a linear, blunt copy of a circular Dseqrecord object. The underlying Dseq object has to be circular.

This method is deprecated, use slicing instead. See example below.

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> a=Dseqrecord("aaa", circular = True)
>>> a
Dseqrecord(o3)
>>> b=a[:]
>>> b
Dseqrecord(-3)
>>>
twice_cutters(batch=RestrictionBatch(['AanI', 'AarI', 'AasI', 'AatII', 'AbaSI', 'AbsI', 'Acc16I', 'Acc36I', 'Acc65I', 'AccB1I', 'AccB7I', 'AccBSI', 'AccI', 'AccII', 'AccIII', 'AciI', 'AclI', 'AclWI', 'AcoI', 'AcsI', 'AcuI', 'AcvI', 'AcyI', 'AdeI', 'AfaI', 'AfeI', 'AfiI', 'AflII', 'AflIII', 'AgeI', 'AgsI', 'AhdI', 'AhlI', 'AjiI', 'AjnI', 'AjuI', 'AleI', 'AloI', 'AluBI', 'AluI', 'Alw21I', 'Alw26I', 'Alw44I', 'AlwI', 'AlwNI', 'Ama87I', 'Aor13HI', 'Aor51HI', 'AoxI', 'ApaI', 'ApaLI', 'ApeKI', 'ApoI', 'ArsI', 'AscI', 'AseI', 'AsiGI', 'AsiSI', 'Asp700I', 'Asp718I', 'AspA2I', 'AspLEI', 'AspS9I', 'AsuC2I', 'AsuHPI', 'AsuII', 'AsuNHI', 'AvaI', 'AvaII', 'AvrII', 'AxyI', 'BaeGI', 'BaeI', 'BalI', 'BamHI', 'BanI', 'BanII', 'BarI', 'BauI', 'BbrPI', 'BbsI', 'Bbv12I', 'BbvCI', 'BbvI', 'BccI', 'BceAI', 'BcgI', 'BciT130I', 'BciVI', 'BclI', 'BcnI', 'BcoDI', 'BcuI', 'BfaI', 'BfmI', 'BfoI', 'BfrI', 'BfuAI', 'BfuI', 'BglI', 'BglII', 'BisI', 'BlnI', 'BlpI', 'BlsI', 'BmcAI', 'Bme1390I', 'Bme18I', 'BmeRI', 'BmeT110I', 'BmgBI', 'BmgT120I', 'BmiI', 'BmrFI', 'BmrI', 'BmsI', 'BmtI', 'BmuI', 'BoxI', 'BpiI', 'BplI', 'BpmI', 'Bpu10I', 'Bpu1102I', 'Bpu14I', 'BpuEI', 'BpuMI', 'Bsa29I', 'BsaAI', 'BsaBI', 'BsaHI', 'BsaI', 'BsaJI', 'BsaWI', 'BsaXI', 'Bsc4I', 'Bse118I', 'Bse1I', 'Bse21I', 'Bse3DI', 'Bse8I', 'BseAI', 'BseBI', 'BseCI', 'BseDI', 'BseGI', 'BseJI', 'BseLI', 'BseMI', 'BseMII', 'BseNI', 'BsePI', 'BseRI', 'BseSI', 'BseX3I', 'BseXI', 'BseYI', 'BsgI', 'Bsh1236I', 'Bsh1285I', 'BshFI', 'BshNI', 'BshTI', 'BshVI', 'BsiEI', 'BsiHKAI', 'BsiHKCI', 'BsiSI', 'BsiWI', 'BslFI', 'BslI', 'BsmAI', 'BsmBI', 'BsmFI', 'BsmI', 'BsnI', 'Bso31I', 'BsoBI', 'Bsp119I', 'Bsp120I', 'Bsp1286I', 'Bsp13I', 'Bsp1407I', 'Bsp143I', 'Bsp1720I', 'Bsp19I', 'Bsp68I', 'BspACI', 'BspANI', 'BspCNI', 'BspDI', 'BspEI', 'BspFNI', 'BspHI', 'BspLI', 'BspMAI', 'BspMI', 'BspOI', 'BspPI', 'BspQI', 'BspT104I', 'BspT107I', 'BspTI', 'BspTNI', 'BsrBI', 'BsrDI', 'BsrFI', 'BsrGI', 'BsrI', 'BssAI', 'BssECI', 'BssHII', 'BssMI', 'BssNAI', 'BssNI', 'BssSI', 'BssT1I', 'Bst1107I', 'Bst2BI', 'Bst2UI', 'Bst4CI', 'Bst6I', 'BstACI', 'BstAFI', 'BstAPI', 'BstAUI', 'BstBAI', 'BstBI', 'BstC8I', 'BstDEI', 'BstDSI', 'BstEII', 'BstENI', 'BstF5I', 'BstFNI', 'BstH2I', 'BstHHI', 'BstKTI', 'BstMAI', 'BstMBI', 'BstMCI', 'BstMWI', 'BstNI', 'BstNSI', 'BstPAI', 'BstPI', 'BstSCI', 'BstSFI', 'BstSLI', 'BstSNI', 'BstUI', 'BstV1I', 'BstV2I', 'BstX2I', 'BstXI', 'BstYI', 'BstZ17I', 'BstZI', 'Bsu15I', 'Bsu36I', 'BsuI', 'BsuRI', 'BsuTUI', 'BtgI', 'BtgZI', 'BtrI', 'BtsCI', 'BtsI', 'BtsIMutI', 'BtuMI', 'BveI', 'Cac8I', 'CaiI', 'CciI', 'CciNI', 'CfoI', 'Cfr10I', 'Cfr13I', 'Cfr42I', 'Cfr9I', 'ClaI', 'CpoI', 'CseI', 'CsiI', 'Csp6I', 'CspAI', 'CspCI', 'CspI', 'CviAII', 'CviJI', 'CviKI_1', 'CviQI', 'DdeI', 'DinI', 'DpnI', 'DpnII', 'DraI', 'DraIII', 'DrdI', 'DriI', 'DseDI', 'EaeI', 'EagI', 'Eam1104I', 'Eam1105I', 'EarI', 'EciI', 'Ecl136II', 'EclXI', 'Eco105I', 'Eco130I', 'Eco147I', 'Eco24I', 'Eco31I', 'Eco32I', 'Eco47I', 'Eco47III', 'Eco52I', 'Eco53kI', 'Eco57I', 'Eco72I', 'Eco81I', 'Eco88I', 'Eco91I', 'EcoICRI', 'EcoNI', 'EcoO109I', 'EcoO65I', 'EcoRI', 'EcoRII', 'EcoRV', 'EcoT14I', 'EcoT22I', 'EcoT38I', 'EgeI', 'EheI', 'ErhI', 'Esp3I', 'FaeI', 'FaiI', 'FalI', 'FaqI', 'FatI', 'FauI', 'FauNDI', 'FbaI', 'FblI', 'Fnu4HI', 'FokI', 'FriOI', 'FseI', 'Fsp4HI', 'FspAI', 'FspBI', 'FspEI', 'FspI', 'GlaI', 'GluI', 'GsaI', 'GsuI', 'HaeII', 'HaeIII', 'HapII', 'HgaI', 'HhaI', 'Hin1I', 'Hin1II', 'Hin6I', 'HinP1I', 'HincII', 'HindII', 'HindIII', 'HinfI', 'HpaI', 'HpaII', 'HphI', 'Hpy166II', 'Hpy188I', 'Hpy188III', 'Hpy8I', 'Hpy99I', 'HpyAV', 'HpyCH4III', 'HpyCH4IV', 'HpyCH4V', 'HpyF10VI', 'HpyF3I', 'HpySE526I', 'Hsp92I', 'Hsp92II', 'HspAI', 'KasI', 'KflI', 'Kpn2I', 'KpnI', 'KroI', 'Ksp22I', 'KspAI', 'KspI', 'Kzo9I', 'LguI', 'LmnI', 'LpnPI', 'Lsp1109I', 'LweI', 'MabI', 'MaeI', 'MaeII', 'MaeIII', 'MalI', 'MauBI', 'MbiI', 'MboI', 'MboII', 'MfeI', 'MflI', 'MhlI', 'MlsI', 'MluCI', 'MluI', 'MluNI', 'Mly113I', 'MlyI', 'MmeI', 'MnlI', 'Mox20I', 'Mph1103I', 'MreI', 'MroI', 'MroNI', 'MroXI', 'MscI', 'MseI', 'MslI', 'Msp20I', 'MspA1I', 'MspCI', 'MspI', 'MspJI', 'MspR9I', 'MssI', 'MteI', 'MunI', 'Mva1269I', 'MvaI', 'MvnI', 'MwoI', 'NaeI', 'NarI', 'NciI', 'NcoI', 'NdeI', 'NdeII', 'NgoMIV', 'NheI', 'NlaIII', 'NlaIV', 'NmeAIII', 'NmuCI', 'NotI', 'NruI', 'NsbI', 'NsiI', 'NspI', 'NspV', 'OliI', 'PacI', 'PaeI', 'PaeR7I', 'PagI', 'PalAI', 'PasI', 'PauI', 'PceI', 'PciI', 'PciSI', 'PcsI', 'PctI', 'PdiI', 'PdmI', 'PfeI', 'Pfl23II', 'PflFI', 'PflMI', 'PfoI', 'PinAI', 'PkrI', 'Ple19I', 'PleI', 'PluTI', 'PmaCI', 'PmeI', 'PmlI', 'PpsI', 'Ppu21I', 'PpuMI', 'PscI', 'PshAI', 'PshBI', 'PsiI', 'Psp124BI', 'Psp1406I', 'Psp5II', 'Psp6I', 'PspCI', 'PspEI', 'PspFI', 'PspGI', 'PspLI', 'PspN4I', 'PspOMI', 'PspPI', 'PspPPI', 'PspXI', 'PsrI', 'PstI', 'PstNI', 'PsuI', 'PsyI', 'PteI', 'PvuI', 'PvuII', 'RgaI', 'RigI', 'RruI', 'RsaI', 'RsaNI', 'RseI', 'Rsr2I', 'RsrII', 'SacI', 'SacII', 'SalI', 'SapI', 'SaqAI', 'SatI', 'Sau3AI', 'Sau96I', 'SbfI', 'ScaI', 'SchI', 'ScrFI', 'SdaI', 'SduI', 'SetI', 'SexAI', 'SfaAI', 'SfaNI', 'SfcI', 'SfiI', 'SfoI', 'Sfr274I', 'Sfr303I', 'SfuI', 'SgeI', 'SgfI', 'SgrAI', 'SgrBI', 'SgrDI', 'SgsI', 'SinI', 'SlaI', 'SmaI', 'SmiI', 'SmiMI', 'SmlI', 'SmoI', 'SnaBI', 'SpeI', 'SphI', 'SrfI', 'Sse8387I', 'Sse9I', 'SseBI', 'SsiI', 'SspDI', 'SspI', 'SspMI', 'SstI', 'StuI', 'StyD4I', 'StyI', 'SwaI', 'TaaI', 'TaiI', 'TaqI', 'TaqII', 'TasI', 'TatI', 'TauI', 'TfiI', 'Tru1I', 'Tru9I', 'TscAI', 'TseFI', 'TseI', 'Tsp45I', 'TspDTI', 'TspGWI', 'TspMI', 'TspRI', 'Tth111I', 'Van91I', 'Vha464I', 'VneI', 'VpaK11BI', 'VspI', 'XagI', 'XapI', 'XbaI', 'XceI', 'XcmI', 'XhoI', 'XmaI', 'XmaJI', 'XmiI', 'XmnI', 'XspI', 'ZraI', 'ZrmI', 'Zsp2I']))[source]
unique_cutters(batch=RestrictionBatch(['AanI', 'AarI', 'AasI', 'AatII', 'AbaSI', 'AbsI', 'Acc16I', 'Acc36I', 'Acc65I', 'AccB1I', 'AccB7I', 'AccBSI', 'AccI', 'AccII', 'AccIII', 'AciI', 'AclI', 'AclWI', 'AcoI', 'AcsI', 'AcuI', 'AcvI', 'AcyI', 'AdeI', 'AfaI', 'AfeI', 'AfiI', 'AflII', 'AflIII', 'AgeI', 'AgsI', 'AhdI', 'AhlI', 'AjiI', 'AjnI', 'AjuI', 'AleI', 'AloI', 'AluBI', 'AluI', 'Alw21I', 'Alw26I', 'Alw44I', 'AlwI', 'AlwNI', 'Ama87I', 'Aor13HI', 'Aor51HI', 'AoxI', 'ApaI', 'ApaLI', 'ApeKI', 'ApoI', 'ArsI', 'AscI', 'AseI', 'AsiGI', 'AsiSI', 'Asp700I', 'Asp718I', 'AspA2I', 'AspLEI', 'AspS9I', 'AsuC2I', 'AsuHPI', 'AsuII', 'AsuNHI', 'AvaI', 'AvaII', 'AvrII', 'AxyI', 'BaeGI', 'BaeI', 'BalI', 'BamHI', 'BanI', 'BanII', 'BarI', 'BauI', 'BbrPI', 'BbsI', 'Bbv12I', 'BbvCI', 'BbvI', 'BccI', 'BceAI', 'BcgI', 'BciT130I', 'BciVI', 'BclI', 'BcnI', 'BcoDI', 'BcuI', 'BfaI', 'BfmI', 'BfoI', 'BfrI', 'BfuAI', 'BfuI', 'BglI', 'BglII', 'BisI', 'BlnI', 'BlpI', 'BlsI', 'BmcAI', 'Bme1390I', 'Bme18I', 'BmeRI', 'BmeT110I', 'BmgBI', 'BmgT120I', 'BmiI', 'BmrFI', 'BmrI', 'BmsI', 'BmtI', 'BmuI', 'BoxI', 'BpiI', 'BplI', 'BpmI', 'Bpu10I', 'Bpu1102I', 'Bpu14I', 'BpuEI', 'BpuMI', 'Bsa29I', 'BsaAI', 'BsaBI', 'BsaHI', 'BsaI', 'BsaJI', 'BsaWI', 'BsaXI', 'Bsc4I', 'Bse118I', 'Bse1I', 'Bse21I', 'Bse3DI', 'Bse8I', 'BseAI', 'BseBI', 'BseCI', 'BseDI', 'BseGI', 'BseJI', 'BseLI', 'BseMI', 'BseMII', 'BseNI', 'BsePI', 'BseRI', 'BseSI', 'BseX3I', 'BseXI', 'BseYI', 'BsgI', 'Bsh1236I', 'Bsh1285I', 'BshFI', 'BshNI', 'BshTI', 'BshVI', 'BsiEI', 'BsiHKAI', 'BsiHKCI', 'BsiSI', 'BsiWI', 'BslFI', 'BslI', 'BsmAI', 'BsmBI', 'BsmFI', 'BsmI', 'BsnI', 'Bso31I', 'BsoBI', 'Bsp119I', 'Bsp120I', 'Bsp1286I', 'Bsp13I', 'Bsp1407I', 'Bsp143I', 'Bsp1720I', 'Bsp19I', 'Bsp68I', 'BspACI', 'BspANI', 'BspCNI', 'BspDI', 'BspEI', 'BspFNI', 'BspHI', 'BspLI', 'BspMAI', 'BspMI', 'BspOI', 'BspPI', 'BspQI', 'BspT104I', 'BspT107I', 'BspTI', 'BspTNI', 'BsrBI', 'BsrDI', 'BsrFI', 'BsrGI', 'BsrI', 'BssAI', 'BssECI', 'BssHII', 'BssMI', 'BssNAI', 'BssNI', 'BssSI', 'BssT1I', 'Bst1107I', 'Bst2BI', 'Bst2UI', 'Bst4CI', 'Bst6I', 'BstACI', 'BstAFI', 'BstAPI', 'BstAUI', 'BstBAI', 'BstBI', 'BstC8I', 'BstDEI', 'BstDSI', 'BstEII', 'BstENI', 'BstF5I', 'BstFNI', 'BstH2I', 'BstHHI', 'BstKTI', 'BstMAI', 'BstMBI', 'BstMCI', 'BstMWI', 'BstNI', 'BstNSI', 'BstPAI', 'BstPI', 'BstSCI', 'BstSFI', 'BstSLI', 'BstSNI', 'BstUI', 'BstV1I', 'BstV2I', 'BstX2I', 'BstXI', 'BstYI', 'BstZ17I', 'BstZI', 'Bsu15I', 'Bsu36I', 'BsuI', 'BsuRI', 'BsuTUI', 'BtgI', 'BtgZI', 'BtrI', 'BtsCI', 'BtsI', 'BtsIMutI', 'BtuMI', 'BveI', 'Cac8I', 'CaiI', 'CciI', 'CciNI', 'CfoI', 'Cfr10I', 'Cfr13I', 'Cfr42I', 'Cfr9I', 'ClaI', 'CpoI', 'CseI', 'CsiI', 'Csp6I', 'CspAI', 'CspCI', 'CspI', 'CviAII', 'CviJI', 'CviKI_1', 'CviQI', 'DdeI', 'DinI', 'DpnI', 'DpnII', 'DraI', 'DraIII', 'DrdI', 'DriI', 'DseDI', 'EaeI', 'EagI', 'Eam1104I', 'Eam1105I', 'EarI', 'EciI', 'Ecl136II', 'EclXI', 'Eco105I', 'Eco130I', 'Eco147I', 'Eco24I', 'Eco31I', 'Eco32I', 'Eco47I', 'Eco47III', 'Eco52I', 'Eco53kI', 'Eco57I', 'Eco72I', 'Eco81I', 'Eco88I', 'Eco91I', 'EcoICRI', 'EcoNI', 'EcoO109I', 'EcoO65I', 'EcoRI', 'EcoRII', 'EcoRV', 'EcoT14I', 'EcoT22I', 'EcoT38I', 'EgeI', 'EheI', 'ErhI', 'Esp3I', 'FaeI', 'FaiI', 'FalI', 'FaqI', 'FatI', 'FauI', 'FauNDI', 'FbaI', 'FblI', 'Fnu4HI', 'FokI', 'FriOI', 'FseI', 'Fsp4HI', 'FspAI', 'FspBI', 'FspEI', 'FspI', 'GlaI', 'GluI', 'GsaI', 'GsuI', 'HaeII', 'HaeIII', 'HapII', 'HgaI', 'HhaI', 'Hin1I', 'Hin1II', 'Hin6I', 'HinP1I', 'HincII', 'HindII', 'HindIII', 'HinfI', 'HpaI', 'HpaII', 'HphI', 'Hpy166II', 'Hpy188I', 'Hpy188III', 'Hpy8I', 'Hpy99I', 'HpyAV', 'HpyCH4III', 'HpyCH4IV', 'HpyCH4V', 'HpyF10VI', 'HpyF3I', 'HpySE526I', 'Hsp92I', 'Hsp92II', 'HspAI', 'KasI', 'KflI', 'Kpn2I', 'KpnI', 'KroI', 'Ksp22I', 'KspAI', 'KspI', 'Kzo9I', 'LguI', 'LmnI', 'LpnPI', 'Lsp1109I', 'LweI', 'MabI', 'MaeI', 'MaeII', 'MaeIII', 'MalI', 'MauBI', 'MbiI', 'MboI', 'MboII', 'MfeI', 'MflI', 'MhlI', 'MlsI', 'MluCI', 'MluI', 'MluNI', 'Mly113I', 'MlyI', 'MmeI', 'MnlI', 'Mox20I', 'Mph1103I', 'MreI', 'MroI', 'MroNI', 'MroXI', 'MscI', 'MseI', 'MslI', 'Msp20I', 'MspA1I', 'MspCI', 'MspI', 'MspJI', 'MspR9I', 'MssI', 'MteI', 'MunI', 'Mva1269I', 'MvaI', 'MvnI', 'MwoI', 'NaeI', 'NarI', 'NciI', 'NcoI', 'NdeI', 'NdeII', 'NgoMIV', 'NheI', 'NlaIII', 'NlaIV', 'NmeAIII', 'NmuCI', 'NotI', 'NruI', 'NsbI', 'NsiI', 'NspI', 'NspV', 'OliI', 'PacI', 'PaeI', 'PaeR7I', 'PagI', 'PalAI', 'PasI', 'PauI', 'PceI', 'PciI', 'PciSI', 'PcsI', 'PctI', 'PdiI', 'PdmI', 'PfeI', 'Pfl23II', 'PflFI', 'PflMI', 'PfoI', 'PinAI', 'PkrI', 'Ple19I', 'PleI', 'PluTI', 'PmaCI', 'PmeI', 'PmlI', 'PpsI', 'Ppu21I', 'PpuMI', 'PscI', 'PshAI', 'PshBI', 'PsiI', 'Psp124BI', 'Psp1406I', 'Psp5II', 'Psp6I', 'PspCI', 'PspEI', 'PspFI', 'PspGI', 'PspLI', 'PspN4I', 'PspOMI', 'PspPI', 'PspPPI', 'PspXI', 'PsrI', 'PstI', 'PstNI', 'PsuI', 'PsyI', 'PteI', 'PvuI', 'PvuII', 'RgaI', 'RigI', 'RruI', 'RsaI', 'RsaNI', 'RseI', 'Rsr2I', 'RsrII', 'SacI', 'SacII', 'SalI', 'SapI', 'SaqAI', 'SatI', 'Sau3AI', 'Sau96I', 'SbfI', 'ScaI', 'SchI', 'ScrFI', 'SdaI', 'SduI', 'SetI', 'SexAI', 'SfaAI', 'SfaNI', 'SfcI', 'SfiI', 'SfoI', 'Sfr274I', 'Sfr303I', 'SfuI', 'SgeI', 'SgfI', 'SgrAI', 'SgrBI', 'SgrDI', 'SgsI', 'SinI', 'SlaI', 'SmaI', 'SmiI', 'SmiMI', 'SmlI', 'SmoI', 'SnaBI', 'SpeI', 'SphI', 'SrfI', 'Sse8387I', 'Sse9I', 'SseBI', 'SsiI', 'SspDI', 'SspI', 'SspMI', 'SstI', 'StuI', 'StyD4I', 'StyI', 'SwaI', 'TaaI', 'TaiI', 'TaqI', 'TaqII', 'TasI', 'TatI', 'TauI', 'TfiI', 'Tru1I', 'Tru9I', 'TscAI', 'TseFI', 'TseI', 'Tsp45I', 'TspDTI', 'TspGWI', 'TspMI', 'TspRI', 'Tth111I', 'Van91I', 'Vha464I', 'VneI', 'VpaK11BI', 'VspI', 'XagI', 'XapI', 'XbaI', 'XceI', 'XcmI', 'XhoI', 'XmaI', 'XmaJI', 'XmiI', 'XmnI', 'XspI', 'ZraI', 'ZrmI', 'Zsp2I']))[source]
write(filename=None, f='gb')[source]

Writes the Dseqrecord to a file using the format f, which must be a format supported by Biopython SeqIO for writing [5]. Default is “gb” which is short for Genbank. Note that Biopython SeqIO reads more formats than it writes.

Filename is the path to the file where the sequece is to be written. The filename is optional, if it is not given, the description property (string) is used together with the format.

If obj is the Dseqrecord object, the default file name will be:

<obj.locus>.<f>

Where <f> is “gb” by default. If the filename already exists and AND the sequence it contains is different, a new file name will be used so that the old file is not lost:

<obj.locus>_NEW.<f>

References

[5]http://biopython.org/wiki/SeqIO

pydna.amplicon module

This module provides the Amplicon class for PCR simulation. This class is not meant to be use directly but is used by the amplify module

class pydna.amplicon.Amplicon(record, *args, template=None, forward_primer=None, reverse_primer=None, saltc=50.0, fprimerc=1000.0, rprimerc=1000.0, **kwargs)[source]

Bases: pydna.dseqrecord.Dseqrecord

The Amplicon class holds information about a PCR reaction involving two primers and one template. This class is used by the Anneal class and is not meant to be instantiated directly.

Parameters:
forward_primer : SeqRecord(Biopython)

SeqRecord object holding the forward (sense) primer

reverse_primer : SeqRecord(Biopython)

SeqRecord object holding the reverse (antisense) primer

template : Dseqrecord

Dseqrecord object holding the template (circular or linear)

saltc : float, optional

saltc = monovalent cations (mM) (Na,K..) default value is 50mM This is used for Tm calculations.

forward_primer_concentration : float, optional

primer concentration (nM) default set to 1000nM = 1µM This is used for Tm calculations.

rc : float, optional

primer concentration (nM) default set to 1000nM = 1µM This is used for Tm calculations.

dbd_program()[source]

Returns a string containing a text representation of a proposed PCR program using a polymerase with a DNA binding domain such as Pfu-Sso7d.

Pfu-Sso7d (rate 15s/kb)             |{size}bp
Three-step|          30 cycles   |      |Tm formula: Pydna tmbresluc
98.0°C    |98.0°C                |      |SaltC 50mM
__________|_____          72.0°C |72.0°C|Primer1C   1µM
00min30s  |10s  \ 61.0°C ________|______|Primer2C   1µM
          |      \______/ 0min 0s|10min |
          |        10s           |      |4-12°C
figure()[source]

This method returns a simple figure of the two primers binding to a part of the template.

5gctactacacacgtactgactg3
 |||||||||||||||||||||| tm 52.6 (dbd) 58.3
5gctactacacacgtactgactg...caagatagagtcagtaaccaca3
3cgatgatgtgtgcatgactgac...gttctatctcagtcattggtgt5
                          |||||||||||||||||||||| tm 49.1 (dbd) 57.7
                         3gttctatctcagtcattggtgt5
Returns:
figure:string

A string containing a text representation of the primers annealing on the template (see example above).

Notes

tm in the figure above is the melting temperature (tm) for each primer calculated according to SantaLucia 1998 [6].

dbd is the tm calculation for enzymes with dsDNA binding domains like Pfu-Sso7d [7]. See [8] for more information.

References

[6]
  1. SantaLucia, “A Unified View of Polymer, Dumbbell, and Oligonucleotide DNA Nearest-neighbor Thermodynamics,” Proceedings of the National Academy of Sciences 95, no. 4 (1998): 1460.
[7]
  1. Nørholm, “A Mutant Pfu DNA Polymerprimerase Designed for Advanced Uracil-excision DNA Engineering,” BMC Biotechnology 10, no. 1 (2010): 21, doi:10.1186/1472-6750-10-21.
[8]http://www.thermoscientificbio.com/webtools/tmc/
pfu_sso7d_program()[source]
program()[source]

Returns a string containing a text representation of a proposed PCR program using Taq or similar polymerase.

Taq (rate 30 nt/s)
Three-step|         30 cycles     |      |Tm formula: Biopython Tm_NN
94.0°C    |94.0°C                 |      |SaltC 50mM
__________|_____          72.0°C  |72.0°C|
04min00s  |30s  \         ________|______|
          |      \ 46.0°C/ 0min 1s|10min |
          |       \_____/         |      |
          |         30s           |      |4-8°C
rc()

Returns the reverse complement.

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> a=Dseqrecord("ggaatt")
>>> a
Dseqrecord(-6)
>>> a.seq
Dseq(-6)
ggaatt
ccttaa
>>> a.reverse_complement().seq
Dseq(-6)
aattcc
ttaagg
>>>
reverse_complement()[source]

Returns the reverse complement.

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> a=Dseqrecord("ggaatt")
>>> a
Dseqrecord(-6)
>>> a.seq
Dseq(-6)
ggaatt
ccttaa
>>> a.reverse_complement().seq
Dseq(-6)
aattcc
ttaagg
>>>
taq_program()[source]

pydna.amplify module

pydna.assembly module

This module provides functions for assembly of sequences by homologous recombination and other related techniques. Given a list of sequences (Dseqrecords), all sequences are analyzed for shared homology longer than the set limit.

A graph is constructed where each overlapping region form a node and sequences separating the overlapping regions form edges.

            -- A --
catgatctacgtatcgtgt     -- B --
            atcgtgtactgtcatattc
                        catattcaaagttct
            
Graph:
            --x--> A --y--> B --z-->
            
            Nodes:
                
            A : atcgtgt
            B : catattc
            
            Edges:

            x : catgatctacgt
            y : actgt
            z : aaagttct

The NetworkX package is used to trace linear and circular paths through the graph.

class pydna.assembly.Assembly(fragments, limit=25, algorithm=<function common_sub_strings>, max_nodes=None)[source]

Bases: object

Assembly of a list of linear DNA fragments into linear or circular constructs. The Assembly is meant to replace the Assembly method as it is easier to use. Accepts a list of Dseqrecords (source fragments) to initiate an Assembly object. Several methods are available for analysis of overlapping sequences, graph construction and assembly.

Parameters:
fragments : list

a list of Dseqrecord objects.

limit : int, optional

The shortest shared homology to be considered

algorithm : function, optional

The algorithm used to determine the shared sequences.

max_nodes : int

The maximum number of nodes in the graph. This can be tweaked to manage sequences with a high number of shared sub sequences.

Examples

>>> from pydna.assembly import Assembly
>>> from pydna.dseqrecord import Dseqrecord
>>> a = Dseqrecord("acgatgctatactgCCCCCtgtgctgtgctcta")
>>> b = Dseqrecord("tgtgctgtgctctaTTTTTtattctggctgtatc")
>>> c = Dseqrecord("tattctggctgtatcGGGGGtacgatgctatactg")
>>> x = Assembly((a,b,c), limit=14)
>>> x
## Assembly object ##
fragments....: 33bp 34bp 35bp
limit(bp)....: 14
G.nodes......: 10
algorithm....: common_sub_strings
linear(3)....: -73 -54 -14
circular(1)..: o59
>>> x.circular
[Contig(o59)]
>>> x.circular_products[0].seq.watson
'acgatgctatactgCCCCCtgtgctgtgctctaTTTTTtattctggctgtatcGGGGGt'
limit = None

The shortest common sub strings to be considered

list_circular()[source]
list_circular_products()
list_linear()[source]
list_linear_products()
max_nodes = None

The max number of nodes allowed. This can be reset to some other value

pydna.common_sub_strings module

This module is based on the Py-rstr-max package that was written by Romain Brixtel (rbrixtel_at_gmail_dot_com) (https://brixtel.users.greyc.fr/) and is available from https://code.google.com/p/py-rstr-max/ the original code was covered by an MIT licence.

class pydna.common_sub_strings.Rstr_max[source]

Bases: object

add_str(str_unicode)[source]
go()[source]
removeMany(stack, results, m, idxEnd)[source]
step1_sort_suffix()[source]
step2_lcp()[source]
step3_rstr()[source]
pydna.common_sub_strings.common_sub_strings(stringx: str, stringy: str, limit=25)[source]

Finds all common substrings between stringx and stringy longer than limit. This function is case sensitive. The substrings may overlap.

returns a list of tuples describing the substrings The list is sorted longest -> shortest.

Parameters:
stringx : str
stringy : str
limit : int, optional
Returns:
list of tuple

[(startx1,starty1,length1),(startx2,starty2,length2), …]

startx1 = startposition in x, where substring 1 starts starty1 = position in y where substring 1 starts length1 = lenght of substring

Examples

>>> from pydna.common_sub_strings import common_sub_strings
>>> common_sub_strings("gatgatttcggtagtta", "gtcagtatgtctatctatcgcg", limit=3)
[(1, 6, 3), (7, 17, 3), (10, 4, 3), (12, 3, 3)]
Overlaps   Symbols
(1, 6,  3)   ---
(7, 17, 3)   +++
(10, 4, 3)   ...
(12, 3, 3)   ===    

            ===       
gatgatttcggtagtta           stringx
 ---   +++...  

    ...           
gtcagtatgtctatctatcgcg      stringy
   ===---        +++  
pydna.common_sub_strings.direct_kark_sort(s)[source]
pydna.common_sub_strings.kark_sort(s, SA, n, K)[source]
pydna.common_sub_strings.radixpass(a, b, r, s, n, k)[source]
pydna.common_sub_strings.terminal_overlap(stringx: str, stringy: str, limit=15)[source]

Finds the the flanking common substrings between stringx and stringy longer than limit. This means that the results only contains substrings that starts or ends at the the ends of stringx and stringy.

This function is case sensitive.

returns a list of tuples describing the substrings The list is sorted longest -> shortest.

Parameters:
stringx : str
stringy : str
limit : int, optional
Returns:
list of tuple

[(startx1,starty1,length1),(startx2,starty2,length2), …]

startx1 = startposition in x, where substring 1 starts starty1 = position in y where substring 1 starts length1 = lenght of substring

Examples

>>> from pydna.common_sub_strings import terminal_overlap
>>> terminal_overlap("agctatgtatcttgcatcgta", "gcatcgtagtctatttgcttac", limit=8)
[(13, 0, 8)]
             <-- 8 ->
<---- 13 --->               
agctatgtatcttgcatcgta                    stringx
             gcatcgtagtctatttgcttac      stringy
             0

pydna.contig module

class pydna.contig.Contig(record, *args, graph=None, path=None, **kwargs)[source]

Bases: pydna.dseqrecord.Dseqrecord

This class holds information about a DNA assembly. This class is instantiated by the Assembly class and is not meant to be used directly.

detailed_fig()[source]

Returns a text representation of the assembled fragments.

Linear:

acgatgctatactgCCCCCtgtgctgtgctcta
                   TGTGCTGTGCTCTA
                   tgtgctgtgctctaTTTTTtattctggctgtatc

Circular:

||||||||||||||
acgatgctatactgCCCCCtgtgctgtgctcta
                   TGTGCTGTGCTCTA
                   tgtgctgtgctctaTTTTTtattctggctgtatc
                                      TATTCTGGCTGTATC
                                      tattctggctgtatcGGGGGtacgatgctatactg
                                                           ACGATGCTATACTG
detailed_figure()

Returns a text representation of the assembled fragments.

Linear:

acgatgctatactgCCCCCtgtgctgtgctcta
                   TGTGCTGTGCTCTA
                   tgtgctgtgctctaTTTTTtattctggctgtatc

Circular:

||||||||||||||
acgatgctatactgCCCCCtgtgctgtgctcta
                   TGTGCTGTGCTCTA
                   tgtgctgtgctctaTTTTTtattctggctgtatc
                                      TATTCTGGCTGTATC
                                      tattctggctgtatcGGGGGtacgatgctatactg
                                                           ACGATGCTATACTG
figure()

Returns a small ascii representation of the assembled fragments. Each fragment is represented by:

Size of common 5' substring|Name and size of DNA fragment| Size of common 5' substring

Linear:

frag20| 6
       \/
       /\
        6|frag23| 6
                 \/
                 /\
                  6|frag14

Circular:

 -|2577|61
|       \/
|       /\
|       61|5681|98
|               \/
|               /\
|               98|2389|557
|                       \/
|                       /\
|                       557-
|                          |
 --------------------------
rc()

Returns the reverse complement.

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> a=Dseqrecord("ggaatt")
>>> a
Dseqrecord(-6)
>>> a.seq
Dseq(-6)
ggaatt
ccttaa
>>> a.reverse_complement().seq
Dseq(-6)
aattcc
ttaagg
>>>
reverse_complement()[source]

Returns the reverse complement.

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> a=Dseqrecord("ggaatt")
>>> a
Dseqrecord(-6)
>>> a.seq
Dseq(-6)
ggaatt
ccttaa
>>> a.reverse_complement().seq
Dseq(-6)
aattcc
ttaagg
>>>
small_fig()[source]

Returns a small ascii representation of the assembled fragments. Each fragment is represented by:

Size of common 5' substring|Name and size of DNA fragment| Size of common 5' substring

Linear:

frag20| 6
       \/
       /\
        6|frag23| 6
                 \/
                 /\
                  6|frag14

Circular:

 -|2577|61
|       \/
|       /\
|       61|5681|98
|               \/
|               /\
|               98|2389|557
|                       \/
|                       /\
|                       557-
|                          |
 --------------------------
small_figure()

Returns a small ascii representation of the assembled fragments. Each fragment is represented by:

Size of common 5' substring|Name and size of DNA fragment| Size of common 5' substring

Linear:

frag20| 6
       \/
       /\
        6|frag23| 6
                 \/
                 /\
                  6|frag14

Circular:

 -|2577|61
|       \/
|       /\
|       61|5681|98
|               \/
|               /\
|               98|2389|557
|                       \/
|                       /\
|                       557-
|                          |
 --------------------------

pydna.design module

pydna.download module

Provides a function for downloading online text files

pydna.editor module

This module provides a class for opening a sequence using an editor that accepts a file as a command line argument.

ApE - A plasmid Editor [9] is and excellent editor for this purpose.

References

[9]http://biologylabs.utah.edu/jorgensen/wayned/ape/
class pydna.editor.Editor(shell_command_for_editor, tmpdir=None)[source]

Bases: object

The Editor class needs to be instantiated before use.

Parameters:
shell_command_for_editor : str

String containing the path to the editor

tmpdir : str, optional

String containing path to the temprary directory where sequence files are stored before opening.

Examples

>>> import pydna
>>> #ape = pydna.Editor("tclsh8.6 /home/bjorn/.ApE/apeextractor/ApE.vfs/lib/app-AppMain/AppMain.tcl")
>>> #ape.open("aaa") # This command opens the sequence in the ApE editor
open(seq_to_open)[source]

Open a sequence for editing in an external (DNA) editor.

Parameters:
args : SeqRecord or Dseqrecord object
pydna.editor.ape(*args, **kwargs)[source]

pydna.gel module

Provides the class Gel for the simulation of agarose slab-gel electrophoresis of DNA at constant electric field.

Note

This code is at an early stage of development and documentation.

pydna.gel.DKuhn(kB, T, eta, l)
pydna.gel.Dblob(kB, T, eta, a)
class pydna.gel.Fakeseq(l, n=1e-11)[source]

Bases: object

pydna.gel.Gauss_FWHM(FWTM)
pydna.gel.Gauss_dev(FWHM)
pydna.gel.Gauss_hgt(auc, dev)
pydna.gel.Gaussian(x, hgt, ctr, dev)
class pydna.gel.Gel(samples, names=None, percentgel=<Quantity(1.0, 'gram / milliliter')>, electrfield=<Quantity(5.0, 'volt / centimeter')>, temperature=<Quantity(295.15, 'kelvin')>, gel_len=<Quantity(8, 'centimeter')>, wellxy=<Quantity([7 2], 'millimeter')>, wellsep=<Quantity(2, 'millimeter')>)[source]

Bases: object

Gel object for DNA slab-gel electrophoresis simulation.

Class designed to store information regarding an electrophoresis experimental setup. Includes gel’s and well’s dimensions, DNA samples loaded, agarose concentration, electric field intensity and temperature.

Parameters:
samples : list of lists of pydna.Dseqrecord objects

List of samples with the DNA fragments to separate. Each sample corresponds to a different well. Accepts lists of pydna.Dseq objects and converts them to Dseqrecords with the default quantity (n parameter).

names : list of str, optional

List with the identifiers of the samples. Defaults to None, in which case the identifiers are of the form “lane i” where i is the index.

percentgel : pint.unit.Quantity object, float or int, optional

Agarose concentration in the gel. Defaults to Q_(1.0, ‘(g/(100 mL))*100’). If a float or int is given assumes grams of agarose per milliliter of buffer.

electrfield : pint.unit.Quantity object, float or int, optional

Electric field intensity. Defaults to Q_(5.0, ‘V/cm’). If a float or int is given assumes Volts per centimeter.

temperature : pint.unit.Quantity object, float or int, optional

Absolute temperature. Defaults to Q_(295.15, ‘K’). If a float or int is given assumes Kelvin. The temperature is only considered in the calculation of the diffusional component of the band width.

gel_len : pint.unit.Quantity object, float or int, optional

Gel length (as measured from the bottom of the well in the direction of the DNA migration). Defaults to Q_(8, ‘cm’). If a float or int is given assumes centimeters.

wellxy : iterable of pint.unit.Quantity object, float or int, optional

Well’s dimensions. Well’s width (perpendicular to the migration direction) and well’s height (migration direction). Defaults to Q_([7, 2], ‘mm’). If a float or int is given assumes millimeters. The well’s width is merely used for aesthetic purposes. The well’s height is used to compute the initial band width.

wellsep : pint.unit.Quantity object, float or int, optional

Separation between wells. Defaults to Q_(2, ‘mm’). Merelly for aestetic purposes.

Notes

  • The DNA is diluted in the full volume of the well.
  • The previous implies that the injection size, which relates to

the initial bandwidth, is assumed to be well height (welly). * The DNA electrophoretic mobility in the well is given by the free solution mobility and is equal for every fragment.

run(till_len=0.75, till_time=None, exposure=0.5, plot=True, res=<Quantity(500, 'pixel / inch')>, cursor_ovr={'hover': False}, back_col=0.3, band_col=1, well_col=0.05, noise=0.015, detectlim=0.04, interpol='linear', dset_name='vertical', replNANs=True)[source]

Run electrophoresis.

Run the electrophoresis procedure until a specified time or until the quickest band reaches a specified gel length. If both conditions are given the most stringent will be respected.

Parameters:
till_len : float (0 to 1), optional

Fraction of the gel length (measured from the well bottom) to serve as finish line. Defaults to 0.75.

till_time : pint.unit.Quantity object, float or int, optional

Time at which to stop the electrophoresis. Defaults to None. If float or int is given assumes hours.

exposure : float (0 to 1)

Fraction of signal saturation. If exposure is set to 0 every band’s light intensity will be given by a perfect Gaussian curve. Wider bands with lower amounts of DNA might be hard to see. The closer to 1 the exposure the higher the saturation, which favors the weaker bands visualization. If exposure is set to 1 only the weakest band will be a Gaussian, all others will be saturated. Defaults to 0.5.

plot : {True, False}, optional

Whether to draw and return the gel picture or not. The electrophoresis data (such as migrated distances) will be stored in the Gel object either way.

res : pint.unit.Quantity object, float or int, optional

Resolution used to construct an array of light intensities corresponding to the gel picture. The dimensions of the intensities array are given by the gel’s dimensions multiplied by the resolution. A higher resolution implies more calculations and might cause the method to become slow. A lower resolution might result in a very pixelated image. Defaults to Q_(500, ‘px/in’). If float or int is given assumes pixels per inch. This resolution won’t necessarily convey to the final gel picture since the intensity array is processed by matplotlib.pyplot.imshow.

cursor_ovr : dict, optional

Key arguments to be passed to mpldatacursor.datacursor which provides interactive cursor functions to the resulting plot. Defaults to dict(hover=False).

back_col : float or int, optional

Background color (light intensity). Defaults to 0.3. Solid black (0) allows the maximum contrast.

band_col : float or int, optional

Band color (maximum light intensity). Defaults to 1. White (1) allows for maximum contrast.

well_col : float or int, optional

Well color (light intensity). Defaults to 0.05.

noise : float or int, optional

Standard deviation used to generate a Normal distribution of noise centered in the background color. This effect is purely aesthetic. Defaults to 0.015.

detectlim : float, optional

Minimal light intensity difference between the center of the band and the background color (back_col) below which the band is considered to be indistinguishable and a white doted outline is drawn around it. Defaults to 0.04.

interpol : {‘linear’, ‘cubic’, ‘nearest’}, optional

Interpolation method. This is passed to scipy.interpolate.griddata for the interpolation of the vWBR’s parameters from the experimental datasets (mu_S, mu_L, gamma = f(field, agarose concentration) [1-3]. Defaults to ‘linear’ which is more conservative. ‘nearest’ is not expected to provide good results.

dset_name : {‘vertical’, ‘horizontal’}, optional

Dataset identifier (str). Identifies the dataset to use. Currently two datasets are available (‘vertical’ and ‘horizontal’) [1-3]. The names alude to the geometry of the experimental setup. The geometry however is not expected to cause significant differences on the results.

replNANs : {True, False}, optional

Whether to replace NANs (not a number) by ‘nearest’ interpolation. NANs will only be produced if the conditions of electric field intensity and agarose concentration go beyond the concave space provided by the dataset.

References

[1]Van Winkle, D.H., Beheshti, A., Rill, R.L.: DNA

electrophoresis in agarose gels: A simple relation describing the length dependence of mobility. ELECTROPHORESIS 23(1), 15–19 (2002)

[2]Rill, R.L., Beheshti, A., Van Winkle, D.H.: DNA

electrophoresis in agarose gels: Effects of field and gel concentration on the exponential dependence of reciprocal mobility on DNA length. ELECTROPHORESIS 23(16), 2710–2719 (2002)

[3]Beheshti, A.: DNA Electrophoresis in th Agarose Gels: A New

Mobility vs. DNA Length Dependence. Electronic Theses, Treatises and Dissertations (Paper 1207) (2002)

set_DNAspace_for_mu0(DNA_space)[source]
set_DNAspace_for_vWBRfit(DNA_space)[source]
set_Tvals_for_mu0(Tvals)[source]
set_field(electrfield)[source]
set_gelength(gel_len)[source]
set_percentgel(percentgel)[source]
set_temperature(temperature)[source]
set_wellsep(wellsep)[source]
set_wellx(wellx)[source]
set_welly(welly)[source]
pydna.gel.H2Oviscosity(T)
pydna.gel.NKuhn_to_N(NKuhn, l, a)
pydna.gel.NKuhn_to_Nbp(NKuhn, b, l)
pydna.gel.N_to_NKuhn(N, a, l)
pydna.gel.N_to_Nbp(N, a, b, l)
pydna.gel.Nbp_to_N(Nbp, a, b, l)
pydna.gel.Nbp_to_NKuhn(Nbp, b, l)
pydna.gel.Ogston_Rouse(Nbp, kB, T, a, eta, b, l)
pydna.gel.Ogston_Zimm(D0, g)
pydna.gel.Zimm_Rouse(x0, args)
pydna.gel.Zimm_g(Nbp, DRouse, qeff, mu0, kB, T)
pydna.gel.accel_plateau(epsilon)
pydna.gel.assign_quantitiesB(samples, maxdef=<Quantity(150, 'nanogram')>)[source]

Assigns quantities (masses in nanograms) to the DNA fragments without corresponding quantity assuming a linear relationship between the DNA length (in basepairs) and its mass. As if the fragments originated in a restriction procedure. For each sample takes the maximum quantity (either from the other samples or from the default) and assigns it to the fragment with greater length.

pydna.gel.bandbroadening(D, time)
pydna.gel.contour_length(Nbp, b)
pydna.gel.diff_Zimm_Rouse(Nbp, args)[source]
pydna.gel.diffusion_coefficient(Nbp, N_lim1, N_lim2, N_lim3, args)[source]
pydna.gel.dim_or_units(quantity, reference)[source]

If <quantity> is not an instance of <Quantity>, instantiate a <Quantity> object with <quantity> as magnitude and as <reference.units> as units. If <quantity> is an instance of <Quantity>, check whether it has the same dimensionality as <reference>.

pydna.gel.equil_accel(epsilon)
pydna.gel.ferguson_to_mu0(field, Tvals, DNAvals, dataset, mu_func, adjmethod='linear', replNANs=True, plot=True)[source]

This function extrapolates the free solution mobility (mu0) for a specified electric field intensity (field), via Ferguson plot (ln(mobility) vs. %agarose).

Mobiliy calculation method: [E,T,muS,muL,gamma] -> [E,T,mu(L)] -(L*)-> [E,T,mu] -(E*,T*,interp.)-> mu*

pydna.gel.flatten(List)[source]
pydna.gel.free_solution(kB, T, eta, Rh)
pydna.gel.gelplot_imshow(distances, bandwidths, intensities, lanes, names, gel_len, wellx, welly, wellsep, res, cursor_ovr, back_col, band_col, well_col, noise, Itol, detectlim, title, FWTM, show=True)[source]
pydna.gel.gen_sample(sizes, quantities)[source]

Return list of pydna Dseqrecords of given size and quantity.

If a single quantity is given it is divided by the DNA fragments in proportion to their length.

Parameters:
sizes : iterable of pint.unit.Quantity objects or ints

List of DNA sizes in base pairs (bp).

quantities : iterable of pint.unit.Quantity objects, floats or ints

List of DNA weights in nanograms (ng). If a single quantity is given (pint.unit.Quantity object, float or int) it is divided linearly by the DNA fragments length.

Examples

Direct quantity assignment without declared units.

>>> sizes = [3000, 500, 1500]  # bp
>>> qts = [70.0, 11.7, 35.0]  # ng
>>> sample = gen_sample(sizes, qts)
>>> sample
[Dseqrecord(-3000), Dseqrecord(-500), Dseqrecord(-1500)]
>>> float("{0:.2f}".format(sample[0].m() * 1E6))  # µg
0.07
>>> Q_([dna.m() for dna in sample], 'g').to('ng') 
<Quantity([70.  11.7 35. ], 'nanogram')>
>>> Q_([dna.n for dna in sample], 'mol').to('pmol') 
<Quantity([0.03776682 0.03786665 0.03776521], 'picomole')>

Direct quantity assignment with declared units.

>>> sizes = Q_([3000, 500, 1500], 'bp')
>>> qts = Q_([70.0, 11.7, 35.0],  'ng') 
>>> sample = gen_sample(sizes, qts)
>>> sample
[Dseqrecord(-3000), Dseqrecord(-500), Dseqrecord(-1500)]
>>> Q_([dna.m() for dna in sample], 'g').to('ng') 
<Quantity([70.  11.7 35. ], 'nanogram')>
>>> Q_([dna.n for dna in sample], 'mol').to('pmol') 
<Quantity([0.03776682 0.03786665 0.03776521], 'picomole')>

Assignment of total quantity (with declared units).

>>> sample = gen_sample(Q_([3000, 500, 1500], 'bp'), Q_(200, 'ng'))
>>> sample
[Dseqrecord(-3000), Dseqrecord(-500), Dseqrecord(-1500)]
>>> Q_([dna.m() for dna in sample], 'g').to('ng') 
<Quantity([120.  20.  60.], 'nanogram')>
>>> Q_([dna.n for dna in sample], 'mol').to('pmol') 
<Quantity([0.06474311 0.06472932 0.06474035], 'picomole')>
pydna.gel.lin_div_Qty(sample, quantity, criteria=<built-in function len>)[source]

Linearly divides a quantity by the elements of sample considering a criteria. Criteria must by a function that returns a number upon being applied to each element of sample.

pydna.gel.logspace_int(minimum, maximum, divs)[source]
pydna.gel.pore_size(gamma, muL, mu0, lp, b)
pydna.gel.pore_size_fit(C)
pydna.gel.radius_gyration(L, lp)
pydna.gel.random_Dseqs(sizes)[source]

Return a list of pydna Dseqs of given sizes and random sequences.

pydna.gel.reduced_field(eta, a, mu0, E, kB, T)
pydna.gel.reduced_field_Kuhn(eta, l, mu0, E, kB, T)
pydna.gel.reptation_accelerated(Dblob, epsilon, N)
pydna.gel.reptation_equilibrium(Dblob, N)
pydna.gel.reptation_plateau(Dblob, epsilon)
pydna.gel.rundistance(time, mobility, field)
pydna.gel.runtime(distance, mobility, field)
size_to_mobility(dna_len, field, percentage, mu_func=<function vWBR.<locals>.<lambda>>, dataset={'E': <Quantity([0.62 0.93 1.24 1.55 1.86 2.17 2.48 3.1 4.97 6.21 0.62 0.93 1.24 1.55
1.86 2.17 2.48 3.1 4.97 6.21 0.62 0.93 1.24 1.55 1.86 2.17 2.48 3.1
4.97 6.21 0.62 0.93 1.24 1.55 1.86 2.17 2.48 3.1 4.97 6.21], 'volt / centimeter')>, 'T': <Quantity([0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7
0.7 0.7 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.3 1.3 1.3 1.3 1.3 1.3
1.3 1.3 1.3 1.3], 'gram / milliliter')>, 'gamma': <Quantity([5.27990e+01 2.53040e+01 1.49220e+01 1.44880e+01 1.26030e+01 1.19110e+01
1.26480e+01 9.42300e+00 9.63000e+00 9.21400e+00 7.32000e+05 5.42640e+01
1.52550e+01 1.31250e+01 9.83400e+00 1.01510e+01 9.03600e+00 7.71300e+00
6.18800e+00 6.37100e+00 1.83000e+14 2.33000e+13 2.58550e+01 1.27730e+01
8.50200e+00 9.37200e+00 7.20900e+00 5.85200e+00 4.74900e+00 4.41700e+00
1.11000e+10 6.10000e+05 1.79189e+02 1.19200e+01 8.59400e+00 1.24120e+01
7.46400e+00 5.15900e+00 4.04800e+00 3.55500e+00], 'kilobase_pair')>, 'muL': <Quantity([2.10e-09 3.40e-09 8.10e-09 7.70e-09 7.80e-09 8.90e-09 9.00e-09 9.80e-09
1.22e-08 1.20e-08 8.36e-14 9.00e-10 4.90e-09 5.30e-09 6.20e-09 5.50e-09
7.20e-09 6.90e-09 9.30e-09 1.03e-08 1.82e-22 1.37e-21 1.70e-09 3.30e-09
4.70e-09 3.80e-09 5.20e-09 6.10e-09 7.70e-09 8.80e-09 1.87e-18 3.80e-14
2.00e-10 2.70e-09 3.60e-09 2.10e-09 4.50e-09 5.00e-09 4.90e-09 5.90e-09], 'meter ** 2 / second / volt')>, 'muS': <Quantity([2.67e-08 2.54e-08 3.67e-08 3.18e-08 3.12e-08 3.07e-08 3.13e-08 3.14e-08
3.34e-08 3.11e-08 2.86e-08 2.38e-08 3.71e-08 3.61e-08 3.61e-08 3.07e-08
3.42e-08 3.14e-08 3.08e-08 3.24e-08 2.48e-08 2.41e-08 3.34e-08 3.25e-08
3.69e-08 2.87e-08 3.39e-08 3.36e-08 3.04e-08 3.13e-08 2.12e-08 1.96e-08
3.32e-08 3.47e-08 3.97e-08 2.76e-08 3.26e-08 3.37e-08 2.68e-08 2.70e-08], 'meter ** 2 / second / volt')>}, method='linear', replNANs=True)
pydna.gel.to_units(quantity, units, var_name=None)[source]

Asserts that the quantity has the proper dimensions (inferred from the default units) if the quantity is an instance of pint.unit.Quantity or assigns the default units if it’s not.

pydna.gel.vWBR(muS, muL, gamma)[source]

vWBR equation

vWBRfit(field, percentage, DNAvals=array([ 100. , 604.04040404, 1108.08080808, 1612.12121212, 2116.16161616, 2620.2020202 , 3124.24242424, 3628.28282828, 4132.32323232, 4636.36363636, 5140.4040404 , 5644.44444444, 6148.48484848, 6652.52525253, 7156.56565657, 7660.60606061, 8164.64646465, 8668.68686869, 9172.72727273, 9676.76767677, 10180.80808081, 10684.84848485, 11188.88888889, 11692.92929293, 12196.96969697, 12701.01010101, 13205.05050505, 13709.09090909, 14213.13131313, 14717.17171717, 15221.21212121, 15725.25252525, 16229.29292929, 16733.33333333, 17237.37373737, 17741.41414141, 18245.45454545, 18749.49494949, 19253.53535354, 19757.57575758, 20261.61616162, 20765.65656566, 21269.6969697 , 21773.73737374, 22277.77777778, 22781.81818182, 23285.85858586, 23789.8989899 , 24293.93939394, 24797.97979798, 25302.02020202, 25806.06060606, 26310.1010101 , 26814.14141414, 27318.18181818, 27822.22222222, 28326.26262626, 28830.3030303 , 29334.34343434, 29838.38383838, 30342.42424242, 30846.46464646, 31350.50505051, 31854.54545455, 32358.58585859, 32862.62626263, 33366.66666667, 33870.70707071, 34374.74747475, 34878.78787879, 35382.82828283, 35886.86868687, 36390.90909091, 36894.94949495, 37398.98989899, 37903.03030303, 38407.07070707, 38911.11111111, 39415.15151515, 39919.19191919, 40423.23232323, 40927.27272727, 41431.31313131, 41935.35353535, 42439.39393939, 42943.43434343, 43447.47474747, 43951.51515152, 44455.55555556, 44959.5959596 , 45463.63636364, 45967.67676768, 46471.71717172, 46975.75757576, 47479.7979798 , 47983.83838384, 48487.87878788, 48991.91919192, 49495.95959596, 50000. ]), dataset={'E': <Quantity([0.62 0.93 1.24 1.55 1.86 2.17 2.48 3.1 4.97 6.21 0.62 0.93 1.24 1.55
1.86 2.17 2.48 3.1 4.97 6.21 0.62 0.93 1.24 1.55 1.86 2.17 2.48 3.1
4.97 6.21 0.62 0.93 1.24 1.55 1.86 2.17 2.48 3.1 4.97 6.21], 'volt / centimeter')>, 'T': <Quantity([0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.7 0.7 0.7 0.7 0.7 0.7 0.7 0.7
0.7 0.7 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.3 1.3 1.3 1.3 1.3 1.3
1.3 1.3 1.3 1.3], 'gram / milliliter')>, 'gamma': <Quantity([5.27990e+01 2.53040e+01 1.49220e+01 1.44880e+01 1.26030e+01 1.19110e+01
1.26480e+01 9.42300e+00 9.63000e+00 9.21400e+00 7.32000e+05 5.42640e+01
1.52550e+01 1.31250e+01 9.83400e+00 1.01510e+01 9.03600e+00 7.71300e+00
6.18800e+00 6.37100e+00 1.83000e+14 2.33000e+13 2.58550e+01 1.27730e+01
8.50200e+00 9.37200e+00 7.20900e+00 5.85200e+00 4.74900e+00 4.41700e+00
1.11000e+10 6.10000e+05 1.79189e+02 1.19200e+01 8.59400e+00 1.24120e+01
7.46400e+00 5.15900e+00 4.04800e+00 3.55500e+00], 'kilobase_pair')>, 'muL': <Quantity([2.10e-09 3.40e-09 8.10e-09 7.70e-09 7.80e-09 8.90e-09 9.00e-09 9.80e-09
1.22e-08 1.20e-08 8.36e-14 9.00e-10 4.90e-09 5.30e-09 6.20e-09 5.50e-09
7.20e-09 6.90e-09 9.30e-09 1.03e-08 1.82e-22 1.37e-21 1.70e-09 3.30e-09
4.70e-09 3.80e-09 5.20e-09 6.10e-09 7.70e-09 8.80e-09 1.87e-18 3.80e-14
2.00e-10 2.70e-09 3.60e-09 2.10e-09 4.50e-09 5.00e-09 4.90e-09 5.90e-09], 'meter ** 2 / second / volt')>, 'muS': <Quantity([2.67e-08 2.54e-08 3.67e-08 3.18e-08 3.12e-08 3.07e-08 3.13e-08 3.14e-08
3.34e-08 3.11e-08 2.86e-08 2.38e-08 3.71e-08 3.61e-08 3.61e-08 3.07e-08
3.42e-08 3.14e-08 3.08e-08 3.24e-08 2.48e-08 2.41e-08 3.34e-08 3.25e-08
3.69e-08 2.87e-08 3.39e-08 3.36e-08 3.04e-08 3.13e-08 2.12e-08 1.96e-08
3.32e-08 3.47e-08 3.97e-08 2.76e-08 3.26e-08 3.37e-08 2.68e-08 2.70e-08], 'meter ** 2 / second / volt')>}, mu_func=<function vWBR.<locals>.<lambda>>, method='linear', replNANs=True, plot=True)
pydna.gel.weight_standard_sample(key, qty=<Quantity(500, 'nanogram')>)[source]

pydna.genbank module

This module provides a class for downloading sequences from genbank called Genbank and an function that does the same thing called genbank.

The function can be used if the environmental variable pydna_email has been set to a valid email address. The easiest way to do this permanantly is to edit the pydna.ini file. See the documentation of pydna.open_config_folder()

class pydna.genbank.Genbank(users_email: str, *args, tool='pydna', **kwargs)[source]

Bases: object

Class to facilitate download from genbank. It is easier and quicker to use the pydna.genbank.genbank() function directly.

Parameters:
users_email : string

Has to be a valid email address. You should always tell Genbanks who you are, so that they can contact you.

Examples

>>> from pydna.genbank import Genbank
>>> gb=Genbank("bjornjobb@gmail.com")
>>> rec = gb.nucleotide("AJ515731")   # <- entry from genbank
>>> print(len(rec))
19
nucleotide(**kwargs)
pydna.genbank.genbank(accession: str = 'CS570233.1', *args, **kwargs)[source]

Download a genbank nuclotide record. This function takes the same paramenters as the :func:pydna.genbank.Genbank.nucleotide method. The email address stored in the pydna_email environment variable is used. The easiest way set this permanantly is to edit the pydna.ini file. See the documentation of pydna.open_config_folder()

if no accession is given, a very short Genbank entry is used as an example. This can be usefuk for testing the connection to Genbank. Please note that this result is also cached by default by settings in the pydna.ini file. See the documentation of pydna.open_config_folder()

pydna.genbankfile module

class pydna.genbankfile.GenbankFile(record, *args, path=None, **kwargs)[source]

Bases: pydna.dseqrecord.Dseqrecord

rc()

Returns the reverse complement.

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> a=Dseqrecord("ggaatt")
>>> a
Dseqrecord(-6)
>>> a.seq
Dseq(-6)
ggaatt
ccttaa
>>> a.reverse_complement().seq
Dseq(-6)
aattcc
ttaagg
>>>
reverse_complement()[source]

Returns the reverse complement.

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> a=Dseqrecord("ggaatt")
>>> a
Dseqrecord(-6)
>>> a.seq
Dseq(-6)
ggaatt
ccttaa
>>> a.reverse_complement().seq
Dseq(-6)
aattcc
ttaagg
>>>

pydna.genbankfixer module

This module provides the gbtext_clean() function which can clean up broken Genbank files enough to pass the BioPython Genbank parser

Almost all of this code was lifted from BioJSON (https://github.com/levskaya/BioJSON) by Anselm Levskaya. The original code was not accompanied by any software licence. This parser is based on pyparsing.

There are some modifications to deal with fringe cases.

The parser first produces JSON as an intermediate format which is then formatted back into a string in Genbank format.

The parser is not complete, so some fields do not survive the roundtrip (see below). This should not be a difficult fix. The returned result has two properties, .jseq which is the intermediate JSON produced by the parser and .gbtext which is the formatted genbank string.

pydna.genbankfixer.concat_dict(dlist)[source]

more or less dict(list of string pairs) but merges vals with the same keys so no duplicates occur

pydna.genbankfixer.gbtext_clean(gbtext)[source]

This function takes a string containing one genbank sequence in Genbank format and returns a named tuple containing two fields, the gbtext containing a string with the corrected genbank sequence and jseq which contains the JSON intermediate.

Examples

>>> s = '''LOCUS       New_DNA      3 bp    DNA   CIRCULAR SYN        19-JUN-2013
... DEFINITION  .
... ACCESSION   
... VERSION     
... SOURCE      .
...   ORGANISM  .
... COMMENT     
... COMMENT     ApEinfo:methylated:1
... ORIGIN
...         1 aaa     
... //'''
>>> from pydna.readers import read
>>> read(s)  
/home/bjorn/anaconda3/envs/bjorn36/lib/python3.6/site-packages/Bio/GenBank/Scanner.py:1388: BiopythonParserWarning: Malformed LOCUS line found - is this correct?
:'LOCUS       New_DNA      3 bp    DNA   CIRCULAR SYN        19-JUN-2013\n'
  "correct?\n:%r" % line, BiopythonParserWarning)
Traceback (most recent call last):
  File "/home/bjorn/python_packages/pydna/pydna/readers.py", line 48, in read
    results = results.pop()
IndexError: pop from empty list

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/bjorn/python_packages/pydna/pydna/readers.py", line 50, in read
    raise ValueError("No sequences found in data:\n({})".format(data[:79]))
ValueError: No sequences found in data:
(LOCUS       New_DNA      3 bp    DNA   CIRCULAR SYN        19-JUN-2013
DEFINITI)
>>> from pydna.genbankfixer import gbtext_clean
>>> s2, j2 = gbtext_clean(s)
>>> print(s2)
LOCUS       New_DNA                    3 bp ds-DNA     circular SYN 19-JUN-2013
DEFINITION  .
ACCESSION   
VERSION     
SOURCE      .
ORGANISM  .
COMMENT     
COMMENT     ApEinfo:methylated:1
FEATURES             Location/Qualifiers
ORIGIN
        1 aaa     
//

>>> s3 = read(s2)
>>> s3
Dseqrecord(o3)
>>> print(s3.format())
LOCUS       New_DNA                    3 bp    ds-DNA  circular SYN 19-JUN-2013
DEFINITION  .
ACCESSION   New_DNA
VERSION     New_DNA
KEYWORDS    .
SOURCE      
  ORGANISM  .
            .
COMMENT     
            ApEinfo:methylated:1
FEATURES             Location/Qualifiers
ORIGIN
        1 aaa
//
pydna.genbankfixer.locstr(locs, strand)[source]

genbank formatted location string, assumes no join’d combo of rev and fwd seqs

pydna.genbankfixer.originstr(sequence)[source]

formats dna sequence as broken, numbered lines ala genbank

pydna.genbankfixer.parseGBLoc(s, l, t)[source]

retwingles parsed genbank location strings, assumes no joins of RC and FWD sequences

pydna.genbankfixer.strip_indent(str)[source]
pydna.genbankfixer.strip_multiline(s, l, t)[source]
pydna.genbankfixer.toGB(jseq)[source]

parses json jseq data and prints out ApE compatible genbank

pydna.genbankfixer.toInt(s, l, t)[source]
pydna.genbankfixer.toJSON(gbkstring)[source]
pydna.genbankfixer.wrapstring(str_, rowstart, rowend, padfirst=True)[source]

wraps the provided string in lines of length rowend-rowstart and padded on the left by rowstart. -> if padfirst is false the first line is not padded

pydna.genbankrecord module

class pydna.genbankrecord.GenbankRecord(record, *args, item='accession', start=None, stop=None, strand=1, **kwargs)[source]

Bases: pydna.dseqrecord.Dseqrecord

rc()

Returns the reverse complement.

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> a=Dseqrecord("ggaatt")
>>> a
Dseqrecord(-6)
>>> a.seq
Dseq(-6)
ggaatt
ccttaa
>>> a.reverse_complement().seq
Dseq(-6)
aattcc
ttaagg
>>>
reverse_complement()[source]

Returns the reverse complement.

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> a=Dseqrecord("ggaatt")
>>> a
Dseqrecord(-6)
>>> a.seq
Dseq(-6)
ggaatt
ccttaa
>>> a.reverse_complement().seq
Dseq(-6)
aattcc
ttaagg
>>>

pydna.myprimers module

This module provides three ways to access a primer list specified in the primers entry in the pydna.ini file or in the pydna_primers environment variable.

The list has to have sequences in FASTA, Genbank or EMBL formats. The primer list can have the format below for example:

>first_primer
tgatcgtcatgctgactatactat
>second_primer
ctaggatcgtagatctagctg
...

list_primers is a list pydna.primer.Primer objects dict_primers is a dict where the key is the id of the object

each primer is instantiated as p001, p002, … for all primers

pydna.myprimers.append_primer_list(primers: list)[source]

pydna.parsers module

Provides two functions, parse and parse_primers

pydna.parsers.parse(data, ds=True)[source]

This function returns all DNA sequences found in data. If no sequences are found, an empty list is returned. This is a greedy function, use carefully.

Parameters:
data : string or iterable

The data parameter is a string containing:

  1. an absolute path to a local file. The file will be read in text mode and parsed for EMBL, FASTA and Genbank sequences.
  2. a string containing one or more sequences in EMBL, GENBANK, or FASTA format. Mixed formats are allowed.
  3. data can be a list or other iterable where the elements are 1 or 2
ds : bool

If True double stranded Dseqrecord objects are returned. If False single stranded Bio.SeqRecord [10] objects are returned.

Returns:
list

contains Dseqrecord or SeqRecord objects

See also

read

References

[10]http://biopython.org/wiki/SeqRecord
pydna.parsers.parse_primers(data)[source]

pydna.primer module

This module contain provide the Primer class that is a subclass of the biopython SeqRecord.

class pydna.primer.Primer(record, *args, template=None, position=None, footprint=0, concentration=1000.0, **kwargs)[source]

Bases: pydna.seqrecord.SeqRecord

This class can hold information about a primer and its position on a template footprint and tail.

footprint
tail
tm(saltc=50.0, formula=<function tmbresluc>)[source]

pydna.readers module

Provides two functions, read and read_primer.

pydna.readers.read(data, ds=True)[source]

This function is similar the parse() function but expects one and only one sequence or and exception is thrown.

Parameters:
data : string

see below

ds : bool

Double stranded or single stranded DNA, if True return Dseqrecord objects, else Bio.SeqRecord objects.

Returns:
Dseqrecord

contains the first Dseqrecord or SeqRecord object parsed.

See also

parse

Notes

The data parameter is similar to the data parameter for parse().

pydna.readers.read_primer(data)[source]

Use this function to read a primer sequence from a string or a local file. The usage is similar to the parse_primer() function.

pydna.seqrecord module

This module provide a subclass of the Biopython SeqRecord class. It has a number of extra methods and uses the pydna._pretty_str.pretty_str class instread of str for a nicer output in the IPython shell.

class pydna.seqrecord.SeqRecord(*args, **kwargs)[source]

Bases: Bio.SeqRecord.SeqRecord

accession

alias for id property

add_colors_to_features_for_ape()[source]

This method assigns random colors to features compatible with the ApE editor

add_feature(x=None, y=None, seq=None, type='misc', *args, **kwargs)[source]

Adds a feature of type misc to the feature list of the sequence.

Parameters:
x : int

Indicates start of the feature

y : int

Indicates end of the feature

Examples

>>> from pydna.seqrecord import SeqRecord
>>> a=SeqRecord("atgtaa")
>>> a.features
[]
>>> a.add_feature(2,4)
>>> a.features
[SeqFeature(FeatureLocation(ExactPosition(2), ExactPosition(4)), type='misc')]
definition

alias for description property

extract_feature(n)[source]

Extracts a feature and creates a new SeqRecord object.

Parameters:
n : int

Indicates the feature to extract

Examples

>>> from pydna.seqrecord import SeqRecord
>>> a=SeqRecord("atgtaa")
>>> a.add_feature(2,4)
>>> b=a.extract_feature(0)
>>> b
SeqRecord(seq=Seq('gt', IUPACAmbiguousDNA()), id='ft2', name='ft2', description='description', dbxrefs=[])
gc()[source]

Returns GC content

isorf(table=1)[source]

Detects if sequence is an open reading frame (orf) in the 5’-3’ direction. Translation tables are numbers according to the NCBI numbering [11].

Parameters:
table : int

Sets the translation table, default is 1 (standard code)

Returns:
bool

True if sequence is an orf, False otherwise.

References

[11]http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi?mode=c

Examples

>>> from pydna.seqrecord import SeqRecord
>>> a=SeqRecord("atgtaa")
>>> a.isorf()
True
>>> b=SeqRecord("atgaaa")
>>> b.isorf()
False
>>> c=SeqRecord("atttaa")
>>> c.isorf()
False
list_features()[source]

Prints an ASCII table with all features.

Examples

>>> from Bio.Alphabet.IUPAC import IUPACAmbiguousDNA
>>> from Bio.Seq import Seq
>>> from pydna.seqrecord import SeqRecord
>>> a=SeqRecord(Seq("atgtaa",IUPACAmbiguousDNA()))
>>> a.add_feature(2,4)
>>> print(a.list_features())
+-----+---------------+-----+-----+-----+-----+------+------+
| Ft# | Label or Note | Dir | Sta | End | Len | type | orf? |
+-----+---------------+-----+-----+-----+-----+------+------+
|   0 | L:ft2         | --- | 2   | 4   |   2 | misc |  no  |
+-----+---------------+-----+-----+-----+-----+------+------+
locus

alias for name property

olaps(other, *args, **kwargs)[source]

Returns the overlaps between the sequence and another sequence, The other sequence can be a string, Seq, SeqRecord, Dseq or DseqRecord

reverse_complement(*args, **kwargs)[source]

Return new SeqRecord with reverse complement sequence.

By default the new record does NOT preserve the sequence identifier, name, description, general annotation or database cross-references - these are unlikely to apply to the reversed sequence.

You can specify the returned record’s id, name and description as strings, or True to keep that of the parent, or False for a default.

You can specify the returned record’s features with a list of SeqFeature objects, or True to keep that of the parent, or False to omit them. The default is to keep the original features (with the strand and locations adjusted).

You can also specify both the returned record’s annotations and letter_annotations as dictionaries, True to keep that of the parent, or False to omit them. The default is to keep the original annotations (with the letter annotations reversed).

To show what happens to the pre-letter annotations, consider an example Solexa variant FASTQ file with a single entry, which we’ll read in as a SeqRecord:

>>> from Bio import SeqIO
>>> record = SeqIO.read("Quality/solexa_faked.fastq", "fastq-solexa")
>>> print("%s %s" % (record.id, record.seq))
slxa_0001_1_0001_01 ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTNNNNNN
>>> print(list(record.letter_annotations))
['solexa_quality']
>>> print(record.letter_annotations["solexa_quality"])
[40, 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5]

Now take the reverse complement, here we explicitly give a new identifier (the old identifier with a suffix):

>>> rc_record = record.reverse_complement(id=record.id + "_rc")
>>> print("%s %s" % (rc_record.id, rc_record.seq))
slxa_0001_1_0001_01_rc NNNNNNACGTACGTACGTACGTACGTACGTACGTACGTACGTACGT

Notice that the per-letter-annotations have also been reversed, although this may not be appropriate for all cases.

>>> print(rc_record.letter_annotations["solexa_quality"])
[-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40]

Now for the features, we need a different example. Parsing a GenBank file is probably the easiest way to get an nice example with features in it…

>>> from Bio import SeqIO
>>> with open("GenBank/pBAD30.gb") as handle:
...     plasmid = SeqIO.read(handle, "gb")
>>> print("%s %i" % (plasmid.id, len(plasmid)))
pBAD30 4923
>>> plasmid.seq
Seq('GCTAGCGGAGTGTATACTGGCTTACTATGTTGGCACTGATGAGGGTGTCAGTGA...ATG', IUPACAmbiguousDNA())
>>> len(plasmid.features)
13

Now, let’s take the reverse complement of this whole plasmid:

>>> rc_plasmid = plasmid.reverse_complement(id=plasmid.id+"_rc")
>>> print("%s %i" % (rc_plasmid.id, len(rc_plasmid)))
pBAD30_rc 4923
>>> rc_plasmid.seq
Seq('CATGGGCAAATATTATACGCAAGGCGACAAGGTGCTGATGCCGCTGGCGATTCA...AGC', IUPACAmbiguousDNA())
>>> len(rc_plasmid.features)
13

Let’s compare the first CDS feature - it has gone from being the second feature (index 1) to the second last feature (index -2), its strand has changed, and the location switched round.

>>> print(plasmid.features[1])
type: CDS
location: [1081:1960](-)
qualifiers:
    Key: label, Value: ['araC']
    Key: note, Value: ['araC regulator of the arabinose BAD promoter']
    Key: vntifkey, Value: ['4']

>>> print(rc_plasmid.features[-2])
type: CDS
location: [2963:3842](+)
qualifiers:
    Key: label, Value: ['araC']
    Key: note, Value: ['araC regulator of the arabinose BAD promoter']
    Key: vntifkey, Value: ['4']

You can check this new location, based on the length of the plasmid:

>>> len(plasmid) - 1081
3842
>>> len(plasmid) - 1960
2963

Note that if the SeqFeature annotation includes any strand specific information (e.g. base changes for a SNP), this information is not amended, and would need correction after the reverse complement.

Note trying to reverse complement a protein SeqRecord raises an exception:

>>> from Bio.SeqRecord import SeqRecord
>>> from Bio.Seq import Seq
>>> from Bio.Alphabet import IUPAC
>>> protein_rec = SeqRecord(Seq("MAIVMGR", IUPAC.protein), id="Test")
>>> protein_rec.reverse_complement()
Traceback (most recent call last):
   ...
ValueError: Proteins do not have complements!

Also note you can reverse complement a SeqRecord using a MutableSeq:

>>> from Bio.SeqRecord import SeqRecord
>>> from Bio.Seq import MutableSeq
>>> from Bio.Alphabet import generic_dna
>>> rec = SeqRecord(MutableSeq("ACGT", generic_dna), id="Test")
>>> rec.seq[0] = "T"
>>> print("%s %s" % (rec.id, rec.seq))
Test TCGT
>>> rc = rec.reverse_complement(id=True)
>>> print("%s %s" % (rc.id, rc.seq))
Test ACGA
seguid()[source]

Returns the url safe SEGUID [12] for the sequence. This checksum is the same as seguid but with base64.urlsafe encoding [13] instead of the normal base 64. This means that the characters + and / are replaced with - and _ so that the checksum can be a part of and URL or a filename.

References

[12]http://wiki.christophchamp.com/index.php/SEGUID

Examples

>>> from pydna.seqrecord import SeqRecord
>>> a=SeqRecord("aaaaaaa")
>>> a.seguid() # original seguid is +bKGnebMkia5kNg/gF7IORXMnIU
'-bKGnebMkia5kNg_gF7IORXMnIU'
stamp()[source]

Adds a SEGUID or cSEGUID checksum and a datestring to the description property. This will show in the genbank format.

For linear sequences:

SEGUID_<seguid>_<datestring>

For circular sequences:

cSEGUID_<seguid>_<datestring>

Examples

>>> from pydna.seqrecord import SeqRecord
>>> a=SeqRecord("aaa")
>>> a.stamp()
'SEGUID_YG7G6b2Kj_KtFOX63j8mRHHoIlE...'
>>> a.description
'SEGUID_YG7G6b2Kj_KtFOX63j8mRHHoIlE...'

pydna.tm module

pydna.tm.Q5(*args, **kwargs)[source]

For Q5 Ta they take the lower of the two Tms and add 1C (up to 72C). For Phusion they take the lower of the two and add 3C (up to 72C).

pydna.tm.basictm(primer, *args, **kwargs)[source]

Returns the melting temperature (Tm) of the primer using the basic formula. This function returns the same value as the Biopython Bio.SeqUtils.MeltingTemp.Tm_Wallace

Tm = (wA+xT)*2 + (yG+zC)*4 assumed 50mM monovalent cations

w = number of A in primer
x = number of T in primer
y = number of G in primer
z = number of C in primer
Parameters:
primer : string

Primer sequence 5’-3’

Returns:
tm : int

Examples

>>> from pydna.tm import basictm
>>> basictm("ggatcc")
20
>>>
pydna.tm.tmbreslauer86(primer, *args, dnac=500.0, saltc=50, thermodynamics=False, **kwargs)[source]

Returns the melting temperature (Tm) of the primer using the nearest neighbour algorithm. Formula and thermodynamic data is taken from Breslauer 1986.

These data are no longer widely used.

Breslauer 1986, table 2 [14]

pair dH dS dG
AA/TT 9.1 24.0 1.9
AT/TA 8.6 23.9 1.5
TA/AT 6.0 16.9 0.9
CA/GT 5.8 12.9 1.9
GT/CA 6.5 17.3 1.3
CT/GA 7.8 20.8 1.6
GA/CT 5.6 13.5 1.6
CG/GC 11.9 27.8 3.6
GC/CG 11.1 26.7 3.1
GG/CC 11.0 26.6 3.1
Parameters:
primer : string

Primer sequence 5’-3’

Returns:
tm : float

References

[13]K.J. Breslauer et al., “Predicting DNA Duplex Stability from the Base Sequence,” Proceedings of the National Academy of Sciences 83, no. 11 (1986): 3746.

Examples

>>> from pydna.tm import tmbreslauer86
>>> tmbreslauer86("ACGTCATCGACACTATCATCGAC")
64.28863985851899
pydna.tm.tmbresluc(primer, *args, primerc=500.0, saltc=50, thermodynamics=False, **kwargs)[source]

Returns the tm for a primer using a formula adapted to polymerases with a DNA binding domain, such as the Phusion polymerase.

Parameters:
primer : string

primer sequence 5’-3’

primerc : float

primer concentration in nM), set to 500.0 nm by default.

saltc : float, optional

Monovalent cation concentration in mM, set to 50.0 mM by default.

thermodynamics : bool, optional

prints details of the thermodynamic data to stdout. For debugging only.

Returns:
tm : float

the tm of the primer

tm,dH,dS : tuple

tm and dH and dS used for the calculation

pydna.tm.tmstaluc98(primer, *args, dnac=50, saltc=50, **kwargs)[source]

Returns the melting temperature (Tm) of the primer using the nearest neighbour algorithm. Formula and thermodynamic data is taken from SantaLucia 1998 [#]_. This implementation gives the same answer as the one provided by Biopython (See Examples).

Thermodynamic data used:

pair dH dS
AA/TT 7.9 22.2
AT/TA 7.2 20.4
TA/AT 7.2 21.3
CA/GT 8.5 22.7
GT/CA 8.4 22.4
CT/GA 7.8 21.0
GA/CT 8.2 22.2
CG/GC 10.6 27.2
GC/CG 9.8 24.4
GG/CC 8.0 19.9
Parameters:
primer : string

Primer sequence 5’-3’

Returns:
tm : float

tm of the primer

References

[14]SantaLucia J Jr. A unified view of polymer, dumbbell, and oligonucleotide DNA nearest-neighbor thermodynamics. Proc Natl Acad Sci U S A 1998;95:1460–5.

Examples

>>> from pydna.tm import tmstaluc98
>>> from Bio.SeqUtils.MeltingTemp import Tm_staluc
>>> tmstaluc98("ACGTCATCGACACTATCATCGAC")
54.55597724052518
>>> Tm_staluc("ACGTCATCGACACTATCATCGAC")
54.55597724052518

pydna.utils module

This module provides miscellaneous functions.

pydna.utils.SmallestRotation(s)[source]
pydna.utils.cseguid(seq: str) → pydna._pretty.pretty_str[source]

Returns the url safe cSEGUID for the sequence. The cSEGUID is the SEGUID checksum calculated for the lexicographically minimal string rotation of a DNA sequence. Only defined for circular sequences.

pydna.utils.eq(*args, **kwargs)[source]

Compares two or more DNA sequences for equality i.e. they represent the same DNA molecule. Comparisons are case insensitive.

Parameters:
args : iterable

iterable containing sequences args can be strings, Biopython Seq or SeqRecord, Dseqrecord or dsDNA objects.

circular : bool, optional

Consider all molecules circular or linear

linear : bool, optional

Consider all molecules circular or linear

Returns:
eq : bool

Returns True or False

Notes

Compares two or more DNA sequences for equality i.e. if they represent the same DNA molecule.

Two linear sequences are considiered equal if either:

  • They have the same sequence (case insensitive)
  • One sequence is the reverse complement of the other (case insensitive)

Two circular sequences are considered equal if they are circular permutations:

  1. They have the same lengt, AND
  2. One sequence or can be found in the concatenation of the other sequence with it , OR
  3. The reverse complement can be found in the concatenation of the other sequence with itself.

The topology for the comparison can be set using one of the keywords linear or circular to True or False.

If circular or linear is not set, it will be deduced from the topology of each sequence for sequences that have a linear or circular attribute (like Dseq and Dseqrecord).

Examples

>>> from pydna.dseqrecord import Dseqrecord
>>> from pydna.utils import eq
>>> eq("aaa","AAA")
True
>>> eq("aaa","AAA","TTT")
True
>>> eq("aaa","AAA","TTT","tTt")
True
>>> eq("aaa","AAA","TTT","tTt", linear=True)
True
>>> eq("Taaa","aTaa", linear = True)
False
>>> eq("Taaa","aTaa", circular = True)
True
>>> a=Dseqrecord("Taaa")
>>> b=Dseqrecord("aTaa")
>>> eq(a,b)
False
>>> eq(a,b,circular=True)
True
>>> a=a.looped()
>>> b=b.looped()
>>> eq(a,b)
True
>>> eq(a,b,circular=False)
False
>>> eq(a,b,linear=True)
False
>>> eq(a,b,linear=False)
True
>>> eq("ggatcc","GGATCC")
True
>>> eq("ggatcca","GGATCCa")
True
>>> eq("ggatcca","tGGATCC")
True
pydna.utils.flatten(*args)[source]

Flattens an iterable of iterables down to str, bytes, bytearray or any of the pydna or Biopython seq objects

pydna.utils.identifier_from_string(s: str) → str[source]

This function returns a string that is a valid python identifier based on the argument s or an empty string

pydna.utils.lseguid(seq: str) → pydna._pretty.pretty_str[source]

Returns the url safe lSEGUID checksum for the sequence (seq). This is the SEGUID checksum with the ‘+’ and ‘/’ characters of standard Base64 encoding are respectively replaced by ‘-‘ and ‘_’.

pydna.utils.memorize(filename)[source]

Decorator for caching fucntions and classes, see pydna.download and pydna.Assembly for use

pydna.utils.rc(sequence)[source]

returns the reverse complement of sequence (string) accepts mixed DNA/RNA

pydna.utils.seguid(seq: str) → pydna._pretty.pretty_str[source]

Returns the url safe SEGUID checksum for the sequence. This is the SEGUID checksum with the ‘+’ and ‘/’ characters of standard Base64 encoding are respectively replaced by ‘-‘ and ‘_’.

Indices and tables