Package imp

Class ImpData


  • public class ImpData
    extends java.lang.Object

    Class ImpData contains the input data for imputation of ungenotyped markers.

    Instances of class ImpData are immutable.

    • Constructor Summary

      Constructors 
      Constructor Description
      ImpData​(Par par, Window window, GT phasedTarg, GeneticMap map)
      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 cluster, int hap)
      Returns the specified target marker cluter alleles for the reference and target haplotypes.
      float errProb​(int cluster)
      Returns the probability that the allele carried by the specified target marker cluster matches the allele labeling the latent HMM state.
      IndexArray hapToSeq​(int cluster)
      Returns the specified target marker cluster alleles for the reference and target haplotypes.
      MarkerIndices markerIndices()  
      int nClusters()
      Return the number of target marker clusters.
      int nHaps()
      Return the total number of reference and target haplotypes.
      int nInputTargHaps()
      Return the number of input target haplotypes.
      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
      double[] pos()
      Return an array of size this.nClusters() containing the the genetic map positions of the target marker clusters.
      double pos​(int cluster)
      Return the genetic map position of the specified target marker cluster.
      float pRecomb​(int cluster)
      Return the probability of recombination between the specified target marker cluster and the previous target marker cluster.
      int refClusterEnd​(int cluster)
      Returns the index of the reference marker corresponding to the end (exclusive) of the specified target marker cluster.
      int refClusterStart​(int cluster)
      Returns the index of the reference marker corresponding to the start (inclusive) of the specified target marker cluster.
      RefGT refGT()
      Return the reference genotype data
      int targClusterEnd​(int cluster)
      Returns the target marker index corresponding to the end (exclusive) of the specified marker cluster.
      int targClusterStart​(int cluster)
      Returns the target marker index corresponding to the start (inclusive) of the specified marker cluster.
      GT targGT()
      Return the phased target genotype data.
      Samples targSamples()
      Returns the list of target samples.
      double weight​(int refMarker)
      Return the weight for the HMM state probability at the preceding target marker cluster when estimating the HMM state probability at the specified reference marker via linear interpolation of HMM state probabilities at the preceding and succeeding target marker clusters.
      • Methods inherited from class java.lang.Object

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

      • ImpData

        public ImpData​(Par par,
                       Window window,
                       GT phasedTarg,
                       GeneticMap map)
        Constructs a new ImpData instance from the specified data.
        Parameters:
        par - the analysis parameters
        window - the input data for the current marker window
        phasedTarg - the phased target genotypes
        map - the genetic map
        Throws:
        java.lang.IllegalArgumentException - if window.targGT().markers().equals(phasedTarg.markers() == false
        java.lang.IllegalArgumentException - if window.targGT().samples().equals(phasedTarg.samples()) == false
        java.lang.IllegalArgumentException - if phasedTarg.isPhased() == false
        java.util.NoSuchElementException - if window.refGT().isPresent() == 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
      • refGT

        public RefGT refGT()
        Return the reference genotype data
        Returns:
        the reference genotype data
      • targGT

        public GT targGT()
        Return the phased target genotype data. The isPhased() method of the returned object returns true.
        Returns:
        the phased target genotype data
      • targClusterStart

        public int targClusterStart​(int cluster)
        Returns the target marker index corresponding to the start (inclusive) of the specified marker cluster.
        Parameters:
        cluster - index of a target marker cluster
        Returns:
        the target marker index corresponding to the start (inclusive) of the specified marker cluster
        Throws:
        java.lang.IndexOutOfBoundsException - if cluster < 0 || cluster >= this.nClusters()
      • targClusterEnd

        public int targClusterEnd​(int cluster)
        Returns the target marker index corresponding to the end (exclusive) of the specified marker cluster.
        Parameters:
        cluster - index of a target marker cluster
        Returns:
        the target marker index corresponding to the end (exclusive) of the specified marker cluster
        Throws:
        java.lang.IndexOutOfBoundsException - if cluster < 0 || cluster >= this.nClusters()
      • refClusterStart

        public int refClusterStart​(int cluster)
        Returns the index of the reference marker corresponding to the start (inclusive) of the specified target marker cluster.
        Parameters:
        cluster - index of a target marker cluster
        Returns:
        the index of the reference marker corresponding to the start (inclusive) of the specified target marker cluster
        Throws:
        java.lang.IndexOutOfBoundsException - if cluster < 0 || cluster >= this.nClusters()
      • refClusterEnd

        public int refClusterEnd​(int cluster)
        Returns the index of the reference marker corresponding to the end (exclusive) of the specified target marker cluster.
        Parameters:
        cluster - index of a target marker cluster
        Returns:
        the index of the reference marker corresponding to the end (exclusive) of the specified target marker cluster
        Throws:
        java.lang.IndexOutOfBoundsException - if cluster < 0 || cluster >= this.nClusters()
      • nClusters

        public int nClusters()
        Return the number of target marker clusters.
        Returns:
        the number of target marker clusters
      • targSamples

        public Samples targSamples()
        Returns the list of target samples.
        Returns:
        the list of target samples
      • nTargSamples

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

        public int nHaps()
        Return the total number of reference and target haplotypes.
        Returns:
        the total number of reference and target haplotypes
      • 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
      • nInputTargHaps

        public int nInputTargHaps()
        Return the number of input target haplotypes. Each sample with haploid input data contributes only one haplotype to the total.
        Returns:
        the number of input target haplotypes
      • allele

        public int allele​(int cluster,
                          int hap)
        Returns the specified target marker cluter alleles for the reference and target haplotypes. Alleles for the reference haplotypes precede alleles for the target haplotypes. If (this.nRefHaps() <= hap && hap < this.nHaps()) then (this.allele(marker, hap) == this.targAllele(marker, hap - this.nRefHaps())
        Parameters:
        cluster - index of a target marker cluster
        hap - a haplotype index
        Returns:
        the specified target marker cluster allele for the specified haplotype
        Throws:
        java.lang.IndexOutOfBoundsException - if cluster < 0 || cluster >= this.nClusters()
        java.lang.IndexOutOfBoundsException - if haplotype < 0 || haplotype >= this.nHaps()
      • hapToSeq

        public IndexArray hapToSeq​(int cluster)
        Returns the specified target marker cluster alleles for the reference and target haplotypes. Alleles for the reference haplotypes precede alleles for the target haplotypes. The returned value will satisfy (this.hapToSeq(cluster).get(hap)==this.allele(cluster, hap)) for any cluster and hap satisfying (0 <= cluster && cluster < this.nClusters()) and (0 <= hap && hap < this.nHaps())
        Parameters:
        cluster - index of a target marker cluster
        Returns:
        the specified target marker cluster alleles for the reference and target haplotypes
        Throws:
        java.lang.IndexOutOfBoundsException - if cluster < 0 || cluster >= this.nClusters()
      • errProb

        public float errProb​(int cluster)
        Returns the probability that the allele carried by the specified target marker cluster matches the allele labeling the latent HMM state.
        Parameters:
        cluster - 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​(int cluster)
        Return the genetic map position of the specified target marker cluster.
        Parameters:
        cluster - index of a target marker cluster
        Returns:
        the genetic map position of the specified target marker cluster
        Throws:
        java.lang.IllegalArgumentException - if cluster < 0 || marker >= this.nClusters()
      • pos

        public double[] pos()
        Return an array of size this.nClusters() containing the the genetic map positions of the target marker clusters.
        Returns:
        the genetic map positions of the target marker clusters
      • pRecomb

        public float pRecomb​(int cluster)
        Return the probability of recombination between the specified target marker cluster and the previous target marker cluster. Returns 0 if (cluster == 0).
        Parameters:
        cluster - index of a target marker cluster
        Returns:
        the probability of recombination between the specified target marker cluster and the previous target marker cluster
        Throws:
        java.lang.IllegalArgumentException - if cluster < 0 || cluster >= this.nClusters()
      • weight

        public double weight​(int refMarker)
        Return the weight for the HMM state probability at the preceding target marker cluster when estimating the HMM state probability at the specified reference marker via linear interpolation of HMM state probabilities at the preceding and succeeding target marker clusters.
        Parameters:
        refMarker - a reference marker index
        Returns:
        the weight for the HMM state probability at the preceding target marker cluster when estimating the HMM state probability at the specified reference marker via linear interpolation
        Throws:
        java.lang.IllegalArgumentException - if refMarker < 0 || refMarker >= this.refGT().nMarkers()