Indigo | Indigo(Python)简介、安装与入门
Indigo简介
- Bingo: 针对Oracle,Microsoft SQL Server和PostgreSQL数据库的化学搜索引擎
- Indigo: U具有与.NET,Java和Python绑定的通用化学信息库,以及以下工具:
- Legio: 组合化学GUI应用程序
- ChemDiff: SDF或SMILES文件的可视化比较
- indigo-depict: 分子和反应渲染工具
- indigo-cano: Canonical SMILES 生成器
- indigo-deco: R-Group反卷积实用程序
Indigo安装
Indigo的Python绑定安装
pip install epam.indigo
Indigo入门
from indigo import *indigo = Indigo()
获取版本
print ("Indigo version " + indigo.version())
Accessing Neighbor Atoms
for atom in mol.iterateAtoms():print ("atom %d: %d neighbors" % (atom.index(), atom.degree()))for nei in atom.iterateNeighbors():print ("neighbor atom %d is connected by bond %d\n" % (nei.index(), nei.bond().index()))
Accessing R-Groups
for rg in mol.iterateRGroups():print ("RGROUP #" + rg.index())for frag in rg.iterateRGroupFragments():print (" FRAGMENT #" + rg.index())print (frag.molfile())
Stereochemistry
The following methods of IndigoObject
are available for accessing molecule’s stereo configuration:
countStereocenters
returns the number of the chiral atoms in a moleculeiterateStereocenters
returns an iterator for molecule’s atoms that are stereocenterscountAlleneCenters
returns the number of allene-like stereo fragmentsiterateAlleneCenters
returns an iterator for molecule’s atoms that are centers of allene fragments (the middle ‘C’ in ‘C=C=C’)bondStereo
returns one of the following constants:Indigo.UP
— stereo “up” bondIndigo.DOWN
— stereo “down” bondIndigo.EITHER
— stereo “either” bondIndigo.CIS
— “Cis” double bondIndigo.TRANS
— “Trans” double bond- zero — not a stereo bond of any kind
stereocenterType
returns one of the following constants:Indigo.ABS
— “absolute” stereocenterIndigo.OR
— “or” stereocenterIndigo.AND
— “and” stereocenterIndigo.EITHER
— “any” stereocenter- zero — not a stereocenter
invertStereo
inverts the stereo configuration of an atomresetStereo
resets the stereo configuration of an atom or a bondchangeStereocenterType(newType)
changes current stereocenter type to a specified typeaddStereocenter(type, idx1, idx2, idx3, [idx4])
adds new stereocenter build on a atom pyramid with a specified atom indicesclearStereocenters
resets the chiral configurations of a molecule’s atomsclearAlleneCenters
resets the chiral configurations of a molecule’s allene-like fragmentsclearCisTrans
resets the cis-trans configurations of a molecule’s bonds
The following methods are useful for keeping cis-trans stereochemistry intact when converting to/from SMILES:
resetSymmetricCisTrans
can be called on a molecule loaded from a Molfile or CML. After this call, the cis-trans configurations remain only on nonsymmetric cis-trans bonds. The method returns the number of bonds that have been reset.markEitherCisTrans
can be called prior to saving a molecule loaded from SMILES to Molfile format. It guarantees that the bonds that have no cis-trans configuration in SMILES will not have a cis-trans configuration in the resulting Molfile.
IndigoObject mol = indigo.loadMolecule("chiral.mol");print mol.countStereocenters(), "chiral atoms"
for atom in mol.iterateStereocenters():print "atom", atom.index(), "-- stereocenter type", atom.stereocenterType()atom.invertStereo();for bond in mol.iterateBonds():if bond.bondStereo() != 0:print "bond", bond.index(), "-- stereo type", bond.bondStereo()print mol.smiles()
mol.clearStereocenters()
mol.clearCisTrans()
print mol.smiles()
Reaction Products Enumeration
reaction = indigo.loadQueryReaction("Cl[C:1]([*:3])=O.[OH:2][*:4]>>[*:4][O:2][C:1]([*:3])=O")monomers_table = indigo.createArray()monomers_table.arrayAdd(indigo.createArray())
monomers_table.at(0).arrayAdd(indigo.loadMolecule("CC(Cl)=O"))
monomers_table.at(0).arrayAdd(indigo.loadMolecule("OC1CCC(CC1)C(Cl)=O"))monomers_table.arrayAdd(indigo.createArray())
monomers_table.at(1).arrayAdd(indigo.loadMolecule("O[C@H]1[C@H](O)[C@@H](O)[C@H](O)[C@@H](O)[C@@H]1O"))output_reactions = indigo.reactionProductEnumerate(reaction, monomers_table)indigo.setOption("render-comment", "Results")
rxn_array = indigo.createArray();
for elem in output_reactions.iterateArray():rxn = elem.clone();rxn_array.arrayAdd(rxn)indigoRenderer.renderGridToFile(rxn_array, None, 2, 'result_rpe.png')
Reaction-based Molecule Transformations
reaction = indigo.loadQueryReaction("[*+:1][*-:2]>>[*:2]=[*:1]")
molecule = indigo.loadMolecule("[O-][C+]1CCCC1[N+]([O-])=O")
indigo.transform(reaction, molecule)
print(molecule.smiles())
运行结果
O=N(C1CCCC1=O)=O
参考
1. https://github.com/epam/Indigo
2. https://lifescience.opensource.epam.com/
3. https://pypi.org/project/epam.indigo/
4. https://lifescience.opensource.epam.com/indigo/api/index.html
Indigo | Indigo(Python)简介、安装与入门相关推荐
- Python学习1——python简介和基础入门
转载 原文Python学习之路[第一篇]-Python简介和基础入门:https://www.cnblogs.com/linupython/p/5713324.html 1.python3.7.2下 ...
- python 简介+安装(搬运廖雪峰网站)
Python简介 Python是著名的"龟叔"Guido van Rossum在1989年圣诞节期间,为了打发无聊的圣诞节而编写的一个编程语言. 现在,全世界差不多有600多种编程 ...
- Python学习-Python简介和基础入门
1.Python简介 1.1 Python是什么 相信混迹IT界的很多朋友都知道,Python是近年来最火的一个热点,没有之一.从性质上来讲它和我们熟知的C.java.php等没有什么本质的区别,也是 ...
- Python学习之路【第一篇】-Python简介和基础入门
1.Python简介 1.1 Python是什么 相信混迹IT界的很多朋友都知道,Python是近年来最火的一个热点,没有之一.从性质上来讲它和我们熟知的C.java.php等没有什么本质的区别,也是 ...
- Xfce4和Python的安装 | AidLux入门操作②
自从"AidLux开发者社区"推出后,有很多用户聚集在社区里探讨各类话题,其中不乏如何在平台内安装.配置各种常用软件和编程语言的相关内容.今天我们就以社区讨论热度较高的两个对象为例 ...
- Python|Python简介|安装Python解释器|运行|开发工具|Python之禅|turtle绘制五星红旗|绘制方块|绘制小猪佩奇|语言100课:学习(1)
文章目录 源项目地址 初识Python Python简介 Python的历史 Python的优缺点 Python的应用领域 安装Python解释器 运行Python程序 确认Python的版本 编写P ...
- linux安装python_VTK:华为笔记本电脑+深度deepin-linux+python下安装和入门
1 说明: ===== 1.1 vtk,(visualization toolkit)是一个开源的免费软件系统,主要用于三维计算机图形学.图像处理和可视化. 1.2 是一个开源.跨平台.可自由获取.支 ...
- 循序渐进学Python 1 安装与入门
1 安装 2 使用 2.1 运行程序 3 艺搜参考 by 2013年10月16日 安装 Windows安装版,源码,帮助文档: 使用 打开开始菜单中的Python GUI启动Python解释器: 启动 ...
- python pdb 安装_入门 Python 调试器 pdb
前言 调试线上的 Python 程序时,虽然 PyCharm 可以实现远程调试,但 pdb 才是最便捷的方式,本文简单介绍 pdb 工具的使用,希望各位除了掌握 PyCharm 调试技巧外,还可以掌握 ...
最新文章
- JS实现select去除option的使用注意事项
- Java10-day01【继承(变量-构造方法访问-成员方法 访问)、super内存图、方法重写、继承、包、import、权限修饰符、final、static】
- ajax不能访问本地php文件,php – 使用htaccess拒绝ajax文件访问
- SpringBoot2.0 基础案例(03):配置系统全局异常映射处理
- ubuntu 16.04安装VMwareTools
- aboboo 上一句 快捷键_电脑软件推荐|这几个快捷键你一定能用得上
- nlogn求最长不上升子序列
- 47. Magneto Transaction Email(1)
- FP-growth发现频繁项集
- Qt QDebug 打印自定义结构体
- html5 uc qq,(进阶版)手机浏览器用户体验报告:UC、QQ、360,到底哪个好?
- 2022美亚杯第八届中国电子数据取证大赛-个人赛write up详解
- JS怎么唤起百度地图
- HTML 计算奖金小程序
- 逐字稿整理-中/TED演讲:如何训练思维,突破局限?(大花猫冯夏)
- UnknownHostException: xxx异常
- PS设计漂亮网站主页图片的实例教程
- iTunesMetadata.plist文件里的内容
- 通俗易懂!看完你就是半个天线专家了
- ArcGIS常用工具:union、merge、append、dissolve区别