RdKit idioms

Jump to navigation Jump to search

Here we collect together bits of code that you can use in RDKit to get the work done.

from rdkit import Chem,DataStructs
import time,random
from collections import defaultdict
import psycopg2
from rdkit.Chem import Draw,PandasTools,rdMolDescriptors
from rdkit.Chem.Draw import IPythonConsole
from rdkit import rdBase
from __future__ import print_function
import requests
from xml.etree import ElementTree
import pandas as pd

from rdkit.Chem import MolFromSmiles, RDKFingerprint
from rdkit.DataStructs import TanimotoSimilarity
 m1 = MolFromSmiles('c1ccccc1')
m2 = MolFromSmiles('c1ccccc1CCCC')
 fp1 = RDKFingerprint(m1)
 fp2 = RDKFingerprint(m2)
print TanimotoSimilarity(fp1, fp2)