Package phase
Class FwdBwd
- java.lang.Object
-
- phase.FwdBwd
-
public class FwdBwd extends java.lang.Object
Class
FwdBwd
implements computes HMM reference haplotypes and state probabilities.Instances of class
FwdBwd
are not thread-safe.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
maxStates()
Returns the maximum number of HMM states.PhaseIbs
phaseIbs()
Return the haplotype IBSint
run(int hap, 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
-
FwdBwd
public FwdBwd(PhaseIbs phaseIbs)
Creates aFwdBwd
instance from the specified data.- Parameters:
phaseIbs
- the IBS haplotypes- Throws:
java.lang.NullPointerException
- ifphaseIbs == null
-
-
Method Detail
-
run
public int run(int hap, 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 each row of the specified arrays is not greater than or equal tothis.maxStates()
.- Parameters:
hap
- a target haplotype indexrefHaps
- the array in which the reference haplotypes for each hidden state will be storedstateProbs
- the array in which estimated probabilities for each hidden state will be stored- Returns:
- the number of hidden states at each marker
- Throws:
java.lang.IndexOutOfBoundsException
- ifhap < 0 || hap >= this.phaseIbs().phaseData().targGT().nHaps()
java.lang.IndexOutOfBoundsException
- ifrefHaps.length < this.phaseIbs().phaseData.targGT().nMarkers()
java.lang.IndexOutOfBoundsException
- ifstateProbs.length < this.phaseIbs().phaseData.targGT().nMarkers()
java.lang.NullPointerException
- ifrefHaps == null || stateProbs == null
-
phaseIbs
public PhaseIbs phaseIbs()
Return the haplotype IBS- Returns:
- the haplotype IBS
-
maxStates
public int maxStates()
Returns the maximum number of HMM states.- Returns:
- the maximum number of HMM states
-
-