Package phase
Class PhaseData
java.lang.Object
phase.PhaseData
Class PhaseData
stores the current genotype phase estimates
and parameter values.
Instances of class PhaseData
are thread-safe.
-
Constructor Summary
ConstructorsConstructorDescriptionPhaseData
(FixedPhaseData fpd, long seed) Constructs a newPhaseData
instance from the specified data. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Sets the iteration equal to the maximum ofthis.it()
andthis.fpd().par().burnin()
.Constructs and returns the coded steps.estPhase()
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.pRecomb()
Return aFloatArray
of sizethis.fpd().stage1TargXGT().nMarkers()
whosek
-th element is the probability of transitioning to a random HMM state between the(k-1)
-st andk
-th markers.float
Returns the recombination intensity.long
seed()
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.
-
Constructor Details
-
PhaseData
Constructs a newPhaseData
instance from the specified data.- Parameters:
fpd
- the input data for phasing that is the same in each iterationseed
- a seed for generating pseudorandom number- Throws:
NullPointerException
- iffpd == 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
- ifrecombIntensity <= 0f || Float.isFinite(recombIntensity) == false
-
ne
public long ne()Returns the effective population size.- Returns:
- the effective population size
-
pRecomb
Return aFloatArray
of sizethis.fpd().stage1TargXGT().nMarkers()
whosek
-th element is the probability of transitioning to a random HMM state between the(k-1)
-st andk
-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
- ifpMismatch < 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 ofthis.it()
andthis.fpd().par().burnin()
. -
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
Returns the estimated phased genotypes.- Returns:
- the estimated phased genotypes
-
codedSteps
Constructs and returns the coded steps. Since aCodedSteps
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
- ifsample < 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
-