Package csb :: Package bio :: Package sequence :: Class Sequence
[frames] | no frames]

Class Sequence

source code

      object --+    
               |    
AbstractSequence --+
                   |
                  Sequence

High-performance sequence object. The actual sequence is stored internally as a string. The indexer acts as a residue factory, which creates a new ResidueInfo instance each time.


Note: This class was created with parsing large volumes of data in mind. This comes at the expense of degraded performance of the sequence indexer.

Nested Classes

Inherited from AbstractSequence: __metaclass__

Instance Methods
 
__init__(self, id, header, residues, type=Unknown)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
AbstractSequence
extract(self, positions)
Extract a subsequence, defined by a list of 1-based positions.
source code
AbstractSequence
strip(self)
Remove all gaps and insertions from the sequence.
source code
AbstractSequence
subregion(self, start, end)
Extract a subsequence, defined by [start, end].
source code

Inherited from AbstractSequence: __getitem__, __iter__, __len__, __repr__, __str__, dump

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

Class Variables
  __abstractmethods__ = frozenset([])

Inherited from AbstractSequence: DELIMITER

Properties
str sequence
The actual sequence

Inherited from AbstractSequence: alphabet, header, id, length, residues, type

Inherited from object: __class__

Method Details

__init__(self, id, header, residues, type=Unknown)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • id (str) - FASTA ID of this sequence (e.g. accession number)
  • header (str) - FASTA sequence header
  • residues (str) - sequence string
  • type (EnumItem) - a SequenceTypes member (defaults to protein)
Overrides: object.__init__
(inherited documentation)

extract(self, positions)

source code 

Extract a subsequence, defined by a list of 1-based positions.

Parameters:
  • positions - positions to extract
Returns: AbstractSequence
a new sequence
Raises:
Overrides: AbstractSequence.extract
(inherited documentation)

strip(self)

source code 

Remove all gaps and insertions from the sequence.

Returns: AbstractSequence
a new sequence instance, containing no gaps
Overrides: AbstractSequence.strip
(inherited documentation)

subregion(self, start, end)

source code 

Extract a subsequence, defined by [start, end]. The start and end positions are 1-based, inclusive.

Parameters:
  • start - start position
  • end - end position
Returns: AbstractSequence
a new sequence
Raises:
Overrides: AbstractSequence.subregion
(inherited documentation)

Property Details

sequence

The actual sequence

Get Method:
unreachable.sequence(self)
Type:
str