Class AbstractWgsMetricsCollector<T extends htsjdk.samtools.util.AbstractRecordAndOffset>

  • Direct Known Subclasses:
    CollectWgsMetrics.WgsMetricsCollector, FastWgsMetricsCollector

    public abstract class AbstractWgsMetricsCollector<T extends htsjdk.samtools.util.AbstractRecordAndOffset>
    extends Object
    Class for collecting data on reference coverage, base qualities and excluded bases from one AbstractLocusInfo object for CollectWgsMetrics.

    The shared code for forming result for CollectWgsMetrics is abstracted into this class. Classes that extend this collector implement their logic in addInfo() method.

    • Field Detail

      • unfilteredDepthHistogramArray

        protected final long[] unfilteredDepthHistogramArray
        Count of sites with a given depth of coverage. Includes all but quality 2 bases. We draw depths from this histogram when we calculate the theoretical het sensitivity.
      • unfilteredBaseQHistogramArray

        protected final long[] unfilteredBaseQHistogramArray
        Count of bases observed with a given base quality. Includes all but quality 2 bases. We draw bases from this histogram when we calculate the theoretical het sensitivity.
      • highQualityDepthHistogramArray

        protected final long[] highQualityDepthHistogramArray
        Count of sites with a given depth of coverage. Excludes bases with quality below MINIMUM_BASE_QUALITY (default 20).
      • coverageCap

        protected final int coverageCap
        Positions with coverage exceeding this value are treated as if they had coverage at this value
      • intervals

        protected final htsjdk.samtools.util.IntervalList intervals
      • counter

        protected long counter
        The number of processed genomic bases
    • Method Detail

      • addInfo

        public abstract void addInfo​(htsjdk.samtools.util.AbstractLocusInfo<T> info,
                                     htsjdk.samtools.reference.ReferenceSequence ref,
                                     boolean referenceBaseN)
        Accumulates the data from AbstractLocusInfo in inner structures
        Parameters:
        info - AbstractLocusInfo with aligned to reference position reads
        ref - ReferenceSequence
        referenceBaseN - true if current the value of reference base represents a no call
      • addToMetricsFile

        public void addToMetricsFile​(htsjdk.samtools.metrics.MetricsFile<CollectWgsMetrics.WgsMetrics,​Integer> file,
                                     boolean includeBQHistogram,
                                     CountingFilter dupeFilter,
                                     CountingFilter mapqFilter,
                                     CountingPairedFilter pairFilter)
        Adds collected metrics and depth histogram to file
        Parameters:
        file - MetricsFile for result of collector's work
        dupeFilter - counting filter for duplicate reads
        mapqFilter - counting filter for mapping quality
        pairFilter - counting filter for reads without a mapped mate pair
      • getHighQualityDepthHistogram

        protected htsjdk.samtools.util.Histogram<Integer> getHighQualityDepthHistogram()
      • getUnfilteredDepthHistogram

        protected htsjdk.samtools.util.Histogram<Integer> getUnfilteredDepthHistogram()
      • getUnfilteredBaseQHistogram

        protected htsjdk.samtools.util.Histogram<Integer> getUnfilteredBaseQHistogram()
      • getHistogram

        protected htsjdk.samtools.util.Histogram<Integer> getHistogram​(long[] array,
                                                                       String binLabel,
                                                                       String valueLabel)
      • getMetrics

        protected CollectWgsMetrics.WgsMetrics getMetrics​(CountingFilter dupeFilter,
                                                          CountingFilter mapqFilter,
                                                          CountingPairedFilter pairFilter)
        Creates CollectWgsMetrics.WgsMetrics - the object holding the result of CollectWgsMetrics
        Parameters:
        dupeFilter - counting filter for duplicate reads
        mapqFilter - counting filter for mapping quality
        pairFilter - counting filter for reads without a mapped mate pair
        Returns:
        CollectWgsMetrics.WgsMetrics with set fields
      • setCounter

        public void setCounter​(long counter)
        Sets the counter to the current number of processed loci. Counter, must be updated from outside, since we are skipping a no call reference positions outside of the collector
        Parameters:
        counter - number of processed loci