dgrapov / CTSgetR

R interface to Chemical Translation Service (CTS)
14 stars 9 forks source link

Is there an option to convert inchikey values to smiles ? #4

Closed TalWac closed 11 months ago

TalWac commented 3 years ago

Dear developers,

I want to ask if there's an option to convert Inchikey values to Smiles ?

Best regards,

Tal

dgrapov commented 3 years ago

It does not look like CTS supports smiles as a to translation option.

library(CTSgetR)
want<-'sm'
possible_to<-unlist(valid_to())
possible_to[grepl(want,possible_to,ignore.case=TRUE)]

You can try one of these options: webchem::get_csid #https://docs.ropensci.org/webchem/reference/get_csid.html rcdkTools::inchi2smiles #https://rdrr.io/github/bachi55/rcdkTools/man/inchi2smiles.html - requires installing open babel

dgrapov commented 11 months ago

Looks like this is now supported. You can see all up to date options.

> library(CTSgetR)
> want<-'sm'
> possible_to<-unlist(valid_to(update=TRUE))
> possible_to[grepl(want,possible_to,ignore.case=TRUE)]
#[1] "SMILES"                              
#[2] "SMID"                                
#[3] "GlaxoSmithKline (GSK)"               
#[4] "MLSMR"                               
#[5] "ORST SMALL MOLECULE SCREENING CENTER"

I updated master to get the list as of today for the default call you showed.