Converts several data frames of NMR-generated
metabolomic data to an object of the class 'nmrData'. Objects of the
class 'nmrData' are lists with two obligatory components, e_data
and
f_data
. An optional list component, e_meta
, is used if analysis
or visualization at other levels (e.g. metabolite identification) is also
desired.
as.nmrData(
e_data,
f_data,
e_meta = NULL,
edata_cname,
fdata_cname,
emeta_cname = NULL,
techrep_cname = NULL,
...
)
Object of class nmrData
a
a data frame with
an optional data frame with e_data
) and other columns giving meta
information.
character string specifying the name of the column
containing the metabolite identifiers in e_data
and e_meta
(if applicable).
character string specifying the name of the column
containing the sample identifiers in f_data
.
character string specifying the name of the column
containing the mapped identifiers in e_meta
(if applicable).
Defaults to NULL. Can be the same as edata_cname, if desired. If e_meta
is NULL, then either do not specify
emeta_cname
or specify it as NULL.
character string specifying the name of the column in
f_data
that specifies which samples are technical replicates. This column is used to
collapse the data when combine_techreps
is called on this object.
Defaults to NULL (no technical replicates).
further arguments
Lisa Bramer, Kelly Stratton
Objects of class 'nmrData' contain some attributes that are referenced by downstream functions. These attributes can be changed from their default value by manual specification. A list of these attributes as well as their default values are as follows:
data_scale | Scale of the data provided in e_data . Acceptable values are 'log2',
'log10', 'log', and 'abundance', which indicate data is log base 2, base
10, natural log, or raw abundance, respectively. Default is
'abundance'. |
is_normalized | A logical argument, specifying whether the data has been normalized or not. Default value is FALSE. |
nmr_norm | A logical argument, specifying whether the data has been normalized either to a spiked in metabolite or to a property taking sample-specific values |
#' | |
norm_info | Default value is an
empty list, which will be populated with a single named element
is_normalized = is_normalized . When a normalization is applied to
the data, this becomes populated with a list containing the normalization
function, normalization subset and subset parameters, the location and
scale parameters used to normalize the data, and the location and scale
parameters used to backtransform the data (if applicable). |
data_types | Character string describing the type of data (e.g.'binned' or 'identified', for NMR data). Default value is NULL. |
Computed
values included in the data_info
attribute are as follows:
num_edata | The number of unique edata_cname
entries. |
num_miss_obs | The number of missing observations. |
num_emeta | The number of unique
emeta_cname entries. |
prop_missing | The proportion
of e_data values that are NA. |
num_samps | The number
of samples that make up the columns of e_data . |
meta_info | A logical argument, specifying where the e_meta is provided. |
as.metabData
normalize_nmr
if (FALSE) { # requireNamespace("pmartRdata", quietly = TRUE)
library(pmartRdata)
mynmrData <- as.nmrData(
e_data = nmr_identified_edata,
f_data = nmr_identified_fdata,
edata_cname = "Metabolite",
fdata_cname = "SampleID",
data_type = "identified"
)
}
Run the code above in your browser using DataLab