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

Class FormattedSeq

source code

object --+
         |
        FormattedSeq

FormattedSeq(seq, [linear=True])-> new FormattedSeq.

Translate a Bio.Seq into a formatted sequence to be used with Restriction.

Roughly: remove anything which is not IUPAC alphabet and then add a space
in front of the sequence to get a biological index instead of a python index (i.e. index of the first base is 1 not 0).

Retains information about the shape of the molecule linear (default) or circular. Restriction sites are search over the edges of circular sequence.

Instance Methods [hide private]
 
__init__(self, seq, linear=True)
FormattedSeq(seq, [linear=True])-> new FormattedSeq.
source code
 
__len__(self) source code
 
__repr__(self)
repr(x)
source code
 
__eq__(self, other) source code
 
circularise(self)
Circularise sequence in place.
source code
 
linearise(self)
Linearise sequence in place.
source code
 
to_linear(self)
Make a new instance of sequence as linear.
source code
 
to_circular(self)
Make a new instance of sequence as circular.
source code
 
is_linear(self)
Return if sequence is linear (True) or circular (False).
source code
 
finditer(self, pattern, size)
Return a list of a given pattern which occurs in the sequence.
source code
 
__getitem__(self, i) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, seq, linear=True)
(Constructor)

source code 

FormattedSeq(seq, [linear=True])-> new FormattedSeq.

seq is either a Bio.Seq, Bio.MutableSeq or a FormattedSeq. if seq is a FormattedSeq, linear will have no effect on the shape of the sequence.

Overrides: object.__init__

__repr__(self)
(Representation operator)

source code 
repr(x)
Overrides: object.__repr__
(inherited documentation)

finditer(self, pattern, size)

source code 

Return a list of a given pattern which occurs in the sequence.

The list is made of tuple (location, pattern.group). The latter is used with non palindromic sites. Pattern is the regular expression pattern corresponding to the enzyme restriction site. Size is the size of the restriction enzyme recognition-site size.