Hi,

The current behavior of the Mol file reader is to set the dimensionality
based on what the Mol file itself says. So if it says "3D", the "is3D" flag
is set to true. If the flag says "2D" the flag is set to false. There's no
attempt to determine whether or not this is actually correct (though from
reading the ctfile spec more carefully it looks like it should set 3D if
there's a non-zero Z coordinate).
If no information is provided (or "0D"), the is3D flag is set to True, this
is the default for RDKit conformers.

If it's important to determine whether a conformer is 2D or 3D, your best
bet is probably to use the PBF descriptor that was added in the 2016.09
release. This should be enabled in the conda builds, but if you build your
own RDKit you will need to make sure that eigen3 is installed first and
that cmake can find it.

Note that dealing with planar molecules is always going to be tricky:
there's no general way to tell from the coordinates if they are 2D or 3D.

I hope this helps,
-greg



On Thu, Jan 19, 2017 at 4:08 PM, Jose Manuel Gally <
jose-manuel.ga...@univ-orleans.fr> wrote:

> 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!
>
> Cheers,
>
> Jose Manuel
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss

Reply via email to