Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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,
  match = c("all", "first", "ask", "na"),
  verbose = TRUE,
  choices = NULL,
  ...
)

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.

match

character; How should multiple hits be handled? "all" returns all matches, "first" returns only the first result, "ask" enters an interactive mode and the user is asked for input, "na" returns NA if multiple hits are found.

verbose

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

choices

deprecated. Use the match argument instead.

...

currently not used.

Details

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

Value

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

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.

See Also

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

Examples

# 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")

webchem

Chemical Information from the Web

v1.1.1
MIT + file LICENSE
Authors
Eduard Szöcs [aut], Robert Allaway [ctb], Daniel Muench [ctb], Johannes Ranke [ctb], Andreas Scharmüller [ctb], Eric R Scott [ctb], Jan Stanstrup [ctb], João Vitor F Cavalcante [ctb], Gordon Getzinger [ctb], Tamás Stirling [ctb, cre]
Initial release
2021-02-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.