Back to index

python-biopython  1.60
Classes | Functions | Variables
Bio.Restriction._Update.RestrictionCompiler Namespace Reference

Classes

class  OverhangError
class  newenzyme
class  TypeCompiler
class  DictionaryBuilder

Functions

def BaseExpand
def regex
def Antiparallel
def is_palindrom
def LocalTime

Variables

 DNA = Seq
dictionary dna_alphabet
dictionary complement_alphabet
dictionary enzymedict = {}
dictionary suppliersdict = {}
dictionary classdict = {}
dictionary typedict = {}
string start

Class Documentation

class Bio::Restriction::_Update::RestrictionCompiler::OverhangError
Exception for dealing with overhang.

Definition at line 83 of file RestrictionCompiler.py.


Function Documentation

Antiparallel(sequence) -> string.

returns a string which represents the reverse complementary strand of
a DNA sequence.

Definition at line 117 of file RestrictionCompiler.py.

00117 
00118 def Antiparallel(sequence):
00119     """Antiparallel(sequence) -> string.
00120 
00121     returns a string which represents the reverse complementary strand of
00122     a DNA sequence."""
00123     return antiparallel(sequence.tostring())

Here is the caller graph for this function:

BaseExpand(base) -> string.

given a degenerated base, returns its meaning in IUPAC alphabet.

i.e:
    b= 'A' -> 'A'
    b= 'N' -> 'ACGT'
    etc...

Definition at line 87 of file RestrictionCompiler.py.

00087 
00088 def BaseExpand(base):
00089     """BaseExpand(base) -> string.
00090 
00091     given a degenerated base, returns its meaning in IUPAC alphabet.
00092 
00093     i.e:
00094         b= 'A' -> 'A'
00095         b= 'N' -> 'ACGT'
00096         etc..."""
00097     base = base.upper()
00098     return dna_alphabet[base]

Here is the caller graph for this function:

is_palindrom(sequence) -> bool.

True is the sequence is a palindrom.
sequence is a DNA object.

Definition at line 124 of file RestrictionCompiler.py.

00124 
00125 def is_palindrom(sequence):
00126     """is_palindrom(sequence) -> bool.
00127 
00128     True is the sequence is a palindrom.
00129     sequence is a DNA object."""
00130     return sequence == DNA(Antiparallel(sequence))

Here is the call graph for this function:

Here is the caller graph for this function:

LocalTime() -> string.

LocalTime calculate the extension for emboss file for the current year and
month.

Definition at line 131 of file RestrictionCompiler.py.

00131 
00132 def LocalTime():
00133     """LocalTime() -> string.
00134 
00135     LocalTime calculate the extension for emboss file for the current year and
00136     month."""
00137     t = time.gmtime()
00138     year = str(t.tm_year)[-1]
00139     month = str(t.tm_mon)
00140     if len(month) == 1 : month = '0'+month
00141     return year+month
00142                 

Here is the caller graph for this function:

regex(site) -> string.

Construct a regular expression from a DNA sequence.
i.e.:
    site = 'ABCGN'   -> 'A[CGT]CG.'

Definition at line 99 of file RestrictionCompiler.py.

00099 
00100 def regex(site):
00101     """regex(site) -> string.
00102 
00103     Construct a regular expression from a DNA sequence.
00104     i.e.:
00105         site = 'ABCGN'   -> 'A[CGT]CG.'"""
00106     reg_ex = site
00107     for base in reg_ex:
00108         if base in ('A', 'T', 'C', 'G', 'a', 'c', 'g', 't'):
00109             pass
00110         if base in ('N', 'n'):
00111             reg_ex = '.'.join(reg_ex.split('N'))
00112             reg_ex = '.'.join(reg_ex.split('n'))
00113         if base in ('R', 'Y', 'W', 'M', 'S', 'K', 'H', 'D', 'B', 'V'):
00114             expand = '['+ str(BaseExpand(base))+']'
00115             reg_ex = expand.join(reg_ex.split(base))
00116     return reg_ex

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 79 of file RestrictionCompiler.py.

Initial value:
00001 {'A':'T', 'T':'A', 'C':'G', 'G':'C','R':'Y', 'Y':'R',
00002                        'W':'W', 'S':'S', 'M':'K', 'K':'M', 'H':'D', 'D':'H',
00003                        'B':'V', 'V':'B', 'N':'N','a':'t', 'c':'g', 'g':'c',
00004                        't':'a', 'r':'y', 'y':'r', 'w':'w', 's':'s','m':'k',
00005                        'k':'m', 'h':'d', 'd':'h', 'b':'v', 'v':'b', 'n':'n'}

Definition at line 72 of file RestrictionCompiler.py.

Definition at line 61 of file RestrictionCompiler.py.

Initial value:
00001 {'A':'A', 'C':'C', 'G':'G', 'T':'T',
00002                 'R':'AG', 'Y':'CT', 'W':'AT', 'S':'CG', 'M':'AC', 'K':'GT',
00003                 'H':'ACT', 'B':'CGT', 'V':'ACG', 'D':'AGT',
00004                 'N':'ACGT',
00005                 'a': 'a', 'c': 'c', 'g': 'g', 't': 't',
00006                 'r':'ag', 'y':'ct', 'w':'at', 's':'cg', 'm':'ac', 'k':'gt',
00007                 'h':'act', 'b':'cgt', 'v':'acg', 'd':'agt',
00008                 'n':'acgt'}

Definition at line 62 of file RestrictionCompiler.py.

Definition at line 77 of file RestrictionCompiler.py.

Initial value:
00001 '\n\
00002 #!/usr/bin/env python\n\
00003 #\n\
00004 #      Restriction Analysis Libraries.\n\
00005 #      Copyright (C) 2004. Frederic Sohm.\n\
00006 #\n\
00007 # This code is part of the Biopython distribution and governed by its\n\
00008 # license.  Please see the LICENSE file that should have been included\n\
00009 # as part of this package.\n\
00010 #\n\
00011 # This file is automatically generated - do not edit it by hand! Instead,\n\
00012 # use the tool Scripts/Restriction/ranacompiler.py which in turn uses\n\
00013 # Bio/Restriction/_Update/RestrictionCompiler.py\n\
00014 #\n\
00015 # The following dictionaries used to be defined in one go, but that does\n\
00016 # not work on Jython due to JVM limitations. Therefore we break this up\n\
00017 # into steps, using temporary functions to avoid the JVM limits.\n\
00018 \n\n'

Definition at line 343 of file RestrictionCompiler.py.

Definition at line 78 of file RestrictionCompiler.py.

Definition at line 80 of file RestrictionCompiler.py.