Package phase
Class HmmUpdater
- java.lang.Object
-
- phase.HmmUpdater
-
public class HmmUpdater extends java.lang.Object
Class
HmmUpdater
has static methods for next marker updates of forward and backward HMM values.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
bwdUpdate(float[] bwd, float pSwitch, float[] pMismatch, byte[] mismatch, int nStates)
Updates the backward values.static float
fwdUpdate(float[] fwd, float sum, float pSwitch, float[] pMismatch, byte[] mismatch, int nStates)
Updates the forward values and returns the sum of the updated forward values.
-
-
-
Method Detail
-
fwdUpdate
public static float fwdUpdate(float[] fwd, float sum, float pSwitch, float[] pMismatch, 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 arraypMismatch
- two element array with emission probabilities for 0 or 1 mismatches between the observed and reference haplotype allelesmismatch
- 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.IllegalArgumentException
- ifpMismatch.length != 2
java.lang.IndexOutOfBoundsException
- if there existsj
such that(0 <= j && j < nStates)
and(mismatch[j] < 0 || mismatch[j] > 1)
java.lang.IndexOutOfBoundsException
- iffwd.length < nStates || mismatch.length < nStates
java.lang.NullPointerException
- iffwd == null || pMismatch == null || mismatch == null
-
bwdUpdate
public static void bwdUpdate(float[] bwd, float pSwitch, float[] pMismatch, 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 statepMismatch
- two element array with emission probabilities for 0 or 1 mismatches between alleles the observed and reference haplotype allelesmismatch
- the number of allele mismatches (0 or 1) for each HMM statenStates
- the number of states- Throws:
java.lang.IllegalArgumentException
- ifpMismatch.length != 2
java.lang.IndexOutOfBoundsException
- if there existsj
such that(0 <= j && j < nStates)
and(mismatch[j] < 0 || mismatch[j] > 1)
java.lang.IndexOutOfBoundsException
- ifbwd.length < nStates || mismatch.length < nStates
java.lang.NullPointerException
- ifbwd == null || mismatch == null
-
-