Package phase
Class PhaseData
- java.lang.Object
-
- phase.PhaseData
-
public class PhaseData extends java.lang.Object
Class
PhaseData
contains the input data for phasing genotypes.Instances of class
PhaseData
are immutable.
-
-
Constructor Summary
Constructors Constructor Description PhaseData(CurrentData cd, EstPhase estPhase, double recombFactor, int it, long seed)
Constructs a newImpData
instance from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
allele(int marker, int hap)
boolean
burnin()
Returnstrue
if the current phasing iteration is a burnin iteration and returnsfalse
otherwise.FloatArray
genDist()
Return aFloatArray
of sizethis.nTargMarkers()
whosek
-th element is the genetic distance between thek
-th target marker and the previous marker, or0.0
if(k == 0)
.int
iter()
Returns the iteration index.Marker
marker(int marker)
Returns the specified marker.Markers
markers()
Returns the list of target markers.int
nHaps()
Returns the number of reference and target haplotypes.int
nItsRemaining()
Returns the number of iterations remaining.int
nMarkers()
Returns the number of target markersint
nRefHaps()
Return the number of reference haplotypes.int
nTargHaps()
Return the number of target haplotypes.int
nTargSamples()
Returns the number of target samples.Par
par()
Returns the command line parametersfloat
pErr(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)
.FloatArray
pRecomb()
Return aFloatArray
of 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.long
seed()
Returns the seed for generating random numbers.
-
-
-
Constructor Detail
-
PhaseData
public PhaseData(CurrentData cd, EstPhase estPhase, double recombFactor, int it, long seed)
Constructs a newImpData
instance 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() == false
java.lang.IllegalArgumentException
- ifrecombFactor < 0 || Double.isFinite(recombFactor)==false
java.lang.IllegalArgumentException
- ifcd.targSamples().equals(estPhase.samples()) == false
java.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()
Returnstrue
if the current phasing iteration is a burnin iteration and returnsfalse
otherwise.- Returns:
true
if 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 aFloatArray
of sizethis.nTargMarkers()
whosek
-th element is the genetic distance between thek
-th target marker and the previous marker, or0.0
if(k == 0)
.- Returns:
- a
FloatArray
of sizethis.nTargMarkers()
whosek
-th element is the genetic distance between thek
-th target marker and the previous marker,
-
pRecomb
public FloatArray pRecomb()
Return aFloatArray
of 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
FloatArray
of 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
-
-