Package vcf
Class BitArrayRefGTRec
java.lang.Object
vcf.BitArrayRefGTRec
Class BitArrayRefGTRec
represents phased, nonmissing, genotypes
for a list of samples at a single marker. Instances of class
BitArrayRefGTRec
store haplotype alleles in bit sets.
Instances of class BitArrayRefGTRec
are immutable.
-
Method Summary
Modifier and TypeMethodDescriptionint
get
(int hap) Returns the specified allele for the specified haplotype or -1 if the allele is missing.boolean
isPhased()
Returnstrue
if every genotype for each sample is a phased, non-missing genotype, and returnsfalse
otherwise.boolean
isPhased
(int sample) Returnstrue
if the genotype for the specified sample has non-missing alleles and is either haploid or diploid with a phased allele separator, and returnsfalse
otherwise.marker()
Returns the marker.samples()
Returns the list of samples.int
size()
Returns the number of haplotypes.static BitArrayRefGTRec[]
toBitArrayRefGTRecs
(EstPhase estPhase) Returns the current estimated phased, non-missing genotypes.toString()
Returns the data represented bythis
as a VCF record with a GT format field.
-
Method Details
-
toBitArrayRefGTRecs
Returns the current estimated phased, non-missing genotypes. This method converts column-major data into row-major data.- Parameters:
estPhase
- the current estimated phased genotypes for each target sample- Returns:
- the current estimated phased, non-missing genotypes
- Throws:
NullPointerException
- ifestPhase == null
-
samples
Description copied from interface:GTRec
Returns the list of samples. -
size
public int size()Description copied from interface:GTRec
Returns the number of haplotypes. -
marker
Description copied from interface:GTRec
Returns the marker. -
isPhased
public boolean isPhased()Description copied from interface:GTRec
Returnstrue
if every genotype for each sample is a phased, non-missing genotype, and returnsfalse
otherwise. -
isPhased
public boolean isPhased(int sample) Description copied from interface:GTRec
Returnstrue
if the genotype for the specified sample has non-missing alleles and is either haploid or diploid with a phased allele separator, and returnsfalse
otherwise. -
get
public int get(int hap) Description copied from interface:GTRec
Returns the specified allele for the specified haplotype or -1 if the allele is missing. The two alleles for a sample at a marker are arbitrarily ordered ifthis.unphased(marker, hap/2) == false
. -
toString
Returns the data represented bythis
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.
-