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 |
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[] |
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.
|
IntArray |
hapToSeq() |
Returns an
IntArray mapping haplotype indices to
sequences. |
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. |
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.
|
IntArray |
seqToAllele() |
Returns an
IntArray mapping the sequence indices
to alleles carried by the sequence for this record |
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, waitalleleCount, hapIndex, isAlleleCoded, isCarrier, majorAllelepublic 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 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 int nSamples()
DuplicatesGTRecthis.nHaps()/2.nSamples in interface DuplicatesGTRecpublic Samples samples()
GTRecpublic 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 IntArray hapToSeq()
RefGTRecIntArray mapping haplotype indices to
sequences.public IntArray seqToAllele()
RefGTRecIntArray mapping the sequence indices
to alleles carried by the sequence for this recordseqToAllele in interface RefGTRecpublic 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