@@ -66,14 +66,16 @@ public static List<ToolParameterDescriptor> getToolDescriptors()
6666 }}, "AUTO" ),
6767 ToolParameterDescriptor .createCommandLineParam (CommandLineParam .createSwitch ("--haploid_contigs" ), "haploidContigs" , "Haploid Contigs" , "" , "textfield" , new JSONObject (){{
6868
69- }}, "X,Y" )
69+ }}, "X,Y" ),
70+ ToolParameterDescriptor .create ("binVersion" , "DeepVariant Version" , "The version of DeepVariant to run, which is passed to their docker container" , "textfield" , new JSONObject (){{
71+ put ("allowBlank" , false );
72+ }}, "1.6.0" )
7073 );
7174 }
7275
7376 @ Override
7477 public void init (SequenceAnalysisJobSupport support ) throws PipelineJobException
7578 {
76- // TODO: handle auto-detection
7779 String modelType = getProvider ().getParameterByName ("modelType" ).extractValue (getPipelineCtx ().getJob (), getProvider (), getStepIdx (), String .class );
7880 if (modelType == null )
7981 {
@@ -136,12 +138,21 @@ public Output performAnalysisPerSampleRemote(Readset rs, File inputBam, Referenc
136138 throw new PipelineJobException ("Missing model type" );
137139 }
138140
141+ List <String > args = new ArrayList <>(getClientCommandArgs ());
142+ args .add ("--model_type=" + modelType );
143+
144+ String binVersion = getProvider ().getParameterByName ("binVersion" ).extractValue (getPipelineCtx ().getJob (), getProvider (), getStepIdx (), String .class );
145+ if (binVersion == null )
146+ {
147+ throw new PipelineJobException ("Missing binVersion" );
148+ }
149+
139150 getWrapper ().setOutputDir (outputDir );
140151 getWrapper ().setWorkingDir (outputDir );
141- getWrapper ().execute (inputBam , referenceGenome .getWorkingFastaFile (), outputFile , output , modelType , getClientCommandArgs () );
152+ getWrapper ().execute (inputBam , referenceGenome .getWorkingFastaFile (), outputFile , output , binVersion , args );
142153
143154 output .addOutput (outputFile , "gVCF File" );
144- output .addSequenceOutput (outputFile , outputFile .getName (), "DeepVariant gVCF File" , rs .getReadsetId (), null , referenceGenome .getGenomeId (), null );
155+ output .addSequenceOutput (outputFile , outputFile .getName (), "DeepVariant gVCF File" , rs .getReadsetId (), null , referenceGenome .getGenomeId (), "DeepVariant Version: " + binVersion );
145156 if (idxFile .exists ())
146157 {
147158 output .addOutput (idxFile , "VCF Index" );
@@ -189,7 +200,7 @@ private File ensureLocalCopy(File input, File workingDirectory, PipelineOutputTr
189200 }
190201 }
191202
192- public void execute (File inputBam , File refFasta , File outputGvcf , PipelineOutputTracker tracker , String modelType , List <String > extraArgs ) throws PipelineJobException
203+ public void execute (File inputBam , File refFasta , File outputGvcf , PipelineOutputTracker tracker , String binVersion , List <String > extraArgs ) throws PipelineJobException
193204 {
194205 File workDir = outputGvcf .getParentFile ();
195206
@@ -205,7 +216,6 @@ public void execute(File inputBam, File refFasta, File outputGvcf, PipelineOutpu
205216 tracker .addIntermediateFile (localBashScript );
206217 tracker .addIntermediateFile (dockerBashScript );
207218
208- String binVersion = "" ;
209219 List <String > bashArgs = new ArrayList <>(Arrays .asList ("/opt/deepvariant/bin/run_deepvariant" ));
210220 bashArgs .add ("--ref=/work/" + refFastaLocal .getName ());
211221 bashArgs .add ("--reads=/work/" + inputBamLocal .getName ());
0 commit comments