Package Bio :: Module Seq :: Class MutableSeq
[hide private]
[frames] | no frames]

Class MutableSeq

source code

Instance Methods [hide private]
 
__init__(self, data, alphabet=Alphabet()) source code
 
__repr__(self)
Returns a (truncated) representation of the sequence for debugging.
source code
 
__str__(self)
Returns the full sequence as a python string.
source code
 
__cmp__(self, other) source code
 
__len__(self) source code
 
__getitem__(self, index) source code
 
__setitem__(self, index, value) source code
 
__delitem__(self, index) source code
 
__add__(self, other) source code
 
__radd__(self, other) source code
 
append(self, c) source code
 
insert(self, i, c) source code
 
pop(self, i=-1) source code
 
remove(self, item) source code
 
count(self, sub, start=None, end=None)
Count method, like that of a python string.
source code
 
index(self, item) source code
 
reverse(self)
Modify the MutableSequence to reverse itself.
source code
 
complement(self)
Modify the MutableSequence to take on its complement.
source code
 
reverse_complement(self)
Modify the MutableSequence to take on its reverse complement.
source code
 
extend(self, other) source code
 
tostring(self)
Returns the full sequence as a python string.
source code
 
toseq(self)
Returns the full sequence as a new immutable Seq object
source code
Method Details [hide private]

__str__(self)
(Informal representation operator)

source code 

Returns the full sequence as a python string.

Note that Biopython 1.44 and earlier would give a truncated version of repr(my_seq) for str(my_seq). If you are writing code which need to be backwards compatible with old Biopython, you should continue to use my_seq.tostring() rather than str(my_seq).

count(self, sub, start=None, end=None)

source code 

Count method, like that of a python string.

Return an integer, the number of occurrences of substring argument sub in the (sub)sequence given by [start:end]. Optional arguments start and end are interpreted as in slice notation.

sub - a string or another Seq object to look for start - optional integer, slice start end - optional integer, slice end

e.g. from Bio.Seq import MutableSeq my_mseq = MutableSeq("AAAATGA") print my_mseq.count("A") print my_mseq.count("ATG") print my_mseq.count(Seq("AT")) print my_mseq.count("AT", 2, -1)

reverse(self)

source code 

Modify the MutableSequence to reverse itself.

No return value

complement(self)

source code 

Modify the MutableSequence to take on its complement.

No return value

reverse_complement(self)

source code 

Modify the MutableSequence to take on its reverse complement.

No return value

tostring(self)

source code 

Returns the full sequence as a python string.

Although not formally deprecated, you are now encouraged to use str(my_seq) instead of my_seq.tostring().