public class RefHapPairs extends java.lang.Object implements SampleHapPairs
Class RefHapPairs stores a list of samples and a
haplotype pair for each sample.
Instances of class RefHapPairs are immutable.
| Constructor and Description |
|---|
RefHapPairs(Markers markers,
Samples samples,
VcfEmission[] refVcfRecs)
Constructs a new
RefHapPairs instance. |
| 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.
|
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.
|
Marker |
marker(int marker)
Returns the specified marker.
|
Markers |
markers()
Returns the markers.
|
int |
nAlleles(int marker)
Returns the number of marker alleles.
|
int |
nHapPairs()
Returns the number of haplotype pairs.
|
int |
nHaps()
Returns the number of haplotypes.
|
int |
nMarkers()
Returns the number of markers.
|
int |
nSamples()
Returns the number of samples.
|
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()
Returns the samples.
|
Samples |
samples(int hapPair)
Returns a list of samples containing the sample associated with
the specified haplotype pair
|
boolean |
storesNonMajorIndices(int marker)
Returns
true if this object stores the indices of haplotypes
that carry non-major alleles, and returns false otherwise. |
public RefHapPairs(Markers markers, Samples samples, VcfEmission[] refVcfRecs)
RefHapPairs instance.markers - the sequence of markerssamples - the sequence of samplesrefVcfRecs - the sequence of per-marker genotype datajava.lang.IllegalArgumentException - if
markers.nMarkers() != refVcfRecs.lengthjava.lang.IllegalArgumentException - if
refVcfRecs[k].samples().equals(samples) == false for any
k satisfying 0 <= k && k < refVcfRecs.lengthjava.lang.IllegalArgumentException - if
refVcfRecs[k].marker().equals(markers.marker(k)) == false
for any k satisfying 0 <= k && k < refVcfRecs.lengthjava.lang.IllegalArgumentException - if
refVcfRecs[k].isRefData() == false for any k
satisfying 0 <= k && k < refVcfRecs.lengthjava.lang.NullPointerException - if
markers == null || samples == null || refVcfRecs == null
|| refVcfRecs[k] == null for any k satisfying
0 <= k && k <= refVcfRecs.lengthpublic int allele1(int marker,
int hapPair)
HapPairspublic int allele2(int marker,
int hapPair)
HapPairspublic int allele(int marker,
int haplotype)
HapPairspublic int nMarkers()
HapPairspublic Marker marker(int marker)
HapPairspublic int nHaps()
HapPairs2*this.nHapPairs().public int nHapPairs()
HapPairsthis.nHaps()/2.public int nSamples()
SampleHapPairsnSamples in interface SampleHapPairspublic Samples samples()
SampleHapPairsk-th sample corresponds to
the k-th haplotype pair.samples in interface SampleHapPairspublic Samples samples(int hapPair)
HapPairspublic int sampleIndex(int hapPair)
HapPairsthis.samples().sampleIndex in interface HapPairshapPair - a haplotype pair indexthis.samples()public int nAlleles(int marker)
SampleHapPairsnAlleles in interface SampleHapPairsmarker - a marker indexpublic boolean storesNonMajorIndices(int marker)
SampleHapPairstrue if this object stores the indices of haplotypes
that carry non-major alleles, and returns false otherwise.storesNonMajorIndices in interface SampleHapPairsmarker - a marker indextrue if this object stores the indices of haplotypes
that carry non-major allelespublic int majorAllele(int marker)
SampleHapPairsmajorAllele in interface SampleHapPairsmarker - a marker indexpublic int alleleCount(int marker,
int allele)
SampleHapPairsalleleCount in interface SampleHapPairsmarker - a marker indexallele - an allele indexpublic int hapIndex(int marker,
int allele,
int copy)
SampleHapPairshapIndex in interface SampleHapPairsmarker - a marker indexallele - an allele indexcopy - a copy index.