DuplicatesGTRec, GTRec, MarkerContainer, RefGTRecpublic final class LowMafRefDiallelicGT extends java.lang.Object implements RefGTRec
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 | Description |
|---|---|
LowMafRefDiallelicGT(Marker marker,
Samples samples,
int[][] hapIndices) |
Constructs a new
LowMafRefDiallelicGT instance from the
specified data. |
LowMafRefDiallelicGT(RefGTRec rec) |
Constructs a new
LowMafRefDiallelicGT instance with phased
non-missing genotypes from the specified data. |
LowMafRefDiallelicGT(VcfRecGTParser gtp) |
Constructs a new
LowMafRefDiallelicGT instance with phased
non-missing genotypes from the specified data. |
| Modifier and Type | Method | Description |
|---|---|---|
int |
allele(int hap) |
Returns the specified allele for 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.
|
int[] |
alleles() |
Returns an array of length
this.nHaps() whose j-th
element is equal to this.allele(j} |
RefGTRec |
changeMarker(Marker marker) |
Returns a
RefGTRec instance with the specified marker and the
same samples and haplotype alleles as this. |
float |
gl(int sample,
int allele1,
int allele2) |
Returns the probability of the observed data for the specified sample
if the specified pair of ordered alleles is the true ordered genotype.
|
int |
hapIndex(int allele,
int copy) |
Returns index of the haplotype that carries the specified copy of the
specified allele.
|
boolean |
isAlleleCoded() |
Returns
true if this instance stores the indices of haplotypes
that carry non-major alleles, and returns false otherwise. |
boolean |
isCarrier(int allele,
int hap) |
Returns
true if the specified haplotype carries the specified
allele and return false otherwise. |
boolean |
isGTData() |
Returns
true if the value returned by this.gl() is
determined by a called or missing genotype, and returns false
otherwise. |
boolean |
isPhased() |
Returns
true. |
boolean |
isPhased(int sample) |
Returns
true. |
int |
majorAllele() |
Returns the index of the major allele.
|
Marker |
marker() |
Returns the marker.
|
int |
nAlleles() |
Returns the number of marker alleles.
|
int |
nHaps() |
Returns the number of haplotypes.
|
int |
nSamples() |
Returns the number of samples.
|
Samples |
samples() |
Returns the list of samples.
|
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, waithapToSeq, seqToAllelepublic LowMafRefDiallelicGT(RefGTRec rec)
LowMafRefDiallelicGT instance with phased
non-missing genotypes from the specified data.rec - the phased, non-missing genotype datajava.lang.IllegalArgumentException - if rec.marker().nAlleles() != 2java.lang.NullPointerException - if rec == nullpublic LowMafRefDiallelicGT(VcfRecGTParser gtp)
LowMafRefDiallelicGT instance with phased
non-missing genotypes from the specified data.gtp - a VCF record parser that extracts sample genotypesjava.lang.IllegalArgumentException - if the VCF record contains an
unphased genotype or missing allelejava.lang.IllegalArgumentException - if gtp.nAlleles() != 2java.lang.IllegalArgumentException - if a format error is detected in the
VCF recordjava.lang.NullPointerException - if gtp == nullpublic LowMafRefDiallelicGT(Marker marker, Samples samples, int[][] hapIndices)
LowMafRefDiallelicGT instance from the
specified data. The contract for this class is unspecified if a
haplotype index is duplicated in the specified hapIndices array.marker - the markersamples - the sampleshapIndices - an array whose j-th element is null
if j is the major allele with lowest index, and otherwise is
an array of indices of haplotypes that carry the j-th allele
sorted in increasing orderjava.lang.IllegalArgumentException - if marker.nAlleles() != 2java.lang.IllegalArgumentException - if the (hapIndices[j] == null)
and j is not the major allele with lowest index, or if
(hapIndices[j] != null) and j is the major allele with
lowest indexjava.lang.IllegalArgumentException - if any element of hapIndices
is not not a sorted array of distinct haplotype indices
between 0 (inclusive) and 2*samples.nSamples() (exclusive)java.lang.IllegalArgumentException - if
marker.nAlleles() != hapIndices.lengthjava.lang.NullPointerException - if
marker == null || samples == null || hapIndices == nullpublic RefGTRec changeMarker(Marker marker)
RefGTRecRefGTRec instance with the specified marker and the
same samples and haplotype alleles as this.changeMarker in interface RefGTRecmarker - a markerRefGTRec instance with the specified marker and the
same samples and haplotype alleles as thispublic Samples samples()
GTRecpublic int nSamples()
DuplicatesGTRecthis.nHaps()/2.nSamples in interface DuplicatesGTRecpublic int nHaps()
DuplicatesGTRec2*this.nSamples().nHaps in interface DuplicatesGTRecpublic Marker marker()
MarkerContainermarker in interface MarkerContainerpublic boolean isPhased()
RefGTRectrue.isPhased in interface DuplicatesGTRecisPhased in interface RefGTRectruepublic boolean isGTData()
GTRectrue if the value returned by this.gl() is
determined by a called or missing genotype, and returns false
otherwise.public float gl(int sample,
int allele1,
int allele2)
GTRecpublic boolean isPhased(int sample)
RefGTRectrue.isPhased in interface DuplicatesGTRecisPhased in interface RefGTRecsample - the sample indextruepublic int allele1(int sample)
DuplicatesGTRecthis.unphased(marker, sample) == false.allele1 in interface DuplicatesGTRecsample - a sample indexpublic int allele2(int sample)
DuplicatesGTRecthis.unphased(marker, sample) == false.allele2 in interface DuplicatesGTRecsample - a sample indexpublic int allele(int hap)
DuplicatesGTRecthis.unphased(marker, hap/2) == false.allele in interface DuplicatesGTRechap - a haplotype indexpublic int[] alleles()
DuplicatesGTRecthis.nHaps() whose j-th
element is equal to this.allele(j}alleles in interface DuplicatesGTRecthis.nHaps() whose j-th
element is equal to this.allele(j}public int nAlleles()
MarkerContainernAlleles in interface MarkerContainerpublic boolean isAlleleCoded()
RefGTRectrue if this instance stores the indices of haplotypes
that carry non-major alleles, and returns false otherwise.
The default implementation returns falseisAlleleCoded in interface RefGTRectrue if this instance stores the indices of haplotypes
that carry non-major allelespublic int majorAllele()
RefGTRecmajorAllele in interface RefGTRecpublic int alleleCount(int allele)
RefGTRecUnsupportedOperationExceptionalleleCount in interface RefGTRecallele - an allele indexpublic int hapIndex(int allele,
int copy)
RefGTRecUnsupportedOperationExceptionpublic boolean isCarrier(int allele,
int hap)
RefGTRectrue if the specified haplotype carries the specified
allele and return false otherwise.public 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