Package csb :: Package bio :: Package hmm
[frames] | no frames]

Package hmm

source code

HHpred and Hidden Markov Model APIs.

This package defines the abstractions for working with HHpred's HMMs and hit lists. ProfileHMM is the most important object of this module. It describes a sequence profile hidden Markov model in the way HHpred sees this concept:

ProfileHMM objects provide list-like access to their layers:

>>> hmm.layers[1]
<HMMLayer>    # first layer: layer at master residue=1

Every layer provides dictionary-like access to its states:

>>> layer[States.Match]
<Match State>

and every state provides dictionary-like access to its transitions to other states:

>>> state = hmm.layers[1][States.match]
>>> state.transitions[States.Insertion]
<Transition>       # Match > Insertion
>>> transition.predecessor
<Match State>      # source state
>>> transition.successor
<Insertion State>  # target state

Whether this transition points to a state at the same (i) or the next layer (i+1) depends on the semantics of the source and the target states.

Building HMMs from scratch is supported through a number of append methods at various places:

>>> layer = HMMLayer(...)
>>> layer.append(State(...))
>>> hmm.layers.append(layer)

See HMMLayersCollection, HMMLayer, EmissionTable and TransitionTable for details.

Submodules

Classes
  EVDParameters
  EmissionExistsError
  EmissionProfileSegment
Represents a segment of the Match state emission probabilities of a ProfileHMM.
  EmissionTable
Represents a lookup table of emission probabilities.
  HHpredHit
Represents a single HHsearch hit.
  HHpredHitAlignment
Represents a query-template alignment in an HHpred result.
  HHpredHitList
Represents a collection of HHpredHits.
  HMMArgumentError
  HMMLayer
Provides a dictionary-like catalog of the available states at this layer.
  HMMLayersCollection
Provides consecutive, 1-based access to all of the layers in the profile.
  LayerIndexError
  ProfileHMM
Describes a protein profile Hidden Markov Model.
  ProfileHMMRegion
A shallow proxy referring to a sub-region of a given Profile HMM.
  ProfileHMMSegment
Represents a segment (fragment) of a ProfileHMM.
  ProfileLength
  ScoreUnits
Enumeration of HMM emission and transition score units
  State
Describes a Hidden Markov Model state.
  StateExistsError
  StateFactory
Simplifies the construction of protein profile HMM states.
  StateNotFoundError
  States
Enumeration of HMM state types
  Transition
Describes a Hidden Markov Model transition between two states.
  TransitionExistsError
  TransitionNotFoundError
  TransitionTable
Represents a lookup table of transitions that are possible from within a given state.
  TransitionType
  UnobservableStateError
Variables
  BACKGROUND = [0.0766271787533, 0.018866884242, 0.0539961367125...
  RELATIVE_SA = {'A': 0.02, 'B': 0.14, 'C': 0.33, 'D': 0.55, 'E'...
  __package__ = 'csb.bio.hmm'
Variables Details

BACKGROUND

Value:
[0.0766271787533,
 0.018866884242,
 0.0539961367125,
 0.0597880098807,
 0.0349394328427,
 0.0754152449825,
 0.0368293564941,
 0.0504850486006,
...

RELATIVE_SA

Value:
{'A': 0.02, 'B': 0.14, 'C': 0.33, 'D': 0.55, 'E': 1.0}