Class VariantTypeCounters
java.lang.Object
org.snpsift.annotate.mem.variantTypeCounter.VariantTypeCounters
The VariantTypeCounters class is responsible for counting the number of variants in VCF (Variant Call Format) files.
It maintains counters for each chromosome and a counter for all variants combined.
The class provides methods to load and save the counters from/to a file, count variants from a VCF file or iterator,
and retrieve counters for specific chromosomes.
Usage:
- Create an instance of VariantTypeCounters with or without specifying Fields and verbosity.
- Use the count method to count variants from a VCF file.
- Save the counters to a file using the save method.
- Load the counters from a file using the static load method.
- Retrieve counters for specific chromosomes using the get method.
Limitations:
- The class assumes that the VCF file is properly formatted and accessible.
- The class does not handle multi-threaded access; concurrent modifications may lead to inconsistent state.
- The class relies on external classes such as Fields, VariantTypeCounter, VcfFileIterator, VcfEntry, and Log, which are not defined within this class.
- The progress display during counting is managed by the ShowProgress class, which is also not defined within this class.
-
Constructor Summary
ConstructorsConstructorDescriptionVariantTypeCounters(boolean verbose) VariantTypeCounters(Fields fields, boolean verbose) -
Method Summary
Modifier and TypeMethodDescriptionvoidCount the number of variants in a VCF filevoidcount(org.snpeff.fileIterator.VcfFileIterator vcfFile) voidcount(org.snpeff.vcf.VcfEntry vcfEntry) Count the number of variants in a VCF filestatic VariantTypeCountersLoad from filevoidvoidsetVerbose(boolean verbose) toString()
-
Constructor Details
-
VariantTypeCounters
public VariantTypeCounters(boolean verbose) -
VariantTypeCounters
-
-
Method Details
-
load
Load from file -
count
Count the number of variants in a VCF file -
count
public void count(org.snpeff.fileIterator.VcfFileIterator vcfFile) -
count
public void count(org.snpeff.vcf.VcfEntry vcfEntry) Count the number of variants in a VCF file -
get
-
getFields
-
save
-
setVerbose
public void setVerbose(boolean verbose) -
toString
-