Hi everyone! I am experimenting on CWL to generate a bwa-mem command, which is like this:
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool
requirements:
- $import: bwa-docker.yml
- class: InlineJavascriptRequirement
inputs:
reference:
type: File
secondaryFiles:
- .64.amb
- .64.ann
- .64.bwt
- .64.pac
- .64.sa
inputBinding:
position: 1
read_1:
type: File
inputBinding:
position: 2
read_2:
type: File
inputBinding:
position: 3
sample_name:
type: string
platform:
type: string
id_sample:
type: string
pu:
type: string
lb:
type: string
stdout: output.bam
outputs:
output:
type: File
outputBinding:
glob: output.bam
baseCommand:
- bwa
- mem
Now, what I would like to accomplish is to generate a complete RG string using the sample_name, platform, id_sample, pu and lb. Something like this, considering a \t is needed in between (using Java expressions):
'@RG\tSM:$(inputs.sample_name)\tPL:$(inputs.platform)\tID:$(inputs.id_sample)\tPU:$(inputs.pu)\tLB:$inputs.lb)'
I have tried adding it as an argument with valueFrom and it replaces the java expression with the value, but it won't take the tabs, it ends up being (it keeps the 't's):
'@RGtSM:sample_nametPL:platformtID:sample_idtPU:putLB:library'
I also tried using actual tabs, but then:
-R \
'@RG SM:sample_name PL:ILLUMINA ID:id_sample PU:foo LB:bar' > /tmp/tmpsss7fq_t/short_9.bam
[E::bwa_set_rg] no ID at the read group line
When trying to use it as an input, it does not replace the values and takes $(inputs...) as a string I suppose, rather than an expression. The added code was:
info_field:
type: string
default: "@RG\tSM:$(inputs.sample_name)\tPL:$(inputs.platform)\tID:$(inputs.id_sample)\tPU:$(inputs.pu)\tLB:$inputs.lb)"
inputBinding:
prefix: -R
Any ideas how can I make it happen?
Thank you everyone!!
Daiana
woohoo! Thank you very much Tom!