Package phase

Class PhaseData

java.lang.Object
phase.PhaseData

public class PhaseData extends 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

    Modifier and Type
    Method
    Description
    void
    Sets the iteration equal to the maximum of this.it() and this.fpd().par().burnin().
    Constructs and returns the coded steps.
    Returns the estimated phased genotypes.
    fpd()
    Returns the input data for phasing that is the same in each iteration.
    void
    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.
    float
    Returns the threshold on the phasing likelihood ratio that determines whether a pair of heterozygotes will be marked as phased.
    long
    ne()
    Returns the effective population size.
    float
    Returns the allele mismatch probability.
    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
    Returns the recombination intensity.
    long
    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 Details

    • 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:
      NullPointerException - if fpd == null
  • Method Details

    • 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:
      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:
      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:
      IndexOutOfBoundsException - if sample < 0 || sample >= this.fpd().targGT().nSamples()
    • lrThreshold

      public float lrThreshold()
      Returns the threshold on the phasing likelihood ratio that determines whether a pair of heterozygotes will be marked as phased.
      Returns:
      the threshold on the phasing likelihood ratio that determines whether a pair of heterozygotes will be marked as phased
    • seed

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