Package phase

Class LowFreqPhaseStates


  • public final class LowFreqPhaseStates
    extends java.lang.Object

    Class LowFreqPhaseStates has methods for constructing a Li and Stephens HMM for a target haplotype. The resulting HMM states are enriched for reference haplotypes carrying low frequency variants.

    Instances of LowFreqPhaseStates are not thread-safe.

    • Constructor Summary

      Constructors 
      Constructor Description
      LowFreqPhaseStates​(LowFreqPhaseIbs ibsHaps, int maxStates)
      Constructs a new LowFreqPhaseStates object from the specified data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int ibsStates​(int targHap, int[][] haps, byte[][] nMismatches)
      Stores the Li and Stephens HMM for the specified target haplotype in the specified arrays.
      int maxStates()
      Returns the maximum number of HMM states at a marker.
      int nMarkers()
      Returns the number of markers.
      int nTargHaps()
      Returns the number of target haplotypes.
      • Methods inherited from class java.lang.Object

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

      • LowFreqPhaseStates

        public LowFreqPhaseStates​(LowFreqPhaseIbs ibsHaps,
                                  int maxStates)
        Constructs a new LowFreqPhaseStates object from the specified data.
        Parameters:
        ibsHaps - the IBS haplotype segments
        maxStates - the maximum number of composite reference haplotypes that will be constructed
        Throws:
        java.lang.IllegalArgumentException - if maxStates < 1
        java.lang.NullPointerException - if ibsHaps == null
    • Method Detail

      • nTargHaps

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

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

        public int maxStates()
        Returns the maximum number of HMM states at a marker.
        Returns:
        the maximum number of HMM states at a marker
      • ibsStates

        public int ibsStates​(int targHap,
                             int[][] haps,
                             byte[][] nMismatches)
        Stores the Li and Stephens HMM for the specified target haplotype in the specified arrays. The haplotype for the j-th state at the m-th marker is stored in haps[m][j]. The number of allele mismatches (0 or 1) between the haplotype for the j-th state and the target haplotype at the m-th marker is stored in nMismatches[m][j]. The number of HMM states states at each marker is returned.
        Parameters:
        targHap - the haplotype index
        haps - the two-dimensional array in which the haplotype for each HMM state will be stored
        nMismatches - the two-dimensional array in which the number of allele mismatches (0 or 1) for each HMM state will be stored
        Returns:
        the number of HMM states at each marker
        Throws:
        java.lang.IndexOutOfBoundsException - if targHap < 0 || targHap >= this.nTargHaps()
        java.lang.IndexOutOfBoundsException - if haps.length < this.nMarkers()
        java.lang.IndexOutOfBoundsException - if nMismatches.length < this.nMarkers()
        java.lang.IndexOutOfBoundsException - if haps[m].length is less than the number of HMM states for any marker m satisfying (0 <= m && m < haps.length)
        java.lang.IndexOutOfBoundsException - if nMismatches[m].length is less than the number of HMM states for any marker m satisfying (0 <= m && m < nMismatches.length)
        java.lang.NullPointerException - if any array is null