I've executed the following Command Line Tool.
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: CommandLineTool
baseCommand: spades.py
requirements:
- class: ShellCommandRequirement
inputs:
SAMPLENAME: string
OUTPUT_DIR: string
FORWARD:
type: string
inputBinding:
position: 1
prefix: '-1'
REVERSE:
type: string
inputBinding:
position: 2
prefix: '-2'
THREADS:
type: int
inputBinding:
position: 4
prefix: "--threads"
shellQuote: false
outputs:
OUTPUT_FILE:
type: File
outputBinding:
glob: "contigs.fasta"
arguments:
- valueFrom: $(inputs.OUTPUT_DIR)/$(inputs.SAMPLENAME)
position: 3
prefix: "-o "
shellQuote: false
The command on the terminal is:
./spadesTool.cwl --SAMPLENAME="11866_1#70" --FORWARD="/media/kevin/2251479E904444F7/data/11866_1#70_1.fastq.gz" --REVERSE="/media/kevin/2251479E904444F7/data/11866_1#70_2.fastq.gz" --OUTPUT_DIR="/media/kevin/2251479E904444F7/Output_Directory" --THREADS=4
The baseCommand (spades.py) executes successfully and produces results. However CWL produces the following error
[ job spadesTool.cwl ] Job error :
spadesTool.cwl:38:3: Error collecting output for parameter "OUTPUT_FILE" :
spadesTool.cwl:41:7: Did not find output file with glob pattern: '[' contigs.fasta ']'
[ job spadesTool.cwl ] completed permanentFail
{}
Final process status is permanentFail
What could be the problem?
Why not just copy it to another directory?
$cd Desktop
$cp OUTPUT_DIR/contigs.fasta .
The file and its parent directory will be created by the tool. I need the file to be capture as output of the Command Line TOOL, using the variable OUTPUT_FILE
Post the command you are using please
It may be as simple as using a pipe.
I'll do this for several samples, and I want the results as sub-directories, in the output directory.
Well now you mention sub-directories...If you are just running this in the command line then I suggest a for loop. Either in the command line or in a script. You would need to store a list of sample names for iterating through. then on each iteration create a new folder (named same as sample name)... use the folder as the output folder
something like this in command line should work (excluding minor synthax errors):
If you follow the idea then a folder will be created for each sample containing only outfiles for that sample.
This does not solve my original issue. Kindly see the change I've made to the question
Ok this is starting to sound like a job for TEE
sorry I can't be of more help
Yes Ram thank you :)
makedir
? Do you meanmkdir
?