Learn R Programming

webchem (version 0.0.5.0)

cs_compinfo: Get record details (CSID, StdInChIKey, StdInChI, SMILES) by ChemSpider ID

Description

Get record details from ChemspiderId (CSID), see http://www.chemspider.com/

Usage

cs_compinfo(csid, token, verbose = TRUE, ...)

Arguments

csid
character, ChemSpider ID.
token
character; security token.
verbose
logical; should a verbose output be printed on the console?
...
currently not used.

Value

  • a list of four, with entries: csid (ChemSpider ID), inchi, inchikey, smiles and source_url.

See Also

get_csid to retrieve ChemSpider IDs, csid_extcompinfo for extended compound information.

Examples

Run this code
# Fails because no TOKEN is included
token <- '<YOUR-SECURITY-TOKEN>'
# convert CAS to CSID
csid <- get_csid("Triclosan", token = token)
cs_compinfo(csid, token)

###
# multiple inputs
csids <- sapply(c('Aspirin', 'Triclosan'), get_csid, token = token)
# fails:
# cs_compinfo(csids, token = token)
(ll <- lapply(csids, cs_compinfo, token = token))
# return a list, convert to matrix:
do.call(rbind, ll)

Run the code above in your browser using DataLab