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 newPhaseDatainstance from the specified data. -
Method Summary
Modifier and TypeMethodDescriptionvoidSets 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.voidIncrements the iteration by one.intit()Returns the current iteration.floatleaveUnphasedProp(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.floatReturns the threshold on the phasing likelihood ratio that determines whether a pair of heterozygotes will be marked as phased.longne()Returns the effective population size.floatReturns the allele mismatch probability.pRecomb()Return aFloatArrayof 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.floatReturns the recombination intensity.longseed()Returns an iteration-dependent seed for generating pseudorandom numbers.voidupdatePMismatch(float pMismatch) Sets the allele mismatch probability to the specified value.voidupdateRecombIntensity(float recombIntensity) Updates the recombination intensity.
-
Constructor Details
-
PhaseData
Constructs a newPhaseDatainstance 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 aFloatArrayof 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 aCodedStepsobject 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
-