forked from dgrapov/CIRgetR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
50 lines (40 loc) · 1.53 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
CIRgetR
=======
R interface for chemical identifier translation through the [Chemical Identifier Resolver (CIR)](http://cactus.nci.nih.gov/chemical/structure) by the CADD Group at the NCI/NIH.
Install package.
```r
install.packages("devtools");install.packages("RJSONIO")
library(devtools);library(RJSONIO)
install_github(repo = "CIRgetR", username = "dgrapov")
library(CIRgetR)
#to show gif
install.packages("caTools")
```
```{r,echo=FALSE,message=FALSE, warning=FALSE, error=FALSE,results='hide'}
install.packages("devtools");install.packages("RJSONIO")
library(devtools);library(RJSONIO)
install_github(repo = "CIRgetR", username = "dgrapov")
library(CIRgetR)
```
Try translating inchi codes.
```{r,message=FALSE, warning=FALSE, erro=FALSE}
#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.
```{r fig.width=10, fig.height=9,message=FALSE, warning=FALSE}
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")
```