Package vcf
Class LowMafGTRec
java.lang.Object
vcf.LowMafGTRec
Class LowMafGTRc
stores genotypes for a list of samples
at a marker. Instances of class LowMafGTRec
store lists of
haplotypes carrying each non-major or missing allele. All genotypes are
considered to be unphased if any sample has an unphased or missing
genotype.
Instances of class LowMafGTRec
are immutable.
-
Constructor Summary
ConstructorsConstructorDescriptionLowMafGTRec
(VcfRecGTParser.HapListRep listRep) Constructs a newLowMafGTRec
representing the specified VCF record's GT format field data. -
Method Summary
Modifier and TypeMethodDescriptionint
alleleCount
(int allele) Returns the number of copies of the specified allele.int
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.int
Returns the major allele.marker()
Returns the marker.samples()
Returns the list of samples.int
size()
Returns the number of haplotypes.toString()
Returns the data represented bythis
as a VCF record with a GT format field.
-
Constructor Details
-
LowMafGTRec
Constructs a newLowMafGTRec
representing the specified VCF record's GT format field data.- Parameters:
listRep
- the VCF record genotype data- Throws:
NullPointerException
- iflistRep == null
-
-
Method Details
-
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. -
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. -
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. -
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
. -
majorAllele
public int majorAllele()Returns the major allele. If there are two major alleles with the same allele count, the smaller allele is returned.- Returns:
- the major allele
-
alleleCount
public int alleleCount(int allele) Returns the number of copies of the specified allele.- Parameters:
allele
- an allele- Returns:
- the number of copies of the specified allele
- Throws:
IndexOutOfBoundsException
- ifallele < 0 || allele >= this.marker().nAlleles()
-
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.
-