# Class CollectInsertSizeMetrics

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

@DocumentedFeature 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
Description
`double`
`DEVIATIONS`
`File`
`Histogram_FILE`
`protected static final String`
`Histogram_R_SCRIPT`
`Integer`
`HISTOGRAM_WIDTH`
`boolean`
`INCLUDE_DUPLICATES`
`Set<MetricAccumulationLevel>`
`METRIC_ACCUMULATION_LEVEL`
`Integer`
`MIN_HISTOGRAM_WIDTH`
`float`
`MINIMUM_PCT`

### Fields inherited from class SinglePassSamProgram

`ASSUME_SORTED, INPUT, output, OUTPUT, STOP_AFTER`

### Fields inherited from class CommandLineProgram

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

## Constructor Summary

Constructors
Constructor
Description
`CollectInsertSizeMetrics()`

## Method Summary

Modifier and Type
Method
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.
`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 overridden and set to false if the section of unmapped reads at the end of the file isn't needed.

### Methods inherited from class SinglePassSamProgram

`doWork, getOutputArgumentCollection, makeItSo, setReferenceSequence`

### Methods inherited from class CommandLineProgram

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

### Methods inherited from class Object

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

## Field Details

### Histogram_R_SCRIPT

protected static final String Histogram_R_SCRIPT

See Also:
  - Constant Field Values

### Histogram_FILE

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

### DEVIATIONS

@Argument(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

@Argument(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

### MIN_HISTOGRAM_WIDTH

@Argument(shortName="MW", doc="Minimum width of histogram plots. In the case when the histogram would otherwise betruncated to a shorter range of sizes, the MIN_HISTOGRAM_WIDTH will enforce a minimum range.", optional=true) public Integer MIN_HISTOGRAM_WIDTH

### MINIMUM_PCT

@Argument(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

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

### INCLUDE_DUPLICATES

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

## Constructor Details

### CollectInsertSizeMetrics

public CollectInsertSizeMetrics()

## Method Details

### 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 overridden 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`