Package phase

Class 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 updated
        pSwitch - the probability of jumping to a random state
        sum - the sum of forward values in the specified array
        pMismatch - two element array with emission probabilities for 0 or 1 mismatches between the observed and reference haplotype alleles
        mismatch - the number of allele mismatches (0 or 1) for each HMM state
        nStates - the number of states
        Returns:
        the sum of the updated forward values
        Throws:
        java.lang.IllegalArgumentException - if pMismatch.length != 2
        java.lang.IndexOutOfBoundsException - if there exists j such that (0 <= j && j < nStates) and (mismatch[j] < 0 || mismatch[j] > 1)
        java.lang.IndexOutOfBoundsException - if fwd.length < nStates || mismatch.length < nStates
        java.lang.NullPointerException - if fwd == 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 updated
        pSwitch - the probability of jumping to a random state
        pMismatch - two element array with emission probabilities for 0 or 1 mismatches between alleles the observed and reference haplotype alleles
        mismatch - the number of allele mismatches (0 or 1) for each HMM state
        nStates - the number of states
        Throws:
        java.lang.IllegalArgumentException - if pMismatch.length != 2
        java.lang.IndexOutOfBoundsException - if there exists j such that (0 <= j && j < nStates) and (mismatch[j] < 0 || mismatch[j] > 1)
        java.lang.IndexOutOfBoundsException - if bwd.length < nStates || mismatch.length < nStates
        java.lang.NullPointerException - if bwd == null || mismatch == null