Thread: [Rdkit-discuss] Generation of stereo-isomers
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: Soren W. <soe...@gm...> - 2015-09-24 21:17:09
|
Hi, is it possible with RDKit to generate all stereoisomers of a given compound? If not, is anyone working on it? If not, how difficult would it be / what would be the best way to implement such a function. best regards Soren |
|
From: Greg L. <gre...@gm...> - 2015-09-24 22:33:02
|
Hi Soren, That functionality isn't currently there, but it's been requested a few times and shouldn't be that tough to get into the next release. -greg On Thursday, September 24, 2015, Soren Wacker <soe...@gm...> wrote: > Hi, > > is it possible with RDKit to generate all stereoisomers of a given > compound? > > If not, is anyone working on it? > > If not, how difficult would it be / what would be the best way to > implement such a function. > > best regards > > Soren > |
|
From: Peter S. <sh...@gm...> - 2015-09-24 22:41:15
|
Umm... would that be all stereoisomers or all realizable stereoisomers? For example consider two bridgeheads in a norbonane-type compound. In this case, only a particular enantiomeric pair would be realizable, and not all four diastereomers. |
|
From: Paolo T. <pao...@un...> - 2015-09-24 23:18:37
|
Dear Soren, I have recently used the RDKit to enumerate stereocentres. The approach I followed was to generate a 3D structure for the molecule of interest (including hydrogens) using EmbedMolecule(), followed by MMFF optimization; do not pay attention to stereochemistry at this stage. Then I used FindMolChiralCenters() to find the n chiral centres in the 3D structure thus obtained; there are 2^n theoretical possible diastereomers. You may enumerate all of them with a "for i in range (0, 2^n)" loop; converting i to binary, and considering 0 for S and 1 for R, you may easily find all possible combinations. Use SetChiralTag() to set the chirality on each stereocentre, then rebuild 3D coordinates with EmbedMolecule() followed by MMFF optimization. Carry out a final check to verify that the chirality of the molecule is the one you initially required; if not, try to rebuild 3D coordinates. If you fail, say, 20 times in a row, it means you are attempting to build a diastereomer that cannot give rise to a sensible 3D geometry (such as the case mentioned by Peter); then give up. You will also need to check if any of the structures that you obtain during the enumeration has more chiral centres than the initial one (for which you didn't specify steeochemistry); in fact, it could be that you started from a meso structure. If this happens, just restart enumeration from scratch with the increased number of stereocentres. I also carried out some geometry checks on the generated stereocentres coupled with MMFF energy evaluation relative to the most stable diastereomer to make sure that the diastereomers obtained where reasonable and not unreasonably strained. This brute-force enumeration is easy to implement, reasonably fast, and it worked very well for me. Kind regards, Paolo On 24/09/2015 22:17, Soren Wacker wrote: > Hi, > > is it possible with RDKit to generate all stereoisomers of a given > compound? > > If not, is anyone working on it? > > If not, how difficult would it be / what would be the best way to > implement such a function. > > best regards > > Soren > > > ------------------------------------------------------------------------------ > > > _______________________________________________ > Rdkit-discuss mailing list > Rdk...@li... > https://lists.sourceforge.net/lists/listinfo/rdkit-discuss |
|
From: Axel P. <axe...@gm...> - 2015-09-25 06:19:35
|
Hi Soren,
maybe this function which enumerates racemates with one stereocenter
into the corresponding enantiomers might help:
def enum_racemates(sdf_list_or_file, find_only=True, mol_id="molid"):
"""returns: result_sdf::list<mol>, racemic_molids::list<int>
find_only==True: return new sdf as list which contains all the
racemates of the input sdf.
find_only==False: return new sdf as list with ALL input structures,
where the racemates are
replaced by their two enantiomers. The returned
sdf is always
equal in size or larger as the input sdf.
Multiple stereo centers are not yet handled.
In the new sdf the molids are no longer unique and should be reassigned
(remove molid and run calc_props(sdf))."""
result_sdf = Mol_List()
racemic_molids = []
if not isinstance(sdf_list_or_file, list) and
sdf_list_or_file.atEnd(): # sdf is file
print(" * file object is at end, please reload.")
return None
for mol in sdf_list_or_file:
first_undefined = False
chiral_centers = Chem.FindMolChiralCenters(mol,
includeUnassigned=True)
if chiral_centers:
first_center = chiral_centers[0][0]
first_undefined = chiral_centers[0][1] == "?"
if first_undefined:
racemic_molids.append(int(mol.GetProp(mol_id)))
if find_only:
result_sdf.append(mol)
continue
else:
mol1 = Chem.Mol(mol)
mol2 = Chem.Mol(mol)
mol1.GetAtomWithIdx(first_center).SetChiralTag(Chem.rdchem.ChiralType.CHI_TETRAHEDRAL_CW)
mol2.GetAtomWithIdx(first_center).SetChiralTag(Chem.rdchem.ChiralType.CHI_TETRAHEDRAL_CCW)
result_sdf.append(mol1)
result_sdf.append(mol2)
else:
if not find_only: # return ALL mols
result_sdf.append(mol)
return result_sdf, racemic_molids
Please also have a look at this post
http://sourceforge.net/p/rdkit/mailman/message/32390126/ and Toby's
answer which pointed me in the right direction.
Kind regards,
Axel
On 24.09.2015 23:17, Soren Wacker wrote:
> Hi,
>
> is it possible with RDKit to generate all stereoisomers of a given
> compound?
>
> If not, is anyone working on it?
>
> If not, how difficult would it be / what would be the best way to
> implement such a function.
>
> best regards
>
> Soren
>
>
> ------------------------------------------------------------------------------
>
>
> _______________________________________________
> Rdkit-discuss mailing list
> Rdk...@li...
> https://lists.sourceforge.net/lists/listinfo/rdkit-discuss
|
|
From: Soren W. <soe...@gm...> - 2015-09-25 16:33:26
|
Hi all, I opened an issue at rdkit-github for that matter. https://github.com/rdkit/rdkit/issues/626 Thanks to your comments! If you want look at the code snippet I posted. At the moment, simply all stereo-isomers are generated. regards Soren On Fri, Sep 25, 2015 at 12:19 AM, Axel Pahl <axe...@gm...> wrote: > Hi Soren, > > maybe this function which enumerates racemates with one stereocenter into > the corresponding enantiomers might help: > > def enum_racemates(sdf_list_or_file, find_only=True, mol_id="molid"): > """returns: result_sdf::list<mol>, racemic_molids::list<int> > find_only==True: return new sdf as list which contains all the > racemates of the input sdf. > find_only==False: return new sdf as list with ALL input structures, > where the racemates are > replaced by their two enantiomers. The returned sdf > is always > equal in size or larger as the input sdf. > Multiple stereo centers are not yet handled. > In the new sdf the molids are no longer unique and should be reassigned > (remove molid and run calc_props(sdf)).""" > > result_sdf = Mol_List() > racemic_molids = [] > > if not isinstance(sdf_list_or_file, list) and > sdf_list_or_file.atEnd(): # sdf is file > print(" * file object is at end, please reload.") > return None > > for mol in sdf_list_or_file: > first_undefined = False > chiral_centers = Chem.FindMolChiralCenters(mol, > includeUnassigned=True) > > if chiral_centers: > first_center = chiral_centers[0][0] > first_undefined = chiral_centers[0][1] == "?" > > if first_undefined: > racemic_molids.append(int(mol.GetProp(mol_id))) > if find_only: > result_sdf.append(mol) > continue > > else: > mol1 = Chem.Mol(mol) > mol2 = Chem.Mol(mol) > > mol1.GetAtomWithIdx(first_center).SetChiralTag(Chem.rdchem.ChiralType.CHI_TETRAHEDRAL_CW) > > mol2.GetAtomWithIdx(first_center).SetChiralTag(Chem.rdchem.ChiralType.CHI_TETRAHEDRAL_CCW) > result_sdf.append(mol1) > result_sdf.append(mol2) > > else: > if not find_only: # return ALL mols > result_sdf.append(mol) > > return result_sdf, racemic_molids > > Please also have a look at this post > http://sourceforge.net/p/rdkit/mailman/message/32390126/ and Toby's > answer which pointed me in the right direction. > > Kind regards, > Axel > > > On 24.09.2015 23:17, Soren Wacker wrote: > > Hi, > > is it possible with RDKit to generate all stereoisomers of a given > compound? > > If not, is anyone working on it? > > If not, how difficult would it be / what would be the best way to > implement such a function. > > best regards > > Soren > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > Rdkit-discuss mailing lis...@li...://lists.sourceforge.net/lists/listinfo/rdkit-discuss > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Rdkit-discuss mailing list > Rdk...@li... > https://lists.sourceforge.net/lists/listinfo/rdkit-discuss > > |