Package phase
Class HmmUpdater
java.lang.Object
phase.HmmUpdater
Class HmmUpdater has static methods for next marker
updates of forward and backward HMM values.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidbwdUpdate(float[] bwd, float pSwitch, float[] pMismatch, byte[] mismatch, int nStates) Updates the backward values.static floatfwdUpdate(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 Details
-
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 updatedsum- the sum of forward values in the specified arraypSwitch- the probability of jumping to a random statepMismatch- 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:
IllegalArgumentException- ifpMismatch.length != 2IndexOutOfBoundsException- if there existsjsuch that(0 <= j && j < nStates)and(mismatch[j] < 0 || mismatch[j] > 1)IndexOutOfBoundsException- iffwd.length < nStates || mismatch.length < nStatesNullPointerException- 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:
IllegalArgumentException- ifpMismatch.length != 2IndexOutOfBoundsException- if there existsjsuch that(0 <= j && j < nStates)and(mismatch[j] < 0 || mismatch[j] > 1)IndexOutOfBoundsException- ifbwd.length < nStates || mismatch.length < nStatesNullPointerException- ifbwd == null || mismatch == null
-