epam / ketcher

Web-based molecule sketcher
https://lifescience.opensource.epam.com/ketcher/demo.html
Apache License 2.0
442 stars 159 forks source link

Option to save as InChIKey #1334

Closed BarneyLabstep closed 2 years ago

BarneyLabstep commented 2 years ago

Is your feature request related to a problem? Please describe.

We want to save the InChIKey of molecules drawn to facilitate searching and indexing downstream.

Describe the solution you'd like

It would be nice to have the option of generating the InChIKey from the InChI or directly from the structure drawn

Describe alternatives you've considered

We could do the InChIKey generation on the server-side using epam's Indigo library but our server is in php and there are only C and Python APIs provided.

AndreiMazol commented 2 years ago

Dear @BarneyLabstep ,

we will discuss this enhancement with Indigo team and then will provide detailed answer about your request.

Best regards, Ketcher team

AndreiMazol commented 2 years ago

Dear @BarneyLabstep ,

your request will be implemented in scope of release 2.5.

Best regards, Ketcher team

even1024 commented 2 years ago

Feature added https://github.com/epam/Indigo/pull/696

BarneyLabstep commented 2 years ago

Thanks!

When trying to use indigo-ketcher we bump into this CSP error https://github.com/epam/Indigo/issues/567

Is there any chance of exposing the method in the main ketcher API in the same way you have ketcher.getSMILES() and ketcher.getMolfile() so there would be ketcher.getInChI() and ketcher.getInChIKey()?

AndreiMazol commented 2 years ago

Hi @BarneyLabstep ,

JFYI Ketcher converters are based on indigo-ketcher package so CSP error will be reproduced in standalone mode too. If you plan to use standalone version of Ketcher it is necessary to wait for fixing the bug on back-end side.

BarneyLabstep commented 2 years ago

For some reason we don't seem to get the error when ketcher-standalone uses indigo-ketcher internally as a dependancy, only when we import the package directly.

AndreiMazol commented 2 years ago

Thank you for information. As I said before we plan to add required methods (ketcher.getInChI() and ketcher.getInChIKey()) as part of release 2.5 (it will be released in April)

even1024 commented 2 years ago

For some reason we don't seem to get the error when ketcher-standalone uses indigo-ketcher internally as a dependancy, only when we import the package directly.

Could you provide details of which methods you call for standalone and WASM versions? Here we have a branch for the fix and test in .js which works fine:

https://github.com/epam/Indigo/blob/ketcher_inchi_key/api/wasm/indigo-ketcher/test.js#L404

Mariia-Katkova commented 2 years ago

Verified in Release 2.5

ZhannaNovikova commented 2 years ago

Verified as fixed on Release 2.5.0.