Question: How can I indicate the output directory of one step in a workflow as an input to the next?
gravatar for karl.sebby
3.4 years ago by
karl.sebby80 wrote:

I am trying to use STAR for multiple steps in a workflow. The first step creates STAR indices and outputs 15 files to the working directory. The next step is the alignment and one of the arguments that it expects is the path to the directory that contains the files in the previous step. How can I indicate the output directory of the previous step as an input? Here's some of the 'steps' section:


    run: lrnaStarIndex1_Star.cwl
      refGenomeFastaFile: refGenomeFasta
      spikeInFasta: spikeIn
      sjdbGtfFile: GTF_file
      #Bunch of stuff is set as defaults.
    out: [exonGeTrInfo, exonInfo, SA, SAindex, transcriptInfo, chrLength, chrNameLength, chrName, chrStart, geneInfo, Genome, genomeParameters, sjdbInfo, sjdbListFromGtfOut, sjdbListOut]

    run: lrnaAlignStarPe1_STAR.cwl
      genomeDir:   #NEED HELP HERE!!! Specify the directory that contains files from prepStar step and force prepStar step to run first.
      readFilesIn: fastqExperimentFile1
      readFilesIn2: fastqExperimentFile2
      #Bunch of stuff is set as defaults.

    out: [logFinal, log, logProgress, SJout, alignedSortedByCoordOut, alignedToTranscriptomeOut]

I've played around with the In lineJavascriptRequirement and InitialWorkDirRequirement without success. Seem like referring to the prepStar step in the requirements section does not force step order and the starAlign step tries to run first.

cwl • 1.5k views
ADD COMMENTlink modified 3.4 years ago by Michael R. Crusoe1.8k • written 3.4 years ago by karl.sebby80
gravatar for Michael R. Crusoe
3.4 years ago by
Common Workflow Language project
Michael R. Crusoe1.8k wrote:

Hello karl.sebby,

Thank you for your question. You have at least three choices:

1) adjust the underlying tool in lrnaAlignStarPe1_STAR.cwl to not need a directory with a particular layout

2) adjust lrnaAlignStarPe1_STAR.cwl to take all the needed inputs from lrnaStarIndex1_Star.cwl (each individually named and specified) and use InitialWorkDirRequirement to place each of them into the current working directory. They you can use either . or $(runtime.outdir) (no lineJavascriptRequirement required) to communicate the location of these files to the underlying tool.

If you post your CWL files I can assist you with this option.

3) adjust lrnaStarIndex1_Star.cwl step to have an output of type: Directory, perhaps with an outputBinding: { glob: . }, then add the corresponding type: Directory input to lrnaAlignStarPe1_STAR.cwl, and finally adjust your workflow to match

ADD COMMENTlink modified 3.4 years ago • written 3.4 years ago by Michael R. Crusoe1.8k

Thanks. I'll give it a try.

ADD REPLYlink written 3.4 years ago by karl.sebby80

Finally got around to working on this again and got it to work with option 3) since I didn't want to change the inputs to either tool. Can only get it to work though if outputBinding is { glob: . } as suggested.

ADD REPLYlink written 3.3 years ago by karl.sebby80
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2018 users visited in the last hour