Linear regression statistics of response curves
Source:R/calc-response.R
get_response_curve_stats.RdThis function calculates linear regression statistics (R², slope, and intercept)
for each response curve in the provided MRMhubExperiment object. Each curve
is fitted on its points with a non-missing intensity, with a warning when some
are missing; a curve with 2 such points has a slope and intercept but no R²
(NA), and a curve with fewer gives NA throughout. Before fitting,
the analyzed sample amount (x) and feature intensity (y) of these points
are each scaled to their maximum (set to 1), so the returned slopenorm and
y0norm are on this normalized scale.
Optionally, it can include
additional statistics from the lancer package (if installed) when with_saturation_stats is set to TRUE.
Usage
get_response_curve_stats(
data = NULL,
with_saturation_stats = FALSE,
limit_to_rqc = FALSE,
silent_invalid_data = FALSE
)Arguments
- data
A
MRMhubExperimentobject containing the dataset and response curve annotations.- with_saturation_stats
Logical, if
TRUE, include additional statistics from thelancerpackage. Note: Thelancerpackage must be installed when this argument is set toTRUE.- limit_to_rqc
Logical, if
TRUE, only include rows withqc_type == "RQC". Default isFALSE.- silent_invalid_data
Logical, if
TRUEsuppresses raising an error when required data or metadata are missing, or there is a mismatch between them.