Package phase
Class PhaseStates
- java.lang.Object
-
- phase.PhaseStates
-
public final class PhaseStates extends java.lang.Object
Class
PhaseStates
identifies a rolling window of reference haplotypes for a target sample.Instances of
PhaseStates
are not thread-safe.
-
-
Constructor Summary
Constructors Constructor Description PhaseStates(PhaseIbs ibsHaps)
Constructs a newPhaseIbs
object from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
ibsStates(int sample, int[][] stateAlleles)
Identifies the HMM state alleles for the specified sample.int
nStates()
Returns the number of HMM states per marker.
-
-
-
Constructor Detail
-
PhaseStates
public PhaseStates(PhaseIbs ibsHaps)
Constructs a newPhaseIbs
object from the specified data.- Parameters:
ibsHaps
- IBS haplotype segments- Throws:
java.lang.IllegalArgumentException
- ifnHapsPerStep < 1
java.lang.NullPointerException
- ifibsStates == null
-
-
Method Detail
-
nStates
public int nStates()
Returns the number of HMM states per marker.- Returns:
- the number of HMM states per marker
-
ibsStates
public int ibsStates(int sample, int[][] stateAlleles)
Identifies the HMM state alleles for the specified sample. Thej
-th state allele for them
-th marker will be stored instateAlleles[m][j]
.- Parameters:
sample
- the sample indexstateAlleles
- the two-dimensional array in which state alleles will be stored- Returns:
- the number of state alleles at each marker
- Throws:
java.lang.IndexOutOfBoundsException
- ifsample < 0 || sample >= this.hapPairs().nSamples()
java.lang.IndexOutOfBoundsException
- ifstateAlleles.length < this.hapPairs().nMarkers()
or ifstateAlleles[j].length < this.nStates()
for anyj
satisfying(0 <= j && j < this.hapPairs().nMarkers())
java.lang.NullPointerException
- ifstateAlleles == null
or ifstateAlleles[j] == null
for anyj
satisfying(0 <= j && j < this.hapPairs().nMarkers())
-
-