Package imp
Class StateProbsFactory
- java.lang.Object
-
- imp.StateProbsFactory
-
public class StateProbsFactory extends java.lang.Object
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
Constructors Constructor Description StateProbsFactory(int nTargMarkers)
Creates anStateProbsFactory
instance from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
nTargMarkers()
Returns the number of target marker.StateProbs
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.
-
-
-
Method Detail
-
nTargMarkers
public int nTargMarkers()
Returns the number of target marker.- Returns:
- the number of target marker
-
stateProbs
public StateProbs 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. 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:
java.lang.IllegalArgumentException
- ifhapIndices.length != this.nTargMarkers()
java.lang.IllegalArgumentException
- ifstateProbs.length != this.nTargMarkers()
java.lang.IndexOutOfBoundsException
- if there existsj
satisfying(0 <= j && j <= this.nTargMarkers())
such that(hapIndices[j].length < nStates || stateProbs[j].length < nStates)
java.lang.NullPointerException
- ifhapIndices == null || stateProbs == null
java.lang.NullPointerException
- if there existsj
satisfying(0 <= j && j <= this.nTargMarkers())
such that(hapIndices[j] == null || stateProbs[j] == null)
-
-