Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upRMB_EIC_prescreen: Complain when RMB settings not loaded. #6
Comments
This comment has been minimized.
This comment has been minimized.
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. |
This comment has been minimized.
This comment has been minimized.
Absolutely the former. We must not assume default settings are the right settings. |
This comment has been minimized.
This comment has been minimized.
@meowcat do you know offhand how to test whether settings are loaded in RMB? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
meowcat
commented
Jun 22, 2019
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, |
MaliRemorker commentedJun 21, 2019
Right now, the thrown error sounds misleading: