Dear all,

I need to discriminate molecules with 2D or 3D coordinates.

I have a question regarding how RDKit decides if a molecule read from SDF is 2D or 3D.

I have a 2D molecule with, for reasons, the "software line" (2nd line in MolBlock) does not end with '2D' or '3D' but with '0D'. For testing purpose, I copied the molecule and changed the '0D' to either '2D' or '3D'. (see attached test.sdf)

Here is what I have when I check if the molecules are 2D or 3D:
In [1]: from rdkit import Chem
In [2]: suppl = Chem.SDMolSupplier('/home/josemanuel/Desktop/test.sdf')
In [3]: for m in suppl:
print(m.GetProp("_Name"), m.GetConformer().Is3D(), Chem.MolToMolBlock(m).split("\n")[1])
TEST0D True      RDKit          3D
TEST2D False      RDKit          2D
TEST3D True      RDKit          3D

For me, the first molecule (0D) should not be considered 3D.

Is the 3D flag set so that if the software line does not end with '2D', it is set to '3D'?

Thanks in advance for your clarification!


Jose Manuel

Attachment: test.sdf
Description: application/vnd.kinar

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
Rdkit-discuss mailing list

Reply via email to