Skip to content

Instantly share code, notes, and snippets.

@ejmurray
Created February 18, 2015 14:17
Show Gist options
  • Save ejmurray/1bb6790253d262d4fa37 to your computer and use it in GitHub Desktop.
Save ejmurray/1bb6790253d262d4fa37 to your computer and use it in GitHub Desktop.
Uses the webel module to search for chemicals.
#!/usr/bin/python
# encoding: utf-8
"""
Output the structure and other information on a chemical that is entered in line 9 of the code.
"""
__author__ = 'Ernest'
from cinfony import webel
mol = webel.readstring("name", "Oestradiol")
print "The molecular weight is %.1f" % mol.molwt
print "The InChI is %s" % mol.write("inchi")
print "The InChiKey is %s" % mol.write("inchikey")
# print "LogP values are %s" % mol.calcdesc(["ALOGPDescriptor"])
print "It is also known as: %s" % mol.write("names")
mol.draw(filename="molecule.png", show=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment