BitHapPair
, WrappedHapPair
public interface HapPair
Interface HapPair
represents a pair of haplotypes for a sample.
The pair of haplotypes are guaranteed to have non-missing alleles at each
marker.
HapPair
are required to be immutable.Modifier and Type | Method | Description |
---|---|---|
int |
allele1(int marker) |
Returns the first allele for the specified marker.
|
int |
allele2(int marker) |
Returns the second allele for the specified marker.
|
static java.util.Comparator<HapPair> |
comparator(Samples samples) |
Returns a
Comparator<HapPairInterface>
whose compare(hp1, hp2) method returns -1, 0, or 1
depending on whether samples.index(hp1.idIndex()) is
less than, equal, or greater than
samples.index(hp2.idIndex()) . |
int |
idIndex() |
Returns the sample identifier index.
|
Marker |
marker(int marker) |
Returns the specified marker.
|
Markers |
markers() |
Returns the markers.
|
int |
nMarkers() |
Returns the number of markers.
|
int allele1(int marker)
marker
- a marker indexjava.lang.IndexOutOfBoundsException
- if
marker < 0 || marker >= this.nMarkers()
int allele2(int marker)
marker
- a marker indexjava.lang.IndexOutOfBoundsException
- if
marker < 0 || marker >= this.nMarkers()
Markers markers()
Marker marker(int marker)
marker
- a marker indexjava.lang.IndexOutOfBoundsException
- if
marker < 0 || marker >= this.nMarkers()
int nMarkers()
int idIndex()
static java.util.Comparator<HapPair> comparator(Samples samples)
Comparator<HapPairInterface>
whose compare(hp1, hp2)
method returns -1, 0, or 1
depending on whether samples.index(hp1.idIndex())
is
less than, equal, or greater than
samples.index(hp2.idIndex())
.samples
- the list of samples used to compare HapsPair
objectsComparator<HapPairInterface>
whose compare(hp1, hp2)
method compares two
haplotype pairs for orderjava.lang.NullPointerException
- if samples == null