Package vcf
Class BitArrayGTRec
java.lang.Object
vcf.BitArrayGTRec
Class BitArrayGT represents genotypes for a list of samples
at a single marker. Instances of class BitArrayGTRec store
haplotype alleles and flags to indicate missing genotypes in bit sets. All
genotypes are considered to be unphased if any sample has an
unphased or missing genotype.t
Instances of class BitArrayGTRec are immutable.
-
Constructor Summary
ConstructorsConstructorDescriptionBitArrayGTRec(VcfRecGTParser recParser) Constructs a newBitArrayGTinstance representing the specified VCF record's GT format field data.Constructs a newBitArrayGTinstance representing the specified VCF record's GT format field data. -
Method Summary
Modifier and TypeMethodDescriptionintget(int hap) Returns the specified allele for the specified haplotype or -1 if the allele is missing.booleanisPhased()Returnstrueif every genotype for each sample is a phased, non-missing genotype, and returnsfalseotherwise.booleanisPhased(int sample) Returnstrueif the genotype for the specified sample has non-missing alleles and is either haploid or diploid with a phased allele separator, and returnsfalseotherwise.marker()Returns the marker.samples()Returns the list of samples.intsize()Returns the number of haplotypes.toString()Returns the data represented bythisas a VCF record with a GT format field.
-
Constructor Details
-
BitArrayGTRec
Constructs a newBitArrayGTinstance representing the specified VCF record's GT format field data.- Parameters:
recParser- the VCF record genotype data- Throws:
IllegalArgumentException- if a format error is detected in the VCF recordNullPointerException- ifrecParser == null
-
BitArrayGTRec
Constructs a newBitArrayGTinstance representing the specified VCF record's GT format field data.- Parameters:
hlr- the VCF record genotype data- Throws:
IllegalArgumentException- if a format error is detected in the VCF recordNullPointerException- ifhlr == null
-
-
Method Details
-
samples
Description copied from interface:GTRecReturns the list of samples. -
size
public int size()Description copied from interface:GTRecReturns the number of haplotypes. -
marker
Description copied from interface:GTRecReturns the marker. -
isPhased
public boolean isPhased()Description copied from interface:GTRecReturnstrueif every genotype for each sample is a phased, non-missing genotype, and returnsfalseotherwise. -
isPhased
public boolean isPhased(int sample) Description copied from interface:GTRecReturnstrueif the genotype for the specified sample has non-missing alleles and is either haploid or diploid with a phased allele separator, and returnsfalseotherwise. -
get
public int get(int hap) Description copied from interface:GTRecReturns 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 bythisas 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.
-