Class CountVariants

All Implemented Interfaces:
org.broadinstitute.barclay.argparser.CommandLinePluginProvider

@DocumentedFeature public final class CountVariants extends VariantWalker
Count variant records in a VCF file, regardless of filter status. The tool prints the count to standard output (and can optionally write it to a file).

Input

  • A single VCF file.

Usage example:

  gatk CountVariants \
      -V input_variants.vcf
 
  • Field Details

  • Constructor Details

    • CountVariants

      public CountVariants()
  • Method Details

    • apply

      public void apply(htsjdk.variant.variantcontext.VariantContext variant, ReadsContext readsContext, ReferenceContext referenceContext, FeatureContext featureContext)
      Description copied from class: VariantWalker
      Process an individual variant. Must be implemented by tool authors. In general, tool authors should simply stream their output from apply(), and maintain as little internal state as possible.
      Specified by:
      apply in class VariantWalker
      Parameters:
      variant - Current variant being processed.
      readsContext - Reads overlapping the current variant. Will be an empty, but non-null, context object if there is no backing source of reads data (in which case all queries on it will return an empty array/iterator)
      referenceContext - Reference bases spanning the current variant. Will be an empty, but non-null, context object if there is no backing source of reference data (in which case all queries on it will return an empty array/iterator). Can request extra bases of context around the current variant's interval by invoking ReferenceContext.setWindow(int, int) on this object before calling ReferenceContext.getBases()
      featureContext - Features spanning the current variant. Will be an empty, but non-null, context object if there is no backing source of Feature data (in which case all queries on it will return an empty List).
    • onTraversalSuccess

      public Object onTraversalSuccess()
      Description copied from class: GATKTool
      Operations performed immediately after a successful traversal (ie when no uncaught exceptions were thrown during the traversal). Should be overridden by tool authors who need to close local resources, etc., after traversal. Also allows tools to return a value representing the traversal result, which is printed by the engine. Default implementation does nothing and returns null.
      Overrides:
      onTraversalSuccess in class GATKTool
      Returns:
      Object representing the traversal result, or null if a tool does not return a value