schrodinger / coordgenlibs

Schrodinger-developed 2D Coordinate Generation
BSD 3-Clause "New" or "Revised" License
42 stars 28 forks source link

Is there any way to leverage 3D coordinates? #122

Open shubbey opened 1 year ago

shubbey commented 1 year ago

Hello again, I realize that you aren't in active development of this library so I'm mainly asking to see if there is a way in the current system to take advantage of known 3D coordinates. I see in the code that they can be used as a fallback for when things fail, but I'm not seeing anything for using them to initialize a starting position for the 2D generation. As I noted in another thread, I'm debating moving from my in-house library which uses a very different method of "flattening" the 3D structure rather than generating it from scratch via connectivity info (which I assume is how coordgen works). My method is slower, but in some cases gives superior results. For example, if we look at: 208 The "flatten" method gives: flatten which is pretty straightfoward from the picture, since the molecule is almost planar already. But coordgen doesn't know this, and gives: coordgen208

I did see some code that attempts to penalize bond crossings and such but I was not able to tweak it to get a superior picture. I get worse results if I give more complicated molecules, but my "flatten" method often gets those wrong too, and takes much longer. Other toolkits, eg JMol, SmilesDrawer, and especially CDKDepict do very well with this molecule and similar, but they are implemented in other languages.