Description Usage Arguments Value Functions Examples
mva
performs multivariate analysis using several possible methods.
The available methods are PCA, PCoA, OPLS and OPLS-DA. The OPLS method
requires a numeric y-variable, whilst OPLS-DA requires two groups for
comparison. By default, for OPLS and OPLS-DA the number of predictive and
orthogonal components are set to 1.
Blank samples are automatically detected (using TIC) and excluded.
Missing data are imputed using average lipid intensity across all samples.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | mva(
data,
measure = "Area",
method = c("PCA", "PCoA", "OPLS", "OPLS-DA"),
group_col = NULL,
groups = NULL,
...
)
plot_mva(
mvaresults,
components = c(1, 2),
color_by = NULL,
ellipse = TRUE,
hotelling = TRUE
)
plot_mva_loadings(
mvaresults,
components = c(1, 2),
color_by = NULL,
top.n = nrow(mvaresults$loadings)
)
top_lipids(mvaresults, top.n = 10)
|
data |
LipidomicsExperiment object. |
measure |
Which measure to use as intensity, usually Area (default). The measure should be already summarized and normalized. |
method |
Either PCA, PCoA, OPLS or OPLS-DA. Default is |
group_col |
Sample annotation to use as grouping column. If not provided, samples are treated independently. |
groups |
A numeric grouping (OPLS) or two groups to be used for supervised analysis (OPLS-DA), ignored in other methods. |
... |
Extra arguments to be passed to |
mvaresults |
Results obtained from |
components |
Which components to plot. Ignored for PCoA, OPLS and OPLS-DA results. Default is first 2 components. |
color_by |
Sample annotation (or lipid annotation in case of
|
ellipse |
Whether to plot ellipses around groups |
hotelling |
Whether to plot Hotelling T2. |
top.n |
Number of top ranked features to highlight in the plot. If omitted, returns top 10 lipids. |
Multivariate analysis results in mvaresults
object.
The object contains the following:
scores Sample scores
loadings Feature or component loadings (not for PCoA)
method Multivariate method that was used
row_data Lipid molecule annotations
col_data Sample annotations
original_object Original output object as returned by corresponding analysis methods
plot_mva
returns a ggplot of the sample scores.
plot_mva_loadings
returns a ggplot of the loadings.
top_lipids
returns s dataframe of top.n
lipids with
their annotations.
plot_mva
: plots a multivariate scatterplot of sample scores to investigate
sample clustering.
plot_mva_loadings
: Plot a multivariate scatterplot of feature loadings
to investigate feature importance.
top_lipids
: extracts top lipids from OPLS-DA results
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | data(data_normalized)
# PCA
mvaresults <- mva(data_normalized, measure = "Area", method = "PCA")
plot_mva(mvaresults, color_by = "group")
# NOT RUN
# plot_mva(mvaresults, color_by = "Diet", components = c(2, 3))
# PCoA
mvaresults <- mva(data_normalized, measure = "Area", method = "PCoA")
# NOT RUN
# plot_mva(mvaresults, color_by = "group")
# OPLS-DA
mvaresults <- mva(
data_normalized,
method = "OPLS-DA", group_col = "Diet", groups = c("HighFat", "Normal")
)
plot_mva(mvaresults, color_by = "group")
plot_mva_loadings(mvaresults, color_by = "Class", top.n = 10)
top_lipids(mvaresults, top.n = 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.