Package phase

Class PhaseStates


  • public final class PhaseStates
    extends java.lang.Object

    Class PhaseStates identifies a rolling window of reference haplotypes for a target sample.

    Instances of PhaseStates are not thread-safe.

    • Constructor Summary

      Constructors 
      Constructor Description
      PhaseStates​(PhaseIbs ibsHaps)
      Constructs a new PhaseIbs object from the specified data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int ibsStates​(int sample, int[][] stateAlleles)
      Identifies the HMM state alleles for the specified sample.
      int nStates()
      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

      • PhaseStates

        public PhaseStates​(PhaseIbs ibsHaps)
        Constructs a new PhaseIbs object from the specified data.
        Parameters:
        ibsHaps - IBS haplotype segments
        Throws:
        java.lang.IllegalArgumentException - if nHapsPerStep < 1
        java.lang.NullPointerException - if ibsStates == null
    • Method Detail

      • nStates

        public int nStates()
        Returns the number of HMM states per marker.
        Returns:
        the number of HMM states per marker
      • ibsStates

        public int ibsStates​(int sample,
                             int[][] stateAlleles)
        Identifies the HMM state alleles for the specified sample. The j-th state allele for the m-th marker will be stored in stateAlleles[m][j].
        Parameters:
        sample - the sample index
        stateAlleles - the two-dimensional array in which state alleles will be stored
        Returns:
        the number of state alleles at each marker
        Throws:
        java.lang.IndexOutOfBoundsException - if sample < 0 || sample >= this.hapPairs().nSamples()
        java.lang.IndexOutOfBoundsException - if stateAlleles.length < this.hapPairs().nMarkers() or if stateAlleles[j].length < this.nStates() for any j satisfying (0 <= j && j < this.hapPairs().nMarkers())
        java.lang.NullPointerException - if stateAlleles == null or if stateAlleles[j] == null for any j satisfying (0 <= j && j < this.hapPairs().nMarkers())