Package phase

Class LowFreqPhaseStates

java.lang.Object
phase.LowFreqPhaseStates

public final class LowFreqPhaseStates extends 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

    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
    Returns the maximum number of HMM states at a marker.
    int
    Returns the number of markers.
    int
    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 Details

    • 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:
      IllegalArgumentException - if maxStates < 1
      NullPointerException - if ibsHaps == null
  • Method Details

    • 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:
      IndexOutOfBoundsException - if targHap < 0 || targHap >= this.nTargHaps()
      IndexOutOfBoundsException - if haps.length < this.nMarkers()
      IndexOutOfBoundsException - if nMismatches.length < this.nMarkers()
      IndexOutOfBoundsException - if haps[m].length is less than the number of HMM states for any marker m satisfying (0 <= m && m < haps.length)
      IndexOutOfBoundsException - if nMismatches[m].length is less than the number of HMM states for any marker m satisfying (0 <= m && m < nMismatches.length)
      NullPointerException - if any array is null