I wonder how I convert a File to an array of files? This might be a completely trivial question, but I have a hard time solving it.
Below is a summary of my problem:
I have a small pipeline (trimming ==> mapping ==> sorting). Sorting is done with picardtools, which allows for multiple input files. Below is the section in the tool description file:
inputs:
...
- id: "inputFileName_mergedSam"
type:
type: array
items: File
streamable: true
inputBinding: { prefix: "INPUT=" }
inputBinding: { position: 5 }
...
My problem is that the mapping step before returns a single file. Connecting the two steps in a workflow fails:
steps:
...
- id: alignment
...
outputs:
- id: alignment
- id: sort
inputs:
- id: inputFileName_mergedSam
source: "#alignment/alignment"
...
The error thrown is a mismatch between source (File
) and sink ({'items': 'File', 'streamable': True, 'inputBinding': {'prefix': 'INPUT='}, 'type': 'array'}
).
How do I convert the File output from the alignment step to an array?