Package phase

Class HmmUpdater

java.lang.Object
phase.HmmUpdater

public class HmmUpdater extends Object

Class HmmUpdater has static methods for next marker updates of forward and backward HMM values.

  • Method Summary

    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 fwdSum, 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 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 updated
      fwdSum - the sum of forward values in the specified array
      pSwitch - an array of probabilities of jumping to a random HMM state
      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:
      IllegalArgumentException - if pMismatch.length != 2
      IndexOutOfBoundsException - if there exists j such that (0 <= j && j < nStates) and (mismatch[j] < 0 || mismatch[j] > 1)
      IndexOutOfBoundsException - if (fwd.length < nStates || mismatch.length < nStates)
      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 - an array of probabilities of jumping to a random HMM 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:
      IllegalArgumentException - if pMismatch.length != 2
      IndexOutOfBoundsException - if there exists j 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)