step_measure_normalize_istd() is an alias for step_measure_normalize_peak()
with domain-specific naming for chromatography and mass spectrometry users.
It normalizes spectra by dividing by a value computed from a specific region
(internal standard peak).
Usage
step_measure_normalize_istd(
recipe,
location_min,
location_max,
method = "mean",
measures = NULL,
role = NA,
trained = FALSE,
skip = FALSE,
id = recipes::rand_id("measure_normalize_istd")
)Arguments
- recipe
A recipe object. The step will be added to the sequence of operations for this recipe.
- location_min
Numeric. The lower bound of the region to use for normalization. This parameter is tunable with
peak_location_min().- location_max
Numeric. The upper bound of the region to use for normalization. This parameter is tunable with
peak_location_max().- method
Character. The summary statistic to compute from the region. One of
"mean"(default),"max", or"integral".- measures
An optional character vector of measure column names to process. If
NULL(the default), all measure columns (columns with classmeasure_list) will be processed. Use this to limit processing to specific measure columns when working with multiple measurement types.- role
Not used by this step since no new variables are created.
- trained
A logical to indicate if the quantities for preprocessing have been estimated.
- skip
A logical. Should the step be skipped when the recipe is baked by
recipes::bake()? While all operations are baked whenrecipes::prep()is run, some operations may not be able to be conducted on new data (e.g. processing the outcome variable(s)). Care should be taken when usingskip = TRUEas it may affect the computations for subsequent operations.- id
A character string that is unique to this step to identify it.
Details
This function is identical to step_measure_normalize_peak() but uses
terminology familiar to chromatography and mass spectrometry practitioners.
Internal standard (ISTD) normalization is commonly used to correct for:
Injection volume variations
Ionization efficiency differences
Matrix effects
Instrument drift
The internal standard should be a compound that:
Is chemically stable
Does not naturally occur in samples
Elutes in a distinct region
Has consistent response
See also
step_measure_normalize_peak() for the underlying implementation
Other measure-preprocessing:
step_measure_absorbance(),
step_measure_calibrate_x(),
step_measure_calibrate_y(),
step_measure_derivative(),
step_measure_derivative_gap(),
step_measure_emsc(),
step_measure_kubelka_munk(),
step_measure_log(),
step_measure_map(),
step_measure_msc(),
step_measure_osc(),
step_measure_ratio_reference(),
step_measure_snv(),
step_measure_subtract_blank(),
step_measure_subtract_reference(),
step_measure_transmittance()
Examples
library(recipes)
# Normalize to internal standard peak region (channels 50-60)
rec <- recipe(water + fat + protein ~ ., data = meats_long) |>
update_role(id, new_role = "id") |>
step_measure_input_long(transmittance, location = vars(channel)) |>
step_measure_normalize_istd(
location_min = 50,
location_max = 60,
method = "integral"
)