The invocation of VarDictJava in paired variant calling mode is
VarDict -b "/path/to/tumor.bam|/path/to/normal.bam"
Now obviously in my CWL I would like the tumour and normal BAM to be separate inputs. However, I'm not sure how to combine these into a single command line argument in the actual CommandLineBinding
2 answers
Hello @ttmigueltt,
Here's an alternative solution if you will always have both samples; no InlineJavascriptRequirement needed:
cwlVersion: v1.0
class: CommandLineTool
inputs:
normal:
type: File
format: edam:format_2572
tumor
type: File
format: edam:format_2572
baseCommand: echo
arguments:
- $(inputs.bam_input.path)|$(inputs.bam_input.path)
outputs: []
$namespaces: { edam: http://edamontology.org/ }
$schemas: [ http://edamontology.org/EDAM_1.20.owl ]
Is this not using JavaScript here? If not, is there documentation on this string interpolation?
Those are parameter references, yep:
http://www.commonwl.org/user_guide/06-params/
https://www.commonwl.org/v1.0/CommandLineTool.html#Parameter_references
The format fields and accompany $namespace and $schemas directives are optional, but nice to have; see http://www.commonwl.org/user_guide/rec-practices/
You could use an inline javascript expression to evaluate the argument from the inputs e.g.:
cwlVersion: v1.0
class: CommandLineTool
requirements:
- class: InlineJavascriptRequirement
baseCommand: "echo"
arguments:
- ${
if(inputs.tumor === null){
return inputs.bam_input;
}
else{
return inputs.tumor.path + "|" + inputs.bam_input.path;
}
}
inputs:
- id: bam_input
type: File
- id: tumor
type: File?
outputs: []
Log in to answer this question.