Re: [Rdkit-discuss] double bond in a ring
Hi Greg and Juuso, Many thanks for your response. yes, it is what describe in issue #4346, the bond stereochemistry looks ok but the 3D coordinates are both cis (slightly different but not trans). please see attached mol files. thank you very much, Best regards, Shani On Fri, Feb 4, 2022 at 9:46 AM Juuso Lehtivarjo wrote: > Hi Greg and Shani, > > Please correct me if I understood something wrong, but isn't Shani > trying to create 3D coordinates in that example code? To me this looks > like the old issue with respecting double bond stereochemistry in > embedding, which should have been fixed with #4346? Oddly enough, the > example code produces correct stereochemistry for > > smiles = {'Cis':'C1C/C=C\\1', 'Trans':'C1C/C=C/1'} > > which are the molecules used in the test case of #4346. > > Cheers, > Juuso > > On Thu, Jan 27, 2022 at 2:56 PM Greg Landrum > wrote: > > > > Hi Shani, > > > > This is a limitation of the RDKit's 2D coordinate generation code. > > The workaround is to use the RDKit's coordgen integration to generate 2D > coordinates. You can toggle this on by doing: > > > > from rdkit.Chem import rdDepictor > > rdDepictor.SetPreferCoordGen(True) > > > > That will, in general, give nicer 2D coordinates anyway. > > > > Best regards, > > -greg > > > > > > > > On Thu, Jan 27, 2022 at 10:37 AM Shani Zev > wrote: > >> > >> Hi everyone, > >> I'm trying to create coordinates for a molecule containing a TRANS > double bond in a ring. However, while I try to create coordinate from the > mol object, the structure that was created is CIS and not TRANS. > >> I check both options (cis and trans) and check that bond specificity > correctly using FindPotentialStereo, then I use MolToMolBlock in order to > create coordinate, and both structures (cis and trans) are created as CIS. > >> any ideas/suggestions? > >> > >> thanks in advance, > >> Shani > >> > >> For example my code: > >> > >> import rdkit > >> from rdkit import Chem > >> from rdkit.Chem import AllChem > >> print(rdkit.__version__) > >> > >> smiles = {'Cis':'C/C1=C\1', 'Trans':'C/C1=C/1'} > >> for key in smiles: > >> mol = Chem.MolFromSmiles(smiles[key]) > >> mol = Chem.AddHs(mol) > >> AllChem.EmbedMolecule(mol) > >> si = Chem.FindPotentialStereo(mol) > >> for element in si: > >> print(f' {key} Type: {element.type}, Descriptor: > {element.descriptor} ') > >> print(Chem.MolToMolBlock(mol), file=open(str(key)+'.mol', 'w+')) > >> > >> the output: > >> > >> 2021.09.4 > >> Cis Type: Bond_Double, Descriptor: Bond_Cis > >> Trans Type: Bond_Double, Descriptor: Bond_Trans > >> > >> ___ > >> Rdkit-discuss mailing list > >> Rdkit-discuss@lists.sourceforge.net > >> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss > > > > ___ > > Rdkit-discuss mailing list > > Rdkit-discuss@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/rdkit-discuss > Trans.mol Description: Binary data Cis.mol Description: Binary data ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] double bond in a ring
Hi Greg and Shani, Please correct me if I understood something wrong, but isn't Shani trying to create 3D coordinates in that example code? To me this looks like the old issue with respecting double bond stereochemistry in embedding, which should have been fixed with #4346? Oddly enough, the example code produces correct stereochemistry for smiles = {'Cis':'C1C/C=C\\1', 'Trans':'C1C/C=C/1'} which are the molecules used in the test case of #4346. Cheers, Juuso On Thu, Jan 27, 2022 at 2:56 PM Greg Landrum wrote: > > Hi Shani, > > This is a limitation of the RDKit's 2D coordinate generation code. > The workaround is to use the RDKit's coordgen integration to generate 2D > coordinates. You can toggle this on by doing: > > from rdkit.Chem import rdDepictor > rdDepictor.SetPreferCoordGen(True) > > That will, in general, give nicer 2D coordinates anyway. > > Best regards, > -greg > > > > On Thu, Jan 27, 2022 at 10:37 AM Shani Zev wrote: >> >> Hi everyone, >> I'm trying to create coordinates for a molecule containing a TRANS double >> bond in a ring. However, while I try to create coordinate from the mol >> object, the structure that was created is CIS and not TRANS. >> I check both options (cis and trans) and check that bond specificity >> correctly using FindPotentialStereo, then I use MolToMolBlock in order to >> create coordinate, and both structures (cis and trans) are created as CIS. >> any ideas/suggestions? >> >> thanks in advance, >> Shani >> >> For example my code: >> >> import rdkit >> from rdkit import Chem >> from rdkit.Chem import AllChem >> print(rdkit.__version__) >> >> smiles = {'Cis':'C/C1=C\1', 'Trans':'C/C1=C/1'} >> for key in smiles: >> mol = Chem.MolFromSmiles(smiles[key]) >> mol = Chem.AddHs(mol) >> AllChem.EmbedMolecule(mol) >> si = Chem.FindPotentialStereo(mol) >> for element in si: >> print(f' {key} Type: {element.type}, Descriptor: >> {element.descriptor} ') >> print(Chem.MolToMolBlock(mol), file=open(str(key)+'.mol', 'w+')) >> >> the output: >> >> 2021.09.4 >> Cis Type: Bond_Double, Descriptor: Bond_Cis >> Trans Type: Bond_Double, Descriptor: Bond_Trans >> >> ___ >> Rdkit-discuss mailing list >> Rdkit-discuss@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss > > ___ > Rdkit-discuss mailing list > Rdkit-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rdkit-discuss ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
Re: [Rdkit-discuss] double bond in a ring
Hi Shani, This is a limitation of the RDKit's 2D coordinate generation code. The workaround is to use the RDKit's coordgen integration to generate 2D coordinates. You can toggle this on by doing: from rdkit.Chem import rdDepictor rdDepictor.SetPreferCoordGen(True) That will, in general, give nicer 2D coordinates anyway. Best regards, -greg On Thu, Jan 27, 2022 at 10:37 AM Shani Zev wrote: > Hi everyone, > I'm trying to create coordinates for a molecule containing a TRANS double > bond in a ring. However, while I try to create coordinate from the mol > object, the structure that was created is CIS and not TRANS. > I check both options (cis and trans) and check that bond > specificity correctly using FindPotentialStereo, then I use MolToMolBlock > in order to create coordinate, and both structures (cis and trans) are > created as CIS. > any ideas/suggestions? > > thanks in advance, > Shani > > For example my code: > > import rdkit > from rdkit import Chem > from rdkit.Chem import AllChem > print(rdkit.__version__) > > smiles = {'Cis':'C/C1=C\1', 'Trans':'C/C1=C/1'} > for key in smiles: > mol = Chem.MolFromSmiles(smiles[key]) > mol = Chem.AddHs(mol) > AllChem.EmbedMolecule(mol) > si = Chem.FindPotentialStereo(mol) > for element in si: > print(f' {key} Type: {element.type}, Descriptor: > {element.descriptor} ') > print(Chem.MolToMolBlock(mol), file=open(str(key)+'.mol', 'w+')) > > *the output: * > > 2021.09.4 > Cis Type: Bond_Double, Descriptor: Bond_Cis > Trans Type: Bond_Double, Descriptor: Bond_Trans > > ___ > Rdkit-discuss mailing list > Rdkit-discuss@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/rdkit-discuss > ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
[Rdkit-discuss] double bond in a ring
Hi everyone, I'm trying to create coordinates for a molecule containing a TRANS double bond in a ring. However, while I try to create coordinate from the mol object, the structure that was created is CIS and not TRANS. I check both options (cis and trans) and check that bond specificity correctly using FindPotentialStereo, then I use MolToMolBlock in order to create coordinate, and both structures (cis and trans) are created as CIS. any ideas/suggestions? thanks in advance, Shani For example my code: import rdkit from rdkit import Chem from rdkit.Chem import AllChem print(rdkit.__version__) smiles = {'Cis':'C/C1=C\1', 'Trans':'C/C1=C/1'} for key in smiles: mol = Chem.MolFromSmiles(smiles[key]) mol = Chem.AddHs(mol) AllChem.EmbedMolecule(mol) si = Chem.FindPotentialStereo(mol) for element in si: print(f' {key} Type: {element.type}, Descriptor: {element.descriptor} ') print(Chem.MolToMolBlock(mol), file=open(str(key)+'.mol', 'w+')) *the output: * 2021.09.4 Cis Type: Bond_Double, Descriptor: Bond_Cis Trans Type: Bond_Double, Descriptor: Bond_Trans ___ Rdkit-discuss mailing list Rdkit-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rdkit-discuss