Hi everyone, I've been working on adding `topics` ...
# tools
n
Hi everyone, I've been working on adding
topics
to the template and I think I've found a nice way to implement this without breaking much: So before we had something like this:
Copy code
output:
...
path('versions.yml'), emit: versions
What I would make it is something like this:
Copy code
output:
...
tuple val("${task.process}"), val('tool1'), eval("tool1 --version"), topic: versions, emit: versions1
tuple val("${task.process}"), val('tool2'), eval("tool2 --version"), topic: versions, emit: versions2
So I think having both the
topic
and the
emit
is the nicest way to go at this. The main advantage is that we can easily test the versions output by using the
emit
names. It also ensures that the
meta.yml
creation tool doesn't break on this and actually documents the whole versioning process. What do you think of this solution? (You can see a POC implementation in this PR: https://github.com/nf-core/tools/pull/3779)
m
how about we do:
Copy code
output:
...
tuple val("${task.process}"), val('tool1'), eval("tool1 --version"), topic: versions, emit: versions
tuple val("${task.process}"), val('tool2'), eval("tool2 --version"), topic: versions, emit: versions2
🙌 2
So that will be of use until we can properly have a release of nf-test that let's us deal with this in a nice way?
And do we agree that we don't need versions in the subworkflows?
n
Yes I agree and we don't need versions in subworkflows, it would kind of remove the advantage of using topics if we kept using the regular outputs
party this 1
I made a POC here of what I imagine the modules would look like: https://github.com/nf-core/modules/pull/9159
It's fully compatible with the code present in the tools PR at the moment. Next step is finding a fix for the templates
I'll try and find a fix for the template issue but we might have to just allow both types of versioning for now, but require all processes without a template to migrate
j
do you think it would be bad if we named the channels
versions_tool1
,
versions_tool2
, etc? I don't love having numbers in the channel names
n
Oooh I like this!
I'll update the PR this afternoon
j
I am also not sure about the
meta.yml
, I think it is better to add a new section
topics
, at the same level of
ìnputs
and
outputs
(while keeping the versions output)
m
For me we shouldn't put too much effort into naming this as it should really only be temporary until a newer nf-test handles topics properly
this is really just a temporary hack
n
Good idea on the topics section!
And I actually quite like having the versions as outputs. it's an additional output that could be used by pipeline developers
So IMO we could make this permanent
j
I think the topics section was your idea originally 😄 but it makes the most sense if we want to be able to replicate the main.nf from the information in meta.yml
n
Yeah true, I'll see how much work it is to add that in 😛