Back to index

python-biopython  1.60
Public Member Functions
Bio.Restriction._Update.RestrictionCompiler.TypeCompiler Class Reference

List of all members.

Public Member Functions

def __init__
def buildtype

Detailed Description

Build the different types possible for Restriction Enzymes

Definition at line 285 of file RestrictionCompiler.py.


Constructor & Destructor Documentation

TypeCompiler() -> new TypeCompiler instance.

Definition at line 289 of file RestrictionCompiler.py.

00289 
00290     def __init__(self):
00291         """TypeCompiler() -> new TypeCompiler instance."""
00292         pass


Member Function Documentation

TC.buildtype() -> generator.

build the new types that will be needed for constructing the
restriction enzymes.

Definition at line 293 of file RestrictionCompiler.py.

00293 
00294     def buildtype(self):
00295         """TC.buildtype() -> generator.
00296 
00297         build the new types that will be needed for constructing the
00298         restriction enzymes."""
00299         baT = (AbstractCut, RestrictionType)
00300         cuT = (NoCut, OneCut, TwoCuts)
00301         meT = (Meth_Dep, Meth_Undep)
00302         paT = (Palindromic, NonPalindromic)
00303         ovT = (Unknown, Blunt, Ov5, Ov3)
00304         deT = (NotDefined, Defined, Ambiguous)
00305         coT = (Commercially_available, Not_available)
00306         All = (baT, cuT, meT, paT, ovT, deT, coT)
00307         #
00308         #   Now build the types. Only the most obvious are left out.
00309         #   Modified even the most obvious are not so obvious.
00310         #   emboss_*.403 AspCNI is unknown and commercially available.
00311         #   So now do not remove the most obvious.
00312         #
00313         types = [(p,c,o,d,m,co,baT[0],baT[1])
00314                  for p in paT for c in cuT for o in ovT
00315                  for d in deT for m in meT for co in coT]
00316         n= 1
00317         for ty in types:
00318             dct = {}
00319             for t in ty:
00320                 dct.update(t.__dict__)
00321                 #
00322                 #   here we need to customize the dictionary.
00323                 #   i.e. types deriving from OneCut have always scd5 and scd3
00324                 #   equal to None. No need therefore to store that in a specific
00325                 #   enzyme of this type. but it then need to be in the type.
00326                 #
00327                 dct['results'] = []
00328                 dct['substrat'] = 'DNA'
00329                 dct['dna'] = None
00330                 if t == NoCut:
00331                     dct.update({'fst5':None,'fst3':None,
00332                                 'scd5':None,'scd3':None,
00333                                 'ovhg':None,'ovhgseq':None})
00334                 elif t == OneCut:
00335                     dct.update({'scd5':None, 'scd3':None})
00336             class klass(type):
00337                 def __new__(cls):
00338                     return type.__new__(cls, 'type%i'%n,ty,dct)
00339                 def __init__(cls):
00340                     super(klass, cls).__init__('type%i'%n,ty,dct)
00341             yield klass()
00342             n+=1

Here is the call graph for this function:


The documentation for this class was generated from the following file: