I am getting this error message from cwltool:
demo.cwl:45:9: Source ‘indexed_sequences’ of type “File” is incompatible
demo.cwl:49:7: with sink ‘reference’ of type “File”
source has linkMerge method merge_nested
demo.cwl:13:5: Source ‘reference’ of type “File” is incompatible
demo.cwl:49:7: with sink ‘reference’ of type “File”
source has linkMerge method merge_nested
I am at a loss to understand how the type File can be incompatible with the type File. The problem seems to be that the source is output from bwa index which has secondary files associated with it and the sink is bwa mem which needs the base reference file as a command line input but the secondary files also have to be present. I’ve tried all sorts of iterations of how to specify this including a number of examples from github but I can’t get this simple worklfow to get past cwltool’s validation.
Here are the relevant files:
bwa_index.cwl
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool
requirements:
InitialWorkDirRequirement:
listing: [ $(inputs.sequences) ]
#TODO: Enable after this issue is fixed: https://github.com/common-workflow-language/cwltool/issues/80
#hints:
# - $import: bwa-docker.yml
inputs:
algorithm:
type: string?
inputBinding:
prefix: -a
doc: |
BWT construction algorithm: bwtsw or is (Default: auto)
sequences:
type: File
inputBinding:
valueFrom: $(self.basename)
position: 4
block_size:
type: int?
inputBinding:
prefix: -b
doc: |
Block size for the bwtsw algorithm (effective with -a bwtsw) (Default: 10000000)
outputs:
indexed_sequences:
type: File
secondaryFiles:
- .amb
- .ann
- .bwt
- .pac
- .sa
outputBinding:
glob: $(inputs.sequences.basename)
baseCommand:
- bwa
- index
type or paste code here
bwa_mem.cwl
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool
requirements:
- class: InlineJavascriptRequirement
inputs:
reference:
type: File
# secondaryFiles:
# - .amb
# - .ann
# - .bwt
# - .pac
# - .sa
inputBinding:
position: 2
output_filename: string
reads:
type: File[]
inputBinding:
position: 3
smart_pairing:
type: boolean?
inputBinding:
position: 1
prefix: -p
threads:
type: int?
inputBinding:
position: 1
prefix: -t
doc: -t INT number of threads [1]
min_std_max_min:
type: int[]?
inputBinding:
position: 1
prefix: -I
itemSeparator: ','
stdout: $(inputs.output_filename)
outputs:
aligned_reads:
type: File
outputBinding:
glob: $(inputs.output_filename)
baseCommand:
- bwa
- mem
demo.cwl
#!/usr/bin/env cwl-runner
class: Workflow
cwlVersion: v1.0
requirements:
InitialWorkDirRequirement:
listing: [ $(inputs.compressed_file) ]
MultipleInputFeatureRequirement: {}
inputs:
reference:
type: File
reads:
type: File[]
smart_pairing:
type: boolean
output_filename:
type: string
outputs:
indexed_sequences:
type: File
secondaryFiles:
- .amb
- .ann
- .bwt
- .pac
- .sa
outputSource: bwa_index/indexed_sequences
bwamem_output:
type: File
outputSource: bwa_mem/aligned_reads
steps:
bwa_index:
run: bwa_index.cwl
in:
sequences: reference
out:
[ indexed_sequences ]
bwa_mem:
run: bwa_mem.cwl
in:
reference:
source: [ bwa_index/indexed_sequences, reference ]
reads: reads
output_filename: output_filename
smart_pairing: smart_pairing
out:
[ aligned_reads ]
type or paste code here