I'm working on a highly configurable R script. I have made a function in witch there are several more functions, like gseGO from clusterProfiler package.
To be configurable by the user I would like to call this function by do.call(gseGO, parameter_list). Where parameter_list is a list of all the parameters the user will provide.
My problem is, that when I try a test run for do.call, I got an error. My code looks like this:
gse <- do.call(gseGO, c(geneList=cluster_data[[1]],
ont ="BP",
keyType = "ENTREZID",
nPerm = 10000,
minGSSize = 3,
maxGSSize = 800,
pvalueCutoff = 1,
verbose = TRUE,
OrgDb = config$organism_org,
pAdjustMethod = config$pAdjustMethod))
and the error is: argument "geneList" is missing, with no default
But when I run this same code without do.call like this:
gse_bp <- gseGO(geneList=cluster_data[[1]],
ont ="BP",
keyType = "ENTREZID",
nPerm = 10000,
minGSSize = 3,
maxGSSize = 800,
pvalueCutoff = 1,
verbose = TRUE,
OrgDb = config$organism_org,
pAdjustMethod = config$pAdjustMethod)
It runs as it supposed to be with no problem.
And for the final code I would like something to look like this:
gse_bp <- do.call(gseGO, c(geneList=cluster_data[[1]],
ont ="BP",
keyType = "ENTREZID",
OrgDb = config$organism_org,
pAdjustMethod = config$pAdjustMethod,
parameter_list))
What could be the problem? Any idea?
Thank you in advance!