Title: | Tools for Manipulating the FOBI Ontology |
---|---|
Description: | A set of tools for interacting with the Food-Biomarker Ontology (FOBI). A collection of basic manipulation tools for biological significance analysis, graphs, and text mining strategies for annotating nutritional data. |
Authors: | Pol Castellano-Escuder [aut, cre] , Alex Sánchez-Pla [aut] |
Maintainer: | Pol Castellano-Escuder <[email protected]> |
License: | GPL-3 |
Version: | 1.15.0 |
Built: | 2024-11-19 03:43:56 UTC |
Source: | https://github.com/bioc/fobitools |
This function provides a text mining pipeline to map nutritional free text to Food-Biomarker Ontology. This pipeline is composed of five sequential layers to map food items to FOBI with the maximum accuracy as possible.
annotate_foods(foods, similarity = 0.85, reference = fobitools::foods)
annotate_foods(foods, similarity = 0.85, reference = fobitools::foods)
foods |
A two column data frame. First column must contain the ID (should be unique) and the second column must contain food items (it can be a word or a string). |
similarity |
Numeric between 0 (low) and 1 (high). This value indicates the semantic similarity cutoff used at the last layer of the text mining pipeline. 1 = exact match; 0 = very poor match. Values below 0.85 are not recommended. |
reference |
FOBI foods table obtained with 'parse_fobi(terms = "FOBI:0001", get = "des")'. If this value is set to NULL, the last version of FOBI will be downloaded from GitHub. |
A list containing two tibble objects: annotated and unannotated food items.
Pol Castellano-Escuder
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.
# Free text annotation in FOBI free_text <- data.frame(id = c(101, 102, 103, 104), text = c("Yesterday I ate eggs and bacon with a butter toast and black tea", "Crisp bread and rice crackers with wholegrain", "Beef and veal, one apple", "pizza without meat")) annotate_foods(free_text)
# Free text annotation in FOBI free_text <- data.frame(id = c(101, 102, 103, 104), text = c("Yesterday I ate eggs and bacon with a butter toast and black tea", "Crisp bread and rice crackers with wholegrain", "Beef and veal, one apple", "pizza without meat")) annotate_foods(free_text)
FOBI table obtained with 'parse_fobi()'
fobi
fobi
A tibble: 4069 FOBI entities with their associated information.
FOBI entity ID.
FOBI entity name.
FOBI entity direct parent class ID.
FOBI entity direct parent class name.
FOBI entity associated food ID (in terms of biomarker).
FOBI entity associated food name (in terms of biomarker).
ChemSpider ID.
KEGG ID.
PubChemCID ID.
InChIKey ID.
InChICode ID.
FOBI ID.
FOBI entity alias name.
HMDB ID.
FOBI entity associated food ID (in terms of a recipe).
FOBI entity associated food ID (in terms of a recipe).
https://github.com/pcastellanoescuder/FoodBiomarkerOntology
This function allows users to create networks based on FOBI relationships.
fobi_graph( terms = NULL, get = NULL, property = c("is_a", "BiomarkerOf", "Contains"), layout = "sugiyama", labels = FALSE, labelsize = 3, legend = FALSE, legendSize = 10, legendPos = "bottom", curved = FALSE, pointSize = 3, fobi = fobitools::fobi )
fobi_graph( terms = NULL, get = NULL, property = c("is_a", "BiomarkerOf", "Contains"), layout = "sugiyama", labels = FALSE, labelsize = 3, legend = FALSE, legendSize = 10, legendPos = "bottom", curved = FALSE, pointSize = 3, fobi = fobitools::fobi )
terms |
A character vector with FOBI term IDs. |
get |
A character string indicating desired relationships between provided terms. Options are 'anc' (for ancestors) and 'des' (for descendants). Default is NULL and all information related with input terms will be provided. |
property |
A character vector indicating which properties should be plotted. Options are 'is_a', 'BiomarkerOf', and 'Contains'. By default all of them are included. |
layout |
A character string indicating the type of layout to create. Options are 'sugiyama' (default) and 'lgl'. |
labels |
Logical indicating if node names should be plotted or not. |
labelsize |
Numeric value indicating the size of labels. |
legend |
Logical indicating if legend should be plotted or not. |
legendSize |
Numeric value indicating the size of legend. |
legendPos |
A character string indicating the legend position (if legend parameter is set to TRUE). Options are 'bottom' (default) and 'top'. |
curved |
Logical indicating if the shape of the edges shape should be curved or not. |
pointSize |
Numeric value indicating the size of graph points. |
fobi |
FOBI table obtained with 'parse_fobi()'. If this value is set to NULL, the last version of FOBI will be downloaded from GitHub. |
A ggraph object.
Pol Castellano-Escuder
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.
terms <- c("CHEBI:16164","CHEBI:16243","FOODON:00001139","FOODON:00003274","FOODON:00003275") fobi_graph(terms, get = "anc") # Red meat related FOBI biomarkers fobi_graph(terms = "FOBI:0193", property = c("is_a", "BiomarkerOf"), layout = "lgl", curved = TRUE) # set labels = TRUE to display node names
terms <- c("CHEBI:16164","CHEBI:16243","FOODON:00001139","FOODON:00003274","FOODON:00003275") fobi_graph(terms, get = "anc") # Red meat related FOBI biomarkers fobi_graph(terms = "FOBI:0193", property = c("is_a", "BiomarkerOf"), layout = "lgl", curved = TRUE) # set labels = TRUE to display node names
FOBI terms obtained with 'ontologyIndex::get_ontology()'
fobi_terms
fobi_terms
An ontology_index object with 1201 terms.
1.2
fobi.owl
fobi
id: character, name: character, parents: list, children: list, ancestors: list, obsolete: logical
FOBI:0001 - Foods, FOBI:01501 - Biomarkers, FOBI:00422 - BiomarkerOf, FOBI:00423 - HasBiomarker, FOBI:00424 - Contains, FOBI:00425 - IsIngredientOf
https://github.com/pcastellanoescuder/FoodBiomarkerOntology
FOBI foods table obtained with 'parse_fobi(terms = "FOBI:0001", get = "des")'
foods
foods
A tibble: 568 FOBI food entities with their associated information.
FOBI entity ID.
FOBI entity name.
FOBI entity direct parent class ID.
FOBI entity direct parent class name.
FOBI entity associated food ID (in terms of biomarker).
FOBI entity associated food name (in terms of biomarker).
ChemSpider ID.
KEGG ID.
PubChemCID ID.
InChIKey ID.
InChICode ID.
FOBI ID.
FOBI entity alias name.
HMDB ID.
FOBI entity associated food ID (in terms of a recipe).
FOBI entity associated food ID (in terms of a recipe).
https://github.com/pcastellanoescuder/FoodBiomarkerOntology
This function can convert metabolite identifiers to other available IDs in FOBI. Input vector can be a combination of different IDs.
id_convert(ids, to = "FOBI", fobi = fobitools::fobi)
id_convert(ids, to = "FOBI", fobi = fobitools::fobi)
ids |
A vector with metabolite IDs to convert. Input ID types can be FOBI, raw metabolite names (used in FOBI), HMDB, KEGG, PubChemCID, InChIKey, InChICode, ChemSpider, and a combination of them. |
to |
Target ID type. If possible, metabolites will be converted to this ID type. Options are "FOBI" (default), "metaboliteNames", "HMDB", "KEGG", "PubChemCID", "InChIKey", "InChICode", and "ChemSpider". |
fobi |
FOBI table obtained with 'parse_fobi()'. If this value is set to NULL, the last version of FOBI will be downloaded from GitHub. |
A tibble with input IDs and converted IDs.
Pol Castellano-Escuder
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.
ids <- c(fobitools::idmap$HMDB[1:10], fobitools::idmap$KEGG[11:23], fobitools::idmap$InChIKey[100:150]) fobitools::id_convert(ids, to = "FOBI")
ids <- c(fobitools::idmap$HMDB[1:10], fobitools::idmap$KEGG[11:23], fobitools::idmap$InChIKey[100:150]) fobitools::id_convert(ids, to = "FOBI")
Identifier mappings for FOBI metabolites
idmap
idmap
A tibble: 590 FOBI metabolites with 8 different IDs.
Raw metabolite names.
FOBI ID.
HMDB ID.
KEGG ID.
PubChemCID ID.
InChIKey ID.
InChICode ID.
ChemSpider ID.
https://github.com/pcastellanoescuder/FoodBiomarkerOntology
This function performs a MSEA based on the adaptive multilevel splitting Monte Carlo approach.
msea( metaboliteRanks, subOntology = "food", pvalCutoff = 0.01, fobi = fobitools::fobi )
msea( metaboliteRanks, subOntology = "food", pvalCutoff = 0.01, fobi = fobitools::fobi )
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. |
A tibble with MSEA results.
Pol Castellano-Escuder
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.
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) # Chemical class enrichment analysis fobitools::msea(metaboliteRanks = metaboliteRanks, subOntology = "biomarker", pvalCutoff = 1)
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) # Chemical class enrichment analysis fobitools::msea(metaboliteRanks = metaboliteRanks, subOntology = "biomarker", pvalCutoff = 1)
This function performs a traditional over representation analysis based on hypergeometric test: classes are treated as sets of individual metabolites and all metabolites are treated as equally informative. This function uses Food-Biomarker Ontology knowledge as biological information.
ora( metaboliteList, metaboliteUniverse, subOntology = "food", pvalCutoff = 0.01, fobi = fobitools::fobi )
ora( metaboliteList, metaboliteUniverse, subOntology = "food", pvalCutoff = 0.01, fobi = fobitools::fobi )
metaboliteList |
A vector of FOBI metabolite identifiers that define the selected list of metabolites. |
metaboliteUniverse |
A vector of FOBI metabolite identifiers that define the universe of possible metabolites (all metabolites analyzed in the study). |
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 hypergeometric test. |
fobi |
FOBI table obtained with 'parse_fobi()'. If this value is set to NULL, the last version of FOBI will be downloaded from GitHub. |
A tibble with ORA results.
Pol Castellano-Escuder
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.
metaboliteUniverse <- c(fobitools::idmap$FOBI[1:200], fobitools::idmap$FOBI[400:450]) metaboliteList <- c(fobitools::idmap$FOBI[1:50], fobitools::idmap$FOBI[70:80]) # Food enrichment analysis fobitools::ora(metaboliteList = metaboliteList, metaboliteUniverse = metaboliteUniverse, pvalCutoff = 1) # Chemical class enrichment analysis fobitools::ora(metaboliteList = metaboliteList, metaboliteUniverse = metaboliteUniverse, subOntology = "biomarker", pvalCutoff = 1)
metaboliteUniverse <- c(fobitools::idmap$FOBI[1:200], fobitools::idmap$FOBI[400:450]) metaboliteList <- c(fobitools::idmap$FOBI[1:50], fobitools::idmap$FOBI[70:80]) # Food enrichment analysis fobitools::ora(metaboliteList = metaboliteList, metaboliteUniverse = metaboliteUniverse, pvalCutoff = 1) # Chemical class enrichment analysis fobitools::ora(metaboliteList = metaboliteList, metaboliteUniverse = metaboliteUniverse, subOntology = "biomarker", pvalCutoff = 1)
This function allows users to download and parse the last version of the Food-Biomarker Ontology into a readable table format.
parse_fobi(terms = NULL, get = NULL)
parse_fobi(terms = NULL, get = NULL)
terms |
A character vector with FOBI term IDs. Default is NULL. |
get |
A character string indicating desired relationships between provided terms. Options are 'anc' (for ancestors) and 'des' (for descendants). Default is NULL and only information of single input terms will be provided. |
A tibble with FOBI terms information.
Pol Castellano-Escuder
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.
# Download and parse whole FOBI fobi <- parse_fobi() # Download and parse 'apple' related terms fobi_apple <- parse_fobi(terms = "FOODON:00002473") # Download and parse 'apple' term ancestors fobi_apple_anc <- parse_fobi(terms = "FOODON:00002473", get = "anc") # Download and parse 'apple' and 'alpha-Chaconine' related terms fobi_subset <- parse_fobi(terms = c("FOODON:00002473", "CHEBI:10219"))
# Download and parse whole FOBI fobi <- parse_fobi() # Download and parse 'apple' related terms fobi_apple <- parse_fobi(terms = "FOODON:00002473") # Download and parse 'apple' term ancestors fobi_apple_anc <- parse_fobi(terms = "FOODON:00002473", get = "anc") # Download and parse 'apple' and 'alpha-Chaconine' related terms fobi_subset <- parse_fobi(terms = c("FOODON:00002473", "CHEBI:10219"))