New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RMB_EIC_prescreen: Complain when RMB settings not loaded. #6
Comments
My suggestion would be to add a test right at the top of the function and then either exit and ask people to load the settings first [then also need to update documentation] or invoke RmbDefaultSettings() and continue with a warning. |
Absolutely the former. We must not assume default settings are the right settings. |
@meowcat do you know offhand how to test whether settings are loaded in RMB? |
yes, though that function is of course not exported, so either Without looking at your specific code, I suggest this pattern we use in RMassBank: findMsMsHR.direct <- function(msRaw, cpdID, mode = "pH", confirmMode = 0, useRtLimit = TRUE,
ppmFine = getOption("RMassBank")$findMsMsRawSettings$ppmFine,
mzCoarse = getOption("RMassBank")$findMsMsRawSettings$mzCoarse,
fillPrecursorScan = getOption("RMassBank")$findMsMsRawSettings$fillPrecursorScan,
rtMargin = getOption("RMassBank")$rtMargin,
deprofile = getOption("RMassBank")$deprofile,
headerCache = NULL) { do.stuff() } In this way, it is never opaque that there are parameters being accessed in a specific function call. Doesn't need to be as granular as this, |
Right now, the thrown error sounds misleading:
The text was updated successfully, but these errors were encountered: