public interface SampleHapPairs extends HapPairs
Interface SampleHapPairs represents a list of samples and a
haplotype pair for each sample. Each haplotype pair is guaranteed
to have two non-missing alleles at each marker.
All instances of SampleHapPairs are required to be immutable.
| Modifier and Type | Method and Description |
|---|---|
int |
alleleCount(int marker,
int allele)
Returns the number of haplotypes that carry the specified allele.
|
int |
hapIndex(int marker,
int allele,
int copy)
Returns index of the haplotype that carries the specified copy of the
specified allele.
|
int |
majorAllele(int marker)
Returns the index of the major allele.
|
int |
nAlleles(int marker)
Returns the number of marker alleles.
|
int |
nSamples()
Returns the number of samples.
|
Samples |
samples()
Returns the samples.
|
boolean |
storesNonMajorIndices(int marker)
Returns
true if this object stores the indices of haplotypes
that carry non-major alleles, and returns false otherwise. |
Samples samples()
k-th sample corresponds to
the k-th haplotype pair.int nSamples()
int nAlleles(int marker)
marker - a marker indexjava.lang.IndexOutOfBoundsException - if
marker < 0 || marker >= this.nMarkers()boolean storesNonMajorIndices(int marker)
true if this object stores the indices of haplotypes
that carry non-major alleles, and returns false otherwise.marker - a marker indextrue if this object stores the indices of haplotypes
that carry non-major allelesjava.lang.IndexOutOfBoundsException - if
marker < 0 || marker >= this.nMarkers()int majorAllele(int marker)
marker - a marker indexjava.lang.IndexOutOfBoundsException - if
marker < 0 || marker >= this.nMarkers()java.lang.UnsupportedOperationException - if
storesNonMajorIndices(marker) == falseint alleleCount(int marker,
int allele)
marker - a marker indexallele - an allele indexjava.lang.IndexOutOfBoundsException - if
marker < 0 || marker >= this.nMarkers()java.lang.IllegalArgumentException - if
allele == this.majorAllele()java.lang.IndexOutOfBoundsException - if
allele < 0 || allele >= this.nAlleles()java.lang.UnsupportedOperationException - if
storesNonMajorIndices(marker) == falseint hapIndex(int marker,
int allele,
int copy)
marker - a marker indexallele - an allele indexcopy - a copy index.java.lang.IllegalArgumentException - if
allele == this.majorAllele()java.lang.IndexOutOfBoundsException - if
marker < 0 || marker >= this.nMarkers()java.lang.IndexOutOfBoundsException - if
allele < 0 || allele >= this.nAlleles()java.lang.IndexOutOfBoundsException - if
copy < 0 || copy >= this.alleleCount(allele)java.lang.UnsupportedOperationException - if
storesNonMajorIndices(marker) == false