Package org.biojava.bio.dp.onehead
Class SingleDP
java.lang.Object
org.biojava.bio.dp.DP
org.biojava.bio.dp.onehead.SingleDP
- All Implemented Interfaces:
Serializable
An implementation of DP that aligns a single sequence against a single model.
- Author:
- Matthew Pocock, Thomas Down, Samiul Hasan, Lukas Kall
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.biojava.bio.dp.DP
DP.ReverseIterator
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected double
double
backward
(SymbolList[] seq, ScoreType scoreType) protected void
backward_initialize
(DPCursor dpCursor, ScoreType scoreType) protected void
backward_recurse
(DPCursor dpCursor, ScoreType scoreType) protected double
backward_termination
(DPCursor dpCursor, ScoreType scoreType) backwardMatrix
(SymbolList[] seq, DPMatrix matrix, ScoreType scoreType) backwardMatrix
(SymbolList[] seq, ScoreType scoreType) protected double
double
forward
(SymbolList[] seq, ScoreType scoreType) protected void
forward_initialize
(DPCursor dpCursor, ScoreType scoreType) forwardMatrix
(SymbolList[] seq, DPMatrix matrix, ScoreType scoreType) forwardMatrix
(SymbolList[] seq, ScoreType scoreType) double[]
getEmission
(Symbol sym, ScoreType scoreType) This method is public for the benefit of training algorithms, and in the future we should look at a better way of exposing the emissions cache.void
update()
viterbi
(SymbolList[] symList, 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
-
Field Details
-
emissionsProb
-
emissionsOdds
-
emissionsNull
-
-
Constructor Details
-
SingleDP
public SingleDP(MarkovModel model) throws IllegalSymbolException, IllegalTransitionException, BioException
-
-
Method Details
-
update
-
getEmission
This method is public for the benefit of training algorithms, and in the future we should look at a better way of exposing the emissions cache.- Throws:
IllegalSymbolException
-
forward
public double forward(SymbolList[] seq, ScoreType scoreType) throws IllegalSymbolException, IllegalAlphabetException, IllegalSymbolException - Specified by:
forward
in classDP
- Throws:
IllegalSymbolException
IllegalAlphabetException
-
backward
public double backward(SymbolList[] seq, ScoreType scoreType) throws IllegalSymbolException, IllegalAlphabetException, IllegalSymbolException - Specified by:
backward
in classDP
- Throws:
IllegalSymbolException
IllegalAlphabetException
-
forwardMatrix
public DPMatrix forwardMatrix(SymbolList[] seq, ScoreType scoreType) throws IllegalSymbolException, IllegalAlphabetException, IllegalSymbolException - Specified by:
forwardMatrix
in classDP
- Throws:
IllegalSymbolException
IllegalAlphabetException
-
backwardMatrix
public DPMatrix backwardMatrix(SymbolList[] seq, ScoreType scoreType) throws IllegalSymbolException, IllegalAlphabetException, IllegalSymbolException - Specified by:
backwardMatrix
in classDP
- Throws:
IllegalSymbolException
IllegalAlphabetException
-
forwardMatrix
public DPMatrix forwardMatrix(SymbolList[] seq, DPMatrix matrix, ScoreType scoreType) throws IllegalArgumentException, IllegalSymbolException, IllegalAlphabetException, IllegalSymbolException - Specified by:
forwardMatrix
in classDP
- Throws:
IllegalArgumentException
IllegalSymbolException
IllegalAlphabetException
-
backwardMatrix
public DPMatrix backwardMatrix(SymbolList[] seq, DPMatrix matrix, ScoreType scoreType) throws IllegalArgumentException, IllegalSymbolException, IllegalAlphabetException, IllegalSymbolException - Specified by:
backwardMatrix
in classDP
- Throws:
IllegalArgumentException
IllegalSymbolException
IllegalAlphabetException
-
forward
- Throws:
IllegalSymbolException
-
backward
- Throws:
IllegalSymbolException
-
forward_initialize
protected void forward_initialize(DPCursor dpCursor, ScoreType scoreType) throws IllegalSymbolException - Throws:
IllegalSymbolException
-
backward_initialize
protected void backward_initialize(DPCursor dpCursor, ScoreType scoreType) throws IllegalSymbolException - Throws:
IllegalSymbolException
-
backward_recurse
protected void backward_recurse(DPCursor dpCursor, ScoreType scoreType) throws IllegalSymbolException - Throws:
IllegalSymbolException
-
backward_termination
protected double backward_termination(DPCursor dpCursor, ScoreType scoreType) throws IllegalSymbolException - Throws:
IllegalSymbolException
-
viterbi
- Specified by:
viterbi
in classDP
- Throws:
IllegalSymbolException
-