Need Help?

Search our documentation and community forum

Terra is a cloud-native platform for biomedical researchers to access data, run analysis tools, and collaborate.
Terra powers important scientific projects like FireCloud, AnVIL, and BioData Catalyst. Learn more.

Cannot look up input variable, variable never declared

Comments

14 comments

  • Avatar
    Beri Shifaw

    Hi Alex,

     

    Is it possible to share the whole workflow? 

    0
    Comment actions Permalink
  • Avatar
    Alex O

    I made a github repo with the files. What is your username, so I can add you to the collaborators?

    0
    Comment actions Permalink
  • Avatar
    Beri Shifaw

    bshifaw, thanks

    0
    Comment actions Permalink
  • Avatar
    Alex O

    Shared, thanks!

    0
    Comment actions Permalink
  • Avatar
    Beri Shifaw

    The message is referring to the following line:

    runtime_memory=if defined(runtime_memory) then '$runtime_memory' else 8 + ceil(size(input_bam, 'G') / 2)

    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

    0
    Comment actions Permalink
  • Avatar
    Alex O
    That solved the problem, but now, for some reason, I'm getting this:

    Call input and runtime attributes evaluation failed for salmon_quant:
    Failed to evaluate input 'runtime_memory' (reason 1 of 1): For input string: "$runtime_memory"
    Failed to evaluate input '__runtime_disk_space' (reason 1 of 1): [Attempted 1 time(s)] - NoSuchFileException: /Users/alexanderostrovsky/Desktop/wdl/jamboree/cromwell-executions/analysis/54ea7ccb-457c-4e19-8683-8aa0e62e2668/call-salmon_quant/salmon_quant_singlebam/84502be0-edc8-44a7-bc61-9c7d50c58850/call-salmon_quant/execution/sequence.fasta

    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?

    0
    Comment actions Permalink
  • Avatar
    Beri Shifaw

    For the first error try removing the quotes and dollar sign from

    '$runtime_memory'

    For the second error make sure the files exists. 

    0
    Comment actions Permalink
  • Avatar
    Alex O

    For the first, I had originally put the quotes on to prevent

    Unrecognized token on line 60, column 60:

    runtime_memory=if defined(runtime_memory) then $runtime_memory else 8 + ceil(size(input_bam, 'G') / 2),
    ^

    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 

    sequence.fasta
    0
    Comment actions Permalink
  • Avatar
    Alex O

    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

    0
    Comment actions Permalink
  • Avatar
    Alex O

    If you want to take a look, I posted the most recent version of the files on the repo I shared last week

    0
    Comment actions Permalink
  • Avatar
    Beri Shifaw

    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.

    0
    Comment actions Permalink
  • Avatar
    Alex O

    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

    0
    Comment actions Permalink
  • Avatar
    Beri Shifaw

    Happy to hear the error was solved

    0
    Comment actions Permalink
  • Avatar
    Alex O

    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

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk