Package Bio :: Package Restriction :: Module Restriction :: Class RestrictionBatch
[hide private]
[frames] | no frames]

Class RestrictionBatch

source code

object --+    
         |    
       set --+
             |
            RestrictionBatch
Known Subclasses:

Instance Methods [hide private]
new RestrictionBatch.
__init__(sequence=...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__str__(self)
str(x)
source code
 
__repr__(self)
repr(x)
source code
 
__contains__(self, other)
y in x.
source code
 
__div__(self, other) source code
 
__rdiv__(self, other) source code
enzyme class
get(B, enzyme, add=...)
if add is True and enzyme is not in B add enzyme to B.
source code
RestrictionBatch
lambdasplit(B, func)
the new batch will contains only the enzymes for which func return True.
source code
add a new set of enzyme to B
add_supplier(B, letter)
letter represents the suppliers as defined in the dictionary RestrictionDictionary.suppliers return None.
source code
add a new set of enzyme to B
current_suppliers(B)
return a sorted list of the suppliers which have been used to create the batch.
source code
 
__iadd__(self, other)
b += other -> add other to b, check the type of other.
source code
 
__add__(self, other)
b + other -> new RestrictionBatch.
source code
remove other from B if other is a RestrictionType
remove(B, other)
Safe set.remove method.
source code
add other to B if other is a RestrictionType
add(B, other)
Safe set.add method.
source code
add other to B
add_nocheck(B, other)
don't check type of other.
source code
RestrictionType or raise ValueError
format(B, y)
if y is a RestrictionType return y if y can be evaluated to a RestrictionType return eval(y) raise a Value Error in all other case.
source code
bool
is_restriction(B, y)
True is y or eval(y) is a RestrictionType.
source code
 
split(self, *classes, **bool)
B.split(class, [class.__name__ = True]) -> new RestrictionBatch.
source code
tuple
elements(B)
give all the names of the enzymes in B sorted alphabetically.
source code
list
as_string(B)
return a list of the name of the elements of B.
source code
dict.
search(B, dna) source code

Inherited from set: __and__, __cmp__, __eq__, __ge__, __getattribute__, __gt__, __iand__, __ior__, __isub__, __iter__, __ixor__, __le__, __len__, __lt__, __ne__, __new__, __or__, __rand__, __reduce__, __ror__, __rsub__, __rxor__, __sizeof__, __sub__, __xor__, clear, copy, difference, difference_update, discard, intersection, intersection_update, isdisjoint, issubset, issuperset, pop, symmetric_difference, symmetric_difference_update, union, update

Inherited from object: __delattr__, __format__, __reduce_ex__, __setattr__, __subclasshook__

Class Methods [hide private]
dict
suppl_codes(B)
letter code for the suppliers
source code
letter codes for the suppliers
show_codes(B) source code
Class Variables [hide private]

Inherited from set: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(sequence=...)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Returns: new RestrictionBatch.
Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 
str(x)

Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 
repr(x)

Overrides: object.__repr__
(inherited documentation)

__contains__(self, other)
(In operator)

source code 
y in x.

Overrides: set.__contains__
(inherited documentation)

get(B, enzyme, add=...)

source code 
if add is True and enzyme is not in B add enzyme to B. if add is False (which is the default) only return enzyme. if enzyme is not a RestrictionType or can not be evaluated to a RestrictionType, raise a ValueError.
Returns: enzyme class

add_supplier(B, letter)

source code 
letter represents the suppliers as defined in the dictionary RestrictionDictionary.suppliers return None. raise a KeyError if letter is not a supplier code.
Returns: add a new set of enzyme to B

remove(B, other)

source code 
Safe set.remove method. Verify that other is a RestrictionType or can be evaluated to a RestrictionType. raise a ValueError if other can not be evaluated to a RestrictionType. raise a KeyError if other is not in B.
Returns: remove other from B if other is a RestrictionType
Overrides: set.remove

add(B, other)

source code 
Safe set.add method. Verify that other is a RestrictionType or can be evaluated to a RestrictionType. raise a ValueError if other can not be evaluated to a RestrictionType.
Returns: add other to B if other is a RestrictionType
Overrides: set.add

split(self, *classes, **bool)

source code 

B.split(class, [class.__name__ = True]) -> new RestrictionBatch.

it works but it is slow, so it has really an interest when splitting over multiple conditions.