picard.analysis.directed.CollectTargetedPcrMetrics Maven / Gradle / Ivy
package picard.analysis.directed;
import htsjdk.samtools.SAMReadGroupRecord;
import htsjdk.samtools.reference.ReferenceSequenceFile;
import htsjdk.samtools.util.IntervalList;
import picard.analysis.MetricAccumulationLevel;
import picard.cmdline.CommandLineProgramProperties;
import picard.cmdline.Option;
import picard.cmdline.programgroups.Metrics;
import java.io.File;
import java.util.List;
import java.util.Set;
/**
* Collect metric information for target pcr metrics runs. See CollectTargetedMetrics and TargetPcrMetricsCollector for
* more information
*/
@CommandLineProgramProperties(
usage = CollectTargetedPcrMetrics.USAGE_SUMMARY + CollectTargetedPcrMetrics.USAGE_DETAILS,
usageShort = CollectTargetedPcrMetrics.USAGE_SUMMARY,
programGroup = Metrics.class
)
public class CollectTargetedPcrMetrics extends CollectTargetedMetrics {
static final String USAGE_SUMMARY = "Calculate PCR-related metrics from targeted sequencing data. ";
static final String USAGE_DETAILS = "This tool calculates a set of PCR-related metrics from an aligned SAM or " +
"BAM file containing targeted sequencing data. It is appropriate for data produced with multiple small-target technologies " +
"including exome sequencing an custom amplicon panels such as the Illumina " +
"" +
"TruSeq Custom Amplicon (TSCA) kit.
" +
"" +
"If a reference sequence is provided, AT/GC dropout metrics will be calculated and the PER_TARGET_COVERAGE option can be " +
"used to output GC content and mean coverage information for each target. The AT/GC dropout metrics indicate the degree of " +
"inadequate coverage of a particular region based on its AT or GC content. The PER_TARGET_COVERAGE option can be used to " +
"output GC content and mean sequence depth information for every target interval.
" +
"" +
"Note: Metrics labeled as percentages are actually expressed as fractions!
" +
"Usage Example
" +
"" +
"java -jar picard.jar CollectTargetedPcrMetrics \\
" +
" I=input.bam \\
" +
" O=pcr_metrics.txt \\
" +
" R=reference_sequence.fasta \\
" +
" AMPLICON_INTERVALS=amplicon.interval_list \\
" +
" TARGET_INTERVALS=targets.interval_list " +
"
" +
"Please see the metrics definitions page on " +
"TargetedPcrMetrics " +
"for detailed explanations of the output metrics produced by this tool." +
"
";
@Option(shortName = "AI", doc = "An interval list file that contains the locations of the baits used.")
public File AMPLICON_INTERVALS;
@Option(shortName = "N", doc = "Custom amplicon set name. If not provided it is inferred from the filename of the AMPLICON_INTERVALS intervals.", optional = true)
public String CUSTOM_AMPLICON_SET_NAME;
/**
* @return AMPLICON_INTERVALS
*/
@Override
protected IntervalList getProbeIntervals() {
return IntervalList.fromFile(AMPLICON_INTERVALS);
}
/**
* @return CUSTOM_AMPLICON_SET_NAME
*/
@Override
protected String getProbeSetName() {
return CUSTOM_AMPLICON_SET_NAME != null ? CUSTOM_AMPLICON_SET_NAME : CollectTargetedMetrics.renderProbeNameFromFile(AMPLICON_INTERVALS);
}
/** Stock main method. */
public static void main(final String[] argv) {
System.exit(new CollectTargetedPcrMetrics().instanceMain(argv));
}
@Override
protected TargetedPcrMetricsCollector makeCollector(final Set accumulationLevels,
final List samRgRecords,
final ReferenceSequenceFile refFile,
final File perTargetCoverage,
final File perBaseCoverage,
final IntervalList targetIntervals,
final IntervalList probeIntervals,
final String probeSetName,
final int nearProbeDistance) {
return new TargetedPcrMetricsCollector(accumulationLevels, samRgRecords, refFile, perTargetCoverage, perBaseCoverage, targetIntervals, probeIntervals, probeSetName, nearProbeDistance,
MINIMUM_MAPPING_QUALITY, MINIMUM_BASE_QUALITY, CLIP_OVERLAPPING_READS, true, COVERAGE_CAP, SAMPLE_SIZE);
}
}