一个氨基酸序列代表的化合物转换为MOL对象,并计算出该分子的描述符,用于机器学习。
导入库
from rdkit import Chemfrom rdkit.Chem import Drawfrom rdkit.Chem.Draw import IPythonConsoleIPythonConsole.ipython_useSVG = True

载入数据
peptide_smiles = Chem.MolToSmiles(Chem.MolFromFASTA("RGDfK"))print(peptide_smiles)

N=C(N)NCCC[C@H](N)C(=O)NCC(=O)N[C@@H](CC(=O)O)C(=O)N[C@@H](Cc1ccccc1)C(=O)N[C@@H](CCCCN)C(=O)O
绘制多肽
peptide_mol = Chem.MolFromSmiles(peptide_smiles)peptide_mol


绘制带原子索引的多肽
def mol_with_atom_index( mol ):atoms = mol.GetNumAtoms()for idx in range( atoms ):mol.GetAtomWithIdx( idx ).SetProp( 'molAtomMapNumber', str( mol.GetAtomWithIdx( idx ).GetIdx() ) )return mol

#With indexmol_with_atom_index(peptide_mol)


