def enumerateStereoIsomers(mol):
out = []
chiralCentres = Chem.FindMolChiralCenters(mol, includeUnassigned=True)
#return the molecule object when no chiral centres where identified
if chiralCentres == []:
return [mol]
#All bit permutations with number of bits equals number of chiralCentres
elements = _spam(len(chiralCentres))
for isoId,element in enumerate(elements):
for centreId,i in enumerate(element):
atomId = chiralCentres[centreId][0]
if i == 0:
mol.GetAtomWithIdx(atomId).SetChiralTag(Chem.rdchem.ChiralType.CHI_TETRAHEDRAL_CW)
elif i == 1:
mol.GetAtomWithIdx(atomId).SetChiralTag(Chem.rdchem.ChiralType.CHI_TETRAHEDRAL_CCW)
outmol = copy(mol)
utils.log("Enumerated ", Chem.MolToSmiles(mol, isomericSmiles=True))
out.append(outmol)
return out
评论列表
文章目录