public final class BasicHapPairs extends java.lang.Object implements HapPairs
Class BasicHapPairs
represents a list of haplotype pairs.
Each haplotype pair is guaranteed to have two non-missing
alleles at each marker.
BasicHapPairs
are immutable.Constructor and Description |
---|
BasicHapPairs(java.util.List<HapPair> hapPairList)
Constructs a new
BasicHapPairs instance corresponding to
the specified list of haplotype pairs. |
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
|
java.lang.String |
toString()
Returns a string representation of
this . |
public BasicHapPairs(java.util.List<HapPair> hapPairList)
BasicHapPairs
instance corresponding to
the specified list of haplotype pairs.hapPairList
- a list of haplotype pairsjava.lang.IllegalArgumentException
- if
hapPairList.isEmpty() == true
java.lang.NullPointerException
- if
(hapPairList == null || hapPairList[j] == null)
for any j
satisfying (0 <= j && j < hapPairsList.size())
public int allele1(int marker, int hapPair)
HapPairs
public int allele2(int marker, int hapPair)
HapPairs
public int allele(int marker, int haplotype)
HapPairs
public int nMarkers()
HapPairs
public Marker marker(int marker)
HapPairs
public int nHaps()
HapPairs
2*this.nHapPairs()
.public int nHapPairs()
HapPairs
this.nHaps()/2
.public Samples samples(int hapPair)
HapPairs
public int sampleIndex(int hapPair)
HapPairs
this.samples()
.sampleIndex
in interface HapPairs
hapPair
- a haplotype pair indexthis.samples()
public java.lang.String toString()
this
. The exact details
of the representation are unspecified and subject to change.toString
in class java.lang.Object
this