Learn R Programming

webchem (version 1.3.1)

pc_prop: Retrieve compound properties from a pubchem CID

Description

Retrieve compound information from pubchem CID, see https://pubchem.ncbi.nlm.nih.gov/

Usage

pc_prop(cid, properties = NULL, verbose = getOption("verbose"), ...)

Value

a tibble; each row is a queried CID, each column is a requested property.

Arguments

cid

numeric; a vector of Pubchem IDs (CIDs). The input vector will be coerced to a vector of positive integers. The function will return a row of NAs for elements that cannot be coerced to positive integers.

properties

character; a vector of properties to retrieve, e.g. c("MolecularFormula", "MolecularWeight"). If NULL (default) all available properties are retrieved. See https://pubchem.ncbi.nlm.nih.gov/docs/pug-rest#section=Compound-Property-Tables for a list of all available properties.

verbose

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

...

currently not used.

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.

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.

Eduard Szöcs, Tamás Stirling, Eric R. Scott, Andreas Scharmüller, Ralf B. Schäfer (2020). webchem: An R Package to Retrieve Chemical Information from the Web. Journal of Statistical Software, 93(13). tools:::Rd_expr_doi("10.18637/jss.v093.i13").

See Also

get_cid, pc_sect

Examples

Run this code
if (FALSE) {
# might fail if API is not available
pc_prop(5564)

###
# multiple CIDS
comp <- c("Triclosan", "Aspirin")
cids <- get_cid(comp)
pc_prop(cids$cid, properties = c("MolecularFormula", "MolecularWeight",
"SMILES"))
}

Run the code above in your browser using DataLab