First a minor correction: the call you want to find out whether or not a
bond is wedged is Bond.GetBondDir(). GetStereo() is for double bond
stereochemistry
Still, the bond direction information is not gong to be there. The RDKit
associates chirality information with atoms, not bonds. When a mol file
with wedged/dashed bonds is processed, the wedging information is used to
assign chirality to attached atoms and is then cleared.
You can add wedging information back in using Chem.WedgeMolBonds(), but the
code will pick its own bonds to wedge.
If you really need bond wedging info, you can preserve it.
Here's an example.
I start with your molecule:
In [18]: m = Chem.MolFromMolBlock(mb)
In [19]: m.GetBondWithIdx(9).GetBondDir()
Out[19]: rdkit.Chem.rdchem.BondDir.NONE
Here's how you preserve that information:
In [20]: m = Chem.MolFromMolBlock(mb,sanitize=False,removeHs=False)
In [21]: m.GetBondWithIdx(9).GetBondDir()
Out[21]: rdkit.Chem.rdchem.BondDir.BEGINWEDGE
In [22]: Chem.SanitizeMol(m)
Out[22]: rdkit.Chem.rdmolops.SanitizeFlags.SANITIZE_NONE
In [23]: Chem.AssignStereochemistry(m)
In [24]: m.GetBondWithIdx(9).GetBondDir()
Out[24]: rdkit.Chem.rdchem.BondDir.BEGINWEDGE
In [26]: m.GetAtomWithIdx(6).GetChiralTag()
Out[26]: rdkit.Chem.rdchem.ChiralType.CHI_TETRAHEDRAL_CCW
In [27]: m.GetAtomWithIdx(6).GetProp("_CIPCode")
Out[27]: 'S'
Note that it's not safe to remove Hs if you want to go this route: the
wedged bond could always be to the H.
A question I have is why you want to access the bond wedging.
-greg
On Thu, Aug 21, 2014 at 3:53 PM, Michał Nowotka <mmm...@gmail.com> wrote:
> Hi,
>
> I have this molfile:
>
> mn beaker 08211400002D
>
> 10 10 0 0 0 0 1 V2000
> -1.6741 -0.2687 0.0000 C 0 0
> -2.3885 -0.6812 0.0000 C 0 0
> -2.3885 -1.5063 0.0000 C 0 0
> -1.6741 -1.9188 0.0000 C 0 0
> -0.9596 -1.5063 0.0000 C 0 0
> -0.9596 -0.6812 0.0000 C 0 0
> -0.2451 -0.2686 0.0000 C 0 0
> -0.2451 0.5563 0.0000 O 0 0
> 0.4692 -0.6811 0.0000 C 0 0
> 0.4692 -1.5061 0.0000 C 0 0
> 1 2 2 0
> 2 3 1 0
> 3 4 2 0
> 4 5 1 0
> 5 6 2 0
> 6 1 1 0
> 6 7 1 0
> 7 9 1 0
> 9 10 1 0
> 7 8 1 1
> M END
>
>
> and as you see the last bond clearly has stereo. But when I read this
> molfile to rdkit and loop over bonds, this information is missing:
>
>
> from rdkit import Chem
> mol = Chem.MolFromMolBlock(ctab)
> for bond in mol.GetBonds():
> print bond.GetStereo()
>
> STEREONONE
> STEREONONE
> STEREONONE
> STEREONONE
> STEREONONE
> STEREONONE
> STEREONONE
> STEREONONE
> STEREONONE
> STEREONONE
>
> How can I get stereo information about the last bond?
>
>
> ------------------------------------------------------------------------------
> Slashdot TV.
> Video for Nerds. Stuff that matters.
> http://tv.slashdot.org/
> _______________________________________________
> Rdkit-discuss mailing list
> Rdkit-discuss@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
>
------------------------------------------------------------------------------
Slashdot TV.
Video for Nerds. Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Rdkit-discuss mailing list
Rdkit-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss