Skip to content

Chemical Translation System in R

Dmitry Grapov edited this page Sep 12, 2013 · 6 revisions

Use the Chemical Translation System (CTS) to translate between > 200 of the most common biological databases identifiers including:

  • "Chemical Name"
  • "InChIKey"
  • "InChI Code"
  • "PubChem CID"
  • "Pubchem SID",
  • "ChemDB"
  • "ChemSpider"
  • "Golm Metabolome Database (GMD)"
  • "BioCyc"
  • "ChEBI"
  • "CAS"
  • "HMDB"
  • "KEGG"
  • "LipidMAPS"

###View all translation options

CTS.options()

###Translation examples ####PubChem CID to InChI Key

id<-c(14242, 5760) # PubChem CIDs
from<-"PubChem CID"
to<-"InChIKey"
CTSgetR(id,from,to)

####InchI Key to pubchem CID

id<- "ZPUCINDJVBIVPJ-LJISPDSOSA-N" # InchI Key
from<-"InChIKey"
to<-"PubChem CID"
CTSgetR(id,from,to) #go ahead and google it

####PubChem CID to all available translations

opts<-CTS.options()
obj<-t(sapply(1:length(opts),function (i)
	{	
		id		= "446220"
                from            = "PubChem CID"	
		to 		= opts[i]
		CTSgetR(id,from,to)
	}))
colnames(obj)<-c(paste("From:",from),"To","Value")
obj

Check out another example HERE