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

Added an argument mode manager and a demonstration of how it might be used in HaplotypeCaller --dragen-mode #7745

Merged
merged 2 commits into from
May 10, 2022

Conversation

jamesemery
Copy link
Collaborator

No description provided.

…d demonstrated on the HaplotypeCaller dragen mode
@jamesemery jamesemery requested a review from droazen March 30, 2022 19:38
*
* The method does not overwrite arguments already set on the command line (as indicated by the parser)
* Additionally, the method emits a warning message indicating which argument were set by the mode and
* to which values.
Copy link
Collaborator

@droazen droazen May 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment documenting when in the arg parsing process this method needs to be invoked (eg., after args have already been parsed in customCommandLineValidation() )

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

* @param modeName - the name of the mode being set. This is used in textual message, such as the warning
* issued to notify the user of the changed argument
*/
public static void setArgValues(final CommandLineParser parser, final String[] argValues, final String modeName) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we avoid setting these arg values if we're not in the specified mode?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method should only be called if the tool has already determined that it must be set. I added a note about it.

ModeArgumentUtils.setArgValues(
getCommandLineParser(),
hcArgs.getDragenNameValuePairs(),
HaplotypeCallerArgumentCollection.DRAGEN_GATK_MODE_LONG_NAME);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be a good idea for setArgValues() itself to check whether the provided mode is activated, and proceed with setting the args only if it's active? Or is an external check on the mode like you have here preferable? Either way, we don't need to address in this PR.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good point. I think ultimately the right place for this utility to live is in barclay and consequently this should maybe be automatic? This is a stopgap that helps handle the proliferation of messy argument mode switches in our tools for now.

@codecov
Copy link

codecov bot commented May 9, 2022

Codecov Report

Merging #7745 (7e6701e) into master (c6eb337) will increase coverage by 68.305%.
The diff coverage is 81.727%.

@@               Coverage Diff                @@
##              master     #7745        +/-   ##
================================================
+ Coverage     18.644%   86.949%   +68.305%     
- Complexity      4635     36911     +32276     
================================================
  Files           1261      2215       +954     
  Lines          73745    173559     +99814     
  Branches       11768     18741      +6973     
================================================
+ Hits           13749    150908    +137159     
+ Misses         57944     16042     -41902     
- Partials        2052      6609      +4557     
Impacted Files Coverage Δ
...ine/GATKPlugin/GATKAnnotationPluginDescriptor.java 83.851% <ø> (+46.584%) ⬆️
...ine/GATKPlugin/GATKReadFilterPluginDescriptor.java 84.615% <ø> (+32.308%) ⬆️
...nder/cmdline/PicardCommandLineProgramExecutor.java 63.636% <0.000%> (+63.636%) ⬆️
...e/argumentcollections/DbsnpArgumentCollection.java 100.000% <ø> (ø)
...llections/MultiVariantInputArgumentCollection.java 100.000% <ø> (+100.000%) ⬆️
...broadinstitute/hellbender/engine/FeatureCache.java 92.157% <ø> (+19.608%) ⬆️
...oadinstitute/hellbender/engine/FeatureContext.java 81.818% <ø> (+72.727%) ⬆️
...roadinstitute/hellbender/engine/ProgressMeter.java 93.814% <ø> (+7.899%) ⬆️
...g/broadinstitute/hellbender/engine/ReadWalker.java 100.000% <ø> (+7.407%) ⬆️
...tute/hellbender/engine/ReadlessAssemblyRegion.java 46.667% <ø> (+46.667%) ⬆️
... and 2325 more

GenotypeCalculationArgumentCollection.CALL_CONFIDENCE_LONG_NAME, "3.0",
GenotypeCalculationArgumentCollection.USE_POSTERIORS_TO_CALCULATE_QUAL_LONG_NAME, "true",
};
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about hcArgs.informativeReadOverlapMargin = 1; from the old settings?

Also, were ReadFilterArgumentDefinitions.MINIMUM_MAPPING_QUALITY_NAME, "1" and ALLELE_EXTENSION_LONG_NAME, "1" set using the old method? I don't see them

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hcArgs.informativeReadOverlapMargin = 1; is handled. That is the ALLELE_EXTENSION_LONG_NAME, "1" in that list. Its argument name and its argument collection variable are fairly confusingly discordant.

MAPPING_QUALITY_THRESHOLD_FOR_GENOTYPING_LONG_NAME, "1", is also handled (which is distinct from the mapping quality on the read filter but that is handled by HaplotypeCaller.customCommandLineValidaiton()

Copy link
Collaborator

@droazen droazen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jamesemery Back to you with my comments

Copy link
Collaborator

@droazen droazen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Merge when ready

@jamesemery jamesemery merged commit 7614ab6 into master May 10, 2022
@jamesemery jamesemery deleted the je_argumentModeManager branch May 10, 2022 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants