java.lang.Object
org.broadinstitute.hellbender.tools.walkers.mutect.Mutect2Engine
All Implemented Interfaces:
AutoCloseable, AssemblyRegionEvaluator

public final class Mutect2Engine extends Object implements AssemblyRegionEvaluator, AutoCloseable
Created by davidben on 9/15/16.
  • Field Details

  • Constructor Details

    • Mutect2Engine

      public Mutect2Engine(M2ArgumentCollection MTAC, AssemblyRegionArgumentCollection assemblyRegionArgs, boolean createBamOutIndex, boolean createBamOutMD5, htsjdk.samtools.SAMFileHeader header, GATKPath referenceSpec, VariantAnnotatorEngine annotatorEngine)
      Create and initialize a new HaplotypeCallerEngine given a collection of HaplotypeCaller arguments, a reads header, and a reference file
      Parameters:
      MTAC - command-line arguments for the HaplotypeCaller
      assemblyRegionArgs -
      createBamOutIndex - true to create an index file for the bamout
      createBamOutMD5 - true to create an md5 file for the bamout
      header - header for the reads
      referenceSpec - reference specifier for the reference
      annotatorEngine - annotator engine built with desired annotations
  • Method Details

    • makeStandardMutect2ReadFilters

      public static List<ReadFilter> makeStandardMutect2ReadFilters()
    • makeStandardMutect2PostFilterReadTransformer

      public static ReadTransformer makeStandardMutect2PostFilterReadTransformer(Path referencePath, boolean clipITRArtifacts)
    • getStandardMutect2AnnotationGroups

      public static List<Class<? extends Annotation>> getStandardMutect2AnnotationGroups()
      Returns:
      the default set of variant annotations for Mutect2
    • writeHeader

      public void writeHeader(htsjdk.variant.variantcontext.writer.VariantContextWriter vcfWriter, Set<htsjdk.variant.vcf.VCFHeaderLine> defaultToolHeaderLines)
    • callRegion

      public List<htsjdk.variant.variantcontext.VariantContext> callRegion(AssemblyRegion originalAssemblyRegion, ReferenceContext referenceContext, FeatureContext featureContext)
    • splitReadsBySample

      protected Map<String,List<GATKRead>> splitReadsBySample(Collection<GATKRead> reads)
    • writeExtraOutputs

      public void writeExtraOutputs(File statsTable)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • isActive

      public ActivityProfileState isActive(AlignmentContext context, ReferenceContext ref, FeatureContext features)
      Description copied from interface: AssemblyRegionEvaluator
      Given a pileup over a single locus, returns an ActivityProfileState containing the probability (0.0 to 1.0) that the locus is an "active" site.
      Specified by:
      isActive in interface AssemblyRegionEvaluator
      Parameters:
      context - reads pileup to examine
      ref - reference base overlapping the pileup locus
      features - features overlapping the pileup locus
      Returns:
      ActivityProfileState containing the probability between 0.0 and 1.0 that the site is active
    • getAttributeAsDoubleList

      public static List<Double> getAttributeAsDoubleList(htsjdk.variant.variantcontext.VariantContext vc, String key, double defaultValue)
    • emitReferenceConfidence

      public boolean emitReferenceConfidence()
      Are we emitting a reference confidence in some form, or not?
      Returns:
      true if HC must emit reference confidence.
    • logLikelihoodRatio

      public static double logLikelihoodRatio(int refCount, List<Byte> altQuals)
    • logLikelihoodRatio

      public static double logLikelihoodRatio(int nRef, List<Byte> altQuals, int repeatFactor, Optional<BetaDistributionShape> afPrior)
      this implements the isActive() algorithm described in docs/mutect/mutect.pdf the multiplicative factor is for the special case where we pass a singleton list of alt quals and want to duplicate that alt qual over multiple reads
      Parameters:
      nRef - ref read count
      altQuals - Phred-scaled qualities of alt-supporting reads
      repeatFactor - Number of times each alt qual is duplicated
      afPrior - Beta prior on alt allele fraction
      Returns:
    • logLikelihoodRatio

      public static double logLikelihoodRatio(int nRef, List<Byte> altQuals, int repeatFactor)
    • logLikelihoodRatio

      public static double logLikelihoodRatio(int refCount, int altCount, double errorProbability)