#!/usr/local/bin/python2.3 import os, sys, socket from var_functions import start_and_end_with if socket.gethostname() != 'bjork.compbio.ucsf.edu': print '\nRun on bjork!\n' raise SystemExit() try: start = sys.argv[1] end = sys.argv[2] except IndexError: print '\nUsage: c2_ionizer.py start-file-pattern end-file-pattern\n' raise SystemExit() for file in os.listdir('.'): prefix = 'c2_'+file[3:-8] if start_and_end_with(file, start, end): if os.path.exists('./'+prefix+'_out.sdf'): print prefix+'_out.sdf exists already, skip '+file continue pass else: continue # Just run ionizer os.system('sdconvert -st -isd c1_'+prefix[3:]+'_out.sdf -omae c1_'+prefix[3:]+'_out.mae') os.system('ionizer -i 2 -ph 7 -s ~joha/PETC/PYTHON/DATABASE_SCRIPTS/ionizer_ti_O-vS-OH_exclude.ini -i c1_'+prefix[3:]+'_out.mae -l '+prefix+'.log -b '+prefix+'_bad.mae -o '+prefix+'_out.mae') os.system('sdconvert -imae '+prefix+'_out.mae -osd '+prefix+'_out.sdf')