sanify_utils.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:pipelines 作者: InformaticsMatters 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号