Thanks so much for the help. This did the trick for setting single bonds to
squiggly bonds, and setting double bonds to the crossed any stereo worked.
However, what is not seeming to work is setting a double bond to STEREONONE
so I can return it to a normal double bond without any stereo indication.
Is this not supported or is there a different function I can use to clear
the stereochemistry for just this bond?
Thanks again!
-Chris
On Wed, Jul 11, 2018 at 12:42 AM Greg Landrum
wrote:
> 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)=CCc1c1'
>
> In [12]: print(Chem.MolToMolBlock(m))
> SomeID
> RDKit 3D
>
> 12 12 0 0 0 0 0 0 0 0999 V2000
> 1.42900.20630. C 0 0 0 0 0 0 0 0 0 0 0 0
> 0.7145 -0.20620. C 0 0 0 0 0 0 0 0 0 0 0 0
> 0.0.20630. C 0 0 0 0 0 0 0 0 0 0 0 0
> 1.42901.03130. N 0 0 0 0 0 0 0 0 0 0 0 0
> 2.1434 -0.20620. C 0 0 0 0 0 0 0 0 0 0 0 0
> 2.14341.44380. C 0 0 0 0 0 0 0 0 0 0 0 0
>-0.7143 -0.20620. C 0 0 0 0 0 0 0 0 0 0 0 0
>-1.42880.20620. C 0 0 0 0 0 0 0 0 0 0 0 0
>-2.1433 -0.20630. C 0 0 0 0 0 0 0 0 0 0 0 0
>-2.1434 -1.03120. C 0 0 0 0 0 0 0 0 0 0 0 0
>-1.4289 -1.44380. C 0 0 0 0 0 0 0 0 0 0 0 0
>-0.7144 -1.03120. 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 <
> chris.mur...@schrodinger.com> 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 0999 V2000
>> 1.42900.20630. C 0 0 0 0 0 0 0 0 0 0 0 0
>> 0.7145 -0.20620. C 0 0 0 0 0 0 0 0 0 0 0 0
>> 0.0.20630. C 0 0 0 0 0 0 0 0 0 0 0 0
>> 1.42901.03130. N 0 0 0 0 0 0 0 0 0 0 0 0
>> 2.1434 -0.20620. C 0 0 0 0 0 0 0 0 0 0 0 0
>> 2.14341.44380. C 0 0 0 0 0 0 0 0 0 0 0 0
>>-0.7143 -0.20620. C 0 0 0 0 0 0 0 0 0 0 0 0
>>-1.42880.20620. C 0 0 0 0 0 0 0 0 0 0 0 0
>>-2.1433 -0.20630. C 0 0 0 0 0 0 0 0 0 0 0 0
>>-2.1434 -1.03120. C 0 0 0 0 0 0 0 0 0 0 0 0
>>-1.4289 -1.44380. C 0 0 0 0 0 0 0 0 0 0 0 0
>>-0.7144 -1.03120. 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