## org.biojava.bio.dp
Interface StatePath

All Superinterfaces:
  Alignment, Changeable, SymbolList

All Known Implementing Classes:
  SimpleStatePath

    public interface StatePath

extends Alignment

Extends the Alignment interface so that it is explicitly used to represent a state path through an HMM, and the associated emitted sequence and likelihoods.

A state path should have the following structure: <bq> STATES -> list of all states used by the machine
SCORES -> list of step-wise scores for each state (transition + emission)
SEQUENCE -> sequence emitted by the machine </bq> The sequence emitted by the machine will be some function of the sequences that were aligned to the machine, and the state-path taken. Whenever the state used is a non-emitting state, this emitted sequence is a gap. Whenever it is an emission state, it is the symbol matched by that state. This is modeled by the following nesting: <bq>

     SEQUENCE
       -> Gapped view (gap inserted for every position aligned with a dot-state
         -> Sequence emitted by emission states as Alignment
           label_n = input_SymbolList_n
             -> gapped view of SymbolList_n

</bq> A multi-head HMM (2 or more) emits a single sequence that is an alignment of the input sequences with gaps added. In this case, the emitted sequence should be an Alignment object with labels being the input sequences, and the associated SymbolList objects being gapped views. For the sake of least-suprise, single-head HMMs should emit an alignment of one sequence, where the label is the input sequence, and the associated SymbolList is also the input sequence.

I think that this scheme keeps the emitted alignment as close as possible to a sensible path through the sequence coordinate space, while making this gappable adapts this to the same co-ordinate system as the HMM state-path space.

Author:
  Matthew Pocock

Nested Class Summary

Nested classes/interfaces inherited from interface org.biojava.bio.symbol.Alignment
`Alignment.SymbolListIterator`

Field Summary
`static Object` `SCORES` Alignment label for the likelyhood at each step.
`static Object` `SEQUENCE` Alignment label for the emitted sequence.
`static Object` `STATES` Alignment label for the state path.

Fields inherited from interface org.biojava.bio.symbol.Alignment
`CONTENT`

Fields inherited from interface org.biojava.bio.symbol.SymbolList
`EDIT, EMPTY_LIST`

Method Summary
`double` `getScore()` Return the overall score for this state-path and it's emissions.

Methods inherited from interface org.biojava.bio.symbol.Alignment
`getLabels, subAlignment, symbolAt, symbolListForLabel, symbolListIterator`

Methods inherited from interface org.biojava.bio.symbol.SymbolList
`edit, getAlphabet, iterator, length, seqString, subList, subStr, symbolAt, toList`

Methods inherited from interface org.biojava.utils.Changeable
`addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener`

Field Detail

### SEQUENCE

    static final Object SEQUENCE

  Alignment label for the emitted sequence.

### STATES

    static final Object STATES

  Alignment label for the state path.

### SCORES

    static final Object SCORES

  Alignment label for the likelyhood at each step.

Method Detail

### getScore

    double getScore()

  Return the overall score for this state-path and it's emissions.

  Returns:
    the score