Skip to content
Snippets Groups Projects
README.Rmd 3.72 KiB
Newer Older
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
output: 
  github_document: default
  html_document:
    self_contained: no
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
```{r, echo = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-"
)
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
# phoenics: Pathways longitudinal and differential analysis in metabolomics
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
`phoenics` is a package that provide a method for differential analysis at a 
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
pathway level. It is based on metabolite quantifications and information on
pathway metabolite composition.

GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
`phoenics` provides four user level functions: `test_pathway`,
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
`from_ASICS_to_PHOENICS`, `pathway_search` and `overlap_coefficient`, which are
briefly explained below.
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed

## `from_ASICS_to_PHOENICS`
`from_ASICS_to_PHOENICS` prepare quantification data from `ASICS` outputs for
the function `test_pathway`.
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
```{r from_ASICS_to_PHOENICS, message=FALSE}
data("MTBLS422")
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed

quantif <- from_ASICS_to_PHOENICS(quantif)
```

## `test_pathway`
`test_pathway` perform the differential analysis at pathway level.

The data.frame or matrix containing the pathway metabolite composition can be
given in the argument `pathways`.
```{r test_pathway, message=FALSE}
out_test <- test_pathway(quantif, design, pathways,
                         fixed = c("Age", "Treatment"), random = "Mouse", 
                         npc = 2, model = "blmer")
out_test
```

GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
The results of `test_pathway` is of class `pathwayRes` and `PCApath`.

GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
By default, a PCA is used to calculate pathway scores. A MFA can be used
instead, by adding the argument `analysis`.
```{r test_pathway_MFA, message=FALSE}
out_test_mfa <- test_pathway(quantif, design, pathways, 
                             fixed = c("Age", "Treatment"), random = "Mouse", 
                             npc = 2, model = "blmer", analysis = "MFA")
out_test_mfa
```

GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
The results of `test_pathway` is of class `pathwayRes` and `MFApath`.

If no pathway information is given, `pathways` is automatically searched by the
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
function.
```{r test_pathway2, message=FALSE}
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
out_test2 <- test_pathway(quantif, design, pathways = "auto",
                          fixed = c("Age", "Treatment"), random = "Mouse",
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
                          npc = 2, model = "blmer", organism = "mmu")
out_test2
```

GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
## `pathway_search`
`pathway_search` search pathways based on a vector of metabolite KEGG codes.
This function is automatically used in the function `test_pathway`, 
when `pathways = "auto"`.
```{r pathway_search}
pathways_auto <- pathway_search(metab = colnames(quantif), organism = "mmu")
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
head.matrix(pathways_auto)
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
## `overlap_coefficient`
`overlap_coefficient` calculate the overlap coefficient between two pathways.

The arguments `pathwayA` and `pathwayB` can be pathway names and their
metabolite compositions are given in the argument `pathways`.
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
```{r overlap_coefficient}
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
pathwayA <- "Galactose metabolism"
pathwayB <- "Vitamin digestion and absorption"
overlap_coefficient(pathwayA, pathwayB, pathways)
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
If `pathways` argument is not given, the argument `organism` is required to
search for pathway composition in KEGG database.
```{r overlap_coefficient2}
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
pathwayA <- "Galactose metabolism"
pathwayB <- "Vitamin digestion and absorption"
overlap_coefficient(pathwayA, pathwayB, organism = "mmu")
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
The arguments `pathwayA` and `pathwayB` can be pathway codes and their
metabolite compositions are given in the argument `pathways`.
```{r overlap_coefficient3}
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
pathwayA <- "mmu00052"
pathwayB <- "mmu00562"
overlap_coefficient(pathwayA, pathwayB, pathways)
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
```
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed

The arguments `pathwayA` and `pathwayB` can be vectors of metabolites. In that
case, the the argument `pathways` is not required.
```{r overlap_coefficient4}
pathwayA <- c("C00029", "C00116", "C00137", "C00794", "C00984", "C01697")
pathwayB <- c("C00191", "C00092", "C00137")
overlap_coefficient(pathwayA, pathwayB)
GUILMINEAU Camille's avatar
GUILMINEAU Camille committed
```