## org.biojava.bio.dp
Class ProfileHMM

    java.lang.Object
      |
      +--org.biojava.bio.dp.SimpleMarkovModel
            |
            +--org.biojava.bio.dp.ProfileHMM

public class ProfileHMM
extends SimpleMarkovModel

See Also:
  Serialized Form

Constructor Summary
`ProfileHMM(Alphabet alpha, int columns, DistributionFactory matchFactory, DistributionFactory insertFactory)` Create a new ProfileHMM.

Method Summary
`int` `columns()` Retrieve the number of columns 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, addTransitionListener, containsTransition, createTransition, destroyTransition, emissionAlphabet, getTransitionListeners, getTransitionScore, heads, magicalState, registerWithTrainer, removeState, removeTransitionListener, sampleTransition, setTransitionScore, stateAlphabet, transitionsFrom, transitionsTo`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ProfileHMM

    public ProfileHMM(Alphabet alpha,
                      int columns,
                      DistributionFactory matchFactory,
                      DistributionFactory insertFactory)
               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

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()