de_analysis: Differential analysis of lipids between sample groups

Description Usage Arguments Value Functions Examples

View source: R/de-analysis.R

Description

de_analysis and de_design perform differential analysis of measured lipids that are associated with a sample group (annotation). de_analysis accepts a list of contrasts, while de_design allows users to define a design matrix, useful for complex experimental designs or for adjusting possible confounding variables.

Usage

1
2
3
4
5
6
7
de_analysis(data, ..., measure = "Area", group_col = NULL)

de_design(data, design, ..., coef = NULL, measure = "Area")

significant_molecules(de.results, p.cutoff = 0.05, logFC.cutoff = 1)

plot_results_volcano(de.results, show.labels = TRUE)

Arguments

data

LipidomicsExperiment object, should be normalized and log2 transformed.

...

Expressions, or character strings which can be parsed to expressions, specifying contrasts. These are passed to limma::makeContrasts.

measure

Which measure to use as intensity, usually Area (default).

group_col

Name of the column containing sample groups. If not provided, defaults to first sample annotation column.

design

Design matrix generated from model.matrix(), or a design formula.

coef

Column number or column name specifying which coefficient of the linear model is of interest.

de.results

Output of de_analysis().

p.cutoff

Significance threshold. Default is 0.05.

logFC.cutoff

Cutoff limit for log2 fold change. Default is 1. Ignored in multi-group (ANOVA-style) comparisons.

show.labels

Whether labels should be displayed for significant lipids. Default is TRUE.

Value

TopTable as returned by limma package

significant_molecules returns a character vector with names of significantly differentially changed lipids.

plot_results_volcano returns a ggplot object.

Functions

Examples

 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
26
27
# type ?normalize_pqn to see how to normalize and log2-transform your data
data(data_normalized)

# Specifying contrasts
de_results <- de_analysis(
  data_normalized,
  HighFat_water - NormalDiet_water,
  measure = "Area"
)
# Using formula
de_results_formula <- de_design(
  data = data_normalized,
  design = ~group,
  coef = "groupHighFat_water",
  measure = "Area"
)

# Using design matrix
design <- model.matrix(~group, data = colData(data_normalized))
de_results_design <- de_design(
  data = data_normalized,
  design = design,
  coef = "groupHighFat_water",
  measure = "Area"
)
significant_molecules(de_results)
plot_results_volcano(de_results, show.labels = FALSE)

lipidr documentation built on Nov. 8, 2020, 7:50 p.m.