R interface for chemical identifier translation through the Chemical Identifier Resolver (CIR) by the CADD Group at the NCI/NIH.
Install package.
install.packages("devtools");install.packages("RJSONIO") library(devtools);library(RJSONIO) install_github(repo = "CIRgetR", username = "dgrapov") library(CIRgetR) #to show gif install.packages("caTools")
install.packages("devtools");install.packages("RJSONIO") library(devtools);library(RJSONIO) install_github(repo = "CIRgetR", username = "dgrapov") library(CIRgetR)
Try translating inchi codes.
#test id<-"CYQFCXCEBYINGO-IAGOWNOFSA-N" opts<-c("smiles", "names", "iupac_name", "cas", "inchi", "stdinchi", "inchikey", "stdinchikey", "ficts", "ficus", "uuuuu", "image", "file", "mw", "monoisotopic_mass","chemspider_id", "pubchem_sid", "chemnavigator_sid", "formula", "chemnavigator_sid") translations<-lapply(1:length(opts), function(i) { CIRgetR(id=id,to=opts[i],return.all=FALSE, progress=FALSE) }) translations<-do.call("cbind",translations) t(translations)
Show structures.
library(caTools) image.url<-as.character(translations$image[1]) gif <- read.gif(image.url, verbose = TRUE, flip = TRUE) par(pin=c(3.5,3.5)) image(gif$image, col = gif$col, main =as.character(translations$name[1]), frame.plot=FALSE,xaxt="n", yaxt="n")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.