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

java.lang.Object
picard.analysis.AbstractWgsMetricsCollector<T>

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 Summary

Fields
Modifier and Type
Field
Description
`protected long`
`counter`
The number of processed genomic bases
`protected final int`
`coverageCap`
Positions with coverage exceeding this value are treated as if they had coverage at this value
`protected final long[]`
`highQualityDepthHistogramArray`
Count of sites with a given depth of coverage.
`protected final htsjdk.samtools.util.IntervalList`
`intervals`
`protected final long[]`
`unfilteredBaseQHistogramArray`
Count of bases observed with a given base quality.
`protected final long[]`
`unfilteredDepthHistogramArray`
Count of sites with a given depth of coverage.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`addBaseQHistogram(htsjdk.samtools.metrics.MetricsFile<WgsMetrics, Integer> file)`
`abstract void`
`addInfo(htsjdk.samtools.util.AbstractLocusInfo<T> info, htsjdk.samtools.reference.ReferenceSequence ref, boolean referenceBaseN)`
Accumulates the data from AbstractLocusInfo in inner structures
`void`
`addToMetricsFile(htsjdk.samtools.metrics.MetricsFile<WgsMetrics, Integer> file, boolean includeBQHistogram, CountingFilter dupeFilter, CountingFilter adapterFilter, CountingFilter mapqFilter, CountingPairedFilter pairFilter)`
Adds collected metrics and depth histogram to file
`protected htsjdk.samtools.util.Histogram<Integer>`
`getHighQualityDepthHistogram()`
`protected htsjdk.samtools.util.Histogram<Integer>`
`getHistogram(long[] array, String binLabel, String valueLabel)`
`protected WgsMetrics`
`getMetrics(CountingFilter dupeFilter, CountingFilter adapterFilter, CountingFilter mapqFilter, CountingPairedFilter pairFilter)`
Creates CollectWgsMetrics.WgsMetrics - the object holding the result of CollectWgsMetrics
`protected htsjdk.samtools.util.Histogram<Integer>`
`getUnfilteredBaseQHistogram()`
`protected htsjdk.samtools.util.Histogram<Integer>`
`getUnfilteredDepthHistogram()`
`void`
`setCounter(long counter)`
Sets the counter to the current number of processed loci.

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### 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 Details

### 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<WgsMetrics, Integer> file, boolean includeBQHistogram, CountingFilter dupeFilter, CountingFilter adapterFilter, 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
  `adapterFilter` - counting filter for adapter reads
  `mapqFilter` - counting filter for mapping quality
  `pairFilter` - counting filter for reads without a mapped mate pair

### addBaseQHistogram

protected void addBaseQHistogram(htsjdk.samtools.metrics.MetricsFile<WgsMetrics, Integer> file)

### 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 WgsMetrics getMetrics(CountingFilter dupeFilter, CountingFilter adapterFilter, 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