public final class IbsHapSegments
extends java.lang.Object
Class IbsHapSegments
identifies IBS haplotype segments in
a list of sample halotype pairs.
Instances of IbsHapSegments
are immutable.
Constructor and Description |
---|
IbsHapSegments(SampleHapPairs haps,
double[] pos,
double minLength)
Constructs a new
IbsHapSegments object from the specified data. |
IbsHapSegments(SampleHapPairs haps,
int minMarkers)
Constructs a new
IbsHapSegments object with marker positions
defined to be marker indices. |
Modifier and Type | Method and Description |
---|---|
java.util.List<HapSegment> |
filteredFind(int hap)
Returns a list of haplotype segments for other haplotypes
that are IBS with the specified haplotype and that have length greater
than or equal to
this.minIbsLength() . |
java.util.List<HapSegment> |
find(int hap)
Returns the list of haplotype segments for other haplotypes that
are IBS with the specified haplotype and have length greater
than or equal to
this.minIbsLength() . |
SampleHapPairs |
haps()
Returns the sample haplotype pairs.
|
double |
minIbsLength()
Returns the minimum length of an IBS segment.
|
double[] |
pos()
Returns an array of non-decreasing marker positions whose
j -th
element is the position of marker this.haps().marker(j) . |
public IbsHapSegments(SampleHapPairs haps, double[] pos, double minLength)
IbsHapSegments
object from the specified data.haps
- the sample haplotype pairspos
- an array of non-decreasing marker positions whose j
-th
element is the position of marker haps.marker(j)
minLength
- the minimum length of a reported IBS segmentjava.lang.IllegalArgumentException
- if
haps.nMarkers() != pos.length
java.lang.IllegalArgumentException
- if pos[0] < 0
, or if
pos[j] < pos[j-1]
for any j
satisfing
(0 < j && j < pos.length)
java.lang.IllegalArgumentException
- if
(Double.isNaN(pos[j])==true || Double.isInfinite(pos[j]) == true)
for any j
satisfying (0 <= j && j < pos.length)
java.lang.IllegalArgumentException
- if minLength <= 0.0f
java.lang.NullPointerException
- if haps == null || pos == null
public IbsHapSegments(SampleHapPairs haps, int minMarkers)
IbsHapSegments
object with marker positions
defined to be marker indices.haps
- the sample haplotype pairsminMarkers
- the minimum number of shared markers in a reported
IBS segmentjava.lang.NullPointerException
- if haps == null
public SampleHapPairs haps()
public double[] pos()
j
-th
element is the position of marker this.haps().marker(j)
.public double minIbsLength()
public java.util.List<HapSegment> find(int hap)
this.minIbsLength()
.hap
- the haplotype indexjava.lang.IndexOutOfBoundsException
- if
hap < 0 || hap >= this.haps().nHaps()
public java.util.List<HapSegment> filteredFind(int hap)
this.minIbsLength()
. An IBS segment is
permitted (but not required) to be excluded from the returned
list if both end-points of the IBD segment are interior points of
another IBD segment.hap
- the haplotype indexjava.lang.IndexOutOfBoundsException
- if
hap < 0 || hap >= this.haps().nHaps()