Package phase
Class PhaseIbs
- java.lang.Object
-
- phase.PhaseIbs
-
public final class PhaseIbs extends java.lang.Object
Class
PhaseIbs
identifies haplotypes that share a long IBS segment with a specified haplotype.Instances of
PhaseIbs
are immutable.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntSet
ibsHaps(int h1, int h2, int step)
Returns a set containing the specified number of haplotype indices that are IBS with haplotypeh1
in the specified step.int
nStates()
Returns the number of HMM states per marker.int
nSteps()
Returns the number of IBS steps in the marker window.PhaseData
phaseData()
Return the data used to phase genotypes in a marker window.int
stepStart(int step)
Returns the first marker index in the specified step.
-
-
-
Constructor Detail
-
PhaseIbs
public PhaseIbs(PhaseData phaseData)
Constructs a newPhaseIbs
object from the specified data.- Parameters:
phaseData
- the input data for an iteration of genotype phasing- Throws:
java.lang.IllegalArgumentException
- ifhapPairs.markers().equals(map.markers()) == false
java.lang.IllegalArgumentException
- ifstepLength <= 0.0 || nStepsToMerge < 1 || nStates < 1
java.lang.NullPointerException
- ifhapPairs == null || map == null
-
-
Method Detail
-
ibsHaps
public IntSet ibsHaps(int h1, int h2, int step)
Returns a set containing the specified number of haplotype indices that are IBS with haplotypeh1
in the specified step. The returned set is guaranteed to not contain indicesh1
orh2
. The returned set will contain fewer thanthis.nHapsPerStep()
haplotypes if the number of haplotypes that are IBS with haplotypeh1
is less thanthis.nHapsPerStep()
.- Parameters:
h1
- a haplotype indexh2
- a haplotype indexstep
- a step index- Returns:
- a set containing IBS haplotype indices
- Throws:
java.lang.IndexOutOfBoundsException
- ifh1 < 0 || h1 >= this.hapPairs().nHaps()
java.lang.IndexOutOfBoundsException
- ifh2 < 0 || h2 >= this.hapPairs().nHaps()
java.lang.IndexOutOfBoundsException
- ifstep < 0 || step >= this.nSteps()
java.lang.IllegalArgumentException
- ifnHaps < 0 || nHaps > (1 << 30)
-
phaseData
public PhaseData phaseData()
Return the data used to phase genotypes in a marker window.- Returns:
- the data used to phase genotypes in a marker window
-
nStates
public int nStates()
Returns the number of HMM states per marker.- Returns:
- the number of HMM states per marker
-
nSteps
public int nSteps()
Returns the number of IBS steps in the marker window.- Returns:
- the number of IBS steps in the marker window
-
stepStart
public int stepStart(int step)
Returns the first marker index in the specified step.- Parameters:
step
- a step index- Returns:
- the first marker index in the specified step
- Throws:
java.lang.IllegalArgumentException
- ifstep < 0 || step >= this.nSteps()
-
-