Skip to content

Commit

Permalink
Add the EXT argument to CollectSamErrorMetrics. (#1478)
Browse files Browse the repository at this point in the history
* Add the EXT argument to CollectSamErrorMetrics.

---------

Co-authored-by: Can Kockan <[email protected]>
  • Loading branch information
nh13 and kockan authored Feb 6, 2024
1 parent 1abb61f commit 48545af
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()}.*/
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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));
}

/**
Expand Down

0 comments on commit 48545af

Please sign in to comment.