translate_id_to_ChEBI: Translate ID to ChEBI

View source: R/id_conversion.R

translate_id_to_ChEBIR Documentation

Translate ID to ChEBI

Description

The function translate_id_to_ChEBI will translate identifiers (ids) of type id_type to ChEBI identifiers.

Usage

translate_id_to_ChEBI(
  ids,
  id_type = colnames(annotation_set),
  annotation_set = annotation_set
)

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

Details

The function will return a named list. Each entry will contain the corresponding ChEBI ids. In case there are no corresponding ChEBI ids to ids, the list will contain the entry NA.

Value

list

Author(s)

Thomas Naake

Examples

## define the identifiers and the id type 
ids <- c("HMDB0004947", "HMDB0004949", "HMDB0011763", "HMDB0004974", "HMDB0011594")
id_type <- "HMDB"

## define the mapping table
library(AnnotationHub)
ah <- AnnotationHub()
datasets <- query(ah, "metaboliteIDmapping")
annotation_set <- ah[["AH91792"]]

## run the function
translate_id_to_ChEBI(ids = ids, id_type = id_type,
    annotation_set = annotation_set)

michaelwitting/wormLipidPredictR documentation built on Nov. 20, 2024, 1:10 a.m.