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

Class RestrictionBatch

source code

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

Class for operations on more than one enzyme.
Instance Methods [hide private]
new empty set object
__init__(self, first=(), suppliers=())
Initialize empty RB or pre-fill with enzymes (from supplier).
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)
Override '/' operator to use as search method.
source code
 
__rdiv__(self, other)
Override division with reversed operands to use as search method.
source code
 
__truediv__(self, other)
Override Python 3 division operator to use as search method.
source code
 
__rtruediv__(self, other)
As __truediv___, with reversed operands.
source code
 
get(self, enzyme, add=False)
Check if enzyme is in batch and return it.
source code
 
lambdasplit(self, func)
Filter enzymes in batch with supplied function.
source code
 
add_supplier(self, letter)
Add all enzymes from a given supplier to batch.
source code
 
current_suppliers(self)
List the current suppliers for the restriction batch.
source code
 
__iadd__(self, other)
Override '+=' for use with sets.
source code
 
__add__(self, other)
Overide '+' for use with sets.
source code
 
remove(self, other)
Remove enzyme from restriction batch.
source code
 
add(self, other)
Add a restriction enzyme to the restriction batch.
source code
 
add_nocheck(self, other)
Add restriction enzyme to batch without checking its type.
source code
 
format(self, y)
Evaluate enzyme (name) and return it (as RestrictionType).
source code
 
is_restriction(self, y)
Return if enzyme (name) is a known enzyme.
source code
 
split(self, *classes, **bool)
Extract enzymes of a certain class and put in new RestrictionBatch.
source code
 
elements(self)
List the enzymes of the RestrictionBatch as list of strings.
source code
 
as_string(self)
List the names of the enzymes of the RestrictionBatch.
source code
 
search(self, dna, linear=True)
Return a dic of cutting sites in the seq for the batch enzymes.
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]
 
suppl_codes(cls)
Return a dicionary with supplier codes.
source code
 
show_codes(cls)
Print a list of supplier codes.
source code
Class Variables [hide private]

Inherited from set: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, first=(), suppliers=())
(Constructor)

source code 
Initialize empty RB or pre-fill with enzymes (from supplier).
Returns: new empty set object
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)

__truediv__(self, other)

source code 

Override Python 3 division operator to use as search method.

Like __div__.

__rtruediv__(self, other)

source code 

As __truediv___, with reversed operands.

Like __rdiv__.

get(self, enzyme, add=False)

source code 

Check if enzyme is in batch and return it.

If add is True and enzyme is not in batch add enzyme to batch. 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.

lambdasplit(self, func)

source code 

Filter enzymes in batch with supplied function.

The new batch will contain only the enzymes for which func return True.

add_supplier(self, letter)

source code 

Add all enzymes from a given supplier to batch.

letter represents the suppliers as defined in the dictionary RestrictionDictionary.suppliers Returns None. Raise a KeyError if letter is not a supplier code.

current_suppliers(self)

source code 

List the current suppliers for the restriction batch.

Return a sorted list of the suppliers which have been used to create the batch.

__iadd__(self, other)

source code 

Override '+=' for use with sets.

b += other -> add other to b, check the type of other.

__add__(self, other)
(Addition operator)

source code 

Overide '+' for use with sets.

b + other -> new RestrictionBatch.

remove(self, other)

source code 

Remove enzyme from restriction batch.

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.

Overrides: set.remove

add(self, other)

source code 

Add a restriction enzyme to the restriction batch.

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.

Overrides: set.add

format(self, y)

source code 

Evaluate enzyme (name) and return it (as RestrictionType).

If y is a RestrictionType return y. If y can be evaluated to a RestrictionType return eval(y). Raise a ValueError in all other case.

is_restriction(self, y)

source code 

Return if enzyme (name) is a known enzyme.

True if y or eval(y) is a RestrictionType.

split(self, *classes, **bool)

source code 

Extract enzymes of a certain class and put in new RestrictionBatch.

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.

elements(self)

source code 

List the enzymes of the RestrictionBatch as list of strings.

Give all the names of the enzymes in B sorted alphabetically.

as_string(self)

source code 

List the names of the enzymes of the RestrictionBatch.

Return a list of the name of the elements of the batch.

suppl_codes(cls)
Class Method

source code 

Return a dicionary with supplier codes.

Letter code for the suppliers.