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

with_cts

Auto-translate identifiers and search databases


Description

Supply a query of any type (e.g. SMILES, CAS, name, InChI, etc.) along with any webchem function that has query and from arguments. If the function doesn't accept the type of query you've supplied, this will try to automatically translate it using CTS and run the query.

Usage

with_cts(query, from, .f, .verbose = TRUE, ...)

Arguments

query

character; the search term

from

character; the format or type of query. Commonly accepted values are "name", "cas", "inchi", and "inchikey"

.f

character; the (quoted) name of a webchem function

.verbose

logical; print a message when translating query?

...

other arguments passed to the function specified with .f

Value

returns results from .f

Note

During the translation step, only the first hit from CTS is used. Therefore, using this function to translate on the fly is not foolproof and care should be taken to verify the results.

Examples

## Not run: 
with_cts("XDDAORKBJWWYJS-UHFFFAOYSA-N", from = "inchikey", .f = "get_etoxid")

## End(Not run)

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.