Are there any official nf-core recommendations for...
# pipeline-maintainers
l
Are there any official nf-core recommendations for using the
params
object in a pipeline? Should
params
only be read in
<http://main.nf|main.nf>
and then passed explicitly into subworkflows, or can subworkflows reference
params
directly?
f
If I recall correctly, you should not assume the existence of any particular
params
in subworkflows and
params
should only be used in
<http://main.nf|main.nf>
.
s
I think the stricter Nextflow guidelines that are on the horizon is that params should be read in the main.nf and passed through, not referenced in other places
l
Definitely makes sense for subworkflows deeper in the pipeline, since they might be reused elsewhere later on. But what about the main pipeline workflow itself? Both #CGFUX04HZ and #CE8SSJV3N reference
params
directly there around 100 times (see here for sarek and here for rnaseq).
@Felix Kummer Thanks for the link! Those guidelines apply only to subworkflows in the
subworkflows/
directory, not to the main
workflows/<PIPELINE_NAME>/main.nf
file, right?
f
yes, you're right this does not apply to
workflows/<PIPELINE_NAME>/main.nf
. Most pipeline use
params
there because the execution of the workflow in that file is enforced through the top level
<http://main.nf|main.nf>
and we thus assume named
params
to be available there. So I'd say its allowed to use
params
in
workflows/<PIPELINE_NAME>/main.nf
.
👍 1
gratitude thank you 1
But I'm curious how the upcoming stricter Nextflow guidelines that @Simon Pearce mentioned will affect the usage of
params
in
workflows/<PIPELINE_NAME>/main.nf
.
l
Same here. Has any blog post or other info been released about it yet?
f
<!subteam^S044DU0NG68> any opinions on this? TL;DR: Nextflow future strict syntax suggest that
params
should only be used in entry workflows, which would be the top level
<http://main.nf|main.nf>
in nf-core pipelines, but most of our pipelines also use
params
in
workflows/<PIPELINE_NAME>/main.nf
.
j
I feel quite strongly that the standards are a good idea. Modules and subworkflows should be better encapsulated and not refer directly to params
party this 4
j
Is this not already a guideline? modules and subworkflows should not declare params inside 🤔
this 2
j
Yes modules/subworkflow must not have parameters In terms of pipeline entry point we have not updated our guidance yet but come in the near future™️
💯 2
We will need to add linting and update templates everywhere
👌🏻 2
f
I totally agree on modules/subworkflows, but that was not the question here. Its about the entry workflow in nf-core pipelines. We usually have
<http://main.nf|main.nf>
(e.g. https://github.com/nf-core/rnaseq/blob/master/main.nf) in the top which includes the actual core workflow in
workflows/<PIPELINE_NAME>/main.nf
. And most of our pipelines use
params
in
workflows/<PIPELINE_NAME>/main.nf
which is discouraged by the new Nextflow guidelines .
So @Leon Hafner if this is feasible for you, I'd suggest keeping
params
out of
workflows/<PIPELINE_NAME>/main.nf
. But for now, its fine to have them in
workflows/<PIPELINE_NAME>/main.nf
.
👍 1
a
I think this is an oversight for rnaseq and sarek and probably needs to be corrected.
m
On it, but it's a long process
nod 2
j
That's what I mean @Felix Kummer we will evenutally move to that, but we don't have guidance on that. So IMO I think if you want to go params all as entry points that's completely fine as 1. we don't have explicit guidance to not do this, 2. it is encouraged Nextflow best practise.
💯 2
(yes it'll be a bit ugly for a while having two systems, but it will prepare people over time 😉 )
m
For me we at nf-core should represent the big Nextflow side of @Rob Syme / @Esha Joshi continuum. So we should thrive to be THE BEST PRACTICES