Package phase
Class PhaseData
- java.lang.Object
-
- phase.PhaseData
-
public class PhaseData extends java.lang.Object
Class
PhaseData
contains the current input data for updating genotype phase.Instances of class
PhaseData
are thread-safe.
-
-
Constructor Summary
Constructors Constructor Description PhaseData(FixedPhaseData fpd, EstPhase estPhase, float recombFactor, int it, long seed)
Constructs a newPhaseData
instance from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
allele(int marker, int hap)
Returns the allele carried by the specified high-frequency marker and haplotype.CodedSteps
codedSteps()
Returns the coded steps.float
err()
Return the allele mismatch probability.EstPhase
estPhase()
Returns the estimated phase.FixedPhaseData
fpd()
Returns the input data for phasing that is the same in each iteration.Ibs2
ibs2()
Returns the ibs2 status at each high-frequency marker.int
it()
Returns the current iteration (0 based).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.MarkerMap
map()
Return the marker map that stores genetic positions of each high-frequency marker.int
nHaps()
Return the total number of target and reference haplotypes.Par
par()
Returns the command line parametersGT
phasedTarg()
Returns the estimated phased target haplotypes at the high-frequency markers.FloatArray
pRecomb()
Return aFloatArray
of 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.float
recombFactor()
Returns the factor multiplied by genetic distance to obtain the probability of transitioning to a random HMM state.GT
refGT()
Returns the phased, nonmissing reference genotypes at the high-frequency markeres, ornull
if there are no reference samples.long
seed()
Returns the seed for generating random numbers.void
setRecombFactor(float recombFactor)
Sets the recombination factor to the specified value.GT
targGT()
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 newPhaseData
instance 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) == false
java.lang.IllegalArgumentException
- iffpd.hiFreqTargGT().equals(estPhase.targGT()) == false
java.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, ornull
if there are no reference samples.- Returns:
- the phased, nonmissing reference genotypes at the
high-frequency markeres, or
null
if 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 aFloatArray
of 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
FloatArray
of 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
-
-