Package phase

Class HmmStateProbs


  • public class HmmStateProbs
    extends java.lang.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
      HmmStateProbs​(LowFreqPhaseIbs phaseIbs)
      Creates a HmmStateProbs instance from the specified data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int maxStates()
      Returns the maximum number of HMM states.
      int nMarkers()
      Returns the number of markers
      int nTargHaps()
      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 Detail

      • HmmStateProbs

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

      • 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:
        java.lang.IndexOutOfBoundsException - if targHap < 0 || targHap >= this.nTargHaps()
        java.lang.IndexOutOfBoundsException - if refHaps.length < this.nMarkers()
        java.lang.IndexOutOfBoundsException - if stateProbs.length < this.nMarkers()
        java.lang.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