Package phase
Class LowFreqPhaseStates
- java.lang.Object
-
- phase.LowFreqPhaseStates
-
public final class LowFreqPhaseStates extends java.lang.Object
Class
LowFreqPhaseStates
has methods for constructing a Li and Stephens HMM for a target haplotype. The resulting HMM states are enriched for reference haplotypes carrying low frequency variants.Instances of
LowFreqPhaseStates
are not thread-safe.
-
-
Constructor Summary
Constructors Constructor Description LowFreqPhaseStates(LowFreqPhaseIbs ibsHaps, int maxStates)
Constructs a newLowFreqPhaseStates
object from the specified data.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
ibsStates(int targHap, int[][] haps, byte[][] nMismatches)
Stores the Li and Stephens HMM for the specified target haplotype in the specified arrays.int
maxStates()
Returns the maximum number of HMM states at a marker.int
nMarkers()
Returns the number of markers.int
nTargHaps()
Returns the number of target haplotypes.
-
-
-
Constructor Detail
-
LowFreqPhaseStates
public LowFreqPhaseStates(LowFreqPhaseIbs ibsHaps, int maxStates)
Constructs a newLowFreqPhaseStates
object from the specified data.- Parameters:
ibsHaps
- the IBS haplotype segmentsmaxStates
- the maximum number of composite reference haplotypes that will be constructed- Throws:
java.lang.IllegalArgumentException
- ifmaxStates < 1
java.lang.NullPointerException
- ifibsHaps == null
-
-
Method Detail
-
nTargHaps
public int nTargHaps()
Returns the number of target haplotypes.- Returns:
- the number of target haplotypes
-
nMarkers
public int nMarkers()
Returns the number of markers.- Returns:
- the number of markers
-
maxStates
public int maxStates()
Returns the maximum number of HMM states at a marker.- Returns:
- the maximum number of HMM states at a marker
-
ibsStates
public int ibsStates(int targHap, int[][] haps, byte[][] nMismatches)
Stores the Li and Stephens HMM for the specified target haplotype in the specified arrays. The haplotype for thej
-th state at them
-th marker is stored inhaps[m][j]
. The number of allele mismatches (0 or 1) between the haplotype for thej
-th state and the target haplotype at them
-th marker is stored innMismatches[m][j]
. The number of HMM states states at each marker is returned.- Parameters:
targHap
- the haplotype indexhaps
- the two-dimensional array in which the haplotype for each HMM state will be storednMismatches
- the two-dimensional array in which the number of allele mismatches (0 or 1) for each HMM state will be stored- Returns:
- the number of HMM states at each marker
- Throws:
java.lang.IndexOutOfBoundsException
- iftargHap < 0 || targHap >= this.nTargHaps()
java.lang.IndexOutOfBoundsException
- ifhaps.length < this.nMarkers()
java.lang.IndexOutOfBoundsException
- ifnMismatches.length < this.nMarkers()
java.lang.IndexOutOfBoundsException
- ifhaps[m].length
is less than the number of HMM states for any markerm
satisfying(0 <= m && m < haps.length)
java.lang.IndexOutOfBoundsException
- ifnMismatches[m].length
is less than the number of HMM states for any markerm
satisfying(0 <= m && m < nMismatches.length)
java.lang.NullPointerException
- if any array isnull
-
-