Package phase
Class HmmUpdater
- java.lang.Object
-
- phase.HmmUpdater
-
public class HmmUpdater extends java.lang.ObjectInstances of class
HmmUpdaterhave methods for one-step updates of forward or backward HMM values.
-
-
Constructor Summary
Constructors Constructor Description HmmUpdater(float pErr)Constructs a newHmmUpdaterinstance from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbwdUpdate(double[] bwd, double pSwitch, byte[] mismatch, int nStates)Updates the backward values.voidbwdUpdate(float[] bwd, float pSwitch, byte[] mismatch, int nStates)Updates the backward values.doublefwdUpdate(double[] fwd, double sum, double pSwitch, byte[] mismatch, int nStates)Updates the forward values and returns the sum of the updated forward values.floatfwdUpdate(float[] fwd, float sum, float pSwitch, byte[] mismatch, int nStates)Updates the forward values and returns the sum of the updated forward values.
-
-
-
Method Detail
-
fwdUpdate
public float fwdUpdate(float[] fwd, float sum, float pSwitch, byte[] mismatch, int nStates)Updates the forward values and returns the sum of the updated forward values.- Parameters:
fwd- the array of forward values that will be updatedpSwitch- the probability of jumping to a random statesum- the sum of forward values in the specified arraymismatch- the number of allele mismatches (0 or 1) for each HMM statenStates- the number of states- Returns:
- the sum of the updated forward values
- Throws:
java.lang.IndexOutOfBoundsException- iffwd.length < nStates || mismatch.length < nStatesjava.lang.NullPointerException- iffwd == null || mismatch == null
-
bwdUpdate
public void bwdUpdate(float[] bwd, float pSwitch, byte[] mismatch, int nStates)Updates the backward values.- Parameters:
bwd- the array of backward values that will be updatedpSwitch- the probability of jumping to a random statemismatch- the number of allele mismatches (0 or 1) for each HMM statenStates- the number of states- Throws:
java.lang.IndexOutOfBoundsException- ifbwd.length < nStates || mismatch.length < nStatesjava.lang.NullPointerException- ifbwd == null || mismatch == null
-
fwdUpdate
public double fwdUpdate(double[] fwd, double sum, double pSwitch, byte[] mismatch, int nStates)Updates the forward values and returns the sum of the updated forward values.- Parameters:
fwd- the array of forward values that will be updatedpSwitch- the probability of jumping to a random statesum- the sum of forward values in the specified arraymismatch- the number of allele mismatches (0 or 1) for each HMM statenStates- the number of states- Returns:
- the sum of the updated forward values
- Throws:
java.lang.IndexOutOfBoundsException- iffwd.length < nStates || mismatch.length < nStatesjava.lang.NullPointerException- iffwd == null || mismatch == null
-
bwdUpdate
public void bwdUpdate(double[] bwd, double pSwitch, byte[] mismatch, int nStates)Updates the backward values.- Parameters:
bwd- the array of backward values that will be updatedpSwitch- the probability of jumping to a random statemismatch- the number of allele mismatches (0 or 1) for each HMM statenStates- the number of states- Throws:
java.lang.IndexOutOfBoundsException- ifbwd.length < nStates || mismatch.length < nStatesjava.lang.NullPointerException- ifbwd == null || mismatch == null
-
-