Hi Chris,
I think at least some of what you observed may be due to older bugs that
have been fixed.
Here's your example using a recent version of the RDKit:
In [9]: rdkit.rdBase.rdkitVersion
Out[9]: '2018.03.1'
In [10]: m = Chem.MolFromMolBlock(mb)
In [11]: Chem.MolToSmiles(m)
Out[11]: 'CNC(C)=CCc1ccccc1'
In [12]: print(Chem.MolToMolBlock(m))
SomeID
RDKit 3D
12 12 0 0 0 0 0 0 0 0999 V2000
1.4290 0.2063 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.7145 -0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.2063 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
1.4290 1.0313 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
2.1434 -0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
2.1434 1.4438 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.7143 -0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.4288 0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-2.1433 -0.2063 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-2.1434 -1.0312 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.4289 -1.4438 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.7144 -1.0312 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
2 1 2 3
2 3 1 0
1 5 1 0
1 4 1 0
4 6 1 0
3 7 1 0
8 9 1 0
9 10 2 0
10 11 1 0
11 12 2 0
7 8 2 0
12 7 1 0
M END
A bit more detail:
The RDKit "prefers" to mark the unknown stereo directly on the double bond,
so it writes mol files with crossed double bonds. It should, however, do
the right thing with squiggly bonds that are attached to double bonds (as
your example shows).
I would also expect setting double bond stereo to STEREOANY to work from
Python:
In [17]: m = Chem.MolFromSmiles('C/C=C/C')
In [18]: Chem.MolToSmiles(m)
Out[18]: 'C/C=C/C'
In [19]: m.GetBondWithIdx(1).SetStereo(Chem.BondStereo.STEREOANY)
In [20]: Chem.MolToSmiles(m)
Out[20]: 'CC=CC'
Though if you want to use the adjacent squiggle bonds, you need to
re-perceive aromaticity:
In [28]: m = Chem.MolFromSmiles('C/C=C/C')
In [29]: m.GetBondWithIdx(0).SetBondDir(Chem.BondDir.UNKNOWN)
In [30]: Chem.AssignStereochemistry(m,cleanIt=True,force=True)
In [31]: Chem.MolToSmiles(m)
Out[31]: 'CC=CC'
I hope this helps,
-greg
On Tue, Jul 10, 2018 at 11:51 PM Chris Murphy <[email protected]>
wrote:
> Hi,
>
> I want to manipulate the "any" stereochemistry representation of double
> bonds. I am trying to set the stereo property for a double bond as
> STEREOANY so it appears as a crossed bond, but I know that the SetStereo
> method does not actually work in Python (not sure if it's just python
> actually?). Alternatively, I also want to be able to remove the STEREOANY
> from a double bond and set one of the adjacent single bonds as STEREOANY so
> it appears as a wiggly bond. Is there a way to manipulate this, directly or
> indirectly, in Python?
>
> Additionally, it seems that when the following sdf is read into a Mol
> object, with a wiggly bond present, it automatically converts the double
> bond to a crossed bond so there is both a wiggly single bond and a crossed
> double bond when the Mol is written back out to MolBlock. Is this because
> the crossed bond is the preferred standard for this situation?
> =============
>
> SomeID
>
> 12 12 0 0 0 0 999 V2000
> 1.4290 0.2063 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> 0.7145 -0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> 0.0000 0.2063 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> 1.4290 1.0313 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
> 2.1434 -0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> 2.1434 1.4438 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> -0.7143 -0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> -1.4288 0.2062 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> -2.1433 -0.2063 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> -2.1434 -1.0312 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> -1.4289 -1.4438 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> -0.7144 -1.0312 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
> 2 1 2 0 0 0 0
> 2 3 1 0 0 0 0
> 1 5 1 0 0 0 0
> 1 4 1 4 0 0 0
> 4 6 1 0 0 0 0
> 3 7 1 0 0 0 0
> 8 9 1 0 0 0 0
> 9 10 2 0 0 0 0
> 10 11 1 0 0 0 0
> 11 12 2 0 0 0 0
> 7 8 2 0 0 0 0
> 12 7 1 0 0 0 0
> M END
> ===============
> This is with the 17.3 release, so not sure if anything has been updated
> since. Thanks for any and all help!
>
> -Chris
>
> ------------------------------------------------------------------------------
> 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
> [email protected]
> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss