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)

Arguments

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.

Value

A tibble with input IDs and converted IDs.

References

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


ids <- c(fobitools::idmap$HMDB[1:10], 
         fobitools::idmap$KEGG[11:23], 
         fobitools::idmap$InChIKey[100:150])
fobitools::id_convert(ids, to = "FOBI")
#> # A tibble: 71 × 4
#>    FOBI        HMDB      KEGG   InChIKey                   
#>    <chr>       <chr>     <chr>  <chr>                      
#>  1 FOBI:030706 HMDB00062 C15025 PHIQHXFUZVPYII-LURJTMIESA-N
#>  2 FOBI:030415 HMDB00375 C11457 QVWAEZJXDYOKEH-UHFFFAOYSA-N
#>  3 FOBI:030460 HMDB02780 C06562 PFTAWBLQPZVEMU-DZGCQCFKSA-N
#>  4 FOBI:030630 HMDB00956 C00898 FEWJPZIEWOKRBE-JCYAYHJZSA-N
#>  5 FOBI:030711 HMDB00925 C01104 UYPYRKYUKCHHIB-UHFFFAOYSA-N
#>  6 FOBI:030687 HMDB00033 C00386 CQOVPNPJLQNMDC-ZETCQYMHSA-N
#>  7 FOBI:030555 HMDB05800 C01514 IQPNAANSBPBGFQ-UHFFFAOYSA-N
#>  8 FOBI:030709 HMDB00251 C00245 XOAAWQZATWQOTB-UHFFFAOYSA-N
#>  9 FOBI:030748 HMDB03000 C05432 OAIJSZIZWZSQBC-GYZMGTAESA-N
#> 10 FOBI:030625 NA        C02824 HCAJEUSONLESMK-UHFFFAOYSA-N
#> # ℹ 61 more rows