kienerj / pycdxml

Tools to automatically convert and proccess cdx and cdxml files in python
GNU General Public License v3.0
35 stars 5 forks source link

Crossed double bond in MOL turned into defined stereo in CDXML #25

Closed baoilleach closed 1 year ago

baoilleach commented 1 year ago

CHEMBL4207369.mol.txt has a crossed double bond visible in ChemDraw when opened. image However, this is converted to a regular double bond by PyCDXML: image

kienerj commented 1 year ago

That is likley due that I recently added the crossed_bonds=False argument. Setting it to True fixes the issue.

Depending on usage of the output often being used for visualization and at least some users don't like seeing crossed bonds, I defaulted to displaying as normal bond. But I'm open to reversing the default.

(Due to different regulations for different industries "stereochemical exactness" might be less important especially if you can sell the molecule as "mixture of isomers")

Leaving it open to discuss about the default value.

baoilleach commented 1 year ago

Ok - I must doublecheck, because I thought I was setting it to True.

Regarding the default, I would recommend that the defaults preserve information as much as possible - otherwise people will never realise that the data has been altered. If people don't want to see the crossed double bond, and wish to discard that information, then they should need to actively choose that option.

kienerj commented 1 year ago

Changed default to crossed_bonds=True in 16b8f2828daef24dac9b8658d6b3bd12b92375da

baoilleach commented 1 year ago

Double-checked, and indeed it was working.