RdKit idioms: Difference between revisions

From DISI
Jump to navigation Jump to search
No edit summary
(no comment)
Line 1: Line 1:
here we collect together bits of code that you can use in rdkit to get the work done.  
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





Revision as of 20:27, 4 November 2014

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)