sorry, to come in last-last minute with implementa...
# hackathon-oct-2025-versions-topics-adoption
m
sorry, to come in last-last minute with implementation questions, but what if the
topics
section in the
meta.yml
only listed the topics used, without extra information describing them (which should be in the json schema for the meta.yml imo), so it would just be
Copy code
topics:
  - versions
instead of
Copy code
topics:
  - versions:
      - - process:
            type: string
            description: The process the versions were collected from
        - tool:
            type: string
            description: The tool name
        - version:
            type: string
            description: The version of the tool
πŸ’― 1
n
It would make things a lot easier, but how would we know what the actual structure of the topic is? It's pretty clear for versions but not really for other topics that might eventually get added
m
For me topics could be more than just versions, so I'd love a bit of description
For example I'd love to put in all QC reports and such
m
the structure of the topic channels is described in the output section, no?
n
We do have both now, but a topic does not need to be an output too
m
okay πŸ€” I just don't like to have the same information in all the meta.yml files with the version topic.
n
Yeah I get that, I'm also not 100% happy with the current system but I couldn't come up with a better system
m
And you wanted that until we get a better solution in nf-test, right?
n
yeah but I do think it does make the modules in general more flexible so I think having both the output and topic is better
s
I don't think we need the output and topic once we have the nf-test solution
βž• 1
(also I very much like removing the boilerplate from the meta)
party this 1
n
I know some use cases where the version of one tool is used in later logic of the pipeline so I think having the versions as output is just a nice thing to have
p
Is there a complete example that someone could point me to please?
'cc @Ben Sherman as we're talking about schema a lot at the moment
n
This PR contains all module updates done in the hackathon: https://github.com/nf-core/modules/pull/9333
πŸ™πŸ» 1
s
I know some use cases where the version of one tool is used in later logic of the pipeline so I think having the versions as output is just a nice thing to have
Could the topic channel be parsed in that case?
p
More to the point, it is an output - it's in the output block, the files are published. So I think we have to describe it in the meta.yml output section.
I don't like exceptions 😬
party this 1
m
meh, I feel it's more meta data
but I understand what you're saying here
n
Could the topic channel be parsed in that case?
That seems a bit overkill if we could just output it?
p
I think in the future, the line between data and files will (hopefully) become more blurred
m
For me versions is not a mandatory output out there. We do like it at nf-core so much that we made it mandatory, but for me it really is just a meta-data tag that we produce on runtime to help with reproducibility. So does it sit with output or not, that's a bigger question. I would just really want to streamline the modules code and keep it as light as possible
πŸ’― 1
j
what do you think of something like this?
Copy code
output:
  versions_{{ component }}:
    - - "${task.process}":
          type: string
          description: The name of the process
      - "{{ component }}":
          type: string
          description: The name of the tool
      - "{{ component }} --version":
          type: eval
          description: The expression to obtain the version of the tool

topics:
  versions:
    channel: versions_{{ component }}
to avoid duplicating the explanation in the
output
section. But this assumes that there will always be an
emit
😞
πŸ‘ 1
πŸ‘πŸ» 1
n
Maybe change it to
output_channels
and make it take a list of emit names
because topics can be specified multiple times
b
keep in mind that with static types the topics are in a separate section: https://nextflow.io/docs/latest/process-typed.html#topics so if you want to also emit a topic as an output you'll need to specify it twice, both under
output:
and
topic:
my two cents is that you should let the module maintainer decide whether they want to include versions in the output. doesn't seem like something that should be mandatory across the board
πŸ’― 2
as for the
meta.yml
, I suppose you could have a
topic
section, but keep in mind that the left-hand side of the
>>
can be an arbitrary expression...
n
Okay that seems like a solid solution, and thanks for the heads up
s
Ben, I don't suppose there is any way to not need the
${task.process}
part of the eval command, and have that accessible from the topic itself?
b
also, don't worry about the syntax change with static types. just add topics like you're currently doing with DSL2, and the language server will be able to automatically convert it to static types when you're ready. I only bring it up to guide the design of the
meta.yml
@Simon Pearce the topic channel doesn't encode any information like that under the hood. we designed it to be super un-opinionated -- just a queue channel that pulls from many sources via matching topic name, that's it. that way you can put whatever you want into it and there's no extra magic the strict syntax should at least allow you to just write it as
task.process
instead of
"${task.process}"
, at least once it becomes required
πŸ™Œ 1
s
at least once it becomes required
Is that because it won't work with an older version of Nextflow? Is there a version that has topics but wouldn't accept this?
b
well I guess by adopting topics you are requiring >=25.04 since that is when topics became stable in that version the strict syntax is still opt-in but I was referring more to the nf-core timeline for requiring strict syntax, I believe there is a date for that
s
FYI, for @JΓΊlia Mir and @mashehu, when I try
val(task.process)
the linting crashes with a traceback and
TypeError: LintResult.__init__() missing 1 required positional argument: 'file_path'
quick look 1
But I think we should be able to make that swap now too as we are requiring them anyway
thanks 1
m
my two cents is that you should let the module maintainer decide whether they want to include versions in the output. doesn't seem like something that should be mandatory across the board
I disagree, I feel it's a decision that should be taken globally for all nf-core modules
b
just seems like unnecessary noise to continue to include the version metadata in the output
p
We discussed this earlier today in the <!subteam^S08LAB76NBU> meeting. Sounds like the main reason is that nf-test doesn't support topics yet. Suggestion from our call was that we keep outputs in until nf-test is updated, then strip them from modules. Happy to hear others' views on this though.
m
That sounds reasonable to me
n
Allright I yield, not a #hill-to-die-on πŸ˜…
It would be nice to make it possible to add the versions to the output in some modules if it makes sense though. But those will be exceptions of course
πŸ‘πŸ» 2
πŸ’― 2
s
Yeah, we need nf-test to support topics. @Phil Ewels, was there any plan on how long that might take?
😬 3
p
Difficult to say sorry.
See
#nf-test-dev
in the Nextflow Slack
Looks like there's an issue for this, but no PR. If anyone is up for trying to put a PR together then it's a much easier ask to push forward.
m
opening this can one more time, because @JΓΊlia Mir and me found probably a better solution for the current situation:
Copy code
output:
...
  versions_{{ component }}: &versions
    - - "${task.process}":
          type: string
          description: The name of the process
      - "{{ component }}":
          type: string
          description: The name of the tool
      - "{{ component }} --version":
          type: eval
          description: The expression to obtain the version of the tool

topics:
  versions: *versions
will make it easier to handle a possible removal of
versions_{{ component }}
in the future
meow love 3
m
I'm sold
j
"{{ component }} --version"
won't work in every case, no?
m
yes, that will be any kind of command (chain) to produce the version
j
ahh gotcha! πŸ‘Œ
p
Is this not exactly the same as the code block that @JΓΊlia Mir sent above on Monday? πŸ˜…
m
nope, now we will have the same structure in output channels and topic channels for versions (it's an anchor, not just a name)
p
ohh right so the difference is the bit at the end?
Copy code
topics:
  versions: *versions
and the
&versions
πŸ‘πŸ» 1
πŸ”¬ code block examination mode enabled πŸ”
Very elegant πŸ‘πŸ»
Will we still remove the versions from the output block in the future, when nf-test supports topics?
m
yep, but we will then "resolve" the anchor and keep the same info we have no in the output in topics still
πŸ‘πŸ» 1
m
And topics will be in their own section and not in output
πŸ‘πŸ» 1
p
shared a GIF
n
I like this! Seems like this will probably solve the main issues people have with the current implementation
s
how does it work with multiple tools?
(still don't think we need to put the command to generate the version into the meta.yml, that seems unnecessary)
e
Hot take: What if Nextflow just generated the meta.yml outputs section and inputs section for you?
m
That's a planned feature, but we don't have it yet