Calculate normalization parameters for the data via median absolute deviation (MAD) transformation.
mad_transform(
e_data,
edata_id,
subset_fn,
feature_subset,
backtransform = FALSE,
apply_norm = FALSE,
check.names = NULL
)
a \(p \times n + 1\) data.frame, where \(p\) is the number of peptides, lipids, or metabolites and \(n\) is the number of samples. Each row corresponds to data for a peptide, lipid, or metabolite, with one column giving the biomolecule identifier name.
character string indicating the name of the peptide, protein,
lipid, or metabolite identifier. Usually obtained by calling
attr(omicsData, "cnames")$edata_cname
.
character string indicating the subset function to use for normalization.
character vector containing the feature names in the subset to be used for normalization
logical argument. If TRUE, the parameters for backtransforming the data after normalization will be calculated so that the values are on a scale similar to their raw values. See details for more information. Defaults to FALSE.
logical argument. If TRUE, the normalization will be applied to the data. Defaults to FALSE.
deprecated
List containing two elements: norm_params
is list with two
elements:
scale | numeric vector of length n median absolute deviations (MAD) for each sample |
location | numeric vector of length n medians for each sample |
backtransform_params
is a list with two elements:
scale | numeric value giving pooled MAD |
location | numeric value giving global median across all samples |
If backtransform
is set to TRUE then each list item under
backtransform_params
will be NULL.
If apply_norm
is TRUE, the transformed data is returned as a third
list item.
Each feature is scaled by subtracting the median of the feature subset specified for normalization and then dividing the result by the median absolute deviation (MAD) of the feature subset specified for normalization to get the normalized data. The location estimates are the subset medians for each sample. The scale estimates are the subset MADs for each sample. Medians are taken ignoring any NA values. If backtransform is TRUE, the normalized feature values are multiplied by a pooled MAD (estimated from all samples) and a global median of the subset data (across all samples) is added back to the normalized values.