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
public class SingleDP extends DP implements 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:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.biojava.bio.dp.DP
DP.ReverseIterator
-
-
Field Summary
Fields Modifier and Type Field Description protected HashMapemissionsNullprotected HashMapemissionsOddsprotected HashMapemissionsProb
-
Constructor Summary
Constructors Constructor Description SingleDP(MarkovModel model)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected doublebackward(DPCursor dpCursor, ScoreType scoreType)doublebackward(SymbolList[] seq, ScoreType scoreType)protected voidbackward_initialize(DPCursor dpCursor, ScoreType scoreType)protected voidbackward_recurse(DPCursor dpCursor, ScoreType scoreType)protected doublebackward_termination(DPCursor dpCursor, ScoreType scoreType)DPMatrixbackwardMatrix(SymbolList[] seq, DPMatrix matrix, ScoreType scoreType)DPMatrixbackwardMatrix(SymbolList[] seq, ScoreType scoreType)protected doubleforward(DPCursor dpCursor, ScoreType scoreType)doubleforward(SymbolList[] seq, ScoreType scoreType)protected voidforward_initialize(DPCursor dpCursor, ScoreType scoreType)DPMatrixforwardMatrix(SymbolList[] seq, DPMatrix matrix, ScoreType scoreType)DPMatrixforwardMatrix(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.voidupdate()StatePathviterbi(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 Detail
-
emissionsProb
protected final HashMap emissionsProb
-
emissionsOdds
protected final HashMap emissionsOdds
-
emissionsNull
protected final HashMap emissionsNull
-
-
Constructor Detail
-
SingleDP
public SingleDP(MarkovModel model) throws IllegalSymbolException, IllegalTransitionException, BioException
-
-
Method Detail
-
getEmission
public double[] getEmission(Symbol sym, ScoreType scoreType) throws IllegalSymbolException
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:
forwardin classDP- Throws:
IllegalSymbolExceptionIllegalAlphabetException
-
backward
public double backward(SymbolList[] seq, ScoreType scoreType) throws IllegalSymbolException, IllegalAlphabetException, IllegalSymbolException
- Specified by:
backwardin classDP- Throws:
IllegalSymbolExceptionIllegalAlphabetException
-
forwardMatrix
public DPMatrix forwardMatrix(SymbolList[] seq, ScoreType scoreType) throws IllegalSymbolException, IllegalAlphabetException, IllegalSymbolException
- Specified by:
forwardMatrixin classDP- Throws:
IllegalSymbolExceptionIllegalAlphabetException
-
backwardMatrix
public DPMatrix backwardMatrix(SymbolList[] seq, ScoreType scoreType) throws IllegalSymbolException, IllegalAlphabetException, IllegalSymbolException
- Specified by:
backwardMatrixin classDP- Throws:
IllegalSymbolExceptionIllegalAlphabetException
-
forwardMatrix
public DPMatrix forwardMatrix(SymbolList[] seq, DPMatrix matrix, ScoreType scoreType) throws IllegalArgumentException, IllegalSymbolException, IllegalAlphabetException, IllegalSymbolException
- Specified by:
forwardMatrixin classDP- Throws:
IllegalArgumentExceptionIllegalSymbolExceptionIllegalAlphabetException
-
backwardMatrix
public DPMatrix backwardMatrix(SymbolList[] seq, DPMatrix matrix, ScoreType scoreType) throws IllegalArgumentException, IllegalSymbolException, IllegalAlphabetException, IllegalSymbolException
- Specified by:
backwardMatrixin classDP- Throws:
IllegalArgumentExceptionIllegalSymbolExceptionIllegalAlphabetException
-
forward
protected double forward(DPCursor dpCursor, ScoreType scoreType) throws IllegalSymbolException
- Throws:
IllegalSymbolException
-
backward
protected double backward(DPCursor dpCursor, ScoreType scoreType) throws IllegalSymbolException
- 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
public StatePath viterbi(SymbolList[] symList, ScoreType scoreType) throws IllegalSymbolException
- Specified by:
viterbiin classDP- Throws:
IllegalSymbolException
-
-