## org.biojava.bio.dp.twohead
Class PairwiseDP

    java.lang.Object
      org.biojava.bio.dp.DP
          org.biojava.bio.dp.twohead.PairwiseDP

All Implemented Interfaces:
  Serializable

    public class PairwiseDP

extends DP
implements Serializable

Algorithms for dynamic programming (alignments) between pairs of SymbolLists. Based on a single-head DP implementation by Matt Pocock.

Author:
  Thomas Down, Matthew Pocock
See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class org.biojava.bio.dp.DP
`DP.ReverseIterator`

Constructor Summary
`PairwiseDP(MarkovModel mm, CellCalculatorFactoryMaker ccfm)`

Method Summary
`double` `backward(SymbolList[] seqs, ScoreType scoreType)`
`DPMatrix` `backwardMatrix(SymbolList[] seqs, DPMatrix d, ScoreType scoreType)`
`DPMatrix` `backwardMatrix(SymbolList[] seqs, ScoreType scoreType)`
`double` `forward(SymbolList[] seqs, ScoreType scoreType)`
`DPMatrix` `forwardMatrix(SymbolList[] seqs, DPMatrix d, ScoreType scoreType)`
`DPMatrix` `forwardMatrix(SymbolList[] seqs, ScoreType scoreType)`
`void` `update()`
`StatePath` `viterbi(SymbolList[] seqs, ScoreType scoreType)`

Methods inherited from class org.biojava.bio.dp.DP
`backwardTransitions, backwardTransitionScores, flatView, forwardsBackwards, forwardTransitions, forwardTransitionScores, generate, getBackwardTransitions, getBackwardTransitionScores, getDotStatesIndex, getForwardTransitions, getForwardTransitionScores, getModel, getStates, lockModel, scoreWeightMatrix, scoreWeightMatrix, setModel, stateList, unlockModel`

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

Constructor Detail

### PairwiseDP

    public PairwiseDP(MarkovModel mm,
                      CellCalculatorFactoryMaker ccfm)
               throws IllegalSymbolException,
                      IllegalTransitionException,
                      BioException

Throws:
  `IllegalSymbolException`
  `IllegalTransitionException`
  `BioException`

Method Detail

### update

    public void update()

  Overrides:
    `update` in class `DP`

### backward

    public double backward(SymbolList[] seqs,
                           ScoreType scoreType)
                    throws IllegalSymbolException,
                           IllegalAlphabetException,
                           IllegalTransitionException

  Specified by:
    `backward` in class `DP`
  Throws:
    `IllegalSymbolException`
    `IllegalAlphabetException`
    `IllegalTransitionException`

### backwardMatrix

    public DPMatrix backwardMatrix(SymbolList[] seqs,
                                   ScoreType scoreType)
                            throws IllegalSymbolException,
                                   IllegalAlphabetException,
                                   IllegalTransitionException

  Specified by:
    `backwardMatrix` in class `DP`
  Throws:
    `IllegalSymbolException`
    `IllegalAlphabetException`
    `IllegalTransitionException`

### backwardMatrix

    public DPMatrix backwardMatrix(SymbolList[] seqs,
                                   DPMatrix d,
                                   ScoreType scoreType)
                            throws IllegalSymbolException,
                                   IllegalAlphabetException,
                                   IllegalTransitionException

  Specified by:
    `backwardMatrix` in class `DP`
  Throws:
    `IllegalSymbolException`
    `IllegalAlphabetException`
    `IllegalTransitionException`

### forward

    public double forward(SymbolList[] seqs,
                          ScoreType scoreType)
                   throws IllegalSymbolException,
                          IllegalAlphabetException,
                          IllegalTransitionException

  Specified by:
    `forward` in class `DP`
  Throws:
    `IllegalSymbolException`
    `IllegalAlphabetException`
    `IllegalTransitionException`

### forwardMatrix

    public DPMatrix forwardMatrix(SymbolList[] seqs,
                                  ScoreType scoreType)
                           throws IllegalSymbolException,
                                  IllegalAlphabetException,
                                  IllegalTransitionException

  Specified by:
    `forwardMatrix` in class `DP`
  Throws:
    `IllegalSymbolException`
    `IllegalAlphabetException`
    `IllegalTransitionException`

### forwardMatrix

    public DPMatrix forwardMatrix(SymbolList[] seqs,
                                  DPMatrix d,
                                  ScoreType scoreType)
                           throws IllegalSymbolException,
                                  IllegalAlphabetException,
                                  IllegalTransitionException

  Specified by:
    `forwardMatrix` in class `DP`
  Throws:
    `IllegalSymbolException`
    `IllegalAlphabetException`
    `IllegalTransitionException`

### viterbi

    public StatePath viterbi(SymbolList[] seqs,
                             ScoreType scoreType)
                      throws IllegalSymbolException,
                             IllegalAlphabetException,
                             IllegalTransitionException

  Specified by:
    `viterbi` in class `DP`
  Throws:
    `IllegalSymbolException`
    `IllegalAlphabetException`
    `IllegalTransitionException`