Class MultiplePassVariantWalker

All Implemented Interfaces:
org.broadinstitute.barclay.argparser.CommandLinePluginProvider
Direct Known Subclasses:
FilterMutectCalls, LabeledVariantAnnotationsWalker, TwoPassVariantWalker

public abstract class MultiplePassVariantWalker extends VariantWalker
A VariantWalker that makes multiple passes through the variants. This allows the user to store internal states during early passes, which the user can then process and access during later passes
  • Constructor Details

    • MultiplePassVariantWalker

      public MultiplePassVariantWalker()
  • Method Details

    • numberOfPasses

      protected abstract int numberOfPasses()
    • traverse

      public void traverse()
      Implementation of variant-based traversal. NOTE: You should only override VariantWalker.traverse() if you are writing a new walker base class in the engine package that extends this class. It is not meant to be overridden by tools outside of the engine package. Implementation of multiple-pass variant traversal. Overrides the default, single-pass traversal framework of VariantWalkerBase allowing for multiple passes. NOTE: You should only override traverse() if you are writing a new walker base class in the engine package that extends this class. It is not meant to be overridden by tools outside of the engine package.
      Overrides:
      traverse in class VariantWalker
    • nthPassApply

      protected abstract void nthPassApply(htsjdk.variant.variantcontext.VariantContext variant, ReadsContext readsContext, ReferenceContext referenceContext, FeatureContext featureContext, int n)
      nth pass through the variants. The user may store data in instance variables of the walker and process them in afterNthPass(int) before making a second pass
      Parameters:
      variant - A variant record in a vcf
      readsContext - Reads overlapping the current variant. Will be empty if a read source (e.g. bam) isn't provided
      referenceContext - Reference bases spanning the current variant
      featureContext - A record overlapping the current variant from an auxiliary data source (e.g. gnomad)
      n - Which pass it is (zero-indexed)
    • afterNthPass

      protected abstract void afterNthPass(int n)
      Process the data collected during the first pass. This method is called between the two traversals
    • apply

      public final void apply(htsjdk.variant.variantcontext.VariantContext variant, ReadsContext readsContext, ReferenceContext referenceContext, FeatureContext featureContext)
      Make final to hide it from subclasses
      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).