public final class LowMafRefDiallelicGT extends java.lang.Object implements VcfEmission
Class LowMafRefDiallelicGT represent represents phased,
non-missing genotypes for a list of reference samples at a single diallelic
marker. Genotype emission probabilities are determined by the sample
genotypes.
Class LowMafRefDiallelicGT stores the minor allele indices.
Instances of class LowMemRefDiallelicGT are immutable.
| Constructor and Description |
|---|
LowMafRefDiallelicGT(Marker marker,
Samples samples,
int minorAllele,
int[] minorIndices)
Constructs a new
LowMafRefDiallelicGT instance with phased
non-missing genotypes from the specified marker, samples, and
haplotype indices. |
| Modifier and Type | Method and Description |
|---|---|
int |
allele(int hap)
Returns the allele on the specified haplotype or -1 if the
allele is missing.
|
int |
allele1(int sample)
Returns the first allele for the specified sample or -1 if the
allele is missing.
|
int |
allele2(int sample)
Returns the second allele for the specified sample or -1 if the
allele is missing.
|
int |
alleleCount(int allele)
Returns the number of haplotypes that carry the specified allele.
|
float |
gl(int sample,
int allele1,
int allele2)
Returns the probability of the observed data if the specified pair
of ordered alleles is the true genotype in the specified sample.
|
int |
hapIndex(int allele,
int copy)
Returns index of the haplotype that carries the specified copy of the
specified allele.
|
boolean |
isPhased(int sample)
Returns
true if the genotype emission probabilities for
the specified sample are determined by a phased, nonmissing genotype,
and returns false otherwise. |
boolean |
isRefData()
Returns
true if the genotype emission probabilities
for each sample are determined by a phased called genotype
that has no missing alleles, and returns false otherwise. |
int |
majorAllele()
Returns the index of the major allele.
|
Marker |
marker()
Returns the marker.
|
int |
nAlleles()
Returns the number of marker alleles.
|
int |
nHapPairs()
Returns the number of haplotype pairs.
|
int |
nHaps()
Returns the number of haplotypes.
|
int |
nSamples()
Returns the number of samples.
|
Samples |
samples()
Returns the list of samples.
|
boolean |
storesNonMajorIndices()
Returns
true if this instance stores the indices of haplotypes
that carry non-major alleles, and returns false otherwise. |
java.lang.String |
toString()
Returns the data represented by
this as a VCF
record with a GT format field. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waittoVcfRecpublic LowMafRefDiallelicGT(Marker marker, Samples samples, int minorAllele, int[] minorIndices)
LowMafRefDiallelicGT instance with phased
non-missing genotypes from the specified marker, samples, and
haplotype indices.marker - the markersamples - the samplesminorAllele - the minor alleleminorIndices - an array whose elements are indices of haplotypes
that carry the minor allelejava.lang.IllegalArgumentException - marker.nAlleles() != 2java.lang.IllegalArgumentException - minorAllele < 0 || minorAllele > 1java.lang.IllegalArgumentException - if any element in
minorIndices is negative or greater than or equal to
2*samples.nSamples()java.lang.IllegalArgumentException - if any two elements in
minorIndices are equaljava.lang.NullPointerException - if
marker == null || samples == null || minorIndices == nullpublic Samples samples()
VcfEmissionsamples in interface VcfEmissionpublic int nSamples()
VcfEmissionnSamples in interface VcfEmissionpublic int nHaps()
HapsMarker2*this.nHapPairs().nHaps in interface HapsMarkerpublic int nHapPairs()
HapsMarkerthis.nHaps()/2.nHapPairs in interface HapsMarkerpublic Marker marker()
HapsMarkermarker in interface HapsMarkermarker in interface MarkerContainerpublic boolean isRefData()
VcfEmissiontrue if the genotype emission probabilities
for each sample are determined by a phased called genotype
that has no missing alleles, and returns false otherwise.isRefData in interface VcfEmissiontrue if the genotype emission probabilities
for each sample are determined by a phased called genotype
that has no missing allelespublic float gl(int sample,
int allele1,
int allele2)
VcfEmissiongl in interface VcfEmissionsample - the sample indexallele1 - the first allele indexallele2 - the second allele indexpublic boolean isPhased(int sample)
VcfEmissiontrue if the genotype emission probabilities for
the specified sample are determined by a phased, nonmissing genotype,
and returns false otherwise.isPhased in interface VcfEmissionsample - the sample indextrue if the genotype emission probabilities
for the specified sample are determined by a phased, nonmissing genotypepublic int allele1(int sample)
VcfEmissionallele1 in interface HapsMarkerallele1 in interface VcfEmissionsample - the sample indexpublic int allele2(int sample)
VcfEmissionallele2 in interface HapsMarkerallele2 in interface VcfEmissionsample - the sample indexpublic int allele(int hap)
VcfEmissionallele in interface HapsMarkerallele in interface VcfEmissionhap - the haplotype indexpublic int nAlleles()
VcfEmissionnAlleles in interface VcfEmissionpublic boolean storesNonMajorIndices()
VcfEmissiontrue if this instance stores the indices of haplotypes
that carry non-major alleles, and returns false otherwise.storesNonMajorIndices in interface VcfEmissiontrue if this instance stores the indices of haplotypes
that carry non-major alleles, and returns false otherwisepublic int majorAllele()
VcfEmissionmajorAllele in interface VcfEmissionpublic int alleleCount(int allele)
VcfEmissionalleleCount in interface VcfEmissionallele - an allele indexpublic int hapIndex(int allele,
int copy)
VcfEmissionhapIndex in interface VcfEmissionallele - an allele indexcopy - a copy indexpublic java.lang.String toString()
this as a VCF
record with a GT format field. The returned VCF record
will have missing QUAL and INFO fields, will have "PASS"
in the filter field, and will have a GT format field.toString in class java.lang.Objectthis as a VCF
record with a GT format field