RDKit | 基于SMILES查找化合物的MACCS密钥

导入包

from rdkit import Chem
from rdkit.Chem import MACCSkeys
from rdkit import DataStructs
import numpy as np

载入smiles并计算MACCS Keys

mol = Chem.MolFromSmiles('OC(=O)C1=C(C=CC=C1)C2=C3C=CC(=O)C(=C3OC4=C2C=CC(=C4Br)O)Br')
fps = MACCSkeys.GenMACCSKeys(mol)
print(fps)
fp_bits = tuple(fps.GetOnBits())
print(fp_bits)
(46, 57, 62, 87, 89, 98, 101, 105, 107, 113, 123, 125, 127, 131, 134, 136, 137, 139, 140, 143, 144, 145, 146, 150, 152, 154, 157, 159, 162, 163, 164, 165)

你可能感兴趣的:(RDKit,化学信息学与AI)