org.biojava.bio.dp
Class ProfileHMM

java.lang.Object
  extended by org.biojava.utils.AbstractChangeable
      extended by org.biojava.bio.dp.SimpleMarkovModel
          extended by org.biojava.bio.dp.ProfileHMM
All Implemented Interfaces:
java.io.Serializable, MarkovModel, Changeable
Direct Known Subclasses:
HmmerProfileHMM

public class ProfileHMM
extends SimpleMarkovModel

Author:
Matthew Pocock, Lachlan Coin
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.biojava.bio.dp.SimpleMarkovModel
serialVersionUID
 
Fields inherited from interface org.biojava.bio.dp.MarkovModel
ARCHITECTURE, PARAMETER
 
Constructor Summary
ProfileHMM(Alphabet alpha, int columns, DistributionFactory matchFactory, DistributionFactory insertFactory)
          Deprecated.  
ProfileHMM(Alphabet alpha, int columns, DistributionFactory matchFactory, DistributionFactory insertFactory, java.lang.String name)
          Create a new ProfileHMM.
 
Method Summary
 int columns()
          Retrieve the number of columns in the model.
protected  void connectModel()
          This is called by constructor in setting up the allowed transitions in the model
 DotState getDelete(int indx)
          Retrieves the delete state for column indx.
 EmissionState getInsert(int indx)
          Retrieves the insert state at column indx.
 EmissionState getMatch(int indx)
          Retrieve the match state at column indx.
 
Methods inherited from class org.biojava.bio.dp.SimpleMarkovModel
addState, advance, containsTransition, createTransition, destroyTransition, emissionAlphabet, getChangeSupport, getWeights, heads, magicalState, removeState, setWeights, stateAlphabet, toString, transitionsFrom, transitionsTo
 
Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
 

Constructor Detail

ProfileHMM

public ProfileHMM(Alphabet alpha,
                  int columns,
                  DistributionFactory matchFactory,
                  DistributionFactory insertFactory)
           throws IllegalSymbolException,
                  IllegalTransitionException,
                  IllegalAlphabetException
Deprecated. 

Throws:
IllegalSymbolException
IllegalTransitionException
IllegalAlphabetException

ProfileHMM

public ProfileHMM(Alphabet alpha,
                  int columns,
                  DistributionFactory matchFactory,
                  DistributionFactory insertFactory,
                  java.lang.String name)
           throws IllegalSymbolException,
                  IllegalTransitionException,
                  IllegalAlphabetException
Create a new ProfileHMM.

The profile will be over the Alphabet alpha. It will have 'columns' match states, 'columns' delete states and 'columns'+1 insert states. The match states will be created by matchFactory, and the insert states will be created by insertFactory. This gives you great freedom for changing how the states are implemented. For example, insertFactory may always return views onto a single underlying probability distribution in which case all insert states will emit the same type of stuff - or it may create an individual state for each insert state, in which case each insert can be a different type of thing. You could make the insert state a view onto your null model, or onto a protein-specific distribution.

Parameters:
alpha - the Alphabet that the profile hmm will emit
columns - the number of match states
matchFactory - the StateFactory to use for creating the match states
insertFactory - the stateFactory to use for creating the insert states
Throws:
IllegalSymbolException
IllegalTransitionException
IllegalAlphabetException
Method Detail

columns

public int columns()
Retrieve the number of columns in the model.

Returns:
the number of columns

getMatch

public EmissionState getMatch(int indx)
                       throws java.lang.IndexOutOfBoundsException
Retrieve the match state at column indx.

The first match state is at index 1, and the last match state is at column columns(). The states at index 0 and columns()+1 are both the magical state. This is so that the whole model backbone can be addressed without writing lots of special-case code.

Parameters:
indx - the index of the column to retrieve the match state for
Returns:
the match state for column indx
Throws:
java.lang.IndexOutOfBoundsException - if indx is negative or above columns()+1

getInsert

public EmissionState getInsert(int indx)
                        throws java.lang.IndexOutOfBoundsException
Retrieves the insert state at column indx.

Insert_0 is the insert that is accessible directly from the magical state. Insert_1..columns() are 'above' each propper match state. There is no insert state above the magical state at the end of the model, as insert_columns already models trailing inserts.

Parameters:
indx - the index of the column to retrieve the insert state for
Returns:
the insert state for column indx
Throws:
java.lang.IndexOutOfBoundsException - if indx is negative or above columns()

getDelete

public DotState getDelete(int indx)
                   throws java.lang.IndexOutOfBoundsException
Retrieves the delete state for column indx.

Delete states are 'above' the match state that they delete. There is no delete state for the magical state at either the beginning or end of the model, so the delete state indx can range within (1..columns()).

Parameters:
indx - the index of the column to retrieve the insert state for
Returns:
the insert state for column indx
Throws:
java.lang.IndexOutOfBoundsException - if indx is negative or above columns()

connectModel

protected void connectModel()
                     throws ChangeVetoException,
                            IllegalSymbolException,
                            IllegalTransitionException,
                            IllegalAlphabetException
This is called by constructor in setting up the allowed transitions in the model

Throws:
ChangeVetoException
IllegalSymbolException
IllegalTransitionException
IllegalAlphabetException