Package phase

Class PhaseData


  • public class PhaseData
    extends java.lang.Object

    Class PhaseData stores the current genotype phase estimates and parameter values.

    Instances of class PhaseData are thread-safe.

    • Constructor Summary

      Constructors 
      Constructor Description
      PhaseData​(FixedPhaseData fpd, long seed)
      Constructs a new PhaseData instance from the specified data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void advanceToFirstPhasingIt()
      Sets the iteration equal to the maximum of this.it() and this.fpd().par().burnin().
      CodedSteps codedSteps()
      Constructs and returns the coded steps.
      EstPhase estPhase()
      Returns the estimated phased genotypes.
      FixedPhaseData fpd()
      Returns the input data for phasing that is the same in each iteration.
      void incrementIt()
      Increments the iteration by one.
      int it()
      Returns the current iteration.
      float leaveUnphasedProp​(int sample)
      Returns the proportion of unphased heterozygotes at the start of a phasing iteration that will be left unphased at the end of a phasing iteration.
      long ne()
      Returns the effective population size.
      float pMismatch()
      Returns the allele mismatch probability.
      FloatArray pRecomb()
      Return a FloatArray of size this.fpd().stage1TargXGT().nMarkers() whose k-th element is the probability of transitioning to a random HMM state between the (k-1)-st and k-th markers.
      float recombIntensity()
      Returns the recombination intensity.
      long seed()
      Returns an iteration-dependent seed for generating pseudorandom numbers.
      void updatePMismatch​(float pMismatch)
      Sets the allele mismatch probability to the specified value.
      void updateRecombIntensity​(float recombIntensity)
      Updates the recombination intensity.
      • Methods inherited from class java.lang.Object

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

      • PhaseData

        public PhaseData​(FixedPhaseData fpd,
                         long seed)
        Constructs a new PhaseData instance from the specified data.
        Parameters:
        fpd - the input data for phasing that is the same in each iteration
        seed - a seed for generating pseudorandom number
        Throws:
        java.lang.NullPointerException - if fpd == null
    • Method Detail

      • recombIntensity

        public float recombIntensity()
        Returns the recombination intensity.
        Returns:
        the recombination intensity
      • updateRecombIntensity

        public void updateRecombIntensity​(float recombIntensity)
        Updates the recombination intensity.
        Parameters:
        recombIntensity - the updated recombination intensity.
        Throws:
        java.lang.IllegalArgumentException - if recombIntensity <= 0f || Float.isFinite(recombIntensity) == false
      • ne

        public long ne()
        Returns the effective population size.
        Returns:
        the effective population size
      • pRecomb

        public FloatArray pRecomb()
        Return a FloatArray of size this.fpd().stage1TargXGT().nMarkers() whose k-th element is the probability of transitioning to a random HMM state between the (k-1)-st and k-th markers.
        Returns:
        the probability of transitioning to a random HMM state between pair of consecutive markers
      • pMismatch

        public float pMismatch()
        Returns the allele mismatch probability.
        Returns:
        the allele mismatch probability
      • updatePMismatch

        public void updatePMismatch​(float pMismatch)
        Sets the allele mismatch probability to the specified value.
        Parameters:
        pMismatch - the allele mismatch probability
        Throws:
        java.lang.IllegalArgumentException - if pMismatch <= 0.0 || pMismatch >= 1.0 || Float.isFinite(pMismatch) == false
      • incrementIt

        public void incrementIt()
        Increments the iteration by one.
      • it

        public int it()
        Returns the current iteration. The initial iteration is 0.
        Returns:
        the current iteration
      • advanceToFirstPhasingIt

        public void advanceToFirstPhasingIt()
        Sets the iteration equal to the maximum of this.it() and this.fpd().par().burnin().
      • fpd

        public FixedPhaseData fpd()
        Returns the input data for phasing that is the same in each iteration.
        Returns:
        the input data for phasing that is the same in each iteration
      • estPhase

        public EstPhase estPhase()
        Returns the estimated phased genotypes.
        Returns:
        the estimated phased genotypes
      • codedSteps

        public CodedSteps codedSteps()
        Constructs and returns the coded steps. Since a CodedSteps object can consume substantial memory, the returned object is not pre-computed, but is constructed upon invocation of this method.
        Returns:
        the coded steps
      • leaveUnphasedProp

        public float leaveUnphasedProp​(int sample)
        Returns the proportion of unphased heterozygotes at the start of a phasing iteration that will be left unphased at the end of a phasing iteration.
        Parameters:
        sample - the sample index
        Returns:
        the proportion of unphased heterozygotes at the start of a phasing iteration that will be left unphased at the end of a phasing iteration
        Throws:
        java.lang.IndexOutOfBoundsException - if sample < 0 || sample >= this.fpd().targGT().nSamples()
      • seed

        public long seed()
        Returns an iteration-dependent seed for generating pseudorandom numbers.
        Returns:
        an iteration-dependent seed for generating pseudorandom numbers