processSmp | R Documentation |
Process data for a single antigen: fit a standard curve, establish bounds, normalize samples, and save a plot showing the fit and the samples.
processSmp(
smp,
std,
bg = NULL,
smpdil = 1,
fitlog = "xy",
ismp = 1:nrow(smp),
plotdir = "./",
pname = NULL,
ptitle = "fit and samples",
xvar = NULL,
yvar = NULL,
smpvar = NULL,
addvar = NULL,
dilvar = NULL,
resvar = "concentration",
model = "sigmoid",
Alow = NULL,
asym = TRUE,
trim.flat = TRUE,
interactive = TRUE,
monot.prompt = FALSE,
rm.before = FALSE,
rm.after = interactive,
maxrm = 2,
set.bounds = interactive,
overwrite.bounds = FALSE,
ifix = NULL,
extrapolate.low = FALSE,
extrapolate.up = FALSE,
optmethod = "Nelder-Mead",
maxit = 5000,
stdcol = c("firebrick3", "darkslategray"),
rugcol = c("cadetblue", "purple", "firebrick2"),
width = 7,
height = 6,
...
)
smp |
data frame with sample ID, sample values and other optional variables (e.g. dilution). |
std |
matrix or data frame with standards for fitting. |
bg |
values for background spots. |
smpdil |
single value for sample dilutions (if dilutions are not
provided in |
fitlog |
character string indicating if standard values should be
log-transformed for fitting. If the string contains _x_, |
ismp |
indices for samples to be plotted (e.g. to exclude standards that
are included in |
plotdir |
directory for the plots to be saved. |
pname |
character string for fit plot. If |
ptitle |
character string for plot title. |
xvar, yvar |
character strings for the variables used to fit a standard
curve. If |
smpvar |
character string indicating sample variable. |
addvar |
named vector for additional variables (e.g. date or plate),
where element names will be used as variable names in |
dilvar, resvar |
character strings for dilution variable and results. |
model |
the model to be fit. |
Alow |
lower asymptote for the sigmoid model. If |
asym |
if |
trim.flat |
logical value determining how the values of |
interactive |
logical value. If |
monot.prompt |
if |
rm.before |
logical value indicating if potential outliers should be
removed before the model is fitted. Ignored if |
rm.after |
logical value indicating if potential outliers should be
removed after the model is fitted. Ignored if |
maxrm |
maximum number of outliers to remove. |
set.bounds |
if |
overwrite.bounds |
logical value indicating the option to overwrite
automatically set bounds. Ignored if |
ifix |
sorted integer vector of length 3 with indices of standards to be used for getting starting values for optimization. |
extrapolate.low |
if |
extrapolate.up |
if |
optmethod |
method to be used in optimization. |
maxit |
maximum number of iterations in optimization. |
stdcol |
vector of two colors for the standard points and the fit on the plot. |
rugcol |
vector of three colors for the rugplot, which indicates sample values (inside the bounds, between the bounds and extrema, and beyond extrema). |
width, height |
optional parameters for the final saved plot. |
... |
further graphical parameters. |
Note that if fitlog
contains _x_ and thus xvar
in
standards is log-transform before fitting, the results are still returned
on a regular scale (values of inverse function are exponentiated and then
multiplied by dilution).
A list of length three. The first element is a data frame that contains the results; the second is a character string with a flag containing information about removed points, failure to fit the model, manually set bounds, and/or an optional custom note provided by the user during an interactive model-fitting procedure. The last element is the number of sample values for which the results are trimmed.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.