rwehrens / BatchCorrMetabolomics

Supplementary material for the paper "Improved batch correction in untargeted MS-based metabolomics" by R. Wehrens, et al. Metabolomics, 2016.
15 stars 9 forks source link

demo: Formal argument “plot” matched by multiple actual arguments #2

Closed leichtle closed 6 years ago

leichtle commented 7 years ago

Installed BatchCorrMetabolomics without errors. Trying the demo function:

> library(BatchCorrMetabolomics)
> demo(BC, echo=FALSE)
Performing batch correction for three Arabidopsis metabolomics 
data sets. In some cases, calculations may take a while - please 
be patient...

Performing corrections for LC-MS data...
Error in evaluateDuplos(X, Y, ..., plot = FALSE, perMetabolite = FALSE) : 
  formal argument “plot” matched by multiple actual arguments

Probably, the error arises from the parameter "plot" in the wrapper function:

evaluateCorrection <- function(X, Y, what = c("duplo", "PCA"), ...) {
  what <- match.arg(what)
  switch(what,
         duplo = evaluateDuplos(X, Y, ..., plot = FALSE, perMetabolite = FALSE),
         evaluatePCA(X, Y, ..., plot = FALSE, perBatch = FALSE))
}

This function is called in the demo script BC.R:

huhnDuplo <- evaluateCorrection(set.1, set.1.Y, what = "duplo", plot = FALSE)
huhnPCA <- evaluateCorrection(set.1, set.1.Y, what = "PCA", plot = FALSE)

I suppose the parameter "plot" cannot get correctly assigned to the respective function. Deleting the parameter in the call of the wrapper function while setting the parameter to "TRUE" within resolves this issue:

evaluateCorrection <- function(X, Y, what = c("duplo", "PCA"), ...) {
  what <- match.arg(what)
  switch(what,
         duplo = evaluateDuplos(X, Y, ..., plot = TRUE, perMetabolite = FALSE),
         PCA = evaluatePCA(X, Y, ..., plot = TRUE, perBatch = FALSE))
}
huhnPCA <- evaluateCorrection(set.1, set.1.Y, what = "PCA",legend.loc = "bottomright")

Is there a convenient workaround? Best regards and many thanks in advance, Alex

rwehrens commented 7 years ago

Hi Alexander,

thanks for noticing this and letting me know. I followed your suggestion and removed the plot argument from the wrapper function. A new version (also fixing some issues in the manual pages) is now on github.

Cheers, Ron

On 21-02-17 17:12, Alexander B. Leichtle wrote:

Installed BatchCorrMetabolomics without errors. Trying the demo function:

|> library(BatchCorrMetabolomics) > demo(BC, echo=FALSE) Performing batch correction for three Arabidopsis metabolomics data sets. In some cases, calculations may take a while - please be patient... Performing corrections for LC-MS data... Error in evaluateDuplos(X, Y, ..., plot = FALSE, perMetabolite = FALSE) : formal argument “plot” matched by multiple actual arguments |

Probably, the error arises from the parameter "plot" in the wrapper function:

|evaluateCorrection <- function(X, Y, what = c("duplo", "PCA"), ...) { what <- match.arg(what) switch(what, duplo = evaluateDuplos(X, Y, ..., plot = FALSE, perMetabolite = FALSE), evaluatePCA(X, Y, ..., plot = FALSE, perBatch = FALSE)) } |

This function is called in the demo script |BC.R|:

|huhnDuplo <- evaluateCorrection(set.1, set.1.Y, what = "duplo", plot = FALSE) huhnPCA <- evaluateCorrection(set.1, set.1.Y, what = "PCA", plot = FALSE) |

I suppose the parameter "plot" cannot get correctly assigned to the respective function. Deleting the parameter in the call of the wrapper function while setting the parameter to "TRUE" within resolves this issue:

|evaluateCorrection <- function(X, Y, what = c("duplo", "PCA"), ...) { what <- match.arg(what) switch(what, duplo = evaluateDuplos(X, Y, ..., plot = TRUE, perMetabolite = FALSE), PCA = evaluatePCA(X, Y, ..., plot = TRUE, perBatch = FALSE)) } huhnPCA <- evaluateCorrection(set.1, set.1.Y, what = "PCA",legend.loc = "bottomright") |

Is there a convenient workaround? Best regards and many thanks in advance, Alex

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rwehrens/BatchCorrMetabolomics/issues/2, or mute the thread https://github.com/notifications/unsubscribe-auth/AFfNa1fFIU0H-ryghJByYvf1Cda6UJnzks5rewzagaJpZM4MHhXH.