partridgejiang / Kekule.js

A Javascript cheminformatics toolkit.
http://partridgejiang.github.io/Kekule.js
MIT License
248 stars 61 forks source link

Feature request: Sterochemistry in Fischer projections #191

Open cleblond opened 3 years ago

cleblond commented 3 years ago

Unless I'm missing a setting it would be a cool feature if we could export fischer projections with the correct stereochemistry. Carl

partridgejiang commented 3 years ago

Hi @cleblond, I guess you mean something like the following image? When saving the Fischer projection, explicitly marks the wedge/hash bonds around the chiral center? http://kylixjiang.xicp.net/~partridge/temp/01.png

cleblond commented 3 years ago

The image link is broken, but yes that's sounds correct. I can see how this could be problematic to implement, not knowing when user was intending to draw fischer or not.

partridgejiang commented 3 years ago

A utility function has been added to Kekule.MolStereoUtils, you can now use it to convert the Fischer projection molecule into explicit wedge/hash bonds:

Kekule.MolStereoUtils.convertFischerBondsToWedge(molecule);

Please check with the latest dist files.

partridgejiang commented 3 years ago

A utility function has been added to Kekule.MolStereoUtils, you can now use it to convert the Fischer projection molecule into explicit wedge/hash bonds:

Kekule.MolStereoUtils.convertFischerBondsToWedge(molecule);

Please check with the latest dist files.