Package org.biojava.bio.dp.twohead
Class EmissionCache
- java.lang.Object
-
- org.biojava.bio.dp.twohead.EmissionCache
-
- All Implemented Interfaces:
Serializable
public class EmissionCache extends Object implements Serializable
Cache for columns of emission probabilities in pair-wise alignment algorithms.- Author:
- Matthew Pocock, David Huen (fixes for magical state)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description EmissionCache(Alphabet alpha, State[] states, int dsi, ScoreType scoreType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
double[]
getEmissions(List symList)
double[]
getEmissions(List symList, boolean exorcise)
Retrieve the emission scores from the cache for every EmissionState for the specified symbols.
-
-
-
Constructor Detail
-
EmissionCache
public EmissionCache(Alphabet alpha, State[] states, int dsi, ScoreType scoreType)
-
-
Method Detail
-
getEmissions
public final double[] getEmissions(List symList) throws IllegalSymbolException
- Throws:
IllegalSymbolException
-
getEmissions
public final double[] getEmissions(List symList, boolean exorcise) throws IllegalSymbolException
Retrieve the emission scores from the cache for every EmissionState for the specified symbols. The scores will be computed and cached if not already available.The correct behaviour should be to exclude emission from the MagicalState except at the origin and bottom-right of the DP matrix. As such, the emission vector is only cached when it it is computed for exorcise set to true. The vector is computed afresh every time when exorcise is false. it should be noted that if exorcise is NOT set to false with the emission vector at the ends of the matrix, the model will fail as the start and and end transitions become impossible.
- Parameters:
symList
- a list of the symbols in each head that require a lookup for emission probabilities.exorcise
- Prevents emission from the MagicalState.- Throws:
IllegalSymbolException
-
clear
public void clear()
-
-