Last data update: 2014.03.03

R: Retrieve Pubchem Id (CID)
get_cidR Documentation

Retrieve Pubchem Id (CID)

Description

Return CompoundID (CID) for a search query using PUG-REST, see https://pubchem.ncbi.nlm.nih.gov/.

Usage

get_cid(query, from = "name", first = FALSE, verbose = TRUE, arg = NULL,
  ...)

Arguments

query

character; search term.

from

character; type of input, can be one of 'name' (default), 'cid', 'sid', 'aid', 'smiles', 'inchi', 'inchikey'

first

logical; If TRUE return only first result.

verbose

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

arg

character; optinal arguments like 'name_type=word' to match individual words.

...

optional arguments

Value

a list of cids. If first = TRUE a vector.

Author(s)

Eduard Szoecs, eduardszoecs@gmail.com

References

Wang, Y., J. Xiao, T. O. Suzek, et al. 2009 PubChem: A Public Information System for Analyzing Bioactivities of Small Molecules. Nucleic Acids Research 37: 623<c3><a2><c2><80><c2><93>633.

Kim, Sunghwan, Paul A. Thiessen, Evan E. Bolton, et al. 2016 PubChem Substance and Compound Databases. Nucleic Acids Research 44(D1): D1202<c3><a2><c2><80><c2><93>D1213.

Kim, S., Thiessen, P. A., Bolton, E. E., & Bryant, S. H. (2015). PUG-SOAP and PUG-REST: web services for programmatic access to chemical information in PubChem. Nucleic acids research, gkv396.

Examples


# might fail if API is not available
get_cid('Triclosan')
get_cid('Triclosan', arg = 'name_type=word')
get_cid("BPGDAMSIGCZZLK-UHFFFAOYSA-N", from = 'inchikey')
get_cid("CCCC", from = 'smiles')

# multiple inputs
comp <- c('Triclosan', 'Aspirin')
get_cid(comp)


Results