picard.analysis

## Class CollectWgsMetrics

- java.lang.Object
- - picard.cmdline.CommandLineProgram
  - - picard.analysis.CollectWgsMetrics

- Direct Known Subclasses:
    CollectRawWgsMetrics, CollectWgsMetricsFromSampledSites, CollectWgsMetricsWithNonZeroCoverage

      public class CollectWgsMetrics
      extends CommandLineProgram

  Computes a number of metrics that are useful for evaluating coverage and performance of whole genome sequencing experiments.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `CollectWgsMetrics.WgsMetrics` Metrics for evaluating the performance of whole genome sequencing experiments.
    `protected class` | `CollectWgsMetrics.WgsMetricsCollector`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `boolean` | `COUNT_UNPAIRED`
    `int` | `COVERAGE_CAP`
    `boolean` | `INCLUDE_BQ_HISTOGRAM`
    `File` | `INPUT`
    `File` | `INTERVALS`
    `int` | `LOCUS_ACCUMULATION_CAP`
    `int` | `MINIMUM_BASE_QUALITY`
    `int` | `MINIMUM_MAPPING_QUALITY`
    `File` | `OUTPUT`
    `File` | `REFERENCE_SEQUENCE`
    `int` | `SAMPLE_SIZE`
    `long` | `STOP_AFTER`

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

      `COMPRESSION_LEVEL, CREATE_INDEX, CREATE_MD5_FILE, GA4GH_CLIENT_SECRETS, MAX_RECORDS_IN_RAM, QUIET, TMP_DIR, VALIDATION_STRINGENCY, VERBOSITY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CollectWgsMetrics()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected int` | `doWork()` Do the work after command line has been parsed.

    `protected CollectWgsMetrics.WgsMetrics`

    `generateWgsMetrics(htsjdk.samtools.util.IntervalList intervals, htsjdk.samtools.util.Histogram<Integer> highQualityDepthHistogram, htsjdk.samtools.util.Histogram<Integer> unfilteredDepthHistogram, double pctExcludedByMapq, double pctExcludedByDupes, double pctExcludedByPairing, double pctExcludedByBaseq, double pctExcludedByOverlap, double pctExcludedByCapping, double pctTotal, int coverageCap, htsjdk.samtools.util.Histogram<Integer> unfilteredBaseQHistogram, int theoreticalHetSensitivitySampleSize)`

    `protected long` | `getBasesExcludedBy(CountingFilter filter)` If INTERVALS is specified, this will count bases beyond the interval list when the read overlaps the intervals and extends beyond the edge.
    `protected CollectWgsMetrics.WgsMetricsCollector` | `getCollector(int coverageCap, htsjdk.samtools.util.IntervalList intervals)`
    `protected htsjdk.samtools.util.IntervalList` | `getIntervalsToExamine()` Gets the intervals over which we will calculate metrics.
    `protected htsjdk.samtools.util.SamLocusIterator` | `getLocusIterator(htsjdk.samtools.SamReader in)`
    `protected htsjdk.samtools.SAMFileHeader` | `getSamFileHeader()` This method should only be called after `this.getSamReader()` is called.
    `protected htsjdk.samtools.SamReader` | `getSamReader()` Gets the SamReader from which records will be examined.
    `static void` | `main(String[] args)`

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

      `customCommandLineValidation, getCommandLine, getCommandLineParser, getDefaultHeaders, getMetricsFile, getNestedOptions, getNestedOptionsForHelp, getStandardUsagePreamble, getVersion, instanceMain, instanceMainWithExit, parseArgs, setDefaultHeaders`

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

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

- - ### Field Detail

    - #### INPUT

          @Option(shortName="I",
                  doc="Input SAM or BAM file.")
          public File INPUT

    - #### OUTPUT

          @Option(shortName="O",
                  doc="Output metrics file.")
          public File OUTPUT

    - #### REFERENCE_SEQUENCE

          @Option(shortName="R",
                  doc="The reference sequence fasta aligned to.")
          public File REFERENCE_SEQUENCE

    - #### MINIMUM_MAPPING_QUALITY

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

    - #### MINIMUM_BASE_QUALITY

          @Option(shortName="Q",
                  doc="Minimum base quality for a base to contribute coverage. N bases will be treated as having a base quality of negative infinity and will therefore be excluded from coverage regardless of the value of this parameter.",
                  overridable=true)
          public int MINIMUM_BASE_QUALITY

    - #### COVERAGE_CAP

          @Option(shortName="CAP",
                  doc="Treat positions with coverage exceeding this value as if they had coverage at this value (but calculate the difference for PCT_EXC_CAPPED).",
                  overridable=true)
          public int COVERAGE_CAP

    - #### LOCUS_ACCUMULATION_CAP

          @Option(doc="At positions with coverage exceeding this value, completely ignore reads that accumulate beyond this value (so that they will not be considered for PCT_EXC_CAPPED).  Used to keep memory consumption in check, but could create bias if set too low",
                  overridable=true)
          public int LOCUS_ACCUMULATION_CAP

    - #### STOP_AFTER

          @Option(doc="For debugging purposes, stop after processing this many genomic bases.")
          public long STOP_AFTER

    - #### INCLUDE_BQ_HISTOGRAM

          @Option(doc="Determines whether to include the base quality histogram in the metrics file.")
          public boolean INCLUDE_BQ_HISTOGRAM

    - #### COUNT_UNPAIRED

          @Option(doc="If true, count unpaired reads, and paired reads with one end unmapped")
          public boolean COUNT_UNPAIRED

    - #### SAMPLE_SIZE

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

    - #### INTERVALS

          @Option(doc="An interval list file that contains the positions to restrict the assessment. Please note that all bases of reads that overlap these intervals will be considered, even if some of those bases extend beyond the boundaries of the interval. The ideal use case for this argument is to use it to restrict the calculation to a subset of (whole) contigs. To restrict the calculation just to individual positions without overlap, please see CollectWgsMetricsFromSampledSites.",
                  optional=true,
                  overridable=true)
          public File INTERVALS

  - ### Constructor Detail

    - #### CollectWgsMetrics

          public CollectWgsMetrics()

  - ### Method Detail

    - #### main

          public static void main(String[] args)

    - #### getSamReader

          protected htsjdk.samtools.SamReader getSamReader()

      Gets the SamReader from which records will be examined. This will also set the header so that it is available in

    - #### doWork

          protected int doWork()

      Description copied from class: `CommandLineProgram`
      Do the work after command line has been parsed. RuntimeException may be thrown by this method, and are reported appropriately.
      Specified by:
        `doWork` in class `CommandLineProgram`
      Returns:
        program exit status.

    - #### getIntervalsToExamine

          protected htsjdk.samtools.util.IntervalList getIntervalsToExamine()

      Gets the intervals over which we will calculate metrics.

    - #### getSamFileHeader

          protected htsjdk.samtools.SAMFileHeader getSamFileHeader()

      This method should only be called after `this.getSamReader()` is called.

    - #### generateWgsMetrics

          protected CollectWgsMetrics.WgsMetrics generateWgsMetrics(htsjdk.samtools.util.IntervalList intervals,
                                                                    htsjdk.samtools.util.Histogram<Integer> highQualityDepthHistogram,
                                                                    htsjdk.samtools.util.Histogram<Integer> unfilteredDepthHistogram,
                                                                    double pctExcludedByMapq,
                                                                    double pctExcludedByDupes,
                                                                    double pctExcludedByPairing,
                                                                    double pctExcludedByBaseq,
                                                                    double pctExcludedByOverlap,
                                                                    double pctExcludedByCapping,
                                                                    double pctTotal,
                                                                    int coverageCap,
                                                                    htsjdk.samtools.util.Histogram<Integer> unfilteredBaseQHistogram,
                                                                    int theoreticalHetSensitivitySampleSize)

    - #### getBasesExcludedBy

          protected long getBasesExcludedBy(CountingFilter filter)

      If INTERVALS is specified, this will count bases beyond the interval list when the read overlaps the intervals and extends beyond the edge. Ideally INTERVALS should only include regions that have hard edges without reads that could extend beyond the boundary (such as a whole contig).

    - #### getLocusIterator

          protected htsjdk.samtools.util.SamLocusIterator getLocusIterator(htsjdk.samtools.SamReader in)

    - #### getCollector

          protected CollectWgsMetrics.WgsMetricsCollector getCollector(int coverageCap,
                                                                       htsjdk.samtools.util.IntervalList intervals)

      Parameters:
        `coverageCap` - the maximum depth/coverage to consider.
        `intervals` - the intervals over which metrics are collected.
      Returns: