Package phase
Class PhaseStates
- java.lang.Object
-
- phase.PhaseStates
-
public final class PhaseStates extends java.lang.ObjectClass
PhaseStatesidentifies a rolling window of reference haplotypes for a target sample.Instances of
PhaseStatesare not thread-safe.
-
-
Constructor Summary
Constructors Constructor Description PhaseStates(PhaseIbs ibsHaps)Constructs a newPhaseIbsobject from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intibsStates(int sample, int[][] stateAlleles)Identifies the HMM state alleles for the specified sample.intnStates()Returns the number of HMM states per marker.
-
-
-
Constructor Detail
-
PhaseStates
public PhaseStates(PhaseIbs ibsHaps)
Constructs a newPhaseIbsobject from the specified data.- Parameters:
ibsHaps- IBS haplotype segments- Throws:
java.lang.IllegalArgumentException- ifnHapsPerStep < 1java.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 anyjsatisfying(0 <= j && j < this.hapPairs().nMarkers())java.lang.NullPointerException- ifstateAlleles == nullor ifstateAlleles[j] == nullfor anyjsatisfying(0 <= j && j < this.hapPairs().nMarkers())
-
-