Learn R Programming

webchem (version 0.0.5.0)

get_pcid: Retrieve Pubchem Id (CID)

Description

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

Usage

get_pcid(query, first = FALSE, verbose = TRUE, ...)

Arguments

query
charachter; search term.
first
logical; If TRUE return only first result.
verbose
logical; should a verbose output be printed on the console?
...
currently not used.

Value

  • a character vector.

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–633.

Kim, Sunghwan, Paul A. Thiessen, Evan E. Bolton, et al. 2016 PubChem Substance and Compound Databases. Nucleic Acids Research 44(D1): D1202–D1213.

Examples

Run this code
# might fail if API is not available
get_pcid('Triclosan')

# multiple inputs
comp <- c('Triclosan', 'Aspirin')
sapply(comp, function(x) get_pcid(x))
sapply(comp, function(x) get_pcid(x, first = TRUE))

Run the code above in your browser using DataLab