Package phase
Class PhaseData
- java.lang.Object
-
- phase.PhaseData
-
public class PhaseData extends java.lang.ObjectClass
PhaseDatacontains the current input data for updating genotype phase.Instances of class
PhaseDataare thread-safe.
-
-
Constructor Summary
Constructors Constructor Description PhaseData(FixedPhaseData fpd, EstPhase estPhase, float recombFactor, int it, long seed)Constructs a newPhaseDatainstance from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intallele(int marker, int hap)Returns the allele carried by the specified high-frequency marker and haplotype.CodedStepscodedSteps()Returns the coded steps.floaterr()Return the allele mismatch probability.EstPhaseestPhase()Returns the estimated phase.FixedPhaseDatafpd()Returns the input data for phasing that is the same in each iteration.Ibs2ibs2()Returns the ibs2 status at each high-frequency marker.intit()Returns the current iteration (0 based).doubleleaveUnphasedProp(int sample)Returns the proportion of unphased heterozygotes that should be left unphased at the end of iterationthis.it()for the specified sample.MarkerMapmap()Return the marker map that stores genetic positions of each high-frequency marker.intnHaps()Return the total number of target and reference haplotypes.Parpar()Returns the command line parametersGTphasedTarg()Returns the estimated phased target haplotypes at the high-frequency markers.FloatArraypRecomb()Return aFloatArrayof sizethis.targGT().nMarkers()whosek-th element is the probability of transitioning to a random HMM state between thek-th high-frequency target marker and the previous high-frequency marker.floatrecombFactor()Returns the factor multiplied by genetic distance to obtain the probability of transitioning to a random HMM state.GTrefGT()Returns the phased, nonmissing reference genotypes at the high-frequency markeres, ornullif there are no reference samples.longseed()Returns the seed for generating random numbers.voidsetRecombFactor(float recombFactor)Sets the recombination factor to the specified value.GTtargGT()Returns the input genotypes for the target samples at the high-frequency target data markers.
-
-
-
Constructor Detail
-
PhaseData
public PhaseData(FixedPhaseData fpd, EstPhase estPhase, float recombFactor, int it, long seed)
Constructs a newPhaseDatainstance from the specified data.- Parameters:
fpd- the input data for phasing that is the same in each iterationestPhase- the current estimate of phased target genotypesrecombFactor- the factor multiplied by genetic distance to obtain the probability of transitioning to a random HMM stateit- the 0-based iterationseed- seed for random numbers- Throws:
java.lang.IllegalArgumentException- ifrecombFactor < 0 || Double.isFinite(recombFactor) == falsejava.lang.IllegalArgumentException- iffpd.hiFreqTargGT().equals(estPhase.targGT()) == falsejava.lang.IllegalArgumentException- ifit < 0 || it > (fpd.par().burnin() + fpd.par().iterations())java.lang.NullPointerException- iffpd == null || estPhase == null
-
-
Method Detail
-
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
-
par
public Par par()
Returns the command line parameters- Returns:
- the command line parameters
-
estPhase
public EstPhase estPhase()
Returns the estimated phase.- Returns:
- the estimated phase
-
allele
public int allele(int marker, int hap)Returns the allele carried by the specified high-frequency marker and haplotype. The first reference haplotype index is this.targGT().nHaps().- Parameters:
marker- the high-frequency marker indexhap- the haplotype index- Returns:
- the allele carried by the specified marker and haplotype
- Throws:
java.lang.IndexOutOfBoundsException- ifmarker < 0 || marker >= this.targGT().nMarkers()java.lang.IndexOutOfBoundsException- ifhap < 0 || hap >= this.nHaps()
-
phasedTarg
public GT phasedTarg()
Returns the estimated phased target haplotypes at the high-frequency markers.- Returns:
- the estimated phased target haplotypes at the high-frequency markers
-
nHaps
public int nHaps()
Return the total number of target and reference haplotypes.- Returns:
- the total number of target and reference haplotypes
-
err
public float err()
Return the allele mismatch probability.- Returns:
- the allele mismatch probability
-
targGT
public GT targGT()
Returns the input genotypes for the target samples at the high-frequency target data markers.- Returns:
- the input genotypes for the target samples at the high-frequency target data markers
-
refGT
public GT refGT()
Returns the phased, nonmissing reference genotypes at the high-frequency markeres, ornullif there are no reference samples.- Returns:
- the phased, nonmissing reference genotypes at the
high-frequency markeres, or
nullif there are no reference samples
-
ibs2
public Ibs2 ibs2()
Returns the ibs2 status at each high-frequency marker.- Returns:
- the ibs2 status at each high-frequency marker
-
codedSteps
public CodedSteps codedSteps()
Returns the coded steps.- Returns:
- the coded steps
-
map
public MarkerMap map()
Return the marker map that stores genetic positions of each high-frequency marker.- Returns:
- the marker map that stores genetic positions of each high-frequency marker
-
recombFactor
public float recombFactor()
Returns the factor multiplied by genetic distance to obtain the probability of transitioning to a random HMM state.- Returns:
- the recombination factor
-
pRecomb
public FloatArray pRecomb()
Return aFloatArrayof sizethis.targGT().nMarkers()whosek-th element is the probability of transitioning to a random HMM state between thek-th high-frequency target marker and the previous high-frequency marker.- Returns:
- a
FloatArrayof sizethis.targGT().nMarkers()whosek-th element is the probability of transitioning to a random HMM state between thek-th high-frequency target marker and the previous high-frequency marker
-
leaveUnphasedProp
public double leaveUnphasedProp(int sample)
Returns the proportion of unphased heterozygotes that should be left unphased at the end of iterationthis.it()for the specified sample.- Parameters:
sample- the sample index- Returns:
- the proportion of unphased heterozygotes that should be
left unphased at the end of iteration
this.it()for the specified sample - Throws:
java.lang.IndexOutOfBoundsException- ifsample < 0 || sample >= this.targGT().nSamples()
-
it
public int it()
Returns the current iteration (0 based).- Returns:
- the current iteration
-
seed
public long seed()
Returns the seed for generating random numbers.- Returns:
- the seed for generating random numbers
-
setRecombFactor
public void setRecombFactor(float recombFactor)
Sets the recombination factor to the specified value.- Parameters:
recombFactor- the new value for the recombination factor- Throws:
java.lang.IllegalArgumentException- ifrecombFactor < 0 || Double.isFinite(recombFactor) == false
-
-