find_RHEA_ids_from_ids: Find RHEA ids from ids

View source: R/id_conversion.R

find_RHEA_ids_from_idsR Documentation

Find RHEA ids from ids

Description

The function find_RHEA_ids_from_ids returns the RHEA ids that are involved in reactions of the given identifiers (ids) of type id_type.

Usage

find_RHEA_ids_from_ids(
  ids,
  id_type,
  annotation_set = NULL,
  rhea_chebi_smiles = NULL,
  rhea_reaction_smiles = NULL,
  rhea_directions = NULL,
  type = c("substrates", "products", "both")
)

Arguments

ids

character, identifiers to be translated to ChEBI ids

id_type

character(1), one of colnames(annotation_set)

annotation_set

data.frame containing the mappings between different ids

rhea_chebi_smiles

data.frame containing the mappings between ChEBI identifiers and SMILES identifiers

rhea_reaction_smiles

data.frame containing the mappings between ChEBI identifiers and SMILES identifiers

rhea_directions

data.frame containing information on the directionality of RHEA directions

type

character(1), one of "both", "substrates", or "products"

Details

If one or several arguments (annotation_set, rhea_chebi_smiles, rhea_reaction_smiles, rhea_directions) are set to NULL, the objects will be loaded as by default (the default values are identical to the values in the Example section below).

The returned result might differ depending on the type object:

  • if type = "both", the function will return the RHEA identifiers for the SMILES found both in the substrates or products of the reactions,

  • if type = "substrates", the function will return the RHEA identifiers for the SMILES found in the substrates of the reactions,

  • if type = "products", the function will return the RHEA identifiers for the SMILES found in the products of the reactions.

Value

list

Author(s)

Thomas Naake

Examples

ids <- c("HMDB0004947", "HMDB0004949", "HMDB0011763", "HMDB0004974", "HMDB0011594")
id_type <- "HMDB"

## load annotation_set
library(metaboliteIDmapping)
library(AnnotationHub)
ah <- AnnotationHub()
datasets <- query(ah, "metaboliteIDmapping")

## Currently, there are two versions of the mapping table.
## AH79817 represents the original ID mapping containing 9 different ID formats
## AH83115 mapping table which also includes common names for each compound
## AH91792 current version of the mapping table that also accounts for tautomers
## For implementing this data in your code, it is recommended to use the 
## AHid for retrieval:
annotation_set <- ah[["AH91792"]]

## load rhea_chebi_smiles
file <- file.path(
    path.package("LipidNetworkPredictR"), "extdata", "rhea-chebi-smiles.tsv",
    fsep = .Platform$file.sep)
rhea_chebi_smiles <- read.csv(file, sep = "\t", header = FALSE)

## load rhea_reaction_smiles
file <- file.path(
    path.package("LipidNetworkPredictR"), "extdata", "rhea-reaction-smiles.tsv",
    fsep = .Platform$file.sep)
rhea_reaction_smiles <- read.csv(file, sep = "\t", header = FALSE)

## load rhea_directions
file <- file.path(
    path.package("LipidNetworkPredictR"), "extdata", "rhea-directions.tsv",
    fsep = .Platform$file.sep)
rhea_directions <- read.csv(file, sep = "\t", header = TRUE)

## run the function
find_RHEA_ids_from_ids(ids = ids, id_type = id_type, 
    annotation_set = annotation_set, rhea_chebi_smiles = rhea_chebi_smiles,
    rhea_reaction_smiles = rhea_reaction_smiles, 
    rhea_directions = rhea_directions, type = "substrates")

michaelwitting/wormLipidPredictR documentation built on Nov. 24, 2024, 5:39 p.m.