Package phase

Class PhaseIbs


  • public final class PhaseIbs
    extends java.lang.Object

    Class PhaseIbs identifies haplotypes that share a long IBS segment with a specified haplotype.

    Instances of PhaseIbs are immutable.

    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      IntSet ibsHaps​(int h1, int h2, int step)
      Returns a set containing the specified number of haplotype indices that are IBS with haplotype h1 in the specified step.
      int nStates()
      Returns the number of HMM states per marker.
      int nSteps()
      Returns the number of IBS steps in the marker window.
      PhaseData phaseData()
      Return the data used to phase genotypes in a marker window.
      int stepStart​(int step)
      Returns the first marker index in the specified step.
      • Methods inherited from class java.lang.Object

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

      • PhaseIbs

        public PhaseIbs​(PhaseData phaseData)
        Constructs a new PhaseIbs object from the specified data.
        Parameters:
        phaseData - the input data for an iteration of genotype phasing
        Throws:
        java.lang.IllegalArgumentException - if hapPairs.markers().equals(map.markers()) == false
        java.lang.IllegalArgumentException - if stepLength <= 0.0 || nStepsToMerge < 1 || nStates < 1
        java.lang.NullPointerException - if hapPairs == null || map == null
    • Method Detail

      • ibsHaps

        public IntSet ibsHaps​(int h1,
                              int h2,
                              int step)
        Returns a set containing the specified number of haplotype indices that are IBS with haplotype h1 in the specified step. The returned set is guaranteed to not contain indices h1 or h2. The returned set will contain fewer than this.nHapsPerStep() haplotypes if the number of haplotypes that are IBS with haplotype h1 is less than this.nHapsPerStep().
        Parameters:
        h1 - a haplotype index
        h2 - a haplotype index
        step - a step index
        Returns:
        a set containing IBS haplotype indices
        Throws:
        java.lang.IndexOutOfBoundsException - if h1 < 0 || h1 >= this.hapPairs().nHaps()
        java.lang.IndexOutOfBoundsException - if h2 < 0 || h2 >= this.hapPairs().nHaps()
        java.lang.IndexOutOfBoundsException - if step < 0 || step >= this.nSteps()
        java.lang.IllegalArgumentException - if nHaps < 0 || nHaps > (1 << 30)
      • phaseData

        public PhaseData phaseData()
        Return the data used to phase genotypes in a marker window.
        Returns:
        the data used to phase genotypes in a marker window
      • nStates

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

        public int nSteps()
        Returns the number of IBS steps in the marker window.
        Returns:
        the number of IBS steps in the marker window
      • stepStart

        public int stepStart​(int step)
        Returns the first marker index in the specified step.
        Parameters:
        step - a step index
        Returns:
        the first marker index in the specified step
        Throws:
        java.lang.IllegalArgumentException - if step < 0 || step >= this.nSteps()