This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Purpose of secondaryFiles in InputParameter and CommandInputParameter

Hi,

I understand that secondaryFiles in a CommandInputParameter can be a convenience function as input files can be specified implicitly when they have filenames that, for example, share a prefix with the primary input file. But my understanding is that a CommandLineTool with secondaryFiles in one of the CommandInputParameters cannot be used in a workflow, as the name of the secondaryFiles (i.e. the name of the primary input file) may not be known yet at submission time. I saw that related questions on biostars regarding the use of secondaryFiles were answered with ideas for workarounds for this problem. I have the impression that the use of patterns in secondaryFiles defeats the idea of being able to compose new workflows by connecting Workflows and {CommandLine,Expression}Tools!?

cwl
a CommandLineTool with secondaryFiles in one of the CommandInputParameters cannot be used in a workflow

I don't believe this should be a problem in CWL, this should be supported:

inputs:
  input_bams:
    type:
      type: array
      items: File
    inputBinding:
      prefix: --in
    secondaryFiles:
    - ^.bai

Could you possibly provide a link to the biostars questions you refer to?

1 answer

I think I found the answer to my problem myself. SecondaryFiles in a CommandLineTool within a workflow, do not come from disk via the pattern. They are provided as a File with SecondaryFiles via the workflow input or output of another Tool. The pattern has no relevance at this point. Before a tool is executed, the engine provides a input file with its SecondaryFiles. Only then the pattern may or may not be used to verify the SecondaryFiles match the correct pattern.

Log in to answer this question.