Hi All. I've been modifying <https://github.com/nf...
# help
u
Hi All. I've been modifying https://github.com/nf-core/modules/tree/master/modules/nf-core/custom/filterdifferentialtable to output up and down filtered genes as additional files. You can see my progress so far at https://github.com/akaviaLab/modules/commit/6545261ae4e33553e9cd5b39fb1d9007c0c8bb10. My question is - do I need to modify the meta variable for the up/down files? Right now, the meta.id has the sample name, but it will be identical for all three files. If I need to modify it, how should I do so? I've tried adapting the code shown in https://nfcore.slack.com/archives/CE6SDBX2A/p1755000935927579?thread_ts=1754998962.637019&cid=CE6SDBX2A to modify the meta.id file, but I've been getting errors. Should I modify it in the workflows that call it? I'm worried about modification because the downstream analysis uses the meta.id to generate the output files, and if it is identical for up/down/all, there might be some confusion.
Also, if there is documentation that answers this kind of question, or an example of changes that happened to a module to do something similar, I'd really appreciate it please. Thank you!
n
I don't understand why it is a problem if those outputs all have the same meta?
u
I might just be confused. This module is used in the differentialabundance pipeline https://github.com/nf-core/differentialabundance/blob/3dd360fed0dca1780db1bdf5dce85e5258fa2253/workflows/differentialabundance.nf#L473 And gprofiler uses the meta to get the output file name. If I gave it three files with the same meta, I'd get three output files with identical names. Not a problem when working (since they're all in different directories/nodes), but a problem at the end when they are all published as output in the same directory. Again, maybe this is just a problem to solve in the workflow.
n
Maybe there is something I grossly misunderstand, but your files will not have identical names, one is
${prefix}_filtered_up.tsv
and the other is
${prefix}_filtered_down.tsv
? The output channel name is defined by
emit:
a
It depends what you do with the 3 output channels. If you
mix
them into a single input channel to the next process, yes, you will have a problem with published files that share the same name. The
meta.id
field should be unique for all entries in a channel. You can easily modify the
meda.id
field, but you don't do this in the process script block, but in the workflow by using a
map
operator on the 3 output channels.
u
Thank you very much. Do you have in mind any workflows that do something similar, so I can look at their code please?