Data will be grouped by combinationId, species, fragment, adduct, polarity, calculatedMass, foundMassRange[ppm], and group columns. Calculates non linear regression models by performing an iterative grid search within the coordinate bounds provided by lower and upper vectors, starting at start_lower and start_upper. Intermediate models are scored by the AIC value until convergence has been achieved following the defaults of nls.multstart.

fits(
  tibble,
  outputPrefix,
  group,
  instrumentId,
  skipGroupOutput = TRUE,
  start_lower,
  start_upper,
  lower,
  upper,
  minDataPoints = 50,
  max_iter = 500
)

Arguments

tibble

the data tibble containing fragment data.

outputPrefix

the output prefix for the file.

group

the group that this data belongs to.

instrumentId

the instrumentId of this data.

skipGroupOutput

whether to skip writing of grouping information (for debugging).

start_lower

the lower bound to start the parameter grid search, argument is passed to nls_multstart.

start_upper

the upper bound to start the parameter grid search, argument is passed to nls_multstart.

lower

the lower bound for the parameter estimates, argument is passed to nlsLM.

upper

the upper bound for the parameter estimates, argument is passed to nlsLM.

minDataPoints

the minimum number of data points required per fragment / adduct / ppm combination to be considered for model calculation.

max_iter

the maximum number of iterations of the model to calculate.

Details

This method returns a list with the following members: fits: the nested fit objects tibble, params: the parameters of the "best" fit for each combination, CI: confidence intervals for all parameters for each combination, preds: predictions on a regular grid over the domain of the data, nls.tibble.unfiltered: all initial data, nls.tibble: all combination Ids that pass the samplesPerCombinationId >= minDataPoints test, preds_from_data: predictions at the collision energy values measured in the original data, fitinfo: metrics and quality information for each fit, res_normality: results of the residual normality tests for each fit.