Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameterize the logging frequency for ProgressLogger. #8662

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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.");
Expand Down Expand Up @@ -299,13 +303,14 @@ private static void gatherConventionally(final SAMSequenceDictionary sequenceDic
final List<Path> inputFiles,
final File outputFile,
final int cloudPrefetchBuffer,
final boolean disableContigOrderingCheck) {
final boolean disableContigOrderingCheck,
final int progressLoggerFrequency) {
final EnumSet<Options> 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;
Expand Down
Loading