Cannot look up input variable, variable never declared
I'm trying to import an established, but modified workflow into a new workflow I'm writing, but I keep getting this error when trying to generate inputs:
Failed to process workflow definition 'analysis' (reason 1 of 1):
Cannot lookup value 'input_bam', it is never declared. Available values are: ['fastq_in', 'hisatOut', 'runtime_zones', 'library', 'slidingWindow_qual', 'slidingWindow_len', 'hisat2.hisatOut', 'Leading', 'truSeq_fa', 'runtime_preemptible', '__resource_log_code', 'hisat2.__after', 'runtime_cpu', 'samtools.__after', 'transcriptome_fasta', 'salmon_quant.salmon_log', 'Trailing', 'transcript_to_gene_map', 'salmon_quant.transcript', 'salmon_quant.resource_log', 'minLen', 'samout', 'runtime_memory', 'resource_log_code', 'salmon_quant.gene', 'trimmomatic.trimmedOut', 'bam_suffix', 'truSeq_score', 'trimmomatic.__after', 'runtime_docker', 'salmon_quant.__after', 'samtools.samout', 'salmon_quant.meta_json', 'salmon_quant.aux_info', 'indexFile', 'resource_log_interval', 'truSeq_mis']
Despite very specifically defining it:
```
call salmonQuant.salmon_quant as salmon_quant{
input:
input_bam=samtools.samout,
transcriptome_fasta=transcriptome_fasta,
transcript_to_gene_map=transcript_to_gene_map,
bam_suffix=bam_suffix,
library=library,
resource_log_code=resource_log_code,
runtime_preemptible=runtime_preemptible,
runtime_memory=if defined(runtime_memory) then '$runtime_memory' else 8 + ceil(size(input_bam, 'G') / 2),
runtime_cpu=runtime_cpu,
runtime_docker=runtime_docker,
runtime_zones=runtime_zones
}
```
I have tried renaming variables, moving things around, etc, but nothing is fixing it. Any ideas how to solve this?
Thank you,
Thank you,
Alex
Comments
14 comments
Hi Alex,
Is it possible to share the whole workflow?
I made a github repo with the files. What is your username, so I can add you to the collaborators?
bshifaw, thanks
Shared, thanks!
The message is referring to the following line:
The declaration made in the call input block is meant to be used by the task and not within the call block. So replace the input_bam in the above line with samtools.samout
Looking at the files, it's not ever actually generating the inputs folder for the run, despite the file being labeled correctly. Any ideas why not?
For the first error try removing the quotes and dollar sign from
For the second error make sure the files exists.
For the first, I had originally put the quotes on to prevent
Unrecognized token on line 60, column 60:
And for the second, the file is in the same folder as where I'm running, is in the same folder as the wdl, is populated and is labeled in the inputs.json as
Furthermore, the else is being triggered despite having runtime memory defined.
The only way was able to get it to start was by taking out the conditional, which I would have preferred stay in
If you want to take a look, I posted the most recent version of the files on the repo I shared last week
Hey Alex,
You should be able to avoid the "unrecognized token" message if you remove the quotes along with the dollar sign.
Its best to use the full path of a file instead of abbreviations to avoid issues like "files not found"
For the latest repo it looks like the contents of the modernsalmon.wdl has been replaced with an input json file.
If you are new to WDL, you may be interested in reviewing our WDL documentation here. For a more technical document on the WDL you be interested in the Tec Spec.
Beri, The first issue was fixed, and I appreciate the links to the documentation. The reason I'm confused with this specific case is that I am using that documentation and importing a file in the same way I have been for the other tools in my pipeline, but it is not generating an executions folder as it should be, and therefore there is no file to be found, despite being labeled properly and populated. I am mostly confused with why there is no executions folder for this tool in the pipeline. Thank you again.
Edit: For some reason, the input for this specific tool had to be an absolute path, unlike the other files for this workflow. It now runs
Happy to hear the error was solved
Sorry for one last thing: any idea why variables wouldn't populate with their values? The script is using the strings "${input_value}" instead of the actual values of the variables for every variable in only the final tool.
Edit for anyone who looks here: Turns out you can’t mix the command section “<<< >>>” from one file with at “{}” in another, it will use your inputs as string literals
Please sign in to leave a comment.