From 7614ab62602481aca08ce656d983c7453e257b28 Mon Sep 17 00:00:00 2001 From: jamesemery Date: Tue, 10 May 2022 16:38:37 -0400 Subject: [PATCH] Added an argument mode manager for group arguments and a demonstration of how it might be used in HaplotypeCaller --dragen-mode (#7745) --- .../hellbender/cmdline/ModeArgumentUtils.java | 115 ++++++++++++++++++ ...GenotypeCalculationArgumentCollection.java | 6 +- ...AssemblyBasedCallerArgumentCollection.java | 3 +- .../haplotypecaller/HaplotypeCaller.java | 45 +------ .../HaplotypeCallerArgumentCollection.java | 34 +++++- .../LikelihoodEngineArgumentCollection.java | 9 +- 6 files changed, 163 insertions(+), 49 deletions(-) create mode 100644 src/main/java/org/broadinstitute/hellbender/cmdline/ModeArgumentUtils.java diff --git a/src/main/java/org/broadinstitute/hellbender/cmdline/ModeArgumentUtils.java b/src/main/java/org/broadinstitute/hellbender/cmdline/ModeArgumentUtils.java new file mode 100644 index 00000000000..444f958bd21 --- /dev/null +++ b/src/main/java/org/broadinstitute/hellbender/cmdline/ModeArgumentUtils.java @@ -0,0 +1,115 @@ +package org.broadinstitute.hellbender.cmdline; + +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.broadinstitute.barclay.argparser.CommandLineArgumentParser; +import org.broadinstitute.barclay.argparser.CommandLineParser; +import org.broadinstitute.barclay.argparser.NamedArgumentDefinition; +import org.broadinstitute.hellbender.exceptions.GATKException; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.*; + +/** + * This class is a static helper for implementing 'mode arguments' by tools. A mode argument is defined as + * an argument which controls the setting of multiple (other) arguments to preset values, thereby resulting + * in the tool being used in a specific 'mode'. In this sense, a mode is simply a macro of sorts. A mode + * argument might be binary (in which case the associated argument and their values will be set when it is true) + * or be an enum (in which case a different set of arguments and value be set according to the selected value). + * + * The detection of the mode (i.e. the implementation of the mode argument) is the tool's responsibility. Following + * that, a public method of this class, setArgValues, can be used to install the associated argument values + * in the command parser, which will propagate them into the associate tools instance fields. + * + * The setting of the arguments is done such that argument already specified on the command line are not + * overwritten. This allows for mode refinement - i.e. the setting of the mode while turing some of its arguments + * to specific values. + * + * NOTE: This utility relies on the argument engine having already been executed. Consequently, the best place in the + * standard GATKTool would be in the #customCommandLineArgumentValidation() or at a similar stage since that gets + * executed after Barclay parsing is complete but before the tool has done anything with the filled arguments. + */ + +public final class ModeArgumentUtils { + + protected static final Logger logger = LogManager.getLogger(ModeArgumentUtils.class); + + /** + * Set a group of arguments (and associated fields) to the specified values - thereby implementing a mode + * + * 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. + * + * NOTE: This does not validate that the specified mode was actually set, that responsibility is left to tool authors. + * + * @param parser - commandline parser associated with the tool. This should be an instance of CommandLineArgumentParser + * @param argValues - an array of arguments and values to potentially set. The order of elements in the array + * is arg0,value0,arg1,value1 ... + * @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 and not for validation that the argument was set. + */ + public static void setArgValues(final CommandLineParser parser, final String[] argValues, final String modeName) { + final Map modifiedArgs = new LinkedHashMap<>(); + + for ( int i = 0 ; i < argValues.length ; i += 2 ) { + if ( !hasBeenSet(parser, argValues[i]) ) { + String parserMessage = setValue(parser, argValues[i], argValues[i+1]); + + if ( StringUtils.isEmpty(parserMessage) ) { + modifiedArgs.put(argValues[i], argValues[i + 1]); + } else { + modifiedArgs.put(argValues[i], argValues[i + 1] + " (" + parserMessage + ")"); + } + } else { + logger.info("parameter not set by the '" + modeName + "' argument mode, as it was already set on the command line: " + argValues[i]); + } + } + + logModeNotice(modifiedArgs, modeName); + } + + private static boolean hasBeenSet(final CommandLineParser parser, final String alias) { + + if ( parser instanceof CommandLineArgumentParser ) { + NamedArgumentDefinition namedArg = ((CommandLineArgumentParser)parser).getNamedArgumentDefinitionByAlias(alias); + + return (namedArg != null) ? namedArg.getHasBeenSet() : false; + } else { + throw new IllegalArgumentException("command line parser is not CommandLineArgumentParser"); + } + } + + private static String setValue(final CommandLineParser parser, final String alias, final String value) { + if ( parser instanceof CommandLineArgumentParser ) { + NamedArgumentDefinition namedArg = ((CommandLineArgumentParser)parser).getNamedArgumentDefinitionByAlias(alias); + if ( namedArg == null ) { + throw new IllegalArgumentException("alias not found: " + alias); + } + + PrintStream ps = new PrintStream(new ByteArrayOutputStream()); + List values = Arrays.asList(value); + namedArg.setArgumentValues((CommandLineArgumentParser)parser, ps, values); + return ps.toString(); + } else { + throw new IllegalArgumentException("command line parser is not CommandLineArgumentParser"); + } + } + + private static void logModeNotice(final Map modifiedArgs, final String modeName) { + logger.warn("*************************************************************************"); + logger.warn(String.format("* %-69s *", "--" + modeName + " was enabled")); + logger.warn("* The following arguments have had their inputs overwritten: *"); + modifiedArgs.forEach((name, value) -> { + logger.warn(String.format("* %-69s *", "--" + name + " " + value)); + }); + logger.warn("* *"); + logger.warn("* If you would like to run this mode with different inputs for any *"); + logger.warn("* of the above arguments please manually construct the command or *"); + logger.warn("* add your specific inputs after the mode argument. This mode *"); + logger.warn("* will not override inputs explicitly provided. *"); + logger.warn("*************************************************************************"); + } +} diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypeCalculationArgumentCollection.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypeCalculationArgumentCollection.java index 5a87214bf74..4745c8df678 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypeCalculationArgumentCollection.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/genotyper/GenotypeCalculationArgumentCollection.java @@ -21,12 +21,14 @@ public final class GenotypeCalculationArgumentCollection implements Serializable public static final String MAX_GENOTYPE_COUNT_LONG_NAME = "max-genotype-count"; public static final String SAMPLE_PLOIDY_SHORT_NAME = "ploidy"; public static final String SAMPLE_PLOIDY_LONG_NAME = "sample-ploidy"; + public static final String GENOTYPE_ASSIGNMENT_METHOD_LONG_NAME = "genotype-assignment-method"; + public static final String USE_POSTERIORS_TO_CALCULATE_QUAL_LONG_NAME = "use-posteriors-to-calculate-qual"; public static final double DEFAULT_STANDARD_CONFIDENCE_FOR_CALLING = 30.0; public static final int DEFAULT_MAX_ALTERNATE_ALLELES = 6; public static final int DEFAULT_MAX_GENOTYPE_COUNT = 1024; - @Argument(fullName="use-posteriors-to-calculate-qual", shortName="gp-qual", optional = true, doc = "if available, use the genotype posterior probabilities to calculate the site QUAL") + @Argument(fullName= USE_POSTERIORS_TO_CALCULATE_QUAL_LONG_NAME, shortName="gp-qual", optional = true, doc = "if available, use the genotype posterior probabilities to calculate the site QUAL") public boolean usePosteriorProbabilitiesToCalculateQual = false; /** @@ -188,6 +190,6 @@ public GenotypeCalculationArgumentCollection clone() { @Argument(fullName= NUM_REF_SAMPLES_LONG_NAME,doc="Number of hom-ref genotypes to infer at sites not present in a panel",optional=true) public int numRefIfMissing = 0; - @Argument(fullName= "genotype-assignment-method", shortName = "gam", doc = "How we assign genotypes", optional = true) + @Argument(fullName= GENOTYPE_ASSIGNMENT_METHOD_LONG_NAME, shortName = "gam", doc = "How we assign genotypes", optional = true) public GenotypeAssignmentMethod genotypeAssignmentMethod = GenotypeAssignmentMethod.USE_PLS_TO_ASSIGN; } diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/AssemblyBasedCallerArgumentCollection.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/AssemblyBasedCallerArgumentCollection.java index ca506d06547..a9b9859ce12 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/AssemblyBasedCallerArgumentCollection.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/AssemblyBasedCallerArgumentCollection.java @@ -61,6 +61,7 @@ public abstract class AssemblyBasedCallerArgumentCollection { * See documentation at {@link SmithWatermanAlignmentConstants#ALIGNMENT_TO_BEST_HAPLOTYPE_SW_PARAMETERS}. */ private static final SWParameters DEFAULT_READ_TO_HAPLOTYPE_SMITH_WATERMAN_PARAMETERS = SmithWatermanAlignmentConstants.ALIGNMENT_TO_BEST_HAPLOTYPE_SW_PARAMETERS; + public static final String SOFT_CLIP_LOW_QUALITY_ENDS_LONG_NAME = "soft-clip-low-quality-ends"; public ReadThreadingAssembler createReadThreadingAssembler() { final ReadThreadingAssembler assemblyEngine = assemblerArgs.makeReadThreadingAssembler(); @@ -171,7 +172,7 @@ public ReadThreadingAssembler createReadThreadingAssembler() { public boolean forceCallFiltered = false; @Advanced - @Argument(fullName = "soft-clip-low-quality-ends", doc = "If enabled will preserve low-quality read ends as softclips (used for DRAGEN-GATK BQD genotyper model)", optional = true) + @Argument(fullName = SOFT_CLIP_LOW_QUALITY_ENDS_LONG_NAME, doc = "If enabled will preserve low-quality read ends as softclips (used for DRAGEN-GATK BQD genotyper model)", optional = true) public boolean softClipLowQualityEnds = false; @Advanced diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/HaplotypeCaller.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/HaplotypeCaller.java index 9b61743896c..ea253ed1065 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/HaplotypeCaller.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/HaplotypeCaller.java @@ -7,6 +7,7 @@ import org.broadinstitute.barclay.argparser.CommandLineProgramProperties; import org.broadinstitute.barclay.help.DocumentedFeature; import org.broadinstitute.hellbender.cmdline.GATKPlugin.GATKReadFilterPluginDescriptor; +import org.broadinstitute.hellbender.cmdline.ModeArgumentUtils; import org.broadinstitute.hellbender.cmdline.StandardArgumentDefinitions; import org.broadinstitute.hellbender.cmdline.argumentcollections.ReferenceInputArgumentCollection; import org.broadinstitute.hellbender.cmdline.programgroups.ShortVariantDiscoveryProgramGroup; @@ -160,7 +161,7 @@ public List getDefaultReadFilters() { } /** - * This is being used to set the mapping quality filter when in dragen mode... there are problems here... + * This is being used to set the mapping quality filter when in dragen mode. This is also where make alterations to the input arguments based on DragenMode. */ protected String[] customCommandLineValidation() { if (hcArgs.dragenMode) { @@ -168,6 +169,10 @@ protected String[] customCommandLineValidation() { getCommandLineParser().getPluginDescriptor(GATKReadFilterPluginDescriptor.class); Optional filterOptional = readFilterPlugin.getResolvedInstances().stream().filter(rf -> rf instanceof MappingQualityReadFilter).findFirst(); filterOptional.ifPresent(readFilter -> ((MappingQualityReadFilter) readFilter).minMappingQualityScore = 1); + ModeArgumentUtils.setArgValues( + getCommandLineParser(), + hcArgs.getDragenNameValuePairs(), + HaplotypeCallerArgumentCollection.DRAGEN_GATK_MODE_LONG_NAME); } return null; } @@ -221,44 +226,6 @@ public void onTraversalStart() { logger.warn("*************************************************************************"); } - if (hcArgs.dragenMode) { - logger.warn("*************************************************************************"); - logger.warn("* DRAGEN-GATK mode enabled *"); - logger.warn("* The following arguments have had their inputs overwritten: *"); - logger.warn("* --apply-frd *"); - logger.warn("* --apply-bqd *"); - logger.warn("* --transform-dragen-mapping-quality *"); - logger.warn("* --soft-clip-low-quality-ends *"); - logger.warn("* --mapping-quality-threshold-for-genotyping 1 *"); - logger.warn("* --minimum-mapping-quality 1 *"); - logger.warn("* --allele-informative-reads-overlap-margin 1 *"); - logger.warn("* --disable-cap-base-qualities-to-map-quality *"); - logger.warn("* --enable-dynamic-read-disqualification-for-genotyping *"); - logger.warn("* --expected-mismatch-rate-for-read-disqualification 0.03 *"); - logger.warn("* --genotype-assignment-method USE_POSTERIOR_PROBABILITIES *"); - logger.warn("* --padding-around-indels 150 *"); - logger.warn("* --standard-min-confidence-threshold-for-calling 3.0 *"); - logger.warn("* --use-posteriors-to-calculate-qual *"); - logger.warn("* --allele-informative-reads-overlap-margin 1 *"); - logger.warn("* *"); - logger.warn("* If you would like to run DRAGEN-GATK with different inputs for any *"); - logger.warn("* of the above arguments please manually construct the command. *"); - logger.warn("*************************************************************************"); - hcArgs.applyBQD = true; - hcArgs.applyFRD = true; - hcArgs.transformDRAGENMapQ = true; - hcArgs.softClipLowQualityEnds = true; - hcArgs.mappingQualityThreshold = 1; - hcArgs.informativeReadOverlapMargin = 1; - hcArgs.likelihoodArgs.disableCapReadQualitiesToMapQ = true; - hcArgs.likelihoodArgs.enableDynamicReadDisqualification = true; - hcArgs.likelihoodArgs.expectedErrorRatePerBase = 0.03; - hcArgs.standardArgs.genotypeArgs.genotypeAssignmentMethod = GenotypeAssignmentMethod.USE_POSTERIOR_PROBABILITIES; - hcArgs.standardArgs.genotypeArgs.standardConfidenceForCalling = 3.0; - hcArgs.standardArgs.genotypeArgs.usePosteriorProbabilitiesToCalculateQual = true; - assemblyRegionArgs.indelPaddingForGenotyping = 150; - } - final VariantAnnotatorEngine variantAnnotatorEngine = new VariantAnnotatorEngine(makeVariantAnnotations(), hcArgs.dbsnp.dbsnp, hcArgs.comps, hcArgs.emitReferenceConfidence != ReferenceConfidenceMode.NONE, false); hcEngine = new HaplotypeCallerEngine(hcArgs, assemblyRegionArgs, createOutputBamIndex, createOutputBamMD5, getHeaderForReads(), getReferenceReader(referenceArguments), variantAnnotatorEngine); diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/HaplotypeCallerArgumentCollection.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/HaplotypeCallerArgumentCollection.java index 9f10daf1428..a4c3f01fae8 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/HaplotypeCallerArgumentCollection.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/HaplotypeCallerArgumentCollection.java @@ -10,6 +10,9 @@ import org.broadinstitute.hellbender.cmdline.argumentcollections.DbsnpArgumentCollection; import org.broadinstitute.hellbender.engine.FeatureInput; import org.broadinstitute.hellbender.engine.GATKPath; +import org.broadinstitute.hellbender.engine.spark.AssemblyRegionArgumentCollection; +import org.broadinstitute.hellbender.tools.walkers.genotyper.GenotypeAssignmentMethod; +import org.broadinstitute.hellbender.tools.walkers.genotyper.GenotypeCalculationArgumentCollection; import org.broadinstitute.hellbender.tools.walkers.genotyper.StandardCallerArgumentCollection; import java.io.Serializable; @@ -28,6 +31,10 @@ public class HaplotypeCallerArgumentCollection extends AssemblyBasedCallerArgume public static final String DO_NOT_CORRECT_OVERLAPPING_BASE_QUALITIES_LONG_NAME = "do-not-correct-overlapping-quality"; public static final String OUTPUT_BLOCK_LOWER_BOUNDS = "floor-blocks"; public static final String DRAGEN_GATK_MODE_LONG_NAME = "dragen-mode"; + public static final String APPLY_BQD_LONG_NAME = "apply-bqd"; + public static final String APPLY_FRD_LONG_NAME = "apply-frd"; + public static final String TRANSFORM_DRAGEN_MAPPING_QUALITY_LONG_NAME = "transform-dragen-mapping-quality"; + public static final String MAPPING_QUALITY_THRESHOLD_FOR_GENOTYPING_LONG_NAME = "mapping-quality-threshold-for-genotyping"; @ArgumentCollection @@ -135,23 +142,23 @@ protected ReadThreadingAssemblerArgumentCollection getReadThreadingAssemblerArgu @Argument(fullName = DRAGEN_GATK_MODE_LONG_NAME, optional = true, doc="Single argument for enabling the bulk of DRAGEN-GATK features. NOTE: THIS WILL OVERWRITE PROVIDED ARGUMENT CHECK TOOL INFO TO SEE WHICH ARGUMENTS ARE SET).") public Boolean dragenMode = false; @Advanced - @Argument(fullName = "apply-bqd", doc = "If enabled this argument will apply the DRAGEN-GATK BaseQualityDropout model to the genotyping model for filtering sites due to Linked Error mode.", optional = true) + @Argument(fullName = APPLY_BQD_LONG_NAME, doc = "If enabled this argument will apply the DRAGEN-GATK BaseQualityDropout model to the genotyping model for filtering sites due to Linked Error mode.", optional = true) public boolean applyBQD = false; @Advanced - @Argument(fullName = "apply-frd", doc = "If enabled this argument will apply the DRAGEN-GATK ForeignReadDetection model to the genotyping model for filtering sites.", optional = true) + @Argument(fullName = APPLY_FRD_LONG_NAME, doc = "If enabled this argument will apply the DRAGEN-GATK ForeignReadDetection model to the genotyping model for filtering sites.", optional = true) public boolean applyFRD = false; @Advanced @Argument(fullName = "disable-spanning-event-genotyping", doc = "If enabled this argument will disable inclusion of the '*' spanning event when genotyping events that overlap deletions", optional = true) public boolean disableSpanningEventGenotyping = false; @Advanced - @Argument(fullName = "transform-dragen-mapping-quality", doc = "If enabled this argument will map DRAGEN aligner aligned reads with mapping quality <=250 to scale up to MQ 50", optional = true) + @Argument(fullName = TRANSFORM_DRAGEN_MAPPING_QUALITY_LONG_NAME, doc = "If enabled this argument will map DRAGEN aligner aligned reads with mapping quality <=250 to scale up to MQ 50", optional = true) public boolean transformDRAGENMapQ = false; //TODO NOTE TO THE REVIEWER, THIS ARGUMENT IS INSUFFICIENT BOTH THIS AND --minimum-mapping-quality must be set, unfortunatley //TODO they can't be unified since the toolDefaultReadFilters get instantiated before this field gets populated, and we can't //TODO pull the threshold from that filter since it might or might not exist by the time we go to filter for threading, really //TODO we should unify on the readFilter version of this check i think but perhaps they are seperate for athropological historical reasons and it is thus culturally protected? @Advanced - @Argument(fullName = "mapping-quality-threshold-for-genotyping", doc = "Control the threshold for discounting reads from the genotyper due to mapping quality after the active region detection and assembly steps but before genotyping. NOTE: this is in contrast to the --"+ ReadFilterArgumentDefinitions.MINIMUM_MAPPING_QUALITY_NAME+" argument which filters reads from all parts of the HaplotypeCaller. If you would like to call genotypes with a different threshold both arguments must be set.", optional = true) + @Argument(fullName = MAPPING_QUALITY_THRESHOLD_FOR_GENOTYPING_LONG_NAME, doc = "Control the threshold for discounting reads from the genotyper due to mapping quality after the active region detection and assembly steps but before genotyping. NOTE: this is in contrast to the --"+ ReadFilterArgumentDefinitions.MINIMUM_MAPPING_QUALITY_NAME+" argument which filters reads from all parts of the HaplotypeCaller. If you would like to call genotypes with a different threshold both arguments must be set.", optional = true) public int mappingQualityThreshold = HaplotypeCallerEngine.DEFAULT_READ_QUALITY_FILTER_THRESHOLD; @Advanced @Argument(fullName = "max-effective-depth-adjustment-for-frd", doc = "Set the maximum depth to modify FRD adjustment to in the event of high depth sites (0 to disable)", optional = false) @@ -203,4 +210,23 @@ protected ReadThreadingAssemblerArgumentCollection getReadThreadingAssemblerArgu @Advanced @Argument(fullName= USE_FILTERED_READS_FOR_ANNOTATIONS_LONG_NAME, doc = "Use the contamination-filtered read maps for the purposes of annotating variants", optional=true) public boolean useFilteredReadMapForAnnotations = false; + + public String[] getDragenNameValuePairs() { + return new String[]{ + APPLY_BQD_LONG_NAME, "true", + APPLY_FRD_LONG_NAME, "true", + TRANSFORM_DRAGEN_MAPPING_QUALITY_LONG_NAME, "true", + SOFT_CLIP_LOW_QUALITY_ENDS_LONG_NAME, "true", + MAPPING_QUALITY_THRESHOLD_FOR_GENOTYPING_LONG_NAME, "1", + ReadFilterArgumentDefinitions.MINIMUM_MAPPING_QUALITY_NAME, "1", + ALLELE_EXTENSION_LONG_NAME, "1", + LikelihoodEngineArgumentCollection.DISABLE_CAP_BASE_QUALITIES_TO_MAP_QUALITY_LONG_NAME, "true", + LikelihoodEngineArgumentCollection.ENABLE_DYNAMIC_READ_DISQUALIFICATION_FOR_GENOTYPING_LONG_NAME, "true", + LikelihoodEngineArgumentCollection.EXPECTED_MISMATCH_RATE_FOR_READ_DISQUALIFICATION_LONG_NAME, "0.03", + GenotypeCalculationArgumentCollection.GENOTYPE_ASSIGNMENT_METHOD_LONG_NAME, String.valueOf(GenotypeAssignmentMethod.USE_POSTERIOR_PROBABILITIES), + AssemblyRegionArgumentCollection.INDEL_PADDING_LONG_NAME, "150", + GenotypeCalculationArgumentCollection.CALL_CONFIDENCE_LONG_NAME, "3.0", + GenotypeCalculationArgumentCollection.USE_POSTERIORS_TO_CALCULATE_QUAL_LONG_NAME, "true", + }; + } } diff --git a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/LikelihoodEngineArgumentCollection.java b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/LikelihoodEngineArgumentCollection.java index f08a3a8989f..765b1bcc027 100644 --- a/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/LikelihoodEngineArgumentCollection.java +++ b/src/main/java/org/broadinstitute/hellbender/tools/walkers/haplotypecaller/LikelihoodEngineArgumentCollection.java @@ -21,6 +21,9 @@ public final class LikelihoodEngineArgumentCollection implements Serializable { public static final String DRAGSTR_PARAMS_PATH_FULLNAME = "dragstr-params-path"; public static final String DRAGSTR_HET_HOM_RATIO_FULLNAME = "dragstr-het-hom-ratio"; public static final String DONT_USE_DRAGSTR_PAIRHMM_FULLNAME = "dont-use-dragstr-pair-hmm-scores"; + public static final String DISABLE_CAP_BASE_QUALITIES_TO_MAP_QUALITY_LONG_NAME = "disable-cap-base-qualities-to-map-quality"; + public static final String ENABLE_DYNAMIC_READ_DISQUALIFICATION_FOR_GENOTYPING_LONG_NAME = "enable-dynamic-read-disqualification-for-genotyping"; + public static final String EXPECTED_MISMATCH_RATE_FOR_READ_DISQUALIFICATION_LONG_NAME = "expected-mismatch-rate-for-read-disqualification"; /** * Bases with a quality below this threshold will reduced to the minimum usable qualiy score (6). @@ -42,7 +45,7 @@ public final class LikelihoodEngineArgumentCollection implements Serializable { public int gcpHMM = 10; @Advanced - @Argument(fullName="expected-mismatch-rate-for-read-disqualification", doc="Error rate used to set expectation for post HMM read disqualification based on mismatches", optional = true) + @Argument(fullName= EXPECTED_MISMATCH_RATE_FOR_READ_DISQUALIFICATION_LONG_NAME, doc="Error rate used to set expectation for post HMM read disqualification based on mismatches", optional = true) public double expectedErrorRatePerBase = PairHMMLikelihoodCalculationEngine.DEFAULT_EXPECTED_ERROR_RATE_PER_BASE; /** @@ -86,14 +89,14 @@ public final class LikelihoodEngineArgumentCollection implements Serializable { public boolean disableSymmetricallyNormalizeAllelesToReference = false; @Advanced - @Argument(fullName ="disable-cap-base-qualities-to-map-quality", doc= "If false this disables capping of base qualities in the HMM to the mapping quality of the read", optional = true) + @Argument(fullName = DISABLE_CAP_BASE_QUALITIES_TO_MAP_QUALITY_LONG_NAME, doc= "If false this disables capping of base qualities in the HMM to the mapping quality of the read", optional = true) public boolean disableCapReadQualitiesToMapQ = false; /** * If enabled, rather than disqualifying all reads over a threshold of minimum hmm scores we will instead choose a less strict * and less aggressive cap for disqualification based on the read length and base qualities. */ - @Argument(fullName="enable-dynamic-read-disqualification-for-genotyping", doc="Will enable less strict read disqualification low base quality reads") + @Argument(fullName= ENABLE_DYNAMIC_READ_DISQUALIFICATION_FOR_GENOTYPING_LONG_NAME, doc="Will enable less strict read disqualification low base quality reads") public boolean enableDynamicReadDisqualification = false; /**