IntArray, DuplicatesGTRec, GTRec, MarkerContainerpublic final class BitSetGT extends java.lang.Object implements GTRec
Class BitSetGT represents genotype emission
probabilities for a list of samples at a single marker.
The genotype emission probabilities are determined by the called
genotypes for the samples.
Class BitSetGT stores alleles using
java.util.BitSet objects.
Instances of class BitSetGT are immutable.
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
GT_FORMAT |
The VCF FORMAT code for genotype data: "GT".
|
| Constructor | Description |
|---|---|
BitSetGT(VcfHeader vcfHeader,
java.lang.String vcfRecord) |
Constructs a new
BitSetGT instance representing
the specified VCF record's GT format field data. |
| 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[] |
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 a1,
int a2) |
Returns the probability of the observed data for the specified sample
if the specified pair of ordered alleles is the true ordered genotype.
|
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 if every genotype for each sample is a phased,
non-missing genotype, and returns false otherwise. |
boolean |
isPhased(int sample) |
Returns
true if the genotype for the specified sample is
a phased, nonmissing genotype, and returns false otherwise. |
Marker |
marker() |
Returns the marker.
|
int |
nAlleles() |
Returns the number of marker alleles.
|
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. |
public static final java.lang.String GT_FORMAT
public BitSetGT(VcfHeader vcfHeader, java.lang.String vcfRecord)
BitSetGT instance representing
the specified VCF record's GT format field data.vcfHeader - meta-information lines and header line for the
specified VCF record.vcfRecord - a VCF record corresponding to the specified
vcfHeader objectjava.lang.IllegalArgumentException - if a format error is detected
in the VCF recordjava.lang.IllegalArgumentException - if rec.nSamples() == 0java.lang.IllegalArgumentException - if the header line
or VCF record does not have a "GT" format fieldjava.lang.NullPointerException - if
vcfHeader == null || vcfRecord == nullpublic 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 isPhased()
DuplicatesGTRectrue if every genotype for each sample is a phased,
non-missing genotype, and returns false otherwise.isPhased in interface DuplicatesGTRectrue if the genotype for each sample is a phased,
non-missing genotypepublic boolean isGTData()
GTRectrue if the value returned by this.gl() is
determined by a called or missing genotype, and returns false
otherwise.public boolean isPhased(int sample)
DuplicatesGTRectrue if the genotype for the specified sample is
a phased, nonmissing genotype, and returns false otherwise.isPhased in interface DuplicatesGTRecsample - a sample indextrue if the genotype for the specified sample
is a phased, nonmissing genotypepublic 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 float gl(int sample,
int a1,
int a2)
GTRecpublic 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 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