PavlidisLab / gemma.R

An R wrapper for the Gemma RESTful API
https://pavlidislab.github.io/gemma.R/
Apache License 2.0
10 stars 1 forks source link

Registry enforces argument defaults and creates documentation errors #25

Closed oganm closed 2 years ago

oganm commented 2 years ago

registry.R forces each argument of the functions that it generates to have defaults, causing some to fail with html errors when a user misses an argument but also some to silently fail in unexpected ways.

there are also a few mistakes in the documentation that's generated (example getPlatformElementGenes) where a mandatory argument is claimed to be optional

oganm commented 2 years ago

Registry uses formals to set function arguments and their defaults. Setting arguments without defaults is possible

f = function(){}
fargs = alist()
fargs[['x']] = bquote()
formals(f) = fargs
f
function (x) 
{
}
oganm commented 2 years ago

argument documentations are set only by their name and they are semi-hard-coded.

here is the monolithic if chain that controls what description goes with which argument.

some refer to this file but not sure how it all connects yet

will go through the endpoints one by one to set the default values right while checking where each argument description comes from

oganm commented 2 years ago

The errors in documentation seem to stem from using an inconsistent combination of hard coded data and data that is read from the website. using chromote or v8 it should be possible to get everything from web instead

oganm commented 2 years ago

will be manually fixing the current registry before the reviewer returns for bioconductor submission. registry2 branch has a new attempt at a new registry that gets all the data from the website. there should also be a better way to do it through gemma's code directly but not sure how