These are chat archives for nextflow-io/nextflow

27th
Jul 2018
Vladimir Kiselev
@wikiselev
Jul 27 2018 09:21
has anyone seen this before? nextflow-io/nextflow#817
Thomas Zichner
@zichner
Jul 27 2018 11:19

Hi Paolo, hi all,
is there a way to execute groovy code within the Nextflow config file? I would like to generate a file that contains, for example, $workflow.projectDir and then assign the name of the file to a param variable. I tried the following but it didn't work

param.csvfile = { 
        file1 = new File('test.csv')
        file1.write $workflow.projectDir
        return "test.csv"
    }

I get the following error: ERROR ~ No signature of method: nextflow.config.ConfigParser$_parse_closure5.endsWith() is applicable for argument types: (java.lang.String) values: [csv]

Paolo Di Tommaso
@pditommaso
Jul 27 2018 12:34
nextflow config file *is* groovy code but
the $ is only required to interpolate variables in a string therefore file1.write $workflow.projectDir is not valid
and above workflow implicit variable is only available in the nextflow script not in the config file
Thomas Zichner
@zichner
Jul 27 2018 14:13
Thanks Paolo for the explanation!
Mike Smoot
@mes5k
Jul 27 2018 19:34
Hi @pditommaso I'm having problem running with the awsbatch executor on the latest code from master. I see [warm up] executor > awsbatch and then it hangs and doesn't submit my jobs. Everything submits fine with version 0.30.2.
An no apparent exceptions or errors in nextflow.log
Paolo Di Tommaso
@pditommaso
Jul 27 2018 19:40
do you mean that it happens only with the latest version and it works with 0.30.2 ?
Mike Smoot
@mes5k
Jul 27 2018 19:45
Yes. I just fetched master, built locally, and see the problem. It works when I use version 0.30.2.
Paolo Di Tommaso
@pditommaso
Jul 27 2018 19:46
bad.. if you can manage to provide an reproducible test case please open an issue
Mike Smoot
@mes5k
Jul 27 2018 19:49
Is this example in git somewhere? I'll see if I can use that (or similar) to reproduce.
Paolo Di Tommaso
@pditommaso
Jul 27 2018 19:50
umm, maybe no
Mike Smoot
@mes5k
Jul 27 2018 19:54
I'll make something