median_center: Median Center Transformation

View source: R/norm_funcs.R

median_centerR Documentation

Median Center Transformation

Description

Calculate normalization parameters for the data via median centering.

Usage

median_center(
  e_data,
  edata_id,
  subset_fn,
  feature_subset,
  backtransform = FALSE,
  apply_norm = FALSE,
  check.names = NULL
)

Arguments

e_data

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, protein, lipid, or metabolite, with one column giving the biomolecule identifier name.

edata_id

character string indicating the name of the peptide, protein, lipid, or metabolite identifier. Usually obtained by calling attr(omicsData, "cnames")$edata_cname.

subset_fn

character string indicating the subset function to use for normalization.

feature_subset

character vector containing the feature names in the subset to be used for normalization

backtransform

logical argument. If TRUE, the data will be back transformed after normalization so that the values are on a scale similar to their raw values. See details for more information. Defaults to FALSE.

apply_norm

logical argument. If TRUE, the normalization will be applied to the data. Defaults to FALSE.

check.names

deprecated

Details

The sample-wise median of the feature subset specified for normalization is subtracted from each feature in e_data to get the normalized data. The location estimates are the sample-wise medians of the subset data. There are no scale estimates for median centering, though the function returns a NULL list element as a placeholder for a scale estimate. If backtransform is TRUE, the global median of the subset data (across all samples) is added back to the normalized values. Medians are taken ignoring any NA values.

Value

List containing two elements: norm_params is list with two elements:

scale NULL
location numeric vector of length n medians for each sample

backtransform_params is a list with two elements:

scale NULL
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.

Author(s)

Lisa Bramer, Kelly Stratton


pmartR/pmartR documentation built on April 24, 2024, 10:22 p.m.