IntArray, DuplicatesGTRec, GTRec, MarkerContainer, RefGTRecpublic class SeqCodedRefGT extends java.lang.Object implements RefGTRec
Class SeqCodedRefGT represents phased, non-missing
genotypes for a list of reference samples at a single marker.
Genotype emission probabilities are determined by the sample
genotypes.
Instances of class SeqCodedRefGT are immutable.
| Constructor | Description |
|---|---|
SeqCodedRefGT(Marker marker,
Samples samples,
IntArray hapToSeq,
IntArray seqToAllele) |
Creates a new
SeqCodedRefGT instance with phased,
non-missing genotypes from the specified marker, samples,
and haplotype alleles. |
| Modifier and Type | Method | Description |
|---|---|---|
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.size() whose j-th
element is equal to this.allele(j} |
int |
get(int hap) |
Returns the specified allele for the specified haplotype or
-1 if the allele is missing.
|
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.
|
int[][] |
hapIndices() |
Returns 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 order |
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.
|
IntArray |
map(int index) |
Returns
this.maps()[index]. |
IntArray[] |
maps() |
Returns an array of maps, which when composed map haplotype indices
to values.
|
Marker |
marker() |
Returns the marker.
|
int |
nAlleles() |
Returns the number of marker alleles.
|
int |
nMaps() |
Returns
this.maps().length |
int |
nSamples() |
Returns the number of samples.
|
Samples |
samples() |
Returns the list of samples.
|
int |
size() |
Returns the number of haplotypes.
|
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, waitpublic SeqCodedRefGT(Marker marker, Samples samples, IntArray hapToSeq, IntArray seqToAllele)
SeqCodedRefGT instance with phased,
non-missing genotypes from the specified marker, samples,
and haplotype alleles. The contract for the constructed object
is undefined if any element of hapToSeq is negative or
greater than or equal to seqToAllele.size() or if any element
of seqToAllele is negative or greater than or equal to
marker.nAlleles().marker - the markersamples - the sampleshapToSeq - an array whose j-th element is the index
of the distinct allele sequence carried by the j-th haplotypeseqToAllele - an array whose j-th element is the marker
allele carried by the j-th distinct allele sequencejava.lang.IllegalArgumentException - if
hapToSeq.size() != 2*samples.nSamples()java.lang.NullPointerException - if any parameter is nullpublic boolean isPhased(int sample)
RefGTRectrue.isPhased in interface DuplicatesGTRecisPhased in interface RefGTRecsample - the sample indextruepublic boolean isPhased()
true.isPhased in interface DuplicatesGTRecisPhased in interface RefGTRectruepublic int nSamples()
DuplicatesGTRecthis.size()/2.nSamples in interface DuplicatesGTRecpublic Samples samples()
GTRecpublic int size()
DuplicatesGTRec2*this.nSamples().size in interface DuplicatesGTRecsize in interface IntArraypublic Marker marker()
MarkerContainermarker in interface MarkerContainerpublic 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 int[][] hapIndices()
RefGTRecj-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 orderhapIndices in interface RefGTRecj-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 orderpublic boolean isAlleleCoded()
RefGTRectrue if this instance stores the indices of haplotypes
that carry non-major alleles, and returns false otherwise.isAlleleCoded 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)
RefGTRecalleleCount in interface RefGTRecallele - an allele indexpublic 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 get(int hap)
DuplicatesGTRecthis.unphased(marker, hap/2) == false.get in interface DuplicatesGTRecget in interface IntArrayhap - a haplotype indexpublic int[] alleles()
DuplicatesGTRecthis.size() whose j-th
element is equal to this.allele(j}alleles in interface DuplicatesGTRecthis.size() whose j-th
element is equal to this.allele(j}public int nAlleles()
MarkerContainernAlleles in interface MarkerContainerpublic int hapIndex(int allele,
int copy)
RefGTRecpublic 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 fieldpublic int nMaps()
RefGTRecthis.maps().lengthpublic IntArray[] maps()
RefGTRech is determined
by the following calculation:
IntArray[] maps = this.maps();
int value = maps[0].get(h);
for (int j=1; j<maps.length; ++j) {
value = indexArrays[j].get(value);
}
int allele = value