cheminfo / openchemlib-js

JavaScript port of OpenChemLib
https://cheminfo.github.io/openchemlib-js/index.html
BSD 3-Clause "New" or "Revised" License
72 stars 21 forks source link

Is there support for SMARTS? Can it be exposed if not? #151

Closed baoilleach closed 1 year ago

baoilleach commented 1 year ago

Hi there. It's been a while since we met at the EMBL-EBI (I think?), @lpatiny, but good to see that this is still going strong.

Doesn't OpenChemLib support SMARTS? If so, it'd be great to have access to SMARTS from JS, as I need this for an application I'm developing (will be available publically). Specifically, I would like to able to read in a SMILES string, find the first match to a particular SMARTS, and then be able to access the matched atoms (and their atomic number, degree, valence, charge, and whether in a ring). I'm hoping to create the same application with multiple JS cheminformatics toolkits as a way of showing the current state-of-the-art of chemistry in the browser.

lpatiny commented 1 year ago

It should be possible to expose this functionality because indeed it is partially supported by openchemlib

https://github.com/cheminfo/openchemlib-js/blob/f688501392d419a5299d8606d150080222662fc4/src/com/actelion/research/gwt/minimal/JSMolecule.java#L254-L259

baoilleach commented 1 year ago

Thanks @targos. Looking forward to trying this out when it's merged.