Package picard.analysis.directed

## Class CollectTargetedMetrics<METRIC extends MultilevelMetrics,​COLLECTOR extends TargetMetricsCollector<METRIC>>

- java.lang.Object
- - picard.cmdline.CommandLineProgram
  - - picard.analysis.directed.CollectTargetedMetrics<METRIC,​COLLECTOR>

- Direct Known Subclasses:
    `CollectHsMetrics`, `CollectTargetedPcrMetrics`

      public abstract class CollectTargetedMetrics<METRIC extends MultilevelMetrics,​COLLECTOR extends TargetMetricsCollector<METRIC>>
      extends CommandLineProgram

  Both CollectTargetedPCRMetrics and CollectHsSelection share virtually identical program structures except for the name of their targeting mechanisms (e.g. bait set or amplicon set). The shared behavior of these programs is encapsulated in CollectTargetedMetrics which is then subclassed by CollectHsMetrics and CollectTargetedPcrMetrics.

  This program verifies the input parameters to TargetMetricsCollector and converts all files to the format desired by TargetMetricsCollector. Then it instantiates a TargetMetricsCollector and collects metric information for all reads in the INPUT sam file.

- - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `List<Double>` | `ALLELE_FRACTION` |
    `boolean` | `CLIP_OVERLAPPING_READS` |
    `int` | `COVERAGE_CAP` |
    `File` | `INPUT` |
    `Set<MetricAccumulationLevel>` | `METRIC_ACCUMULATION_LEVEL` |
    `int` | `MINIMUM_BASE_QUALITY` |
    `int` | `MINIMUM_MAPPING_QUALITY` |
    `int` | `NEAR_DISTANCE` |
    `File` | `OUTPUT` |
    `File` | `PER_BASE_COVERAGE` |
    `File` | `PER_TARGET_COVERAGE` |
    `int` | `SAMPLE_SIZE` |
    `List<File>` | `TARGET_INTERVALS` |
    `File` | `THEORETICAL_SENSITIVITY_OUTPUT` |

    - ### Fields inherited from class picard.cmdline.CommandLineProgram

      `COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, GA4GH_CLIENT_SECRETS, MAX_RECORDS_IN_RAM, QUIET, REFERENCE_SEQUENCE, referenceSequence, specialArgumentsCollection, TMP_DIR, USE_JDK_DEFLATER, USE_JDK_INFLATER, VALIDATION_STRINGENCY, VERBOSITY`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `CollectTargetedMetrics()` |

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected String[]` | `customCommandLineValidation()` | Put any custom command-line validation in an override of this method.
    `protected int` | `doWork()` | Asserts that files are readable and writable and then fires off an HsMetricsCalculator instance to do the real work.
    `protected abstract htsjdk.samtools.util.IntervalList` | `getProbeIntervals()` |
    `protected abstract String` | `getProbeSetName()` |

    `protected abstract COLLECTOR`

    `makeCollector​(Set<MetricAccumulationLevel> accumulationLevels, List<htsjdk.samtools.SAMReadGroupRecord> samRgRecords, htsjdk.samtools.reference.ReferenceSequenceFile refFile, File perTargetCoverage, File perBaseCoverage, htsjdk.samtools.util.IntervalList targetIntervals, htsjdk.samtools.util.IntervalList probeIntervals, String probeSetName, int nearProbeDistance)`

    A factory method for the TargetMetricsCollector to use this time.

    - ### Methods inherited from class picard.cmdline.CommandLineProgram

      `getCommandLine, getCommandLineParser, getDefaultHeaders, getFaqLink, getMetricsFile, getStandardUsagePreamble, getStandardUsagePreamble, getVersion, hasWebDocumentation, instanceMain, instanceMainWithExit, makeReferenceArgumentCollection, parseArgs, requiresReference, setDefaultHeaders, useLegacyParser`

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

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

- - ### Field Detail

    - #### TARGET_INTERVALS

          @Argument(shortName="TI",
                    doc="An interval list file that contains the locations of the targets.",
                    minElements=1)
          public List<File> TARGET_INTERVALS

    - #### INPUT

          @Argument(shortName="I",
                    doc="An aligned SAM or BAM file.")
          public File INPUT

    - #### OUTPUT

          @Argument(shortName="O",
                    doc="The output file to write the metrics to.")
          public File OUTPUT

    - #### METRIC_ACCUMULATION_LEVEL

          @Argument(shortName="LEVEL",
                    doc="The level(s) at which to accumulate metrics.")
          public Set<MetricAccumulationLevel> METRIC_ACCUMULATION_LEVEL

    - #### PER_TARGET_COVERAGE

          @Argument(optional=true,
                    doc="An optional file to output per target coverage information to.")
          public File PER_TARGET_COVERAGE

    - #### PER_BASE_COVERAGE

          @Argument(optional=true,
                    doc="An optional file to output per base coverage information to. The per-base file contains one line per target base and can grow very large. It is not recommended for use with large target sets.")
          public File PER_BASE_COVERAGE

    - #### NEAR_DISTANCE

          @Argument(optional=true,
                    doc="The maximum distance between a read and the nearest probe/bait/amplicon for the read to be considered \'near probe\' and included in percent selected.")
          public int NEAR_DISTANCE

    - #### MINIMUM_MAPPING_QUALITY

          @Argument(shortName="MQ",
                    doc="Minimum mapping quality for a read to contribute coverage.")
          public int MINIMUM_MAPPING_QUALITY

    - #### MINIMUM_BASE_QUALITY

          @Argument(shortName="Q",
                    doc="Minimum base quality for a base to contribute coverage.")
          public int MINIMUM_BASE_QUALITY

    - #### CLIP_OVERLAPPING_READS

          @Argument(doc="True if we are to clip overlapping reads, false otherwise.",
                    optional=true)
          public boolean CLIP_OVERLAPPING_READS

    - #### COVERAGE_CAP

          @Argument(shortName="covMax",
                    doc="Parameter to set a max coverage limit for Theoretical Sensitivity calculations. Default is 200.",
                    optional=true)
          public int COVERAGE_CAP

    - #### SAMPLE_SIZE

          @Argument(doc="Sample Size used for Theoretical Het Sensitivity sampling. Default is 10000.",
                    optional=true)
          public int SAMPLE_SIZE

    - #### THEORETICAL_SENSITIVITY_OUTPUT

          @Argument(doc="Output for Theoretical Sensitivity metrics where the allele fractions are provided by the ALLELE_FRACTION argument.",
                    optional=true)
          public File THEORETICAL_SENSITIVITY_OUTPUT

    - #### ALLELE_FRACTION

          @Argument(doc="Allele fraction for which to calculate theoretical sensitivity.",
                    optional=true)
          public List<Double> ALLELE_FRACTION

  - ### Constructor Detail

    - #### CollectTargetedMetrics

          public CollectTargetedMetrics()

  - ### Method Detail

    - #### getProbeIntervals

          protected abstract htsjdk.samtools.util.IntervalList getProbeIntervals()

    - #### getProbeSetName

          protected abstract String getProbeSetName()

    - #### makeCollector

          protected abstract COLLECTOR makeCollector​(Set<MetricAccumulationLevel> accumulationLevels,
                                                     List<htsjdk.samtools.SAMReadGroupRecord> samRgRecords,
                                                     htsjdk.samtools.reference.ReferenceSequenceFile refFile,
                                                     File perTargetCoverage,
                                                     File perBaseCoverage,
                                                     htsjdk.samtools.util.IntervalList targetIntervals,
                                                     htsjdk.samtools.util.IntervalList probeIntervals,
                                                     String probeSetName,
                                                     int nearProbeDistance)

      A factory method for the TargetMetricsCollector to use this time. Examples of TargetMetricsCollector: (TargetedPcrMetricsCollector, HsMetricsCalculator)
      Returns:
        A TargetMetricsCollector to which we will pass SAMRecords

    - #### doWork

          protected int doWork()

      Asserts that files are readable and writable and then fires off an HsMetricsCalculator instance to do the real work.
      Specified by:
        `doWork` in class `CommandLineProgram`
      Returns:
        program exit status.

    - #### customCommandLineValidation

          protected String[] customCommandLineValidation()

      Description copied from class: `CommandLineProgram`
      Put any custom command-line validation in an override of this method. clp is initialized at this point and can be used to print usage and access argv. Any options set by command-line parser can be validated.
      Overrides:
        `customCommandLineValidation` in class `CommandLineProgram`
      Returns:
        null if command line is valid. If command line is invalid, returns an array of error message to be written to the appropriate place.