Package phase
Class HmmStateProbs
- java.lang.Object
-
- phase.HmmStateProbs
-
public class HmmStateProbs extends java.lang.ObjectClass
HmmStateProbshas a method that returns the reference haplotype and probability associated with each HMM state.Instances of class
HmmStateProbsare not thread-safe.
-
-
Constructor Summary
Constructors Constructor Description HmmStateProbs(LowFreqPhaseIbs phaseIbs)Creates aHmmStateProbsinstance from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intmaxStates()Returns the maximum number of HMM states.intnMarkers()Returns the number of markersintnTargHaps()Returns the number of target haplotypes.intrun(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 Detail
-
HmmStateProbs
public HmmStateProbs(LowFreqPhaseIbs phaseIbs)
Creates aHmmStateProbsinstance from the specified data.- Parameters:
phaseIbs- the IBS haplotypes- Throws:
java.lang.NullPointerException- ifphaseIbs == null
-
-
Method Detail
-
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:
java.lang.IndexOutOfBoundsException- iftargHap < 0 || targHap >= this.nTargHaps()java.lang.IndexOutOfBoundsException- ifrefHaps.length < this.nMarkers()java.lang.IndexOutOfBoundsException- ifstateProbs.length < this.nMarkers()java.lang.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
-
-