def mol_with_atom_index(mol): for atom in mol.GetAtoms(): atom.SetAtomMapNum(atom.GetIdx()) return mol smiles2png 这个函数通过给定的smiles,保存为名为filename的图片。我在这个函数中包含了 Gasteiger 电荷的计算,读者可以把 ComputeGasteigerCharges 替换为其他描述符或标签。 def smiles2png(smiles...
RDkit渲染分子图片时,可使用和 表示上下标,代码如下所示: from rdkit import Chem from rdkit.Chem import Draw # 定义一个添加注释的函数 def add_annotation_to_atom(mol, atom_indices, notes): for atom_index, note in zip(atom_indices, notes): mol.GetAtomWithIdx(atom_index).SetProp('atomNote...
IPythonConsole.ipython_useSVG=True defmol_with_atom_index(mol):atoms=mol.GetNumAtoms()foridxinrange(atoms):mol.GetAtomWithIdx(idx).SetProp('molAtomMapNumber',str(mol.GetAtomWithIdx(idx).GetIdx()))returnmol mol=Chem.MolFromSmiles("C1CC2=C3C(=CC=C2)C(=CN3C1)[C@H]4[C@@H](C(=O...
GetEndAtomIdx())) Several different RDKit functions are in this portion of code, so let’s break it down piece by piece: For the ~id field of both nodes and edges, we combine the data type Node or Edge, the SMILES string itself, and the unique index for the atom For the ~label ...
cmap = {pi: reference_mol.GetConformer().GetAtomPosition(xi) for pi, xi in match} mol = Chem.Mol(simi_mol) mol = Chem.AddHs(mol) code = AllChem.EmbedMultipleConfs(mol, coordMap=cmap, numConfs=100) keep=[] for index, t in enumerate(code): ...
strcmp(evar, "0")) { return false; } else { return true; } } return defVal; } bool is_regular_h(const Atom &atom) { return atom.getAtomicNum() == 1 && atom.getIsotope() == 0; } Bond::BondDir getOppositeBondDir(Bond::BondDir dir) { PRECONDITION(dir == Bond::ENDDOWNRIGHT...
Atom index out of range error (github issue #1868 from A-Thakkar) Incorrect cis/trans stereo symbol for conjugated ring (github issue #2023 from baoilleach) Hardcoded max length of SMARTs string cut of input query for FragCatlog (github issue #2163 from 7FeiW) VSA_EState {1, ..., ...
atompair_fp(mol):atompair的sfp指纹 rdkit_fp(mol):rdkit的拓扑指纹 maccs_fp(mol):预定义的MACCS指纹 接下来在postgresql中计算分子指纹 根据rdk.mols中的m列(存放分子的mol对象),计算torsion、morgan ECFP、morgan FCFP指纹,分别命名为torsionbv、mfp2、ffp2,并放入到rdk.fps表中 ...
return parity_shell(other_atom_ids) To restore the parity, again get the list of neighboring atom ids, but this time from the fragmented molecule. This will be connected to one of the new wildcard atoms. I need to map that back to the original atom index before I can compute the parit...
MolFromSmiles('CN1C(=O)CN=C(C2=C1C=CC(=C2)Cl)C3=CC=CC=C3') # Draw molecule with atom index (see RDKitCB_0) def mol_with_atom_index(mol): for atom in mol.GetAtoms(): atom.SetAtomMapNum(atom.GetIdx()) return mol mol_with_atom_index(mol) 输出: 示例代码: from rdkit ...