Package csb :: Package bio :: Package sequence :: Module alignment :: Class SimilarityMatrix

[frames] | no frames]

# Class SimilarityMatrix

source code

               object --+
                        |
    AbstractScoringMatrix --+
                            |
                           SimilarityMatrix

Similarity scoring matrix.

Nested Classes
Inherited from `AbstractScoringMatrix`: `__metaclass__`

Instance Methods

__init__(self, matrix=`{``'``*``'``:` `{``'``*``'``:` 1.0`,` `'``A``'``:` -4.0`,` `'``B``'``:` -4.0`,` `'``C``'``:` -4.0`,` `'``D``'``:` -4.0`,` `'``...`) x.__init__(...) initializes x; see help(type(x)) for signature | source code

float

score(self, x, y) Return the pairwise score of residues `x` and `y`. | source code

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

Static Methods

SimilarityMatrix

parse(string) Parse a standard scoring matrix file, where the first row and column are residue labels. | source code

Class Variables
| BLOSUM62 = ``{``'``*``'``:` `{``'``*``'``:` 1.0`,` `'``A``'``:` -4.0`,` `'``B``'``:` -4.0`,` `'``C``'``:` -4.0`,` `'``...``
| __abstractmethods__ = ``frozenset([``])``

Properties
Inherited from `object`: `__class__`

Method Details

### __init__(self, matrix=`{``'``*``'``:` `{``'``*``'``:` 1.0`,` `'``A``'``:` -4.0`,` `'``B``'``:` -4.0`,` `'``C``'``:` -4.0`,` `'``D``'``:` -4.0`,` `'``...`)
(Constructor)

source code

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

Parameters:
  - `matrix`
Overrides: object.__init__
  (inherited documentation)

### parse(string)
Static Method

source code

Parse a standard scoring matrix file, where the first row and column are residue labels.

Parameters:
  - `string` (str) - scoring matrix string
Returns: SimilarityMatrix

### score(self, x, y)

source code

Return the pairwise score of residues `x` and `y`. `x` and `y` must be comparable (e.g. implement __eq__ and __hash__).

Parameters:
  - `x` - first residue
  - `y` - second residue
Returns: float
Raises:
  - `ResidueNotFoundError` - if `x` or `y` cannot be handled by this scoring matrix
Overrides: AbstractScoringMatrix.score
  (inherited documentation)

Class Variable Details

### BLOSUM62

Value:

      {'*': {'*': 1.0,
             'A': -4.0,
             'B': -4.0,
             'C': -4.0,
             'D': -4.0,
             'E': -4.0,
             'F': -4.0,
             'G': -4.0,
      ...