Back to index

python-biopython  1.60
Public Member Functions | Static Public Attributes | Private Member Functions
Bio.Restriction.Restriction.Ov5 Class Reference
Inheritance diagram for Bio.Restriction.Restriction.Ov5:
Inheritance graph
[legend]
Collaboration diagram for Bio.Restriction.Restriction.Ov5:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def catalyse
def is_blunt
def is_5overhang
def is_3overhang
def overhang
def compatible_end
def search
def all_suppliers
def is_equischizomer
def is_neoschizomer
def is_isoschizomer
def equischizomers
def neoschizomers
def isoschizomers
def frequency
def __add__
def __div__
def __rdiv__
def __truediv__
def __rtruediv__
def __floordiv__
def __rfloordiv__
def __str__
def __repr__
def __len__
def __hash__
def __eq__
def __ne__
def __rshift__
def __mod__
def __ge__
def __gt__
def __le__
def __lt__

Static Public Attributes

 catalyze = catalyse

Private Member Functions

def _mod1

Detailed Description

Implement the methods specific to the enzymes for which the overhang
is recessed in 3'.

The enzyme cuts the + strand after the - strand of the DNA.

Internal use only. Not meant to be instantiated.

Definition at line 1087 of file Restriction.py.


Member Function Documentation

def Bio.Restriction.Restriction.RestrictionType.__add__ (   cls,
  other 
) [inherited]
RE.__add__(other) -> RestrictionBatch().

if other is an enzyme returns a batch of the two enzymes.
if other is already a RestrictionBatch add enzyme to it.

Definition at line 250 of file Restriction.py.

00250 
00251     def __add__(cls, other):
00252         """RE.__add__(other) -> RestrictionBatch().
00253 
00254         if other is an enzyme returns a batch of the two enzymes.
00255         if other is already a RestrictionBatch add enzyme to it."""
00256         if isinstance(other, RestrictionType):
00257             return RestrictionBatch([cls, other])    
00258         elif isinstance(other, RestrictionBatch):
00259             return other.add_nocheck(cls)
00260         else:
00261             raise TypeError
        
def Bio.Restriction.Restriction.RestrictionType.__div__ (   cls,
  other 
) [inherited]
RE.__div__(other) -> list.

RE/other
returns RE.search(other).

Definition at line 262 of file Restriction.py.

00262 
00263     def __div__(cls, other):
00264         """RE.__div__(other) -> list.
00265 
00266         RE/other
00267         returns RE.search(other)."""
00268         return cls.search(other)
    
def Bio.Restriction.Restriction.RestrictionType.__eq__ (   cls,
  other 
) [inherited]
RE == other -> bool

True if RE and other are the same enzyme.

Specifically this checks they are the same Python object.

Definition at line 327 of file Restriction.py.

00327 
00328     def __eq__(cls, other):
00329         """RE == other -> bool
00330 
00331         True if RE and other are the same enzyme.
00332         
00333         Specifically this checks they are the same Python object.
00334         """
00335         #assert (id(cls)==id(other)) == (other is cls) == (cls is other)
00336         return id(cls)==id(other)

def Bio.Restriction.Restriction.RestrictionType.__floordiv__ (   cls,
  other 
) [inherited]
RE.__floordiv__(other) -> list.

RE//other
returns RE.catalyse(other).

Definition at line 290 of file Restriction.py.

00290 
00291     def __floordiv__(cls, other):
00292         """RE.__floordiv__(other) -> list.
00293 
00294         RE//other
00295         returns RE.catalyse(other)."""
00296         return cls.catalyse(other)
    
def Bio.Restriction.Restriction.RestrictionType.__ge__ (   cls,
  other 
) [inherited]
a >= b -> bool.

a is greater or equal than b if the a site is longer than b site.
if their site have the same length sort by alphabetical order of their
names.

Definition at line 373 of file Restriction.py.

00373 
00374     def __ge__(cls, other):
00375         """a >= b -> bool.
00376 
00377         a is greater or equal than b if the a site is longer than b site.
00378         if their site have the same length sort by alphabetical order of their
00379         names."""
00380         if not isinstance(other, RestrictionType):
00381             raise NotImplementedError
00382         if len(cls) > len(other):
00383             return True
00384         elif cls.size == len(other) and cls.__name__ >= other.__name__:
00385             return True
00386         else:
00387             return False

def Bio.Restriction.Restriction.RestrictionType.__gt__ (   cls,
  other 
) [inherited]
a > b -> bool.

sorting order:
    1. size of the recognition site.
    2. if equal size, alphabetical order of the names.

Definition at line 388 of file Restriction.py.

00388 
00389     def __gt__(cls, other):
00390         """a > b -> bool.
00391 
00392         sorting order:
00393                     1. size of the recognition site.
00394                     2. if equal size, alphabetical order of the names."""
00395         if not isinstance(other, RestrictionType):
00396             raise NotImplementedError
00397         if len(cls) > len(other):
00398             return True
00399         elif cls.size == len(other) and cls.__name__ > other.__name__:
00400             return True
00401         else:
00402             return False

Definition at line 322 of file Restriction.py.

00322 
00323     def __hash__(cls):
00324         #Python default is to use id(...)
00325         #This is consistent with the __eq__ implementation
00326         return id(cls)
    
def Bio.Restriction.Restriction.RestrictionType.__le__ (   cls,
  other 
) [inherited]
a <= b -> bool.

sorting order:
    1. size of the recognition site.
    2. if equal size, alphabetical order of the names.

Definition at line 403 of file Restriction.py.

00403 
00404     def __le__(cls, other):
00405         """a <= b -> bool.
00406 
00407         sorting order:
00408                     1. size of the recognition site.
00409                     2. if equal size, alphabetical order of the names."""
00410         if not isinstance(other, RestrictionType):
00411             raise NotImplementedError
00412         elif len(cls) < len(other):
00413             return True
00414         elif len(cls) == len(other) and cls.__name__ <= other.__name__:
00415             return True
00416         else:
00417             return False

RE.__len__() -> int.

length of the recognition site.

Definition at line 316 of file Restriction.py.

00316 
00317     def __len__(cls):
00318         """RE.__len__() -> int.
00319 
00320         length of the recognition site."""
00321         return cls.size
    
def Bio.Restriction.Restriction.RestrictionType.__lt__ (   cls,
  other 
) [inherited]
a < b -> bool.

sorting order:
    1. size of the recognition site.
    2. if equal size, alphabetical order of the names.

Definition at line 418 of file Restriction.py.

00418 
00419     def __lt__(cls, other):
00420         """a < b -> bool.
00421 
00422         sorting order:
00423                     1. size of the recognition site.
00424                     2. if equal size, alphabetical order of the names."""
00425         if not isinstance(other, RestrictionType):
00426             raise NotImplementedError
00427         elif len(cls) < len(other):
00428             return True
00429         elif len(cls) == len(other) and cls.__name__ < other.__name__:
00430             return True
00431         else:
00432             return False
    
def Bio.Restriction.Restriction.RestrictionType.__mod__ (   cls,
  other 
) [inherited]
a % b -> bool.

Test compatibility of the overhang of a and b.
True if a and b have compatible overhang.

Definition at line 363 of file Restriction.py.

00363 
00364     def __mod__(cls, other):
00365         """a % b -> bool.
00366 
00367         Test compatibility of the overhang of a and b.
00368         True if a and b have compatible overhang."""
00369         if not isinstance(other, RestrictionType):
00370             raise TypeError( \
00371                   'expected RestrictionType, got %s instead' % type(other))
00372         return cls._mod1(other)
        
def Bio.Restriction.Restriction.RestrictionType.__ne__ (   cls,
  other 
) [inherited]
RE != other -> bool.
isoschizomer strict, same recognition site, same restriction -> False
all the other-> True

WARNING - This is not the inverse of the __eq__ method.

Definition at line 337 of file Restriction.py.

00337 
00338     def __ne__(cls, other):
00339         """RE != other -> bool.
00340         isoschizomer strict, same recognition site, same restriction -> False
00341         all the other-> True
00342         
00343         WARNING - This is not the inverse of the __eq__ method.
00344         """
00345         if not isinstance(other, RestrictionType):
00346             return True
00347         elif cls.charac == other.charac:
00348             return False
00349         else:
00350             return True

def Bio.Restriction.Restriction.RestrictionType.__rdiv__ (   cls,
  other 
) [inherited]
RE.__rdiv__(other) -> list.

other/RE
returns RE.search(other).

Definition at line 269 of file Restriction.py.

00269 
00270     def __rdiv__(cls, other):
00271         """RE.__rdiv__(other) -> list.
00272 
00273         other/RE
00274         returns RE.search(other)."""
00275         return cls.search(other)
    
RE.__repr__() -> str.

used with eval or exec will instantiate the enzyme.

Definition at line 310 of file Restriction.py.

00310 
00311     def __repr__(cls):
00312         """RE.__repr__() -> str.
00313 
00314         used with eval or exec will instantiate the enzyme."""
00315         return "%s" % cls.__name__
    
def Bio.Restriction.Restriction.RestrictionType.__rfloordiv__ (   cls,
  other 
) [inherited]
RE.__rfloordiv__(other) -> list.

other//RE
returns RE.catalyse(other).

Definition at line 297 of file Restriction.py.

00297 
00298     def __rfloordiv__(cls, other):
00299         """RE.__rfloordiv__(other) -> list.
00300 
00301         other//RE
00302         returns RE.catalyse(other)."""
00303         return cls.catalyse(other)
    
def Bio.Restriction.Restriction.RestrictionType.__rshift__ (   cls,
  other 
) [inherited]
RE >> other -> bool.

neoschizomer : same recognition site, different restriction. -> True
all the others :                                             -> False

Definition at line 351 of file Restriction.py.

00351 
00352     def __rshift__(cls, other):
00353         """RE >> other -> bool.
00354         
00355         neoschizomer : same recognition site, different restriction. -> True
00356         all the others :                                             -> False"""
00357         if not isinstance(other, RestrictionType):
00358             return False
00359         elif cls.site == other.site and cls.charac != other.charac:
00360             return True
00361         else:
00362             return False

def Bio.Restriction.Restriction.RestrictionType.__rtruediv__ (   cls,
  other 
) [inherited]
RE.__rtruediv__(other) -> list.

other/RE
returns RE.search(other).

Definition at line 283 of file Restriction.py.

00283 
00284     def __rtruediv__(cls, other):
00285         """RE.__rtruediv__(other) -> list.
00286 
00287         other/RE
00288         returns RE.search(other)."""
00289         return cls.search(other)
    
RE.__str__() -> str.

return the name of the enzyme.

Definition at line 304 of file Restriction.py.

00304 
00305     def __str__(cls):
00306         """RE.__str__() -> str.
00307 
00308         return the name of the enzyme."""
00309         return cls.__name__
    
def Bio.Restriction.Restriction.RestrictionType.__truediv__ (   cls,
  other 
) [inherited]
RE.__truediv__(other) -> list.

RE/other
returns RE.search(other).

Definition at line 276 of file Restriction.py.

00276 
00277     def __truediv__(cls, other):
00278         """RE.__truediv__(other) -> list.
00279 
00280         RE/other
00281         returns RE.search(other)."""
00282         return cls.search(other)
    
def Bio.Restriction.Restriction.Ov5._mod1 (   self,
  other 
) [private]
RE._mod1(other) -> bool.

for internal use only

test for the compatibility of restriction ending of RE and other.

Definition at line 1197 of file Restriction.py.

01197 
01198     def _mod1(self, other):
01199         """RE._mod1(other) -> bool.
01200 
01201         for internal use only
01202         
01203         test for the compatibility of restriction ending of RE and other."""
01204         if issubclass(other, Ov5) : return self._mod2(other)
01205         else : return False
01206 

Here is the call graph for this function:

RE.all_suppliers -> print all the suppliers of R

Definition at line 470 of file Restriction.py.

00470 
00471     def all_suppliers(self):
00472         """RE.all_suppliers -> print all the suppliers of R"""
00473         supply = [x[0] for x in suppliers_dict.itervalues()]
00474         supply.sort()
00475         print ",\n".join(supply)
00476         return

def Bio.Restriction.Restriction.Ov5.catalyse (   self,
  dna,
  linear = True 
)
RE.catalyse(dna, linear=True) -> tuple of DNA.
RE.catalyze(dna, linear=True) -> tuple of DNA.

return a tuple of dna as will be produced by using RE to restrict the
dna.

dna must be a Bio.Seq.Seq instance or a Bio.Seq.MutableSeq instance.

if linear is False, the sequence is considered to be circular and the
output will be modified accordingly.

Definition at line 1096 of file Restriction.py.

01096 
01097     def catalyse(self, dna, linear=True):
01098         """RE.catalyse(dna, linear=True) -> tuple of DNA.
01099         RE.catalyze(dna, linear=True) -> tuple of DNA.
01100 
01101         return a tuple of dna as will be produced by using RE to restrict the
01102         dna.
01103         
01104         dna must be a Bio.Seq.Seq instance or a Bio.Seq.MutableSeq instance.
01105         
01106         if linear is False, the sequence is considered to be circular and the
01107         output will be modified accordingly."""
01108         r = self.search(dna, linear)
01109         d = self.dna
01110         if not r : return d[1:],
01111         length = len(r)-1
01112         fragments = []
01113         if d.is_linear():
01114             #
01115             #   START of the sequence to FIRST site.
01116             #
01117             fragments.append(d[1:r[0]])
01118             if length:
01119                 #
01120                 #   if more than one site add them.
01121                 #
01122                 fragments += [d[r[x]:r[x+1]] for x in xrange(length)]
01123             #
01124             #   LAST site to END of the sequence.
01125             #
01126             fragments.append(d[r[-1]:])             
01127         else:
01128             #
01129             #   circular : bridge LAST site to FIRST site.
01130             #
01131             fragments.append(d[r[-1]:]+d[1:r[0]])
01132             if not length:
01133                 #
01134                 #   one site we finish here.
01135                 #
01136                 return tuple(fragments)
01137             #
01138             #   add the others.
01139             #
01140             fragments += [d[r[x]:r[x+1]] for x in xrange(length)]
        return tuple(fragments)

Here is the call graph for this function:

def Bio.Restriction.Restriction.Ov5.compatible_end (   self,
  batch = None 
)
RE.compatible_end() -> list.

list of all the enzymes that share compatible end with RE.

Definition at line 1187 of file Restriction.py.

01187 
01188     def compatible_end(self, batch=None):
01189         """RE.compatible_end() -> list.
01190 
01191         list of all the enzymes that share compatible end with RE."""
01192         if not batch : batch = AllEnzymes
01193         r = [x for x in iter(AllEnzymes) if x.is_5overhang() and x % self]
01194         r.sort()
01195         return r 

def Bio.Restriction.Restriction.AbstractCut.equischizomers (   self,
  batch = None 
) [inherited]
RE.equischizomers([batch]) -> list.

return a tuple of all the isoschizomers of RE.
if batch is supplied it is used instead of the default AllEnzymes.

equischizomer <=> same site, same position of restriction.

Definition at line 508 of file Restriction.py.

00508 
00509     def equischizomers(self, batch=None):
00510         """RE.equischizomers([batch]) -> list.
00511 
00512         return a tuple of all the isoschizomers of RE.
00513         if batch is supplied it is used instead of the default AllEnzymes.
00514 
00515         equischizomer <=> same site, same position of restriction."""
00516         if not batch : batch = AllEnzymes
00517         r = [x for x in batch if not self != x]
00518         i = r.index(self)
00519         del r[i]
00520         r.sort()
00521         return r

RE.frequency() -> int.

frequency of the site.

Definition at line 549 of file Restriction.py.

00549 
00550     def frequency(self):
00551         """RE.frequency() -> int.
00552 
00553         frequency of the site."""
00554         return self.freq
00555 

RE.is_3overhang() -> bool.

True if the enzyme produces 3' overhang sticky end.

see also:
    RE.is_5overhang()
    RE.is_blunt()
    RE.is_unknown()

Definition at line 1168 of file Restriction.py.

01168 
01169     def is_3overhang(self):
01170         """RE.is_3overhang() -> bool.
01171 
01172         True if the enzyme produces 3' overhang sticky end.
01173 
01174         see also:
01175             RE.is_5overhang()
01176             RE.is_blunt()
01177             RE.is_unknown()"""
01178         return False

RE.is_5overhang() -> bool.

True if the enzyme produces 5' overhang sticky end.

see also:
    RE.is_3overhang()
    RE.is_blunt()
    RE.is_unknown()

Definition at line 1156 of file Restriction.py.

01156 
01157     def is_5overhang(self):
01158         """RE.is_5overhang() -> bool.
01159 
01160         True if the enzyme produces 5' overhang sticky end.
01161 
01162         see also:
01163             RE.is_3overhang()
01164             RE.is_blunt()
01165             RE.is_unknown()"""
01166         return True

Here is the caller graph for this function:

RE.is_blunt() -> bool.

True if the enzyme produces blunt end.

see also:
    RE.is_3overhang()
    RE.is_5overhang()
    RE.is_unknown()

Definition at line 1144 of file Restriction.py.

01144 
01145     def is_blunt(self):
01146         """RE.is_blunt() -> bool.
01147 
01148         True if the enzyme produces blunt end.
01149 
01150         see also:
01151             RE.is_3overhang()
01152             RE.is_5overhang()
01153             RE.is_unknown()"""
01154         return False

Here is the caller graph for this function:

def Bio.Restriction.Restriction.AbstractCut.is_equischizomer (   self,
  other 
) [inherited]
RE.is_equischizomers(other) -> bool.

True if other is an isoschizomer of RE.
False else.

equischizomer <=> same site, same position of restriction.

Definition at line 478 of file Restriction.py.

00478 
00479     def is_equischizomer(self, other):
00480         """RE.is_equischizomers(other) -> bool.
00481 
00482         True if other is an isoschizomer of RE.
00483         False else.
00484 
00485         equischizomer <=> same site, same position of restriction."""
00486         return not self != other

def Bio.Restriction.Restriction.AbstractCut.is_isoschizomer (   self,
  other 
) [inherited]
RE.is_isoschizomers(other) -> bool.

True if other is an isoschizomer of RE.
False else.

isoschizomer <=> same site.

Definition at line 498 of file Restriction.py.

00498 
00499     def is_isoschizomer(self, other):
00500         """RE.is_isoschizomers(other) -> bool.
00501 
00502         True if other is an isoschizomer of RE.
00503         False else.
00504 
00505         isoschizomer <=> same site."""
00506         return (not self != other) or self >> other

def Bio.Restriction.Restriction.AbstractCut.is_neoschizomer (   self,
  other 
) [inherited]
RE.is_neoschizomers(other) -> bool.

True if other is an isoschizomer of RE.
False else.

neoschizomer <=> same site, different position of restriction.

Definition at line 488 of file Restriction.py.

00488 
00489     def is_neoschizomer(self, other):
00490         """RE.is_neoschizomers(other) -> bool.
00491 
00492         True if other is an isoschizomer of RE.
00493         False else.
00494 
00495         neoschizomer <=> same site, different position of restriction."""
00496         return self >> other

def Bio.Restriction.Restriction.AbstractCut.isoschizomers (   self,
  batch = None 
) [inherited]
RE.isoschizomers([batch]) -> list.

return a tuple of all the equischizomers and neoschizomers of RE.
if batch is supplied it is used instead of the default AllEnzymes.

Definition at line 536 of file Restriction.py.

00536 
00537     def isoschizomers(self, batch=None):
00538         """RE.isoschizomers([batch]) -> list.
00539 
00540         return a tuple of all the equischizomers and neoschizomers of RE.
00541         if batch is supplied it is used instead of the default AllEnzymes."""
00542         if not batch : batch = AllEnzymes 
00543         r = [x for x in batch if (self >> x) or (not self != x)]
00544         i = r.index(self)
00545         del r[i]
00546         r.sort()
00547         return r

def Bio.Restriction.Restriction.AbstractCut.neoschizomers (   self,
  batch = None 
) [inherited]
RE.neoschizomers([batch]) -> list.

return a tuple of all the neoschizomers of RE.
if batch is supplied it is used instead of the default AllEnzymes.

neoschizomer <=> same site, different position of restriction.

Definition at line 523 of file Restriction.py.

00523 
00524     def neoschizomers(self, batch=None):
00525         """RE.neoschizomers([batch]) -> list.
00526 
00527         return a tuple of all the neoschizomers of RE.
00528         if batch is supplied it is used instead of the default AllEnzymes.
00529 
00530         neoschizomer <=> same site, different position of restriction."""
00531         if not batch : batch = AllEnzymes              
00532         r = [x for x in batch if self >> x]
00533         r.sort()
00534         return r

RE.overhang() -> str. type of overhang of the enzyme.,

can be "3' overhang", "5' overhang", "blunt", "unknown"   

Definition at line 1180 of file Restriction.py.

01180 
01181     def overhang(self):
01182         """RE.overhang() -> str. type of overhang of the enzyme.,
01183 
01184         can be "3' overhang", "5' overhang", "blunt", "unknown"   """
01185         return "5' overhang"

def Bio.Restriction.Restriction.AbstractCut.search (   cls,
  dna,
  linear = True 
) [inherited]
RE.search(dna, linear=True) -> list.

return a list of all the site of RE in dna. Compensate for circular
sequences and so on.

dna must be a Bio.Seq.Seq instance or a Bio.Seq.MutableSeq instance.

if linear is False, the restriction sites than span over the boundaries
will be included.

The positions are the first base of the 3' fragment,
i.e. the first base after the position the enzyme will cut. 

Definition at line 442 of file Restriction.py.

00442 
00443     def search(cls, dna, linear=True):
00444         """RE.search(dna, linear=True) -> list.
00445 
00446         return a list of all the site of RE in dna. Compensate for circular
00447         sequences and so on.
00448 
00449         dna must be a Bio.Seq.Seq instance or a Bio.Seq.MutableSeq instance.
00450         
00451         if linear is False, the restriction sites than span over the boundaries
00452         will be included.
00453 
00454         The positions are the first base of the 3' fragment,
00455         i.e. the first base after the position the enzyme will cut. """
00456         #
00457         #   Separating search from _search allow a (very limited) optimisation
00458         #   of the search when using a batch of restriction enzymes.
00459         #   in this case the DNA is tested once by the class which implements
00460         #   the batch instead of being tested by each enzyme single.
00461         #   see RestrictionBatch.search() for example.
00462         #
00463         if isinstance(dna, FormattedSeq):
00464             cls.dna = dna
00465             return cls._search()
00466         else :  
00467             cls.dna = FormattedSeq(dna, linear)
00468             return cls._search()

Here is the caller graph for this function:


Member Data Documentation

Definition at line 1141 of file Restriction.py.


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