From 48545af7469f49b69b73bd8c1e24d87459f1fa57 Mon Sep 17 00:00:00 2001 From: Nils Homer Date: Tue, 6 Feb 2024 12:55:25 -0700 Subject: [PATCH] Add the EXT argument to CollectSamErrorMetrics. (#1478) * Add the EXT argument to CollectSamErrorMetrics. --------- Co-authored-by: Can Kockan --- .../sam/SamErrorMetric/CollectSamErrorMetrics.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/picard/sam/SamErrorMetric/CollectSamErrorMetrics.java b/src/main/java/picard/sam/SamErrorMetric/CollectSamErrorMetrics.java index 7f58931394..4b071ef473 100644 --- a/src/main/java/picard/sam/SamErrorMetric/CollectSamErrorMetrics.java +++ b/src/main/java/picard/sam/SamErrorMetric/CollectSamErrorMetrics.java @@ -212,6 +212,11 @@ public class CollectSamErrorMetrics extends CommandLineProgram { ) public boolean INTERVAL_ITERATOR = false; + @Argument(shortName = "EXT", + doc = "Append the given file extension to all metric file names (ex. OUTPUT.insert_size_metrics.EXT). No extension by default.", + optional = true) + public String FILE_EXTENSION = ""; + // ===================================================================== /** Random object from which to pull pseudo-random numbers. Initialized in {@link #initializeAggregationState()}.*/ @@ -450,7 +455,7 @@ private SamLocusAndReferenceIterator createSamLocusAndReferenceIterator(final Sa log.info("Using " + aggregatorList.size() + " aggregators."); aggregatorList.forEach(la -> - IOUtil.assertFileIsWritable(new File(OUTPUT + la.getSuffix()))); + IOUtil.assertFileIsWritable(new File(OUTPUT + la.getSuffix() + FILE_EXTENSION))); // iterate over loci log.info("Starting iteration over loci"); @@ -540,7 +545,7 @@ private void writeMetricsFileForAggregator(final BaseErrorAggregation locusAggre } } - file.write(new File(OUTPUT + "." + locusAggregator.getSuffix())); + file.write(new File(OUTPUT + "." + locusAggregator.getSuffix() + FILE_EXTENSION)); } /**