Has there ever been a discussion about adding a fu...
# modules
a
Has there ever been a discussion about adding a functions directory to the nf-core/modules repo?
p
What would it do?
a
Include functions like these ones, that aren't quite big enough for a plugin but don't really fall into classic modules: https://github.com/nf-core/modules/blob/master/subworkflows/nf-core/utils_nfcore_pipeline/main.nf
m
For me this is not a modules
We crammed it into subworkflows for lack of any other places
in nf-core logic, a module is just the single process
anything else is a subworkflows
maybe it's time to have another entity
I've been wondering this a lot for my channel to CSV channel manipulation subworkflows in #sarek Where do they really fit?
☝️ 1
a
Especially if the long term plan is to trim down the number of operators, we might need a repertoire of useful functions
m
I think subworkflows is a good fit for now, until we find a better solution, meaning a
functions/
folder plus command and import
m
I would like a functions folder. I've brought it up before, so I can add my functions that do combine/join on meta map keys
p
Where does the boundary lie with plugins? Could also imagine it as a plugin
a
Sooo that’s actually what kicked off this question. I was writing a utility function for Sarek and Maxime and myself were wondering what should be a plugin. Plugins are still fairly heavyweight to develop and maintain, plus the versioning system and deployment is a bit awkward for widespread use. For certain things, a plugin makes 100% more sense. e.g. there should definitely be nf-slack and nf-teams plugin for integrations, but should one of the little helper functions have its own plugin? Or a collection of functions in one plugin?
👍🏻 1
m
basically I'd want to avoid what @Matthias Zepper has tried to do for #seqinspector and put all this code in a plugins/functions/whatever so that all can use
I think a collection of functions in one plugin is OK, and maybe at some point it's mature enough to be part of BIG Nextflow
m
So an nf-core utils plugin?
m
yeah
m
I'm open to adding my functions to that.
Do we need to consider offline users? I've forgotten what the experience is for people copying a workflow across vs having a plugin too
m
yes, but a plugin can be downloaded
Sarek is I think the most widely offline pipeline used
and we have plugins, so it's not an issue
m
Something that imho argues for functions or sticking with the subworkflows is the version control. Plugins have versions, but they are not pinned in most pipeline releases? So if somebody runs the pipeline with the different version of the
nf-core-utils-plugin
, a particular function may not be found or differ. Also nf-core download does not cater for plugins yet. It is not an unsolvable problem, but it is predictable that this plugin will have to be released often, if it should hold utility functions for all pipelines. So in order to run the pipelines offline, one will always have to keep another thing up to date (Since plugins are stored in the
$NXF_HOME
or (if configured) in the
$NXF_PLUGINS_DIR
, which may lie within a users home directory. So on shared clusters, either users can’t maintain their own plugin dirs or all need to keep them up to date themselves.
💯 2
a
Yep, I much prefer the nf-core/modules model for lightweight functions, which puts the onus on the pipeline developer and keeps a local copy. I don't know if it was intentional, but nf-core/modules is an almost perfect model for bioinformatic pipeline components. So the question really is, where is something complex enough to justify a plugin? And for anything below that threshold, where shall we put it in nf-core/modules?
m
plugins should always be pinned
p
They definitely should be pinned - that's how we got into the mess with nf-validation
party this 2
m
please let's not go down this road again
p
There is a PR in Nextflow at the moment for fuzzy matching semver for plugins
a
I would vote +1 on not having simple helper functions be a plugin. Plugins need a much greater understanding of groovy/java in my experience, whereas many helper functions use code that is either part of the nextflow DSL or simple groovy. Plugins also necessitate going elsewhere to actually introspect code and see what it is doing, whereas as having it come from
nf-core/modules
style means it’s visible easily both within the pipeline and to people installing it. I’d also second the comments from Matthias.
👍🏻 1
👍 2