Hi, I just saw this new way of setting the params ...
# team-maintainers
l
Hi, I just saw this new way of setting the params for modules: In nextflow.config
Copy code
params {
    module_args = ""
}
process {
    withName: "MYMODULE" {
        ext.args = params.module_args
    }
}
This way you can load the config for all the test in main.nf.test and only specify params.module_args only for the test where the value is different from “”. This has been done for 9 modules (gcta, ldak and regenie) and I’m currently reviewing a module using it. I quite like this solution and reduce a bit the main.nf.test file. What do you think ?
m
I think we’ve started doing that, but we never really formalized it
I’d say go for it
Let’s make it official and write docs about it
l
Should it be
ext.args = params.module_args
or
ext.args = { params.module_args ?: "" }
? I guess the first one should be sufficient ?
n
Not sure we should put much more time into this since we take the args as module inputs for statically typed modules. But looks good for now 😛
party this 1
m
m
right
I almost forgot about this static typing thing
🤣 1
but this modules_args ain’t new
party this 1
it has been spreading
l
That will be quite the lot of changes 😅
m
just in time for DSL3
l
In gcta, ldak and regenie, you have in the nextflow.config
Copy code
params {
    module_args = ""
}

process {
    withName: "REGENIE_STEP2" {
        ext.args = { params.module_args ?: "" }
    }
}
Isn’t it redundant ? you should simply need either to specify the default globally or use the closure ?
m
It’s been in the docs for a while now: nf-co.re/docs/…/testing#… ( it was me who proposed it )
ext.args = params.module_args
or
ext.args = { params.module_args ?: "" }
First one is sufficient since the param has to be declared or the linter complains.
👍 1