From bbc028b64e16605fa71fed496702f404e3098e61 Mon Sep 17 00:00:00 2001 From: George Grant Date: Wed, 7 Feb 2024 13:50:06 -0500 Subject: [PATCH] Parameterize the logging frequency for ProgressLogger in GatherVcfsCloud. (#8662) --- .../hellbender/tools/GatherVcfsCloud.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/broadinstitute/hellbender/tools/GatherVcfsCloud.java b/src/main/java/org/broadinstitute/hellbender/tools/GatherVcfsCloud.java index 1751baece73..2fe45cc2e52 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/GatherVcfsCloud.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/GatherVcfsCloud.java @@ -129,6 +129,10 @@ public final class GatherVcfsCloud extends CommandLineProgram { "AUTOMATIC chooses BLOCK if possible and CONVENTIONAL otherwise.") public GatherType gatherType = GatherType.AUTOMATIC; + @Argument(fullName = "progress-logger-frequency", + doc = "The frequency with which the progress is logged to output (i.e. every N records)") + public Integer progressLoggerFrequency = 10000; + @Advanced @Argument(fullName = IGNORE_SAFETY_CHECKS_LONG_NAME, doc = "Disable sanity checks to improve performance, may result in silently creating corrupted outputs data") public boolean ignoreSafetyChecks = false; @@ -188,7 +192,7 @@ protected Object doWork() { break; case CONVENTIONAL: log.info("Gathering by conventional means."); - gatherConventionally(sequenceDictionary, createIndex, inputPaths, output, cloudPrefetchBuffer, disableContigOrderingCheck); + gatherConventionally(sequenceDictionary, createIndex, inputPaths, output, cloudPrefetchBuffer, disableContigOrderingCheck, progressLoggerFrequency); break; default: throw new GATKException.ShouldNeverReachHereException("Invalid gather type: " + gatherType + ". Please report this bug to the developers."); @@ -299,13 +303,14 @@ private static void gatherConventionally(final SAMSequenceDictionary sequenceDic final List inputFiles, final File outputFile, final int cloudPrefetchBuffer, - final boolean disableContigOrderingCheck) { + final boolean disableContigOrderingCheck, + final int progressLoggerFrequency) { final EnumSet options = EnumSet.copyOf(VariantContextWriterBuilder.DEFAULT_OPTIONS); if (createIndex) options.add(Options.INDEX_ON_THE_FLY); else options.remove(Options.INDEX_ON_THE_FLY); try (final VariantContextWriter out = new VariantContextWriterBuilder().setOutputFile(outputFile) .setReferenceDictionary(sequenceDictionary).setOptions(options).build()) { - final ProgressLogger progress = new ProgressLogger(log, 10000); + final ProgressLogger progress = new ProgressLogger(log, progressLoggerFrequency); VariantContext lastContext = null; Path lastFile = null; VCFHeader firstHeader = null;