CTSgetR provides a consitent interface to translation of chemical names and over 200 database identifiers including InChIKey, HMDB, KEGG and PubChem. Translation of chemical names is hard. Use CTSgetR to robustly translate chemical names to other identifiers through 1) conversion to InChIKey 2) biological or popularity scoring and 3) translation to over 200 biological database identifiers. CTSgetR uses a sqlite database to cache and speed all of your routine translations.
This package supports metabolite identifier translation:
## id from to
## 1 alanine Chemical Name PubChem CID
## 2 foo Chemical Name PubChem CID
## 3 lactic acid Chemical Name PubChem CID
## 4 alanine Chemical Name KEGG
## 5 foo Chemical Name KEGG
## 6 lactic acid Chemical Name KEGG
## 7 alanine Chemical Name Human Metabolome Database
## 8 foo Chemical Name Human Metabolome Database
## 9 lactic acid Chemical Name Human Metabolome Database
## 10 HMDB0000161 Human Metabolome Database KEGG
## 11 HMDB0000161 Human Metabolome Database PubChem CID
localhost/rstudio/ : rstudio server (use user: opencpu and password: )
Build docker image
build
export rstudio_pass=mypassword # rstudio server password for user opencpu
docker-compose -f docker-compose.yml build --force-rm
Launch API
#mount to persist internal sqlite DB between updates
export ctsgetr_db_mount=<local path to save database e.g. /mypath>
docker-compose -f docker-compose.yml up -d
The following example shows a how to use a shiny module combined with futures and promisesR packages to connect to an opencpu API uisng async calls.
library(shiny)
library(tippy)
library(CTSgetR) # local calls
library(ocpuclient) # CTSgetR opencpu API calls
Specify local database or API options
#one of local
Sys.setenv('ctsgetr_DB'='inst/ctsgetr.sqlite') #see section `in R` showing how to initialize a local databse#or API
Sys.setenv('ctsgetr_DB'='/ctsgetr/inst/ctsgetr.sqlite') # in API docker for mount
Sys.setenv('CTSgetR_API'='http://localhost/ocpu/library/CTSgetR/R/CTSgetR') # url of API endpoint