ci_query | R Documentation |
Retrieve information from ChemIDPlus https://chem.nlm.nih.gov/chemidplus
ci_query(query, from = c("rn", "inchikey"), verbose = getOption("verbose"))
query |
character; query string |
from |
character; type of query string, can be one of |
verbose |
logical; should a verbose output be printed on the console? |
A list of 8 entries: name (vector), synonyms (vector), cas (vector), inchi (vector), inchikey (vector), smiles(vector), toxicity (data.frame), physprop (data.frame) and source_url.
Please respect the Terms and Conditions of the National Library of Medicine, https://www.nlm.nih.gov/databases/download.html.
## Not run: # might fail if API is not available y1 <- ci_query('50-00-0', from = 'rn') y1[['50-00-0']]$inchikey # query by inchikey y2 <- ci_query('WSFSSNUMVMOOMR-UHFFFAOYSA-N', from = 'inchikey') y2[[1]]$name # query multiple compounds comps <- c("50-00-0", "64-17-5") y3 <- ci_query(comps, from = "rn") # extract log-P sapply(y3, function(y){ if (length(y) == 1 && is.na(y)) return(NA) y$physprop$Value[y$physprop$`Physical Property` == 'log P (octanol-water)'] }) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.