public interface HapPairs
Interface HapPairs
represents a list of haplotype pairs.
Each haplotype pair is guaranteed to have two non-missing
alleles at each marker.
HapPairs
are required to
be immutable.Modifier and Type | Method and Description |
---|---|
int |
allele(int marker,
int haplotype)
Returns the allele for the specified marker and haplotype.
|
int |
allele1(int marker,
int hapPair)
Returns the first allele for the specified marker and haplotype pair.
|
int |
allele2(int marker,
int hapPair)
Returns the second allele for the specified marker and haplotype pair.
|
Marker |
marker(int marker)
Returns the specified marker.
|
Markers |
markers()
Returns the markers.
|
int |
nHapPairs()
Returns the number of haplotype pairs.
|
int |
nHaps()
Returns the number of haplotypes.
|
int |
nMarkers()
Returns the number of markers.
|
int |
sampleIndex(int hapPair)
Returns the index of the sample associated with the specified
haplotype pair in the list of samples returned by
this.samples() . |
Samples |
samples(int hapPair)
Returns a list of samples containing the sample associated with
the specified haplotype pair
|
int allele(int marker, int haplotype)
marker
- a marker indexhaplotype
- a haplotype indexjava.lang.IndexOutOfBoundsException
- if
marker < 0 || marker >= this.nMarkers()
java.lang.IndexOutOfBoundsException
- if
haplotype < 0 || haplotype >= this.nHaps()
int allele1(int marker, int hapPair)
marker
- a marker indexhapPair
- a haplotype pair indexjava.lang.IndexOutOfBoundsException
- if
marker < 0 || marker >= this.nMarkers()
java.lang.IndexOutOfBoundsException
- if
hapPair < 0 || hapPair >= this.nHapPairs()
int allele2(int marker, int hapPair)
marker
- a marker indexhapPair
- a haplotype pair indexjava.lang.IndexOutOfBoundsException
- if
marker < 0 || marker >= this.nMarkers()
java.lang.IndexOutOfBoundsException
- if
hapPair < 0 || hapPair >= this.nHapPairs()
int nMarkers()
Markers markers()
Marker marker(int marker)
marker
- a marker indexjava.lang.IndexOutOfBoundsException
- if
marker < 0 || marker >= this.nMarkers()
int nHaps()
2*this.nHapPairs()
.int nHapPairs()
this.nHaps()/2
.Samples samples(int hapPair)
hapPair
- a haplotype pair indexjava.lang.IndexOutOfBoundsException
- if
hapPair < 0 || hapPair >= this.nHapPairs()
int sampleIndex(int hapPair)
this.samples()
.hapPair
- a haplotype pair indexthis.samples()
java.lang.IndexOutOfBoundsException
- if
hapPair < 0 || hapPair >= this.nHapPairs()