Package picard.metrics

## Interface PerUnitMetricCollector<BEAN extends htsjdk.samtools.metrics.MetricBase,​HKEY extends Comparable,​ARGTYPE>

- All Known Implementing Classes:
    `GcBiasMetricsCollector.PerUnitGcBiasMetricsCollector`, `InsertSizeMetricsCollector.PerUnitInsertSizeMetricsCollector`, `RnaSeqMetricsCollector.PerUnitRnaSeqMetricsCollector`, `TargetMetricsCollector.PerUnitTargetMetricCollector`

      public interface PerUnitMetricCollector<BEAN extends htsjdk.samtools.metrics.MetricBase,​HKEY extends Comparable,​ARGTYPE>

  PerRecordCollector - An interface for classes that collect data in order to generate one or more metrics. This process usually occurs in the following fashion: 1. Loop through a data set (usually all records in a BAM file) and call collector.acceptRecord( data ), data in this step is usually added to metrics/Histogram objects 2. Call collector.finish() - perform any final calculations necessary after ALL records have been accepted 3. addMetricsToFile is then used to add any metric(s) or Histogram(s) to the given file BEAN - The Metric type we are generating HKEY - The Key used in any Histograms, use a Wildcard(?) type if there are no Histograms ARGTYPE - Collectors are often used in groups of accumulation levels, in order to avoid recalculating any information needed by multiple collectors we allow different types of arguments that extend DefaultPerRecordCollectorArgs to accommodate any computed values

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `acceptRecord​(ARGTYPE args)` | Add a SAMRecord (with ReferenceSequence and Read Group info) to the metric(s) being calculated)
    `void` | `addMetricsToFile​(htsjdk.samtools.metrics.MetricsFile<BEAN,​HKEY> file)` | Any metrics collected will be added to the metric file provided.
    `void` | `finish()` | When all records have been collected, compute any final values needed to finish constructing metrics/Histogram

- - ### Method Detail

    - #### acceptRecord

          void acceptRecord​(ARGTYPE args)

      Add a SAMRecord (with ReferenceSequence and Read Group info) to the metric(s) being calculated)
      Parameters:
        `args` - Contains SAMRecord, SAMReadGroupRecord, ReferenceSequence of current record and any previously computed values that might be needed for this class

    - #### finish

          void finish()

      When all records have been collected, compute any final values needed to finish constructing metrics/Histogram

    - #### addMetricsToFile

          void addMetricsToFile​(htsjdk.samtools.metrics.MetricsFile<BEAN,​HKEY> file)

      Any metrics collected will be added to the metric file provided.
      Parameters:
        `file` - MetricsFile to which all metrics created by this collector should be added