Created
November 5, 2016 10:43
-
-
Save jhjensen2/575785e225d863f6de21f228210e73d9 to your computer and use it in GitHub Desktop.
Converts a SMILES string to a 2D picture
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
import sys | |
sys.path.append("/usr/local/lib/python2.7/site-packages/") | |
from rdkit import Chem | |
from rdkit.Chem import AllChem | |
from rdkit.Chem import Draw | |
from rdkit.sping import PIL | |
filename = sys.argv[1] | |
file = open(filename, "r+") | |
for line in file: | |
words = line.split() | |
name = words[0] | |
smiles = words[1] | |
m = Chem.MolFromSmiles(smiles) | |
Draw.MolToFile(m,name+".png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment