This function performs a MSEA based on the adaptive multilevel splitting Monte Carlo approach.

msea(
  metaboliteRanks,
  subOntology = "food",
  pvalCutoff = 0.01,
  fobi = fobitools::fobi
)

Arguments

metaboliteRanks

A named vector of FOBI metabolite identifiers with their metabolite-level stats.

subOntology

A character string specifying one of the two FOBI sub-ontologies: "food", or "biomarker".

pvalCutoff

A numeric value indicating a p-value cutoff for raw p-values generated by MSEA.

fobi

FOBI table obtained with `parse_fobi()`. If this value is set to NULL, the last version of FOBI will be downloaded from GitHub.

Value

A tibble with MSEA results.

References

G. Korotkevich, V. Sukhov, A. Sergushichev. Fast gene set enrichment analysis. bioRxiv (2019), doi:10.1101/060012

Pol Castellano-Escuder, Raúl González-Domínguez, David S Wishart, Cristina Andrés-Lacueva, Alex Sánchez-Pla, FOBI: an ontology to represent food intake data and associate it with metabolomic data, Database, Volume 2020, 2020, baaa033, https://doi.org/10.1093/databa/baaa033.

Author

Pol Castellano-Escuder

Examples


metabolites <- c(fobitools::idmap$FOBI[1:49], fobitools::idmap$FOBI[70:80])
random_pvals <- c(runif(n = length(metabolites)*0.3, min = 0.001, max = 0.05), runif(n = length(metabolites)*0.7, min = 0.05, max = 0.99))
names(random_pvals) <- metabolites
metaboliteRanks <- random_pvals[order(random_pvals)]

# Food enrichment analysis
fobitools::msea(metaboliteRanks = metaboliteRanks, 
                pvalCutoff = 1)
#> # A tibble: 141 × 8
#>    className              classSize log2err    ES   NES   pval  padj leadingEdge
#>    <chr>                      <int>   <dbl> <dbl> <dbl>  <dbl> <dbl> <list>     
#>  1 legume food product           29  0.204  0.601  1.34 0.0480 0.996 <chr [11]> 
#>  2 sugar                          2  0.134  0.841  1.54 0.104  0.996 <chr [2]>  
#>  3 soybean (whole)               12  0.129  0.606  1.27 0.111  0.996 <chr [7]>  
#>  4 soft drink                     1  0.128  0.898  1.79 0.114  0.996 <chr [1]>  
#>  5 meat food product             11  0.105  0.588  1.22 0.160  0.996 <chr [7]>  
#>  6 egg food product               8  0.101  0.615  1.23 0.169  0.996 <chr [7]>  
#>  7 beer                          12  0.0953 0.565  1.19 0.187  0.996 <chr [4]>  
#>  8 grapefruit (whole, ra…         5  0.0911 0.646  1.22 0.201  0.996 <chr [3]>  
#>  9 nut (whole or part)           25  0.0892 0.523  1.17 0.208  0.996 <chr [10]> 
#> 10 citrus fruit food pro…         1  0.0789 0.763  1.52 0.251  0.996 <chr [1]>  
#> # ℹ 131 more rows

# Chemical class enrichment analysis
fobitools::msea(metaboliteRanks = metaboliteRanks, 
                subOntology = "biomarker", 
                pvalCutoff = 1)
#> # A tibble: 48 × 8
#>    className              classSize log2err    ES   NES   pval  padj leadingEdge
#>    <chr>                      <int>   <dbl> <dbl> <dbl>  <dbl> <dbl> <list>     
#>  1 5-hydroxypsoralens             1  0.381  1      1.99 0.0155 0.743 <chr [1]>  
#>  2 Para cresols                   1  0.245  0.983  1.95 0.0340 0.815 <chr [1]>  
#>  3 Catechols                      1  0.174  0.949  1.89 0.0649 0.846 <chr [1]>  
#>  4 Xanthines                      1  0.152  0.932  1.85 0.0829 0.846 <chr [1]>  
#>  5 Salicylic acids                1  0.114  0.881  1.75 0.138  0.846 <chr [1]>  
#>  6 Indolyl carboxylic ac…         1  0.107  0.864  1.72 0.155  0.846 <chr [1]>  
#>  7 1-hydroxy-2-unsubstit…         1  0.0944 0.831  1.65 0.190  0.846 <chr [1]>  
#>  8 4'-O-methylisoflavones         2  0.0873 0.758  1.40 0.215  0.846 <chr [2]>  
#>  9 1-hydroxy-4-unsubstit…         1  0.0848 0.797  1.58 0.225  0.846 <chr [1]>  
#> 10 O-glycosyl compounds           2  0.0848 0.746  1.38 0.225  0.846 <chr [2]>  
#> # ℹ 38 more rows