#!/usr/local2/bin/python2.3 # transform sdfs to mol2 and give new titles import sys, string, os from openeye.oechem import * import MySQLdb try: file = sys.argv[1] except IndexError: print 'usage: c3_sdf2mol2_mysql_names_remove.py filename_containig_mol2_filenames(zipped does not hurt)' raise SystemExit() db = MySQLdb.connect(host='newelvis.ucsf.edu',passwd='secret',db='joha') c = db.cursor() listfile = open(file, 'r') for line in listfile.readlines(): c.execute('delete from PROC_NAMES where Proc_Name like "'+line[:string.find(line ,'.mol2')]+'%"') db.close() c.close() listfile.close()