Package csb :: Package bio :: Package hmm :: Class EmissionTable

[frames] | no frames]

# Class EmissionTable

source code

                  object --+
                           |
        core.AbstractIndexer --+
                               |
    core.BaseDictionaryContainer --+
                                   |
            core.DictionaryContainer --+
                                       |
                                      EmissionTable

Represents a lookup table of emission probabilities. Provides dictionary-like access:

    >>> state.emission[ProteinAlphabet.ALA]
    emission probability for ALA

Instance Methods

__init__(self, emission=None, restrict=`frozenset([`STOP`,` GAP`,` INSERTION`,` ALA`,` ASX`,` CYS`,` ASP`,` GLU`,` PHE`,``...`) x.__init__(...) initializes x; see help(type(x)) for signature | source code

append(self, residue, probability) Append a new emission probability to the table. | source code

set(self, table) Set the emission table using the dictionary provided in the argument. | source code

update(self, residue, probability) Update the emission `probability` of a given emission `residue`. | source code

Inherited from `core.BaseDictionaryContainer`: `__bool__`, `__contains__`, `__getitem__`, `__iter__`, `__len__`, `__nonzero__`, `__repr__`, `keys` Inherited from `object`: `__delattr__`, `__format__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`, `__sizeof__`, `__str__`, `__subclasshook__`

Properties
Inherited from `core.BaseDictionaryContainer`: `length` Inherited from `object`: `__class__`

Method Details

### __init__(self, emission=None, restrict=`frozenset([`STOP`,` GAP`,` INSERTION`,` ALA`,` ASX`,` CYS`,` ASP`,` GLU`,` PHE`,``...`)
(Constructor)

source code

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

Parameters:
  - `emission` (dict) - an initialization dictionary of emission probabilities
  - `restrict` (list) - a list of residue types allowed for this emission table. Defaults to the members of csb.bio.sequence.ProteinAlphabet
Overrides: object.__init__
  (inherited documentation)

### append(self, residue, probability)

source code

Append a new emission probability to the table.

Parameters:
  - `residue` (csb.core.EnumItem) - residue name (type) - a member of csb.bio.sequence.ProteinAlphabet
  - `probability` (float) - emission score
Raises:
  - `EmissionExistsError` - if residue is already defined
Overrides: core.DictionaryContainer.append

### set(self, table)

source code

Set the emission table using the dictionary provided in the argument.

Parameters:
  - `table` (dict) - the new emission table

### update(self, residue, probability)

source code

Update the emission `probability` of a given emission `residue`.

Parameters:
  - `residue` (csb.core.EnumItem) - name (type) of the residue to be updated
  - `probability` (float) - new emission score