Package phase
Class HmmStateProbs
java.lang.Object
phase.HmmStateProbs
Class HmmStateProbs
has a method that returns the reference
haplotype and probability associated with each HMM state.
Instances of class HmmStateProbs
are not thread-safe.
-
Constructor Summary
ConstructorsConstructorDescriptionHmmStateProbs
(LowFreqPhaseIbs phaseIbs) Creates aHmmStateProbs
instance from the specified data. -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the maximum number of HMM states.int
nMarkers()
Returns the number of markersint
Returns the number of target haplotypes.int
run
(int targHap, int[][] refHaps, float[][] stateProbs) Stores the HMM reference haplotypes and states probabilities for the specified target haplotype, and returns the number of HMM states per marker.
-
Constructor Details
-
HmmStateProbs
Creates aHmmStateProbs
instance from the specified data.- Parameters:
phaseIbs
- the IBS haplotypes- Throws:
NullPointerException
- ifphaseIbs == null
-
-
Method Details
-
run
public int run(int targHap, int[][] refHaps, float[][] stateProbs) Stores the HMM reference haplotypes and states probabilities for the specified target haplotype, and returns the number of HMM states per marker. The contract for this method is undefined if the number of elements in any row of the specified arrays is not greater than or equal tothis.maxStates()
.- Parameters:
targHap
- a target haplotype indexrefHaps
- the array in which the reference haplotype corresponding to each hidden state will be storedstateProbs
- the array in which the estimated probability of each hidden state will be stored- Returns:
- the number of hidden states at each marker
- Throws:
IndexOutOfBoundsException
- iftargHap < 0 || targHap >= this.nTargHaps()
IndexOutOfBoundsException
- ifrefHaps.length < this.nMarkers()
IndexOutOfBoundsException
- ifstateProbs.length < this.nMarkers()
NullPointerException
- ifrefHaps == null || stateProbs == null
-
nMarkers
public int nMarkers()Returns the number of markers- Returns:
- the number of markers
-
nTargHaps
public int nTargHaps()Returns the number of target haplotypes.- Returns:
- the number of target haplotypes
-
maxStates
public int maxStates()Returns the maximum number of HMM states.- Returns:
- the maximum number of HMM states
-