11package org .labkey .sequenceanalysis .run .bampostprocessing ;
22
33import org .apache .logging .log4j .Logger ;
4- import org .apache .logging .log4j .LogManager ;
54import org .jetbrains .annotations .Nullable ;
5+ import org .json .JSONObject ;
66import org .labkey .api .pipeline .PipelineJobException ;
77import org .labkey .api .sequenceanalysis .model .Readset ;
88import org .labkey .api .sequenceanalysis .pipeline .AbstractPipelineStepProvider ;
99import org .labkey .api .sequenceanalysis .pipeline .BamProcessingOutputImpl ;
1010import org .labkey .api .sequenceanalysis .pipeline .BamProcessingStep ;
11+ import org .labkey .api .sequenceanalysis .pipeline .CommandLineParam ;
1112import org .labkey .api .sequenceanalysis .pipeline .PipelineContext ;
1213import org .labkey .api .sequenceanalysis .pipeline .PipelineStepProvider ;
1314import org .labkey .api .sequenceanalysis .pipeline .ReferenceGenome ;
@@ -33,7 +34,7 @@ public BaseQualityScoreRecalibrator(Logger log)
3334 super (log );
3435 }
3536
36- public File execute (File bam , File fasta , File output , @ Nullable File knownVariants ) throws PipelineJobException
37+ public File execute (File bam , File fasta , File output , @ Nullable File knownVariants , @ Nullable List < String > extraArgs ) throws PipelineJobException
3738 {
3839 boolean deleteKnownVariantFile = false ;
3940 if (knownVariants == null )
@@ -70,6 +71,12 @@ public File execute(File bam, File fasta, File output, @Nullable File knownVaria
7071 argsRecal .add (knownVariants .getPath ());
7172 argsRecal .add ("-O" );
7273 argsRecal .add (recalTable .getPath ());
74+
75+ if (extraArgs != null )
76+ {
77+ argsRecal .addAll (extraArgs );
78+ }
79+
7380 execute (argsRecal );
7481
7582 // If there is not recal possible, the output has 132 lines.
@@ -110,7 +117,7 @@ public File execute(File bam, File fasta, File output, @Nullable File knownVaria
110117
111118 public static class BaseQualityScoreRecalibratorStep extends AbstractCommandPipelineStep <BaseQualityScoreRecalibrator > implements BamProcessingStep
112119 {
113- public BaseQualityScoreRecalibratorStep (PipelineStepProvider provider , PipelineContext ctx )
120+ public BaseQualityScoreRecalibratorStep (PipelineStepProvider <?> provider , PipelineContext ctx )
114121 {
115122 super (provider , ctx , new BaseQualityScoreRecalibrator (ctx .getLogger ()));
116123 }
@@ -120,7 +127,10 @@ public static class Provider extends AbstractPipelineStepProvider<BaseQualitySco
120127 public Provider ()
121128 {
122129 super ("BaseQualityScoreRecalibrator" , "Base Quality Score Recalibrator" , "GATK" , "The step runs GATK's BaseQualityScoreRecalibrator tool." , Arrays .asList (
123- ToolParameterDescriptor .createExpDataParam ("knownVariants" , "Known Variants VCF" , "This is typically the dbSNP variants file. If working in a species where no suitable reference data exists, leave this blank and an empty VCF will be created." , "ldk-expdatafield" , null , null )
130+ ToolParameterDescriptor .createExpDataParam ("knownVariants" , "Known Variants VCF" , "This is typically the dbSNP variants file. If working in a species where no suitable reference data exists, leave this blank and an empty VCF will be created." , "ldk-expdatafield" , null , null ),
131+ ToolParameterDescriptor .createCommandLineParam (CommandLineParam .create ("--maximum-cycle-value" ), "maximumCycleValue" , "Maximum Cycle Value" , "Passed directly to BaseQualityScoreRecalibrator" , "ldk-integerfield" , new JSONObject (){{
132+ put ("minValue" , 0 );
133+ }}, null )
124134 ), new LinkedHashSet <>(Arrays .asList ("ldk/field/ExpDataField.js" )), "https://gatk.broadinstitute.org/hc/en-us/articles/360036363332-BaseRecalibrator" );
125135 }
126136
@@ -150,7 +160,7 @@ public Output processBam(Readset rs, File inputBam, ReferenceGenome referenceGen
150160 }
151161 }
152162
153- outputBam = getWrapper ().execute (inputBam , referenceGenome .getWorkingFastaFile (), outputBam , knownVariants );
163+ outputBam = getWrapper ().execute (inputBam , referenceGenome .getWorkingFastaFile (), outputBam , knownVariants , getClientCommandArgs () );
154164
155165 output .setBAM (outputBam );
156166
0 commit comments