RDKit:化合物亚结构(Substructure)搜索(基于Python3)
【摘要】
代码示例:
#导入依赖包#!/usr/bin/python3 from rdkit.Chem import AllChem as chfrom rdkit.Chem import Draw as d
#载入分子库 suppl = ch.SDMolSupplier('drugbank.sdf')mols = [x for x in suppl if x is...
代码示例:
-
#导入依赖包
-
#!/usr/bin/python3
-
-
from rdkit.Chem import AllChem as ch
-
from rdkit.Chem import Draw as d
-
#载入分子库
-
-
suppl = ch.SDMolSupplier('drugbank.sdf')
-
mols = [x for x in suppl if x is not None]
-
print (len(mols)) #获取分子数目
-
#载入substructure结构
-
-
pattern = ch.MolFromSmarts('[CX3](=O)[OX2H1]')
-
#亚结构匹配
-
-
matching_molecules = [m for m in mols if m.HasSubstructMatch(pattern)]
-
print (len(matching_molecules)) #统计匹配分子数目
-
#输出匹配的前十个分子
-
-
result = [m for m in matching_molecules[:10]]
-
map(ch.Compute2DCoords, result)
-
img = d.MolsToGridImage(result, kekulize=False, subImgSize=(400,400),
-
l
文章来源: drugai.blog.csdn.net,作者:DrugAI,版权归原作者所有,如需转载,请联系作者。
原文链接:drugai.blog.csdn.net/article/details/82534661
【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)