Package phase
Class LowFreqPhaseStates
java.lang.Object
phase.LowFreqPhaseStates
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
ConstructorsConstructorDescriptionLowFreqPhaseStates(LowFreqPhaseIbs ibsHaps, int maxStates) Constructs a newLowFreqPhaseStatesobject from the specified data. -
Method Summary
Modifier and TypeMethodDescriptionintibsStates(int targHap, int[][] haps, byte[][] nMismatches) Stores the Li and Stephens HMM for the specified target haplotype in the specified arrays.intReturns the maximum number of HMM states at a marker.intnMarkers()Returns the number of markers.intReturns the number of target haplotypes.
-
Constructor Details
-
LowFreqPhaseStates
Constructs a newLowFreqPhaseStatesobject from the specified data.- Parameters:
ibsHaps- the IBS haplotype segmentsmaxStates- the maximum number of composite reference haplotypes that will be constructed- Throws:
IllegalArgumentException- ifmaxStates < 1NullPointerException- ifibsHaps == null
-
-
Method Details
-
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:
IndexOutOfBoundsException- iftargHap < 0 || targHap >= this.nTargHaps()IndexOutOfBoundsException- ifhaps.length < this.nMarkers()IndexOutOfBoundsException- ifnMismatches.length < this.nMarkers()IndexOutOfBoundsException- ifhaps[m].lengthis less than the number of HMM states for any markermsatisfying(0 <= m && m < haps.length)IndexOutOfBoundsException- ifnMismatches[m].lengthis less than the number of HMM states for any markermsatisfying(0 <= m && m < nMismatches.length)NullPointerException- if any array isnull
-