Update: July 26, 2019
This section of the forum is no longer actively monitored. We are working on a support migration plan that we will share here shortly. Apologies for this inconvenience.

validation error only when importing workflow, not when running it.

I have three workflows. write_tsv.wdl that writes a tab separated file. read_tsv.wdl that calls write_tsv.wdl and reads the tab separated file into an array. The third workflow use_tsv only calls read_tsv and does nothing else. Both write_tsv.wdl and read_tsv.wdl validate and run without any issues. However, when I try to validate use_tsv.wdl I get errors for read_tsv.wdl.

$ java -jar wdltool-0.10.jar validate use_tsv.wdl 
ERROR: Variable wf does not reference any declaration in the task (line 5, col 44):

    Array[Array[File]] tab_file = read_tsv(wf.tsv)
                                           ^

Declaration starts here (line 5, col 24):

    Array[Array[File]] tab_file = read_tsv(wf.tsv)
                       ^

I have attached a zip file with the wdl code.

Workaround code

I created the following workaround, where write_tsv2.wdl already parses the file into an Array[Array[String]]. Note that in the original code it was parsed into Array[Array[File]], but for some reason that leads to file not found errors in the *tsv2.wdl scripts. I think throwing file not found errors is the correct behavior, but I'm not sure why the same errors do not show up in both scripts. I guess it might be an indication that the *tsv.wdl scripts don't parse the tsv file properly?

Tagged:

Answers

  • RuchiRuchi Member, Broadie, Moderator, Dev admin

    @Redmar_van_den_Berg
    There seems to be an issue here as I believe your original three workflows should validate properly. However, as a workaround, it seems you can alter your read_tsv.wdl to look like:

    import "write_tsv.wdl" as tsv
    
    workflow readTSV {
        call tsv.wf as wf
        #Array[Array[File]] tab_file = read_tsv(wf.tsv)
        output{
            File tsv = wf.tsv
            Array[Array[File]] array = read_tsv(tsv)
        }
    }
    

    This will eliminate the need for File to String coercions. I ran use_tsv.wdl using the suggestions made above and the workflow succeeds:

    {
      "outputs": {
        "use.readTSV.array": [["Sample1", "Forward1", "Reverse1"], ["Sample2", "Forward2", "Reverse2"]],
        "use.readTSV.tsv": "/Users/rmunshi/tsv/cromwell-executions/use/944e40a2-bb56-4ac0-bdf3-510fadd372d6/call-readTSV/readTSV/a69f1b94-d791-4566-90c5-cb136bb5fdb4/call-wf/wf/960d4310-871e-48bd-af7d-dd2c49d5271c/call-writeTSV/execution/outfile.txt"
      },
      "id": "944e40a2-bb56-4ac0-bdf3-510fadd372d6"
    }
    

    If you'd like me to look further into the failure-modes you saw with the alternate approach you tried, please let me know. Thanks!

Sign In or Register to comment.