Package phase

Class PhaseBaum1


  • public class PhaseBaum1
    extends java.lang.Object

    Class PhaseBaum1 implements the forward and backward algorithms for a haploid Li and Stephens hidden Markov model.

    Instances of class PhaseBaum1 are not thread-safe.

    • Constructor Summary

      Constructors 
      Constructor Description
      PhaseBaum1​(PbwtPhaseIbs phaseIbs)
      Creates a PhaseLSBaum instance from the specified data.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static double getAndResetSwapRate()
      Returns the proportion of unphased heterozygotes whose phase relative to the previous heterozygote has been changed.
      int nTargSamples()
      Returns the number of target samples.
      void phase​(int sample)
      Estimates and stores the phased haplotypes for the specified sample
      • Methods inherited from class java.lang.Object

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

      • PhaseBaum1

        public PhaseBaum1​(PbwtPhaseIbs phaseIbs)
        Creates a PhaseLSBaum instance from the specified data.
        Parameters:
        phaseIbs - the IBS haplotype segments
        Throws:
        java.lang.NullPointerException - if phaseIBS == null
    • Method Detail

      • getAndResetSwapRate

        public static double getAndResetSwapRate()
        Returns the proportion of unphased heterozygotes whose phase relative to the previous heterozygote has been changed. The counters for the number of heterozygotes whose phase has been changed and for the total number of heterozygotes are then re-initialized to 0.
        Returns:
        the proportion of unphased heterozygotes whose phase has been changed
      • nTargSamples

        public int nTargSamples()
        Returns the number of target samples.
        Returns:
        the number of target samples
      • phase

        public void phase​(int sample)
        Estimates and stores the phased haplotypes for the specified sample
        Parameters:
        sample - a sample index
        Throws:
        java.lang.IndexOutOfBoundsException - if sample < 0 || sample >= this.nTargSamples()