Package phase

Class PhaseData


  • public class PhaseData
    extends java.lang.Object

    Class PhaseData contains the input data for phasing genotypes.

    Instances of class PhaseData are immutable.

    • Constructor Summary

      Constructors 
      Constructor Description
      PhaseData​(CurrentData cd, EstPhase estPhase, double recombFactor, int it, long seed)
      Constructs a new ImpData instance from the specified data.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int allele​(int marker, int hap)  
      boolean burnin()
      Returns true if the current phasing iteration is a burnin iteration and returns false otherwise.
      FloatArray genDist()
      Return a FloatArray of size this.nTargMarkers() whose k-th element is the genetic distance between the k-th target marker and the previous marker, or 0.0 if (k == 0).
      int iter()
      Returns the iteration index.
      Marker marker​(int marker)
      Returns the specified marker.
      Markers markers()
      Returns the list of target markers.
      int nHaps()
      Returns the number of reference and target haplotypes.
      int nItsRemaining()
      Returns the number of iterations remaining.
      int nMarkers()
      Returns the number of target markers
      int nRefHaps()
      Return the number of reference haplotypes.
      int nTargHaps()
      Return the number of target haplotypes.
      int nTargSamples()
      Returns the number of target samples.
      Par par()
      Returns the command line parameters
      float pErr​(int marker)
      Returns the probability that the allele carried by the specified target marker cluster matches the allele labeling the latent HMM state.
      double[] pos()
      Returns the array of genetic map positions whose k-th element equals this.pos(k).
      FloatArray pRecomb()
      Return a FloatArray of size this.nTargMarkers() whose k-th element is the factor multiplied by genetic distance to obtain the probability of transitioning to a random HMM state between the k-th target marker and the previous marker.
      long seed()
      Returns the seed for generating random numbers.
      • Methods inherited from class java.lang.Object

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

      • PhaseData

        public PhaseData​(CurrentData cd,
                         EstPhase estPhase,
                         double recombFactor,
                         int it,
                         long seed)
        Constructs a new ImpData instance from the specified data.
        Parameters:
        cd - the input data for the current marker window
        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 current iteration (first iteration has index 0)
        seed - seed for random numbers
        Throws:
        java.lang.IllegalArgumentException - if cd.targMarkers().equals(estPhase.markers() == false
        java.lang.IllegalArgumentException - if recombFactor < 0 || Double.isFinite(recombFactor)==false
        java.lang.IllegalArgumentException - if cd.targSamples().equals(estPhase.samples()) == false
        java.lang.NullPointerException - if any parameter is null
    • Method Detail

      • par

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

        public boolean burnin()
        Returns true if the current phasing iteration is a burnin iteration and returns false otherwise.
        Returns:
        true if the current phasing iteration is a burnin iteration
      • allele

        public int allele​(int marker,
                          int hap)
      • iter

        public int iter()
        Returns the iteration index.
        Returns:
        the iteration index
      • nItsRemaining

        public int nItsRemaining()
        Returns the number of iterations remaining.
        Returns:
        the number of iterations remaining
      • nMarkers

        public int nMarkers()
        Returns the number of target markers
        Returns:
        the number of target markers
      • markers

        public Markers markers()
        Returns the list of target markers.
        Returns:
        the list of target markers
      • marker

        public Marker marker​(int marker)
        Returns the specified marker.
        Parameters:
        marker - a marker index
        Returns:
        the specified marker
        Throws:
        java.lang.IndexOutOfBoundsException - if marker < 0 || marker >= this.nMarkers()
      • nTargSamples

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

        public int nRefHaps()
        Return the number of reference haplotypes.
        Returns:
        the number of reference haplotypes
      • nTargHaps

        public int nTargHaps()
        Return the number of target haplotypes.
        Returns:
        the number of target haplotypes
      • nHaps

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

        public float pErr​(int marker)
        Returns the probability that the allele carried by the specified target marker cluster matches the allele labeling the latent HMM state.
        Parameters:
        marker - index of a target marker cluster
        Returns:
        the probability that the allele carried by the specified target marker cluster matches the allele labeling the latent HMM state
        Throws:
        java.lang.IndexOutOfBoundsException - if cluster < 0 || cluster >= this.nClusters()
      • pos

        public double[] pos()
        Returns the array of genetic map positions whose k-th element equals this.pos(k).
        Returns:
        the array of genetic map positions
      • genDist

        public FloatArray genDist()
        Return a FloatArray of size this.nTargMarkers() whose k-th element is the genetic distance between the k-th target marker and the previous marker, or 0.0 if (k == 0).
        Returns:
        a FloatArray of size this.nTargMarkers() whose k-th element is the genetic distance between the k-th target marker and the previous marker,
      • pRecomb

        public FloatArray pRecomb()
        Return a FloatArray of size this.nTargMarkers() whose k-th element is the factor multiplied by genetic distance to obtain the probability of transitioning to a random HMM state between the k-th target marker and the previous marker.
        Returns:
        a FloatArray of size this.nTargMarkers() whose k-th element is the factor multiplied by genetic distance to obtain the probability of transitioning to a random HMM state between the k-th target marker and the previous marker
      • seed

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