Skip to contents

This function will automatically scale your data based on the normalization method you choose. It will also calculate the CVs for each sample and each metabolite.

Usage

auto_scale(
  is_to_use,
  pref_to_use,
  prefs_to_remove,
  normalization,
  data,
  sample_information,
  pool_missing_p,
  fill_method,
  smooth_method = "lowess"
)

Arguments

is_to_use

A vector of the internal standards to use for normalization. If you do not want to use internal standards, leave this blank.

pref_to_use

A string of the preferred reference to use for normalization. If you do not want to use a preferred reference, leave this blank.

prefs_to_remove

A vector of the preferred references to remove from the data. If you do not want to remove any preferred references, leave this blank.

normalization

A string of the normalization method to use. This can be "IS", "NN", or "SMOOTH".

data

A data frame of the data to be normalized. This should be the output of the read_data function.

sample_information

A data frame of the sample information. This should be the output of the read_sample_information function.

pool_missing_p

A boolean indicating whether or not to pool missing values. If TRUE, missing values will be pooled. If FALSE, missing values will be filled with the half-minimum.

fill_method

A string indicating how to fill missing values. This can be "half-min" or "mean". If "half-min", missing values will be filled with the half-minimum. If "mean", missing values will be filled with the mean.

smooth_method

A string indicating the smoothing method to use. This can be "lowess" or "loess". If "lowess", a local polynomial regression will be used. If "loess", a local polynomial regression will be used.

Value

A data frame of the normalized data.