What's the logic behind: ```All ext variables SHOU...
# wg-meta-pipelines
j
What's the logic behind:
Copy code
All ext variables SHOULD be specified as a independent directive of the modules instead using def prefix = ... in the script block (based on <https://github.com/nf-core/modules/pull/8808/changes>). These variables SHOULD be defined as closures to make sure these work in all cases.
Looking at the example I find this more unclear than the existing pattern as the definition is moved further away from where it is used.
b
I'm not sure that it's needed if you do something like:
Copy code
def args = task.ext.args ?: args ?: <default>
j
That's what I would prefer too.
b
I remember now, the idea was to deduplicated the
def args
/
def prefix
declarations in script/stub But I think a better solution would be to leave it for now and see if we can have nextflow auto-generate the stub block instead
👍 1
🎉 1
cc @Nicolas Vannieuwkerke since you put this in the hackmd. though I guess this works just as well:
Copy code
ext [
        prefix: { output_prefix ?: "${meta.id}" },
        args: { samtools_stats_args ?: '' }
    ]
n
Yeah this is mainly to deduplicate everything. I don't think this makes it less clear since you access the values via
task.ext.<?>
b
Sounds good. I still might try to see if we can auto-generate the stubs eyebrows
n
shared a GIF