Learn R Programming

webchem (version 0.0.5.0)

cts_convert: Convert Ids using Chemical Translation Service (CTS)

Description

Convert Ids using Chemical Translation Service (CTS), see http://cts.fiehnlab.ucdavis.edu/conversion/index

Usage

cts_convert(query, from, to, first = FALSE, verbose = TRUE, ...)

Arguments

query
character; query ID.
from
character; type of query ID, e.g. 'Chemical Name' , 'InChIKey', 'PubChem CID', 'ChemSpider', 'CAS'.
to
character; type to convert to.
first
logical; return only first result be returned?
verbose
logical; should a verbose output be printed on the console?
...
currently not used.

Value

  • a character vector.

Details

See see http://cts.fiehnlab.ucdavis.edu/conversion/index for possible values of from and to.

References

Wohlgemuth, G., P. K. Haldiya, E. Willighagen, T. Kind, and O. Fiehn 2010The Chemical Translation Service -- a Web-Based Tool to Improve Standardization of Metabolomic Reports. Bioinformatics 26(20): 2647–2648.

Examples

Run this code
# might fail if API is not available
cts_convert('XEFQLINVKFYRCS-UHFFFAOYSA-N', 'inchikey', 'Chemical Name')

### multiple inputs
comp <- c('XEFQLINVKFYRCS-UHFFFAOYSA-N', 'BSYNRYMUTXBXSQ-UHFFFAOYSA-N')
sapply(comp, function(x) cts_convert(x, 'inchikey', 'Chemical Name', first = TRUE))

Run the code above in your browser using DataLab