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 void
bwdUpdate
(float[] bwd, float pSwitch, float[] pMismatch, byte[] mismatch, int nStates) Updates the backward values.static float
fwdUpdate
(float[] fwd, float fwdSum, 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 fwdSum, 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 updatedfwdSum
- the sum of forward values in the specified arraypSwitch
- an array of probabilities of jumping to a random HMM 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 != 2
IndexOutOfBoundsException
- if there existsj
such that(0 <= j && j < nStates)
and(mismatch[j] < 0 || mismatch[j] > 1)
IndexOutOfBoundsException
- if(fwd.length < nStates || mismatch.length < nStates)
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
- an array of probabilities of jumping to a random HMM 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 != 2
IndexOutOfBoundsException
- if there existsj
such that(0 <= j && j < nStates)
and(mismatch[j] < 0 || mismatch[j] > 1)
IndexOutOfBoundsException
- if(bwd.length < nStates || mismatch.length < nStates)
NullPointerException
- if(bwd == null || mismatch == null)
NullPointerException
- if(bwd == null || pSwitch == null || pMismatch == null || mismatch == null)
-