Package imp
Class StateProbsFactory
java.lang.Object
imp.StateProbsFactory
Class StateProbsFactory stores HMM state probabilities
that that can be used to imputed impute missing HMM state probabilities
using linear interpolation.
Instances of class StateProbsFactory are not thread-safe.
-
Constructor Summary
ConstructorsConstructorDescriptionStateProbsFactory(int nTargMarkers) Creates anStateProbsFactoryinstance from the specified data. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the number of target marker.stateProbs(int targHap, int nStates, int[][] hapIndices, float[][] stateProbs) Stores the reference haplotypes and state probabilities that will be used to imputed missing state probabilities using linear interpolation.
-
Constructor Details
-
StateProbsFactory
public StateProbsFactory(int nTargMarkers) Creates anStateProbsFactoryinstance from the specified data.- Parameters:
nTargMarkers- the number of target markers- Throws:
IllegalArgumentException- ifnTargMarkers <= 0
-
-
Method Details
-
nTargMarkers
public int nTargMarkers()Returns the number of target marker.- Returns:
- the number of target marker
-
stateProbs
Stores the reference haplotypes and state probabilities that will be used to imputed missing state probabilities using linear interpolation. If a HMM state probability at a marker or the following marker are greater than or equal toMath.min(0.005f, 1.0f/nStates), then the reference haplotype, the state probability at the marker, and the state probability at the succeeding marker are stored.- Parameters:
targHap- a target data haplotype indexnStates- the number of HMM states at each markerhapIndices- the reference haplotype indices corresponding to each state at each markerstateProbs- the HMM state probabilities at each marker- Returns:
- the state probabilities
- Throws:
IllegalArgumentException- ifhapIndices.length != this.nTargMarkers()IllegalArgumentException- ifstateProbs.length != this.nTargMarkers()IndexOutOfBoundsException- if there existsjsatisfying(0 <= j && j <= this.nTargMarkers())such that(hapIndices[j].length < nStates || stateProbs[j].length < nStates)NullPointerException- ifhapIndices == null || stateProbs == nullNullPointerException- if there existsjsatisfying(0 <= j && j <= this.nTargMarkers())such that(hapIndices[j] == null || stateProbs[j] == null)
-