Learn R Programming

webchem (version 1.0.0)

cts_convert: Convert Ids using Chemical Translation Service (CTS)

Description

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

Usage

cts_convert(
  query,
  from,
  to,
  first = FALSE,
  choices = NULL,
  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

deprecated. Use choices = 1 instead.

choices

to return only the first result, use 'choices = 1'. To choose a result from an interative menu, provide a number of choices to choose from or "all".

verbose

logical; should a verbose output be printed on the console?

...

currently not used.

Value

a list of character vectors or if choices is used, then a single named vector.

Details

See also http://cts.fiehnlab.ucdavis.edu/ 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<U+2013>2648.

See Also

cts_from for possible values in the 'from' argument and cts_to for possible values in the 'to' argument.

Examples

Run this code
# NOT RUN {
# might fail if API is not available
cts_convert("triclosan", "Chemical Name", "inchikey")

### multiple inputs
comp <- c("triclosan", "hexane")
cts_convert(comp, "Chemical Name", "cas")
# }

Run the code above in your browser using DataLab