Package imp
Class ImpData
java.lang.Object
imp.ImpData
Class ImpData
contains the input data for imputation of
ungenotyped markers.
Instances of class ImpData
are immutable.
-
Constructor Summary
ConstructorsConstructorDescriptionImpData
(Par par, Window window, GT phasedTarg, GeneticMap map) Constructs a newImpData
instance from the specified data. -
Method Summary
Modifier and TypeMethodDescriptionint
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.hapToSeq
(int cluster) Returns the specified target marker cluster alleles for the reference and target haplotypes.int
Return the number of target marker clusters.int
nHaps()
Return the total number of reference and target haplotypes.int
Return the number of input target haplotypes.int
nRefHaps()
Return the number of reference haplotypes.int
Return the number of target haplotypes.int
Returns the number of target samples.par()
Returns the command line parametersdouble[]
pos()
Return an array of sizethis.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()
Return the reference genotype dataint
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.targGT()
Return the phased target genotype data.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.
-
Constructor Details
-
ImpData
Constructs a newImpData
instance from the specified data.- Parameters:
par
- the analysis parameterswindow
- the input data for the current marker windowphasedTarg
- the phased target genotypesmap
- the genetic map- Throws:
IllegalArgumentException
- ifwindow.targGT().markers().equals(phasedTarg.markers() == false
IllegalArgumentException
- ifwindow.targGT().samples().equals(phasedTarg.samples()) == false
IllegalArgumentException
- ifphasedTarg.isPhased() == false
NoSuchElementException
- ifwindow.refGT().isPresent() == false
NullPointerException
- if any parameter isnull
-
-
Method Details
-
par
Returns the command line parameters- Returns:
- the command line parameters
-
markerIndices
-
refGT
Return the reference genotype data- Returns:
- the reference genotype data
-
targGT
Return the phased target genotype data. TheisPhased()
method of the returned object returnstrue
.- 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:
IndexOutOfBoundsException
- ifcluster < 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:
IndexOutOfBoundsException
- ifcluster < 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:
IndexOutOfBoundsException
- ifcluster < 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:
IndexOutOfBoundsException
- ifcluster < 0 || cluster >= this.nClusters()
-
nClusters
public int nClusters()Return the number of target marker clusters.- Returns:
- the number of target marker clusters
-
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 clusterhap
- a haplotype index- Returns:
- the specified target marker cluster allele for the specified haplotype
- Throws:
IndexOutOfBoundsException
- ifcluster < 0 || cluster >= this.nClusters()
IndexOutOfBoundsException
- ifhaplotype < 0 || haplotype >= this.nHaps()
-
hapToSeq
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 anycluster
andhap
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:
IndexOutOfBoundsException
- ifcluster < 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:
IndexOutOfBoundsException
- ifcluster < 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:
IllegalArgumentException
- ifcluster < 0 || marker >= this.nClusters()
-
pos
public double[] pos()Return an array of sizethis.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. Returns0
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:
IllegalArgumentException
- ifcluster < 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:
IllegalArgumentException
- ifrefMarker < 0 || refMarker >= this.refGT().nMarkers()
-