Trees | Index | Help |
---|
Package Bio :: Package HMM :: Module MarkovModel :: Class HiddenMarkovModel |
|
Method Summary | |
---|---|
Initialize a Markov Model. | |
Get the starting default emmissions for each sequence. | |
Get the default transitions for the model. | |
Get all transitions which can happen from the given state. | |
Calculate the most probable state path using the Viterbi algorithm. |
Method Details |
---|
__init__(self,
transition_prob,
emission_prob,
transition_pseudo,
emission_pseudo)
|
get_blank_emissions(self)Get the starting default emmissions for each sequence. This returns a dictionary of the default emmissions for each letter. The dictionary is structured with keys as (seq_letter, emmission_letter) and values as the starting number of emmissions. |
get_blank_transitions(self)Get the default transitions for the model. Returns a dictionary of all of the default transitions between any two letters in the sequence alphabet. The dictionary is structured with keys as (letter1, letter2) and values as the starting number of transitions. |
transitions_from(self, state_letter)Get all transitions which can happen from the given state. This returns all letters which the given state_letter is allowed to transition to. An empty list is returned if no letters are possible. |
viterbi(self, sequence, state_alphabet)Calculate the most probable state path using the Viterbi algorithm. This implements the Viterbi algorithm (see pgs 55-57 in Durbin et al for a full explanation -- this is where I took my implementation ideas from), to allow decoding of the state path, given a sequence of emissions. Arguments: o sequence -- A Seq object with the emission sequence that we want to decode. o state_alphabet -- The alphabet of the possible state sequences that can be generated. |
Trees | Index | Help |
---|
Generated by Epydoc 2.1 on Thu Mar 31 20:15:37 2005 | http://epydoc.sf.net |