The `samtools/merge` and `samtools/cat` modules de...
# modules
a
The
samtools/merge
and
samtools/cat
modules define their
prefix
differently between the
script
and `stub`:
Copy code
prefix = task.ext.prefix ?: "${meta.id}"
prefix = task.ext.suffix ? "${meta.id}${task.ext.suffix}" : "${meta.id}"
This creates issues when you define
ext.prefix
in config and want to use a stub run. It also seems to me that
taxk.ext.suffix
isn’t used at all in the
script
so I am not sure why it is in the
stub
? These aren’t the only modules which have different definitions for prefix between script/stub, some rough grep-ing and filtering suggests there are ~30 modules which have discrepancies. I can’t confirm which of those have a good reason for it but I’m wondering if people have any objection to aligning the
samtools
ones at least for now?
party this 4
s
They should all have the same prefix between the two. Also please make the default for tools that take the same input and output files to be not just
${meta.id}
, use something like
prefix = task.ext.prefix ?: "${meta.id}_merged"
a
Hmm. That hasn’t been the way I’ve seen that second part done typically. I thought most modules where that was a common concern did a check and threw an error?
s
It should also do the check and throw an error, but this way lets you override it if you want but it makes the module just work out of the box
👍 1
a
e.g. samtools sort:
Copy code
if ("$bam" == "${prefix}.bam") error "Input and output names are the same, use \"task.ext.prefix\" to disambiguate!"
I never really understood why it didn’t default to
${meta.id}.sorted
but AFAICT no modules set a default that isn’t just
meta.id
s
Ok, I've just merged the PR to change the guidelines that has been hanging around for a while. I've been doing this for some time. It makes the modules usable out of the box without having to make a config. FYI, we had a lot of discussion in the maintainers team about it, with some people being quite strongly against this.
a
Heh well I agree with you so happy to make those changes as they come up.
FYI, we had a lot of discussion in the maintainers team about it, with some people being quite strongly against this.
I think that was what I found when I asked about
samtools/sort
wayyyy back when. I don’t actually mind at this point which way around the guidance is, as long as the application in consistent. I think with the huge number of modules we now have it’s important to keep consistency and not have the project break apart into clusters of modules run one way or the other depending on who is maintaining them.
👍 1
s
Yes, agreed. We've just finished the pytest -> nf-test migration nf core party, and so @Louis Le Nézet decided that he needs more thesis procrastination so he decided to go through all the modules starting with "A" to standardise them. It is something that it'd be good to get round to doing yes.
😍 3
The last ~200 or so (actually maybe more like 500 to be honest) of the pytest migrations were mostly modules that aren't particularly used, they aren't used in any nf-core module and don't have anyone actively looking at them.
Some of them were really quite far from our current standards
But to your original point, please update the stub to be the same as the script in all modules. If you don't have time, please put the ones you have found into an issue so someone else can take a look.
👍 1
a
I'll try and dump my cursory list in an issue. It's only ~30 modules that got flagged and I'm not sure if all of them are even the stub vs script (some I think define different prefixes under different inputs)
👍 1