picard.analysis

## Class CollectInsertSizeMetrics

- java.lang.Object
- - picard.cmdline.CommandLineProgram
  - - picard.analysis.SinglePassSamProgram
    - - picard.analysis.CollectInsertSizeMetrics

-     public class CollectInsertSizeMetrics
      extends SinglePassSamProgram

  Command line program to read non-duplicate insert sizes, create a Histogram and report distribution statistics.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `double` | `DEVIATIONS`
    `File` | `Histogram_FILE`
    `protected static String` | `Histogram_R_SCRIPT`
    `Integer` | `HISTOGRAM_WIDTH`
    `boolean` | `INCLUDE_DUPLICATES`
    `Set<MetricAccumulationLevel>` | `METRIC_ACCUMULATION_LEVEL`
    `float` | `MINIMUM_PCT`

    - ### Fields inherited from class picard.analysis.SinglePassSamProgram

      `ASSUME_SORTED, INPUT, OUTPUT, STOP_AFTER`

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

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CollectInsertSizeMetrics()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `acceptRead(htsjdk.samtools.SAMRecord record, htsjdk.samtools.reference.ReferenceSequence ref)` Should be implemented by subclasses to accept SAMRecords one at a time.
    `protected String[]` | `customCommandLineValidation()` Put any custom command-line validation in an override of this method.
    `protected void` | `finish()` Should be implemented by subclasses to do one-time finalization work.
    `static void` | `main(String[] argv)` Required main method implementation.
    `protected void` | `setup(htsjdk.samtools.SAMFileHeader header, File samFile)` Should be implemented by subclasses to do one-time initialization work.
    `protected boolean` | `usesNoRefReads()` Can be overriden and set to false if the section of unmapped reads at the end of the file isn't needed.

    - ### Methods inherited from class picard.analysis.SinglePassSamProgram

      `doWork, makeItSo`

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

      `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

    - #### Histogram_R_SCRIPT

          protected static final String Histogram_R_SCRIPT

      See Also:
        Constant Field Values

    - #### Histogram_FILE

          @Option(shortName="H",
                  doc="File to write insert size Histogram chart to.")
          public File Histogram_FILE

    - #### DEVIATIONS

          @Option(doc="Generate mean, sd and plots by trimming the data down to MEDIAN + DEVIATIONS*MEDIAN_ABSOLUTE_DEVIATION. This is done because insert size data typically includes enough anomalous values from chimeras and other artifacts to make the mean and sd grossly misleading regarding the real distribution.")
          public double DEVIATIONS

    - #### HISTOGRAM_WIDTH

          @Option(shortName="W",
                  doc="Explicitly sets the Histogram width, overriding automatic truncation of Histogram tail. Also, when calculating mean and standard deviation, only bins <= Histogram_WIDTH will be included.",
                  optional=true)
          public Integer HISTOGRAM_WIDTH

    - #### MINIMUM_PCT

          @Option(shortName="M",
                  doc="When generating the Histogram, discard any data categories (out of FR, TANDEM, RF) that have fewer than this percentage of overall reads. (Range: 0 to 1).")
          public float MINIMUM_PCT

    - #### METRIC_ACCUMULATION_LEVEL

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

    - #### INCLUDE_DUPLICATES

          @Option(doc="If true, also include reads marked as duplicates in the insert size histogram.")
          public boolean INCLUDE_DUPLICATES

  - ### Constructor Detail

    - #### CollectInsertSizeMetrics

          public CollectInsertSizeMetrics()

  - ### Method Detail

    - #### main

          public static void main(String[] argv)

      Required main method implementation.

    - #### customCommandLineValidation

          protected String[] customCommandLineValidation()

      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.

    - #### usesNoRefReads

          protected boolean usesNoRefReads()

      Description copied from class: `SinglePassSamProgram`
      Can be overriden and set to false if the section of unmapped reads at the end of the file isn't needed.
      Overrides:
        `usesNoRefReads` in class `SinglePassSamProgram`

    - #### setup

          protected void setup(htsjdk.samtools.SAMFileHeader header,
                               File samFile)

      Description copied from class: `SinglePassSamProgram`
      Should be implemented by subclasses to do one-time initialization work.
      Specified by:
        `setup` in class `SinglePassSamProgram`

    - #### acceptRead

          protected void acceptRead(htsjdk.samtools.SAMRecord record,
                                    htsjdk.samtools.reference.ReferenceSequence ref)

      Description copied from class: `SinglePassSamProgram`
      Should be implemented by subclasses to accept SAMRecords one at a time. If the read has a reference sequence and a reference sequence file was supplied to the program it will be passed as 'ref'. Otherwise 'ref' may be null.
      Specified by:
        `acceptRead` in class `SinglePassSamProgram`

    - #### finish

          protected void finish()

      Description copied from class: `SinglePassSamProgram`
      Should be implemented by subclasses to do one-time finalization work.
      Specified by:
        `finish` in class `SinglePassSamProgram`