Package phase

Class HmmStateProbs

java.lang.Object
phase.HmmStateProbs

public class HmmStateProbs extends Object

Class HmmStateProbs has a method that returns the reference haplotype and probability associated with each HMM state.

Instances of class HmmStateProbs are not thread-safe.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a HmmStateProbs instance from the specified data.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the maximum number of HMM states.
    int
    Returns the number of markers
    int
    Returns the number of target haplotypes.
    int
    run(int targHap, int[][] refHaps, float[][] stateProbs)
    Stores the HMM reference haplotypes and states probabilities for the specified target haplotype, and returns the number of HMM states per marker.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HmmStateProbs

      public HmmStateProbs(LowFreqPhaseIbs phaseIbs)
      Creates a HmmStateProbs instance from the specified data.
      Parameters:
      phaseIbs - the IBS haplotypes
      Throws:
      NullPointerException - if phaseIbs == null
  • Method Details

    • run

      public int run(int targHap, int[][] refHaps, float[][] stateProbs)
      Stores the HMM reference haplotypes and states probabilities for the specified target haplotype, and returns the number of HMM states per marker. The contract for this method is undefined if the number of elements in any row of the specified arrays is not greater than or equal to this.maxStates().
      Parameters:
      targHap - a target haplotype index
      refHaps - the array in which the reference haplotype corresponding to each hidden state will be stored
      stateProbs - the array in which the estimated probability of each hidden state will be stored
      Returns:
      the number of hidden states at each marker
      Throws:
      IndexOutOfBoundsException - if targHap < 0 || targHap >= this.nTargHaps()
      IndexOutOfBoundsException - if refHaps.length < this.nMarkers()
      IndexOutOfBoundsException - if stateProbs.length < this.nMarkers()
      NullPointerException - if refHaps == null || stateProbs == null
    • nMarkers

      public int nMarkers()
      Returns the number of markers
      Returns:
      the number of markers
    • nTargHaps

      public int nTargHaps()
      Returns the number of target haplotypes.
      Returns:
      the number of target haplotypes
    • maxStates

      public int maxStates()
      Returns the maximum number of HMM states.
      Returns:
      the maximum number of HMM states