Package phase
Class PhaseData
- java.lang.Object
-
- phase.PhaseData
-
public class PhaseData extends java.lang.ObjectClass
PhaseDatacontains the input data for phasing genotypes.Instances of class
PhaseDataare immutable.
-
-
Constructor Summary
Constructors Constructor Description PhaseData(CurrentData cd, EstPhase estPhase, double recombFactor, int it, long seed)Constructs a newImpDatainstance from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intallele(int marker, int hap)booleanburnin()Returnstrueif the current phasing iteration is a burnin iteration and returnsfalseotherwise.FloatArraygenDist()Return aFloatArrayof sizethis.nTargMarkers()whosek-th element is the genetic distance between thek-th target marker and the previous marker, or0.0if(k == 0).intiter()Returns the iteration index.Markermarker(int marker)Returns the specified marker.Markersmarkers()Returns the list of target markers.intnHaps()Returns the number of reference and target haplotypes.intnItsRemaining()Returns the number of iterations remaining.intnMarkers()Returns the number of target markersintnRefHaps()Return the number of reference haplotypes.intnTargHaps()Return the number of target haplotypes.intnTargSamples()Returns the number of target samples.Parpar()Returns the command line parametersfloatpErr(int marker)Returns the probability that the allele carried by the specified target marker cluster matches the allele labeling the latent HMM state.double[]pos()Returns the array of genetic map positions whosek-th element equalsthis.pos(k).FloatArraypRecomb()Return aFloatArrayof sizethis.nTargMarkers()whosek-th element is the factor multiplied by genetic distance to obtain the probability of transitioning to a random HMM state between thek-th target marker and the previous marker.longseed()Returns the seed for generating random numbers.
-
-
-
Constructor Detail
-
PhaseData
public PhaseData(CurrentData cd, EstPhase estPhase, double recombFactor, int it, long seed)
Constructs a newImpDatainstance from the specified data.- Parameters:
cd- the input data for the current marker windowestPhase- the current estimate of phased target genotypesrecombFactor- the factor multiplied by genetic distance to obtain the probability of transitioning to a random HMM state.it- the current iteration (first iteration has index 0)seed- seed for random numbers- Throws:
java.lang.IllegalArgumentException- ifcd.targMarkers().equals(estPhase.markers() == falsejava.lang.IllegalArgumentException- ifrecombFactor < 0 || Double.isFinite(recombFactor)==falsejava.lang.IllegalArgumentException- ifcd.targSamples().equals(estPhase.samples()) == falsejava.lang.NullPointerException- if any parameter isnull
-
-
Method Detail
-
par
public Par par()
Returns the command line parameters- Returns:
- the command line parameters
-
burnin
public boolean burnin()
Returnstrueif the current phasing iteration is a burnin iteration and returnsfalseotherwise.- Returns:
trueif the current phasing iteration is a burnin iteration
-
allele
public int allele(int marker, int hap)
-
iter
public int iter()
Returns the iteration index.- Returns:
- the iteration index
-
nItsRemaining
public int nItsRemaining()
Returns the number of iterations remaining.- Returns:
- the number of iterations remaining
-
nMarkers
public int nMarkers()
Returns the number of target markers- Returns:
- the number of target markers
-
markers
public Markers markers()
Returns the list of target markers.- Returns:
- the list of target markers
-
marker
public Marker marker(int marker)
Returns the specified marker.- Parameters:
marker- a marker index- Returns:
- the specified marker
- Throws:
java.lang.IndexOutOfBoundsException- ifmarker < 0 || marker >= this.nMarkers()
-
nTargSamples
public int nTargSamples()
Returns the number of target samples.- Returns:
- the number of target samples
-
nRefHaps
public int nRefHaps()
Return the number of reference haplotypes.- Returns:
- the number of reference haplotypes
-
nTargHaps
public int nTargHaps()
Return the number of target haplotypes.- Returns:
- the number of target haplotypes
-
nHaps
public int nHaps()
Returns the number of reference and target haplotypes.- Returns:
- the number of reference and target haplotypes
-
pErr
public float pErr(int marker)
Returns the probability that the allele carried by the specified target marker cluster matches the allele labeling the latent HMM state.- Parameters:
marker- index of a target marker cluster- Returns:
- the probability that the allele carried by the specified target marker cluster matches the allele labeling the latent HMM state
- Throws:
java.lang.IndexOutOfBoundsException- ifcluster < 0 || cluster >= this.nClusters()
-
pos
public double[] pos()
Returns the array of genetic map positions whosek-th element equalsthis.pos(k).- Returns:
- the array of genetic map positions
-
genDist
public FloatArray genDist()
Return aFloatArrayof sizethis.nTargMarkers()whosek-th element is the genetic distance between thek-th target marker and the previous marker, or0.0if(k == 0).- Returns:
- a
FloatArrayof sizethis.nTargMarkers()whosek-th element is the genetic distance between thek-th target marker and the previous marker,
-
pRecomb
public FloatArray pRecomb()
Return aFloatArrayof sizethis.nTargMarkers()whosek-th element is the factor multiplied by genetic distance to obtain the probability of transitioning to a random HMM state between thek-th target marker and the previous marker.- Returns:
- a
FloatArrayof sizethis.nTargMarkers()whosek-th element is the factor multiplied by genetic distance to obtain the probability of transitioning to a random HMM state between thek-th target marker and the previous marker
-
seed
public long seed()
Returns the seed for generating random numbers.- Returns:
- the seed for generating random numbers
-
-