test_pathway {phoenics} | R Documentation |
Pathway differential analysis based on longitudinal metabolomics data
Description
Perform a differential analysis at pathway level based on metabolite quantifications and information on pathway metabolite composition. The method relies on a PCA step.
Usage
test_pathway(
quantif,
design,
pathways = "auto",
fixed,
random,
npc = 1L,
model = c("lmer", "blmer"),
organism = NULL,
min_size = 2
)
Arguments
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
|
Details
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.
Value
an object of class pathwayRes
which is a list of pathway
results. Each element of the list contain 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 (a |
model |
the output of the mixed model fit |
test_pathway |
a data.frame with the p-values for each tested fixed effect |
Author(s)
Camille Guilmineau <camille.guilmineau@inrae.fr>
Remi Servien <remi.servien@inrae.fr>
Nathalie Vialaneix <nathalie.vialaneix@inrae.fr>
See Also
pathway_search for the automatic annotation of metabolites in KEGG pathways.
Examples
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
if (requireNamespace("KEGGREST", quietly = TRUE)) {
out_test2 <- test_pathway(quantif, design, pathways = "auto",
fixed = c("Age", "Treatment"), random = "Mouse",
npc = 2, model = "blmer", organism = "mmu")
out_test2
}