CWL Style Guide
This section outlines the BIXU Dev team style guide for cwl. It serves to standarize formatting to increase portability and understanding between team members.
CWL Style Guide
File format, with .cwl
, should be in YAML format, when possible
Tool cwl
Field order and template:
cwlVersion: v1.0 # change if needed, but this is our default
class: CommandLine Tool
id: short_tool_name
doc: “Brief description of tool, can be expansive if a more complicated tool, like strelka2, annovar, etc” # doc strings should be double quoted
requirements:
- class: ResourceRequirement
ramMin: <int>
coresMin: <int>
- class: ClassRequirement
- class: ClassRequirement2
baseCommand: [cmd1, arg1] # can be empty
arguments: # suggested
- position: 0
shellQuote: false
valueFrom: >-
cmd1/cmd1_arg1
cmd1_arg2
cmd2
cmd2_arg1
inputs: #doc for inputs STRONGLY suggested, default optional
in_var1_name: {type: string, doc: “describe input briefly”}
in_var2_name: {type: int, doc: “describe input briefly”}
in_var3_name: {type: 'File[]?', doc: “describe input briefly”} # recommend single quote complex file types
outputs:
out_var1_name:
type: type
outputBinding:
glob: ‘<pattern>’
doc: “Brief output description”
out_var2_name:
type: type
outputBinding:
glob: ‘<pattern>’
doc: “Brief output description”
Workflow cwl
Field order and template:
cwlVersion: v1.0 # change if needed, but this is our default
class: Workflow
id: short_wf_name
doc: “Brief description of workflow, can be expansive if a more complicated tool, like WGS align, RNAseq WF etc”
requirements:
- class: ClassRequirement
- class: ClassRequirement2
inputs: #doc for inputs STRONGLY suggested, default optional
in_var1_name: {type: type, doc: “describe input briefly”}
in_var2_name: {type: type, doc: “describe input briefly”}
outputs:
out_var1_name: {type: type, doc: “describe input briefly”,outputSource: <source>}
out_var2_name: {type: type, doc: “describe input briefly”,outputSource: <source>}
steps:
alias_for_tool:
run: <relative_path_to_tool_cwl>
in:
tool_input_name1: <source>
tool_input_name2: <source>
scatter: <tool_input> # if applicable
out: [output1, output2]
$namespaces: # if needed
sbg: https://sevenbridges.com
hints: # if needed
- class: 'sbg:maxNumberOfParallelInstances'
value: 3