Drift and Batch Correction
Source:vignettes/articles/manual-07-corrections.Rmd
manual-07-corrections.RmdManual
MRMhub provides functions for run-order drift and batch
correction. The correction is based on user-selected reference sample
types (ref_qc_types), relative to which all other samples
are adjusted. The corrections can be applied to intensity,
norm_intensity, or conc data.
Caution. Drift and batch corrections must be fitted
on dedicated reference samples (typically QC pools), never on
study samples (Broadhurst et al. 2018).
The correct_drift_gaussiankernel() option that fits on
study samples is the sole exception and is only safe for large,
well-randomised cohorts.
Drift correction (smoothing)
The following drift correction methods are available in
MRMhub, two of which are typically used for QC samples and
one (gaussian kernel-based) for study samples.
Corrections can be applied on a batch-by-batch basis
(batch_wise = TRUE, default) or across all batches
(batch_wise = FALSE). The correction can either replace
existing drift or batch corrections
(replace_previous = TRUE, default) or applied on top of
existing corrections (replace_previous = FALSE).
Drift correction can be applied to all features
(conditional_correction = FALSE) or conditionally, based on
whether the sample CV difference before and after correction is below a
defined threshold (cv_diff_threshold). The conditional
correction is applied separately for each batch if
batch_wise = TRUE.
It is recommended to visually inspect the correction using the
plot_runscatter() function. Set the argument
recalc_trend_after = TRUE so that the trends after
correction are also available for plotting. For further details, refer
to the description of plot_runscatter(). This, however,
doubles the processing time.
Note: The function outputs a message indicating the median CV change and the mean absolute CV before and after correction for all samples. However, these metrics are experimental and should not be used as definitive criteria for correction (see function documentation).
| Method | Function | Details |
|---|---|---|
| Cubic Spline | correct_drift_cubicspline() |
Smoothing parameter determined via cross-validation or set as fixed. Typically used with QC samples as reference. |
| Loess | correct_drift_loess() |
Loess smoothing with fixed span. Typically used with QC samples as reference. |
| Gaussian Kernel | correct_drift_gaussiankernel() |
Fixed kernel size. Option to smooth scale (variability). Typically used with study samples as reference. Only suitable for large, well-randomized sample sets. |
The cubic spline smoothing approach, particularly when used with the
regularization parameter lambda, is similar but not
identical to previously described QC-based drift correction methods,
such as QC-RSC (Quality Control Regularized Spline
Correction), described in Dunn et al.
(2011) and Kirwan et al.
(2013).
See the tutorial Drift and Batch Correction for more information on how to use these functions and plot the results.
Batch-effect correction (centering)
MRMhub currently supports median centering-based batch
correction correct_batch_centering(), whereby the scale of
the batches can optionally also be normalized. The selected QC types
(ref_qc_types) are used to calculate the medians, which are
then used to align all other samples.
See the tutorial Drift and Batch Correction for more information.
Next steps
- Drift and Batch Correction (tutorial) — worked examples of both corrections
- Exploring QC: RunScatter and PCA — visualise run-order and batch effects