Package picard.analysis.directed

## Class TargetMetricsCollector.PerUnitTargetMetricCollector

- java.lang.Object
- - picard.analysis.directed.TargetMetricsCollector.PerUnitTargetMetricCollector

- All Implemented Interfaces:
    `PerUnitMetricCollector<METRIC_TYPE,​Integer,​htsjdk.samtools.SAMRecord>`
  Enclosing class:
    TargetMetricsCollector<METRIC_TYPE extends MultilevelMetrics>

      public class TargetMetricsCollector.PerUnitTargetMetricCollector
      extends Object
      implements PerUnitMetricCollector<METRIC_TYPE,​Integer,​htsjdk.samtools.SAMRecord>

  Collect the Target Metrics for one unit of "accumulation" (i.e. for one sample, or for one library ...)

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---

    `PerUnitTargetMetricCollector​(String probeSetName, Set<htsjdk.samtools.util.Interval> coverageTargets, String sample, String library, String readGroup, long probeTerritory, long targetTerritory, long genomeSize, Map<htsjdk.samtools.util.Interval,​Double> intervalToGc, int minimumMappingQuality, int minimumBaseQuality, boolean clipOverlappingReads, boolean includeIndels)`

    Constructor that parses the squashed reference to genome reference file and stores the information in a map for later use.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `acceptRecord​(htsjdk.samtools.SAMRecord record)` | Adds information about an individual SAMRecord to the statistics.
    `void` | `addMetricsToFile​(htsjdk.samtools.metrics.MetricsFile<METRIC_TYPE,​Integer> hsMetricsComparableMetricsFile)` | 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
    `Map<htsjdk.samtools.util.Interval,​TargetMetricsCollector.Coverage>` | `getCoverageByTarget()` | Returns the accumulated coverage per target.
    `void` | `setBaitSetName​(String name)` | Sets the name of the bait set explicitly instead of inferring it from the bait file.
    `void` | `setPerBaseOutput​(File perBaseOutput)` | Sets the (optional) File to write per-base coverage information to.
    `void` | `setPerTargetOutput​(File perTargetOutput)` | Sets the (optional) File to write per-target coverage information to.

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### PerUnitTargetMetricCollector

          public PerUnitTargetMetricCollector​(String probeSetName,
                                              Set<htsjdk.samtools.util.Interval> coverageTargets,
                                              String sample,
                                              String library,
                                              String readGroup,
                                              long probeTerritory,
                                              long targetTerritory,
                                              long genomeSize,
                                              Map<htsjdk.samtools.util.Interval,​Double> intervalToGc,
                                              int minimumMappingQuality,
                                              int minimumBaseQuality,
                                              boolean clipOverlappingReads,
                                              boolean includeIndels)

      Constructor that parses the squashed reference to genome reference file and stores the information in a map for later use.

  - ### Method Detail

    - #### setPerTargetOutput

          public void setPerTargetOutput​(File perTargetOutput)

      Sets the (optional) File to write per-target coverage information to. If null (the default), no file is produced.

    - #### setPerBaseOutput

          public void setPerBaseOutput​(File perBaseOutput)

      Sets the (optional) File to write per-base coverage information to. If null (the default), no file is produced.

    - #### setBaitSetName

          public void setBaitSetName​(String name)

      Sets the name of the bait set explicitly instead of inferring it from the bait file.

    - #### getCoverageByTarget

          public Map<htsjdk.samtools.util.Interval,​TargetMetricsCollector.Coverage> getCoverageByTarget()

      Returns the accumulated coverage per target. Note that while the returned Map is immutable, it is possible that the underlying Map will continue to be mutated if the map is retrieved prior to additional calls to `acceptRecord(SAMRecord)`.

    - #### acceptRecord

          public void acceptRecord​(htsjdk.samtools.SAMRecord record)

      Adds information about an individual SAMRecord to the statistics.
      Specified by:
        `acceptRecord` in interface `PerUnitMetricCollector<METRIC_TYPE extends MultilevelMetrics,​Integer,​htsjdk.samtools.SAMRecord>`
      Parameters:
        `record` - Contains SAMRecord, SAMReadGroupRecord, ReferenceSequence of current record and any previously computed values that might be needed for this class

    - #### finish

          public void finish()

      Description copied from interface: `PerUnitMetricCollector`
      When all records have been collected, compute any final values needed to finish constructing metrics/Histogram
      Specified by:
        `finish` in interface `PerUnitMetricCollector<METRIC_TYPE extends MultilevelMetrics,​Integer,​htsjdk.samtools.SAMRecord>`

    - #### addMetricsToFile

          public void addMetricsToFile​(htsjdk.samtools.metrics.MetricsFile<METRIC_TYPE,​Integer> hsMetricsComparableMetricsFile)

      Description copied from interface: `PerUnitMetricCollector`
      Any metrics collected will be added to the metric file provided.
      Specified by:
        `addMetricsToFile` in interface `PerUnitMetricCollector<METRIC_TYPE extends MultilevelMetrics,​Integer,​htsjdk.samtools.SAMRecord>`
      Parameters:
        `hsMetricsComparableMetricsFile` - MetricsFile to which all metrics created by this collector should be added