Package phase

Class PhaseData


  • public class PhaseData
    extends java.lang.Object

    Class PhaseData contains the current input data for updating genotype phase.

    Instances of class PhaseData are thread-safe.

    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int allele​(int marker, int hap)
      Returns the allele carried by the specified high-frequency marker and haplotype.
      CodedSteps codedSteps()
      Returns the coded steps.
      float err()
      Return the allele mismatch probability.
      EstPhase estPhase()
      Returns the estimated phase.
      FixedPhaseData fpd()
      Returns the input data for phasing that is the same in each iteration.
      Ibs2 ibs2()
      Returns the ibs2 status at each high-frequency marker.
      int it()
      Returns the current iteration (0 based).
      double leaveUnphasedProp​(int sample)
      Returns the proportion of unphased heterozygotes that should be left unphased at the end of iteration this.it() for the specified sample.
      MarkerMap map()
      Return the marker map that stores genetic positions of each high-frequency marker.
      int nHaps()
      Return the total number of target and reference haplotypes.
      Par par()
      Returns the command line parameters
      GT phasedTarg()
      Returns the estimated phased target haplotypes at the high-frequency markers.
      FloatArray pRecomb()
      Return a FloatArray of size this.targGT().nMarkers() whose k-th element is the probability of transitioning to a random HMM state between the k-th high-frequency target marker and the previous high-frequency marker.
      float recombFactor()
      Returns the factor multiplied by genetic distance to obtain the probability of transitioning to a random HMM state.
      GT refGT()
      Returns the phased, nonmissing reference genotypes at the high-frequency markeres, or null if there are no reference samples.
      long seed()
      Returns the seed for generating random numbers.
      void setRecombFactor​(float recombFactor)
      Sets the recombination factor to the specified value.
      GT targGT()
      Returns the input genotypes for the target samples at the high-frequency target data markers.
      • 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,
                         EstPhase estPhase,
                         float recombFactor,
                         int it,
                         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
        estPhase - the current estimate of phased target genotypes
        recombFactor - the factor multiplied by genetic distance to obtain the probability of transitioning to a random HMM state
        it - the 0-based iteration
        seed - seed for random numbers
        Throws:
        java.lang.IllegalArgumentException - if recombFactor < 0 || Double.isFinite(recombFactor) == false
        java.lang.IllegalArgumentException - if fpd.hiFreqTargGT().equals(estPhase.targGT()) == false
        java.lang.IllegalArgumentException - if it < 0 || it > (fpd.par().burnin() + fpd.par().iterations())
        java.lang.NullPointerException - if fpd == null || estPhase == null
    • Method Detail

      • 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
      • par

        public Par par()
        Returns the command line parameters
        Returns:
        the command line parameters
      • estPhase

        public EstPhase estPhase()
        Returns the estimated phase.
        Returns:
        the estimated phase
      • allele

        public int allele​(int marker,
                          int hap)
        Returns the allele carried by the specified high-frequency marker and haplotype. The first reference haplotype index is this.targGT().nHaps().
        Parameters:
        marker - the high-frequency marker index
        hap - the haplotype index
        Returns:
        the allele carried by the specified marker and haplotype
        Throws:
        java.lang.IndexOutOfBoundsException - if marker < 0 || marker >= this.targGT().nMarkers()
        java.lang.IndexOutOfBoundsException - if hap < 0 || hap >= this.nHaps()
      • phasedTarg

        public GT phasedTarg()
        Returns the estimated phased target haplotypes at the high-frequency markers.
        Returns:
        the estimated phased target haplotypes at the high-frequency markers
      • nHaps

        public int nHaps()
        Return the total number of target and reference haplotypes.
        Returns:
        the total number of target and reference haplotypes
      • err

        public float err()
        Return the allele mismatch probability.
        Returns:
        the allele mismatch probability
      • targGT

        public GT targGT()
        Returns the input genotypes for the target samples at the high-frequency target data markers.
        Returns:
        the input genotypes for the target samples at the high-frequency target data markers
      • refGT

        public GT refGT()
        Returns the phased, nonmissing reference genotypes at the high-frequency markeres, or null if there are no reference samples.
        Returns:
        the phased, nonmissing reference genotypes at the high-frequency markeres, or null if there are no reference samples
      • ibs2

        public Ibs2 ibs2()
        Returns the ibs2 status at each high-frequency marker.
        Returns:
        the ibs2 status at each high-frequency marker
      • codedSteps

        public CodedSteps codedSteps()
        Returns the coded steps.
        Returns:
        the coded steps
      • map

        public MarkerMap map()
        Return the marker map that stores genetic positions of each high-frequency marker.
        Returns:
        the marker map that stores genetic positions of each high-frequency marker
      • recombFactor

        public float recombFactor()
        Returns the factor multiplied by genetic distance to obtain the probability of transitioning to a random HMM state.
        Returns:
        the recombination factor
      • pRecomb

        public FloatArray pRecomb()
        Return a FloatArray of size this.targGT().nMarkers() whose k-th element is the probability of transitioning to a random HMM state between the k-th high-frequency target marker and the previous high-frequency marker.
        Returns:
        a FloatArray of size this.targGT().nMarkers() whose k-th element is the probability of transitioning to a random HMM state between the k-th high-frequency target marker and the previous high-frequency marker
      • leaveUnphasedProp

        public double leaveUnphasedProp​(int sample)
        Returns the proportion of unphased heterozygotes that should be left unphased at the end of iteration this.it() for the specified sample.
        Parameters:
        sample - the sample index
        Returns:
        the proportion of unphased heterozygotes that should be left unphased at the end of iteration this.it() for the specified sample
        Throws:
        java.lang.IndexOutOfBoundsException - if sample < 0 || sample >= this.targGT().nSamples()
      • it

        public int it()
        Returns the current iteration (0 based).
        Returns:
        the current iteration
      • seed

        public long seed()
        Returns the seed for generating random numbers.
        Returns:
        the seed for generating random numbers
      • setRecombFactor

        public void setRecombFactor​(float recombFactor)
        Sets the recombination factor to the specified value.
        Parameters:
        recombFactor - the new value for the recombination factor
        Throws:
        java.lang.IllegalArgumentException - if recombFactor < 0 || Double.isFinite(recombFactor) == false