CommandlineTool Directory outputs can't be found

Hi,
I am generating 3 directories that will be used for in other steps.

outputs:
  dir:
    type: Directory
    outputBinding:
      glob: "*/$(inputs.input.basename)/dir"

The directories do exist, but I kept getting: “Did not find output file with glob pattern”. I’ve tried to change “basename” to others like location, but that didn’t work neither.

Thanks in advance.

Hey @NDe,
If I understood correctly from your syntax, you are trying to recursively find these directories $(inputs.input.basename)/dir in your working directory. Is that right?

If so, may I ask why are you generating these directories inside other directories and not directly in the working directory?

Hi HrishiDhondge,

Thank you for replying. It’s my first time using CWL. The program that I am writting the CWL for creates temporary directories. Then it generates files/processing in those temporary directories. I am trying to write the step that generating the directories, so that the other steps have the temporary directories for input.

Thank you.

Hi @NDe, Could you provide an example of what you’re trying to do so it will be more clear?

Hi @HrishiDhondge,

Sorry for the late response. I misunderstood my task and was trying to get some clarifications.

Yes, I should just work in the working directory.

My original question was about the scenerio that Program_A creates a directory full of files. Then Program_B takes in the directory and creates another directory that contains result files.

For instance:

Program_A     ./result_A_dir
Program_B    ./result_A_dir   ./result_B_dir    

result_A_dir contains Version 1 results.
result_B_dir contains Version 2 results.

I think the input/output of the cwl should look like this:

A.cwl:

......

inputs:
  Dir:
    type: Directory
    inputBinding:
      position: 1

outputs:
  Results_A:
    type: Directory
    outputBinding:
      glob: result_A_dir/**

B.cwl:

......

inputs:
  A_results:
    type: Directory
    inputBinding:
      position: 1

outputs:
  Results_B:
    type: Directory
    outputBinding:
      glob: result_B_dir/**