Last active
January 5, 2016 21:07
-
-
Save leelasd/1be159a45b756f0c3776 to your computer and use it in GitHub Desktop.
Generating Chemdraw 2d Figures from MOL file or Smiles file. Download SAMPL1_Dataset from https://github.com/leelasd/SAMPL1/blob/master/SAMPL1_Dataset.csv.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## installing dependencies | |
## conda install boost | |
## conda install rdkit | |
## Download SAMPL1 database file from leelasd/SAMPL1 github repo | |
from __future__ import print_function | |
from rdkit import Chem | |
from rdkit.Chem import AllChem,Draw | |
import pandas as pd | |
df=pd.read_csv('SAMPL1_Dataset.csv') | |
mols = [Chem.MolFromSmiles(smi) for smi in df.SMILES] | |
for m,name in zip(mols,df.NAME): | |
tmp=AllChem.Compute2DCoords(m) | |
Draw.MolToFile(m,'SAMPL1/'+name+'.png',size=(300,300),fitImage=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dependencies include
It produces output like this
![fig_sampl1](https://cloud.githubusercontent.com/assets/7967695/12127314/857ce0fe-b3c4-11e5-9e2d-1e1fa1c15667.png)