Package phase
Class PhaseData
- java.lang.Object
-
- phase.PhaseData
-
public class PhaseData extends java.lang.ObjectClass
PhaseDatastores the current genotype phase estimates and parameter values.Instances of class
PhaseDataare thread-safe.
-
-
Constructor Summary
Constructors Constructor Description PhaseData(FixedPhaseData fpd, long seed)Constructs a newPhaseDatainstance from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadvanceToFirstPhasingIt()Sets the iteration equal to the maximum ofthis.it()andthis.fpd().par().burnin().CodedStepscodedSteps()Constructs and returns the coded steps.EstPhaseestPhase()Returns the estimated phased genotypes.FixedPhaseDatafpd()Returns the input data for phasing that is the same in each iteration.voidincrementIt()Increments 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.longne()Returns the effective population size.floatpMismatch()Returns the allele mismatch probability.FloatArraypRecomb()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.floatrecombIntensity()Returns 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 Detail
-
PhaseData
public PhaseData(FixedPhaseData fpd, long seed)
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:
java.lang.NullPointerException- iffpd == null
-
-
Method Detail
-
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:
java.lang.IllegalArgumentException- ifrecombIntensity <= 0f || Float.isFinite(recombIntensity) == false
-
ne
public long ne()
Returns the effective population size.- Returns:
- the effective population size
-
pRecomb
public FloatArray 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:
java.lang.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
public FixedPhaseData 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
public EstPhase estPhase()
Returns the estimated phased genotypes.- Returns:
- the estimated phased genotypes
-
codedSteps
public CodedSteps 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:
java.lang.IndexOutOfBoundsException- ifsample < 0 || sample >= this.fpd().targGT().nSamples()
-
seed
public long seed()
Returns an iteration-dependent seed for generating pseudorandom numbers.- Returns:
- an iteration-dependent seed for generating pseudorandom numbers
-
-