>>> d = rdMolDraw2D.MolDraw2DCairo(250, 250) >>> rdMolDraw2D.PrepareAndDrawMolecule(d,mol) >>> d.WriteDrawingText("./images/atom_labels_1.png") 得到: 由于atomLabel 属性也用于其他用途(例如在演示的 CXSMILES 中),如果要提供自己的原子标签,最好使用 _displayLabel 属性: >>> smi = 'c...
首先,确保你已经安装了 RDKit。然后,可以运行以下示例代码: fromrdkitimportChemfromrdkit.Chemimportrdmolops# 创建一个分子对象(这里以乙烯为例)smiles="C=C"mol=Chem.MolFromSmiles(smiles)# 计算分子中的自由旋转化学键数目num_rotatable_bonds=rdmolops.CalcNumRotatableBonds(mol)# 打印结果print(f"分子 '{...
# 需要导入模块: from rdkit import Chem [as 别名]# 或者: from rdkit.Chem importMolFromSmiles[as 别名]defsetUp(self):current_dir = os.path.dirname(os.path.realpath(__file__))# simple flat ringfromrdkit.ChemimportMolFromSmilesself.cycle4 =MolFromSmiles('C1CCC1') self.cycle4.Compute2DC...
DATIVEONE = rdkit.Chem.rdchem.BondType.DATIVEONE DATIVER = rdkit.Chem.rdchem.BondType.DATIVER DOUBLE = rdkit.Chem.rdchem.BondType.DOUBLE FIVEANDAHALF = rdkit.Chem.rdchem.BondType.FIVEANDAHALF FOURANDAHALF = rdkit.Chem.rdchem.BondType.FOURANDAHALF HEXTUPLE = rdkit.Chem.rdchem.BondType...
Description: RDKit Version: 2018.09.2, also 2019.03.dev1 Platform: Linux/python 3.6.8, also MacOS 10.14.3/python 3.7.2 I was surprised that the results of AllChem.MolFromSmiles with sanitize=True can differ subtly from the results of All...
The following code... mol = Chem.MolFromSmiles('c1c[C+]1') smi = Chem.MolToSmiles(mol) print 'smi=', smi Chem.MolFromSmiles(smi) ... produces the following output (in Jupyter): smi= [c+]1cc1 RDKit ERROR: [11:35:51] Can't kekulize mol RDK...
1. 下载pymol:PyMOL | pymol.org 2. 完成安装 3. 找到下图所示的Prompt, 并运行pymol -R命令打开pymol server 4. 可以使用如下的简单代码运行pymol from rdkit.Chem import PyMol from rdkit import Chem v= Chem.PyMol.MolViewer() rdmol = Chem.MolFromSmiles('C') ...
traceback.print_exc()ok=Falseifok:res[self.smiCol]=canv.drawingelse:# FIX: maybe include smiles here in a Paragraph?res[self.smiCol]='Failed'returnres 浏览完整代码来源:DbReport.py项目:ashwin/rdkit
那么Chem.MolFromMolFile(path)会报错。因为这个接口仅支持字符串https://github.com/rdkit/rdkit/...
开发者ID:connorcoley,项目名称:ASKCOS,代码行数:19,代码来源:eval_by_smiles.py 示例4: matrices2mol ▲点赞 6▼ # 需要导入模块: from rdkit import Chem [as 别名]# 或者: from rdkit.Chem importRWMol[as 别名]defmatrices2mol(self, node_labels, edge_labels, strict=False):mol = Chem.RWMol(...