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

Class RestrictionBatch

source code

  object --+        
           |        
sets.BaseSet --+    
               |    
        sets.Set --+
                   |
                  RestrictionBatch

Instance Methods [hide private]
new RestrictionBatch.
__init__(sequence=...)
Construct a set from an optional iterable.
source code
 
__str__(self)
Return string representation of a set.
source code
 
__repr__(self)
Return string representation of a set.
source code
 
__contains__(self, other)
Report whether an element is a member of a set.
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 sets.Set: __as_immutable__, __as_temporarily_immutable__, __getstate__, __hash__, __iand__, __ior__, __isub__, __ixor__, __setstate__, clear, difference_update, discard, intersection_update, pop, symmetric_difference_update, union_update, update

Inherited from sets.BaseSet: __and__, __cmp__, __copy__, __deepcopy__, __eq__, __ge__, __gt__, __iter__, __le__, __len__, __lt__, __ne__, __or__, __sub__, __xor__, copy, difference, intersection, issubset, issuperset, symmetric_difference, union

Inherited from sets.BaseSet (private): _binary_sanity_check, _compute_hash, _repr, _update

Inherited from object: __delattr__, __getattribute__, __new__, __reduce__, __reduce_ex__, __setattr__

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

Inherited from object: __class__

Method Details [hide private]

__init__(sequence=...)
(Constructor)

source code 

Construct a set from an optional iterable.

Returns: new RestrictionBatch.
Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 

Return string representation of a set.

This looks like 'Set([<list of elements>])'.

Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

Return string representation of a set.

This looks like 'Set([<list of elements>])'.

Overrides: object.__repr__
(inherited documentation)

__contains__(self, other)
(In operator)

source code 

Report whether an element is a member of a set.

(Called in response to the expression `element in self'.)

Overrides: sets.BaseSet.__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: sets.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: sets.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.