Thank you for your response Greg,
unfortunately, it does not seem to work when converting the molecule to
MolBlock:
m = Chem.MolFromSmiles('C/C=C/CC/C=C/F')
[1] print Chem.MolToSmiles(m, isomericSmiles=True)
m.GetBondWithIdx(0).SetBondDir(Chem.BondDir.UNKNOWN)
Chem.AssignStereochemistry(m,force=True,cleanIt=True)
[2] print Chem.MolToSmiles(m, isomericSmiles=True)
[3] print Chem.MolToMolBlock(m,includeStereo=True)
The snippet above gives the following output:
[1] C/C=C/CC/C=C/F
[2] CC=CCC/C=C/F
[3]
RDKit
8 7 0 0 0 0 0 0 0 0999 V2000
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.0000 0.0000 0.0000 F 0 0 0 0 0 0 0 0 0 0 0 0
1 2 1 0
2 3 2 0
3 4 1 0
4 5 1 0
5 6 1 0
6 7 2 0
7 8 1 0
M END
As you can see, even if the smiles is successfully updated, there is no
unknown flag (3) in the bond block... Since I actually have to return
the MolBlock, I'll just edit it with some basic text replacement to put
this '3' flag where I think it should be... I just hope it won't break
the molecules!
Cheers,
Jose Manuel
On 08/28/2015 02:53 PM, Greg Landrum wrote:
Hi,
On Fri, Aug 28, 2015 at 11:33 AM, Jose Manuel
<[email protected]
<mailto:[email protected]>> wrote:
Hi RDKitters,
I would like to know if it's possible to set one given double bond
stereo to "STEREOANY" without modifying the others?
For example, I have a molecule with two specified double bond
stereo centers but want to set only one to STEREOANY and get the
'3' stereo flag in bond block of the output MolBlock. I could find
a GetStereo function for bonds but not its Set counterpart. With
the RemoveStereochemistry function, I get the '3' stereo flag, but
for both stereo double bonds.
SetStereo() doesn't exist in Python because it is difficult/impossible
to provide the additional information required to specify bond stereo
when it's not STEREOANY or STEREONONE.
A solution is to set the direction of an adjacent single bond to
UNKNOWN like this:
In [10]: m = Chem.MolFromSmiles('C/C=C/CC/C=C/F')
In [11]: m.Debug()
Atoms:
0 6 C chg: 0 deg: 1 exp: 1 imp: 3 hyb: 4 arom?: 0 chi: 0
1 6 C chg: 0 deg: 2 exp: 3 imp: 1 hyb: 3 arom?: 0 chi: 0
2 6 C chg: 0 deg: 2 exp: 3 imp: 1 hyb: 3 arom?: 0 chi: 0
3 6 C chg: 0 deg: 2 exp: 2 imp: 2 hyb: 4 arom?: 0 chi: 0
4 6 C chg: 0 deg: 2 exp: 2 imp: 2 hyb: 4 arom?: 0 chi: 0
5 6 C chg: 0 deg: 2 exp: 3 imp: 1 hyb: 3 arom?: 0 chi: 0
6 6 C chg: 0 deg: 2 exp: 3 imp: 1 hyb: 3 arom?: 0 chi: 0
7 9 F chg: 0 deg: 1 exp: 1 imp: 0 hyb: 4 arom?: 0 chi: 0
Bonds:
0 0->1 order: 1 dir: 4 conj?: 0 aromatic?: 0
1 1->2 order: 2 stereo: 3 conj?: 0 aromatic?: 0
2 2->3 order: 1 dir: 4 conj?: 0 aromatic?: 0
3 3->4 order: 1 conj?: 0 aromatic?: 0
4 4->5 order: 1 dir: 4 conj?: 0 aromatic?: 0
5 5->6 order: 2 stereo: 3 conj?: 0 aromatic?: 0
6 6->7 order: 1 dir: 4 conj?: 0 aromatic?: 0
In [12]: m.GetBondWithIdx(0).SetBondDir(Chem.BondDir.UNKNOWN)
In [13]: Chem.AssignStereochemistry(m,force=True,cleanIt=True)
In [14]: m.Debug()
Atoms:
0 6 C chg: 0 deg: 1 exp: 1 imp: 3 hyb: 4 arom?: 0 chi: 0
1 6 C chg: 0 deg: 2 exp: 3 imp: 1 hyb: 3 arom?: 0 chi: 0
2 6 C chg: 0 deg: 2 exp: 3 imp: 1 hyb: 3 arom?: 0 chi: 0
3 6 C chg: 0 deg: 2 exp: 2 imp: 2 hyb: 4 arom?: 0 chi: 0
4 6 C chg: 0 deg: 2 exp: 2 imp: 2 hyb: 4 arom?: 0 chi: 0
5 6 C chg: 0 deg: 2 exp: 3 imp: 1 hyb: 3 arom?: 0 chi: 0
6 6 C chg: 0 deg: 2 exp: 3 imp: 1 hyb: 3 arom?: 0 chi: 0
7 9 F chg: 0 deg: 1 exp: 1 imp: 0 hyb: 4 arom?: 0 chi: 0
Bonds:
0 0->1 order: 1 dir: 6 conj?: 0 aromatic?: 0
1 1->2 order: 2 conj?: 0 aromatic?: 0
2 2->3 order: 1 dir: 4 conj?: 0 aromatic?: 0
3 3->4 order: 1 conj?: 0 aromatic?: 0
4 4->5 order: 1 dir: 4 conj?: 0 aromatic?: 0
5 5->6 order: 2 stereo: 3 conj?: 0 aromatic?: 0
6 6->7 order: 1 dir: 4 conj?: 0 aromatic?: 0
This works because the RDKit supports (well, it attempts to support)
the IUPAC recommendation for drawing double bonds with unknown
stereochemistry: drawing one of the single bonds as a squiggle bond
(UNKNOWN).
Best,
-greg
--
José-Manuel Gally
/PhD Student
Structural Bioinformatics & Chemoinformatics
Institut de Chimie Organique et Analytique (ICOA)
UMR CNRS-Université d'Orléans 7311
Université d'Orléans
Rue de Chartres
F-45067 Orléans
phone: +33 238 494 577/
------------------------------------------------------------------------------
_______________________________________________
Rdkit-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rdkit-discuss