Title: | Pathways Longitudinal and Differential Analysis in Metabolomics |
---|---|
Description: | Perform a differential analysis at pathway level based on metabolite quantifications and information on pathway metabolite composition. The method is based on a Principal Component Analysis step and on a linear mixed model. Automatic query of metabolic pathways is also implemented. |
Authors: | Camille Guilmineau [aut, cre], Remi Servien [aut] , Nathalie Vialaneix [aut] |
Maintainer: | Camille Guilmineau <[email protected]> |
License: | GPL-3 |
Version: | 0.4 |
Built: | 2024-12-12 13:42:21 UTC |
Source: | CRAN |
Prepare quantification data from ASICS
outputs for
test_pathway
. In short, it replaces metabolite names by metabolites
KEGG codes and transposes the matrix to have samples in rows and metabolites
in columns.
from_ASICS_to_PHOENICS(quantif)
from_ASICS_to_PHOENICS(quantif)
quantif |
output matrix of |
A matrix of quantification with samples in rows and metabolites in
columns, properly formatted for test_pathway
Camille Guilmineau <[email protected]>
Remi Servien <[email protected]>
Nathalie Vialaneix <[email protected]>
Lefort G., Liaubet L., Canlet C., Tardivel P., P\'ere M.C., Quesnel H., Paris A., Iannuccelli N., Vialaneix N. Servien R. (2019). ASICS: an R package for a whole analysis workflow of 1D 1H NMR spectra. Bioinformatics, 35(21): 4356–4363. doi:10.1093/bioinformatics/btz248
Tardivel P., Canlet C., Lefort G., Tremblay-Franco M., Debrauwer L., Concordet D., Servien R. (2017). ASICS: an automatic method for identification and quantification of metabolites in complex 1D 1H NMR spectra. Metabolomics, 13(10): 109. doi:10.1007/s11306-017-1244-5
data("MTBLS422") quantif <- from_ASICS_to_PHOENICS(quantif)
data("MTBLS422") quantif <- from_ASICS_to_PHOENICS(quantif)
Metabolites quantifications, associated metabolic pathways and experimental design to characterize the effects of two clinically important antibiotic treatments, ciprofloxacin and vancomycin-imipenem on mice.
3 datasets are provided:
quantif
: a data frame with 10 rows (metabolites name) and 11
columns (samples id), which corresponds to the metabolites quantifications
in the samples.
pathways
: a data frame with 11 rows and 4 columns, which
contains informations about pathways and their metabolites.
design
: a data frame with 11 rows (samples id) and 4 columns
(id and effects to be added in the model).
The raw dataset have been made available on MetaboLights (with the
id MTBLS422 https://www.ebi.ac.uk/metabolights/editor/MTBLS422) by
[Choo et al., 2017]. Metabolites quantifications were obtained
based on the raw signal using ASICS
package. Pathways were obtained
using KEGGREST
package. The datasets provided for the example
are a subset of the original dataset.
Choo J. M., Kanno T., Zain N. M. M., Leong L. E. X., Abell G. C. J., Keeble J. E., Bruce K. D., Mason A. J., Rogers G. B. (2017). Divergent relationships between fecal microbiota and metabolome following distinct antibiotic-induced disruptions. mSphere, 2(1) doi:10.1128/msphere.00005-17
Lefort G., Liaubet L., Canlet C., Tardivel P., P\'ere M.C., Quesnel H., Paris A., Iannuccelli N., Vialaneix N. Servien R. (2019). ASICS: an R package for a whole analysis workflow of 1D 1H NMR spectra. Bioinformatics, 35(21): 4356–4363. doi:10.1093/bioinformatics/btz248
Tardivel P., Canlet C., Lefort G., Tremblay-Franco M., Debrauwer L., Concordet D., Servien R. (2017). ASICS: an automatic method for identification and quantification of metabolites in complex 1D 1H NMR spectra. Metabolomics, 13(10): 109. doi:10.1007/s11306-017-1244-5
Tenenbaum D., Maintainer B. (2022). KEGGREST: Client-side REST access to the Kyoto Encyclopedia of Genes and Genomes (KEGG). R package version 1.38.0.
data(MTBLS422) design[1:5, ] pathways[1:5, ] quantif[1:5, 1:5]
data(MTBLS422) design[1:5, ] pathways[1:5, ] quantif[1:5, 1:5]
Calculate overlap coefficient between pathways
overlap_coefficient(pathwayA, pathwayB, pathways = NULL, organism = NULL)
overlap_coefficient(pathwayA, pathwayB, pathways = NULL, organism = NULL)
pathwayA |
a character string of pathway name or pathway code or a character vector of metabolite names or metabolite codes |
pathwayB |
a character string of pathway name or pathway code or a character vector of metabolite names or metabolite codes |
pathways |
data.frame or matrix with metabolites in rows and the following information in columns:
Used if |
organism |
organism code in KEGG database. Required if
|
A value between 0 and 1 calculated with the formula:
An overlap coefficient of 1 means that one pathway is included in the other. An overlap coefficient of 0 means that there is no overlap between the pathways.
Wieder C., Lai R.P.J., Ebbels T.M.D. (2022). Single sample pathway analysis in metabolomics: performance evaluation and application. BMC Bioinformatics, 23, 481. doi:10.1186/s12859-022-05005-1
data("MTBLS422") pathwayA <- "Galactose metabolism" pathwayB <- "Vitamin digestion and absorption" overlap_coefficient(pathwayA, pathwayB, pathways) if (requireNamespace("KEGGREST", quietly = TRUE)) { pathwayA <- "Galactose metabolism" pathwayB <- "Vitamin digestion and absorption" overlap_coefficient(pathwayA, pathwayB, organism = "mmu") } pathwayA <- "mmu00052" pathwayB <- "mmu00562" overlap_coefficient(pathwayA, pathwayB, pathways) pathwayA <- c("C00029", "C00116", "C00137", "C00794", "C00984", "C01697") pathwayB <- c("C00191", "C00092", "C00137") overlap_coefficient(pathwayA, pathwayB)
data("MTBLS422") pathwayA <- "Galactose metabolism" pathwayB <- "Vitamin digestion and absorption" overlap_coefficient(pathwayA, pathwayB, pathways) if (requireNamespace("KEGGREST", quietly = TRUE)) { pathwayA <- "Galactose metabolism" pathwayB <- "Vitamin digestion and absorption" overlap_coefficient(pathwayA, pathwayB, organism = "mmu") } pathwayA <- "mmu00052" pathwayB <- "mmu00562" overlap_coefficient(pathwayA, pathwayB, pathways) pathwayA <- c("C00029", "C00116", "C00137", "C00794", "C00984", "C01697") pathwayB <- c("C00191", "C00092", "C00137") overlap_coefficient(pathwayA, pathwayB)
Query KEGG pathways for a given set of metabolites
pathway_search(metab, organism, min_size = 2)
pathway_search(metab, organism, min_size = 2)
metab |
vector of metabolite KEGG codes |
organism |
organism code in KEGG database |
min_size |
minimal number of metabolites required for a pathway to be returned |
a data.frame with metabolites in rows and the following information in columns:
metabolite_code
metabolite code
metabolite_name
metabolite name
pathway_code
pathway code (identifier)
pathway_name
name of the pathway
Camille Guilmineau <[email protected]>
Remi Servien <[email protected]>
Nathalie Vialaneix <[email protected]>
Kanehisa M., Goto S. (2000). KEGG: Kyoto Encyclopedia of Genes and Genomes, Nucleic Acids Research, Volume 28, Issue 1, Pages 27–30, doi:10.1093/nar/28.1.27
Tenenbaum D., Maintainer B. (2022). KEGGREST: Client-side REST access to the Kyoto Encyclopedia of Genes and Genomes (KEGG). R package version 1.38.0.
if (requireNamespace("KEGGREST", quietly = TRUE)) { data("MTBLS422") quantif <- from_ASICS_to_PHOENICS(quantif) pathways <- pathway_search(metab = colnames(quantif), organism = "mmu") }
if (requireNamespace("KEGGREST", quietly = TRUE)) { data("MTBLS422") quantif <- from_ASICS_to_PHOENICS(quantif) pathways <- pathway_search(metab = colnames(quantif), organism = "mmu") }
S3 class for pathway differential analysis results
## S3 method for class 'pathwayRes' summary(object, ...) ## S3 method for class 'pathwayRes' print(x, ...) ## S3 method for class 'pathwayRes' plot( x, ..., pathway_id = NULL, plot = c("eig", "var", "ind", "group"), habillage = "none" ) head(object) extract(object, pathway_id) adjust_pval(object, method = p.adjust.methods, n = length(object))
## S3 method for class 'pathwayRes' summary(object, ...) ## S3 method for class 'pathwayRes' print(x, ...) ## S3 method for class 'pathwayRes' plot( x, ..., pathway_id = NULL, plot = c("eig", "var", "ind", "group"), habillage = "none" ) head(object) extract(object, pathway_id) adjust_pval(object, method = p.adjust.methods, n = length(object))
object , x
|
object of class |
... |
not used |
pathway_id |
a character string or vector of pathway codes or names |
plot |
a character string indicating the type of plot to return. Default
to |
habillage |
a character string indicating the column of the design used
to color the individuals. Only used when |
method |
a character string indicating the correction method to be used
for multiple testing correction (authorized values are those of
|
n |
number of comparisons for multiple testing correction |
Methods for the class pathwayRes
The function extract
returns an object of class
pathwayRes
which is a list of pathway results, containing only the
pathways in pathway_id
.
The function adjust_pval
returns a data.frame with pathways
in rows and the following information in columns:
pathway_name |
name of the pathway |
pathway_code |
pathway code (identifier) |
Fixed_effect |
tested effect |
pval |
raw p-value of the pathway |
adjusted_pval |
adjusted p-value of the pathway |
data("MTBLS422") quantif <- from_ASICS_to_PHOENICS(quantif) out_test <- test_pathway(quantif, design, pathways, fixed = c("Age", "Treatment"), random = "Mouse", npc = 2, model = "blmer") summary(out_test) out_test2 <- test_pathway(quantif, design, pathways, fixed = c("Age", "Treatment"), random = "Mouse", npc = 2, model = "blmer", analysis = "MFA") summary(out_test2) print(out_test) print(out_test2) plot(out_test) plot(out_test, pathway_id = "mmu00052", plot = "var") plot(out_test, pathway_id = "mmu00052", plot = "ind", habillage = "Age") plot(out_test2, pathway_id = "mmu00562", plot = "eig") plot(out_test2, pathway_id = "mmu00562", plot = "var") plot(out_test2, pathway_id = "mmu00562", plot = "ind") plot(out_test2, pathway_id = "mmu00562", plot = "group") head(out_test) extract(out_test, "mmu00562") adj_pval <- adjust_pval(out_test)
data("MTBLS422") quantif <- from_ASICS_to_PHOENICS(quantif) out_test <- test_pathway(quantif, design, pathways, fixed = c("Age", "Treatment"), random = "Mouse", npc = 2, model = "blmer") summary(out_test) out_test2 <- test_pathway(quantif, design, pathways, fixed = c("Age", "Treatment"), random = "Mouse", npc = 2, model = "blmer", analysis = "MFA") summary(out_test2) print(out_test) print(out_test2) plot(out_test) plot(out_test, pathway_id = "mmu00052", plot = "var") plot(out_test, pathway_id = "mmu00052", plot = "ind", habillage = "Age") plot(out_test2, pathway_id = "mmu00562", plot = "eig") plot(out_test2, pathway_id = "mmu00562", plot = "var") plot(out_test2, pathway_id = "mmu00562", plot = "ind") plot(out_test2, pathway_id = "mmu00562", plot = "group") head(out_test) extract(out_test, "mmu00562") adj_pval <- adjust_pval(out_test)
Perform a differential analysis at pathway level based on metabolite quantifications and information on pathway metabolite composition. The method relies on a PCA or a MFA step.
test_pathway( quantif, design, pathways = "auto", fixed, random, npc = 1L, model = c("lmer", "blmer"), organism = NULL, min_size = 2, analysis = c("PCA", "MFA") )
test_pathway( quantif, design, pathways = "auto", fixed, random, npc = 1L, model = c("lmer", "blmer"), organism = NULL, min_size = 2, analysis = c("PCA", "MFA") )
quantif |
data.frame or matrix of the metabolite quantification with samples in rows (sample identifiers must be row names) and metabolites in columns (metabolite codes must be column names) |
design |
data.frame or matrix with samples in rows (sample identifiers
must be row names) and the different effects to be included in the model
in columns. Column names must be provided and are used as arguments for
|
pathways |
data.frame or matrix with metabolites in rows (all
metabolites in columns of
|
fixed |
character vector of fixed effects to be included in the model.
They must correspond to column names of |
random |
character vector of random effects to be included in the model.
They must correspond to column names of |
npc |
number of PCs for the PCA step |
model |
a character string indicating if the model has to be fitted
using lmer or blmer. Default to |
organism |
organism code in KEGG database. Required if
|
min_size |
minimal number of metabolites in a pathway. Required if
|
analysis |
character string indicating if the pathway scores are obtained using PCA or MFA |
If pathways = "auto"
, information on pathways in which metabolites are
present is automatically obtained by the function pathway_search using
KEGGREST
that queries KEGG database. Results are specific to a given
organism (passed in organism
). Pathways containing less than
min_size
metabolites are filtered out.
an object of class PCApath
or MFApath
that inherits
from class pathwayRes
(a list of pathway results). Each element of the
list contains the following entries:
pathway_name |
a character corresponding to the pathway name |
pathway_code |
a character corresponding to the pathway code |
metabolites |
a data.frame with the names and codes of the quantified metabolites in the pathway |
PCA |
the result of the pathway PCA or MFA (a |
model |
the output of the mixed model fit |
test_pathway |
a data.frame with the p-values for each tested fixed effect |
Camille Guilmineau <[email protected]>
Remi Servien <[email protected]>
Nathalie Vialaneix <[email protected]>
pathway_search for the automatic annotation of metabolites in KEGG pathways.
data("MTBLS422") quantif <- from_ASICS_to_PHOENICS(quantif) out_test <- test_pathway(quantif, design, pathways, fixed = c("Age", "Treatment"), random = "Mouse", npc = 2, model = "blmer") out_test out_test2 <- test_pathway(quantif, design, pathways, fixed = c("Age", "Treatment"), random = "Mouse", npc = 2, model = "blmer", analysis = "MFA") out_test2 if (requireNamespace("KEGGREST", quietly = TRUE)) { out_test3 <- test_pathway(quantif, design, pathways = "auto", fixed = c("Age", "Treatment"), random = "Mouse", npc = 2, model = "blmer", organism = "mmu") out_test3 }
data("MTBLS422") quantif <- from_ASICS_to_PHOENICS(quantif) out_test <- test_pathway(quantif, design, pathways, fixed = c("Age", "Treatment"), random = "Mouse", npc = 2, model = "blmer") out_test out_test2 <- test_pathway(quantif, design, pathways, fixed = c("Age", "Treatment"), random = "Mouse", npc = 2, model = "blmer", analysis = "MFA") out_test2 if (requireNamespace("KEGGREST", quietly = TRUE)) { out_test3 <- test_pathway(quantif, design, pathways = "auto", fixed = c("Age", "Treatment"), random = "Mouse", npc = 2, model = "blmer", organism = "mmu") out_test3 }