You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After quickly going around the Bioconductor ecosystem, I found that several packages define the version() function, either as a regular function, or as an S4 generic function with methods:
BiocManager:
regular function with no argument
DaparToolshed:
generic with 1 method
generic's arguments: version(object, ...)
note that the method does not use the ellipsis
GenomicSuperSignature:
generic with 1 method
generic's arguments: version(x)
NanoStringNCTools:
generic with 1 method
generic's arguments: version(object, ...)
note that the method does not use the ellipsis
RedeR:
generic with 1 method
generic's arguments: version(obj)
Rigraphlib:
regular function with 1 argument
arguments: version(expected = FALSE)
msa:
generic with 1 method
generic's arguments: version(object)
I propose to use version(object) for the version() generic that we add to BiocGenerics. Better not to have the ellipsis in the argument list if it's not used. Problem with having the ellipsis in the generic and then define methods that ignore the ellipsis is that extra arguments mistakenly passed thru these methods are silently ignored instead of triggering an error.
So we can always add the ellipsis later when it's actually needed. Note that it's easy to do and doesn't break the existing methods.
Finally, as @Artur-manpointed out, conflicts with BiocManager::version() will be avoided by using the BiocManager:: prefix. Same thing with Rigraphlib::version().
Also submitted a PR for msa that removes their own version() generic and uses the new generic in BiocGenerics instead. See UBod/msa#45
At some point we should also notify the maintainers of DaparToolshed, GenomicSuperSignature, NanoStringNCTools, and RedeR, to encourage them to do the same thing. @Artur-man Do you think you can help with this? Note that GenomicSuperSignature::version() and RedeR::version() use a different argument name so they will need to adapt the definition of their version() methods. Thanks!
Activity
hpages commentedon Nov 10, 2026
Taking back my little blurb about methods silently ignoring the extra arguments. With R 4.5 and R 4.6:
So everything is fine.
That's because the
.local()trick does the right thing i.e..local()gets called with.local(object, ...):I've not checked this for a long time but I have some vague memory that things were different at some point. But maybe not.
Anyways, adding
version(object, ...)now...hpages commentedon Nov 11, 2026
Done in BiocGenerics 0.59.13. See commit 9263b0b
Also submitted a PR for msa that removes their own
version()generic and uses the new generic in BiocGenerics instead. See UBod/msa#45At some point we should also notify the maintainers of DaparToolshed, GenomicSuperSignature, NanoStringNCTools, and RedeR, to encourage them to do the same thing. @Artur-man Do you think you can help with this? Note that
GenomicSuperSignature::version()andRedeR::version()use a different argument name so they will need to adapt the definition of theirversion()methods. Thanks!Artur-man commentedon Nov 11, 2026
ohhh, we gonna knock on doors again, will do @hpages!