# Make symlinks # source = '/enzyme/nielsen/pkaparms' files = ['DELRAD.DAT', 'DELCRG.DAT', 'TOPOLOGY.H'] for file in files: r_s = os.path.join(source, file) r_d = os.path.join(pwd, file) os.system('ln -s %s %s' % (r_s, r_d)) # # Start pKa calc # import pKa params = { 'dbcrit': 1000, 'lowph': 0.1, 'highph': 20.0, 'phstep': 0.1, 'pairene': 10.0 } Y = pKa.pKarun(os.getcwd(), pdbfile, params) if not os.path.isfile(pkafile): Y.runseq() # # Do the design # import Design_dist_nummuts Design_dist_nummuts.main(pdbfile) # # All done #
def main(): # # Run pKa calculations in all subdirs given as argument # import sys print print 'Run pKa calculations in all subdirs. ' print print 'Looking for pdb files with the name: %s' %sys.argv[1] print 'Running pKa calculations for: ' import os, sys, string initial_pdbfile='pdbfile.pdb' dirs=sys.argv[1:] # # if the last argument is '-name', then the name of the dir is part of the pdbfile name # top=os.getcwd() for dir in dirs: if os.path.isdir(dir): print dir print print '----------------------' for dir in dirs: if os.path.isdir(dir): initial_pdbfile=dir+'.pdb' pkafile=os.path.join(dir,'clean.pka.pdb') if not os.path.isfile(pkafile): import WI_tools logfile,files=WI_tools.delwat_dellig_corall(os.path.join(os.getcwd(),dir,initial_pdbfile),None,1) print os.path.join(os.getcwd(),dir,initial_pdbfile) for line in logfile: print line, fs=files.keys() print fs if len(fs)!=1: done=None print dir import string pdbfile=string.lower(dir[-4:])+'.pdb.gz' pdbdir='/net/scratch67/jnielsen/pdb' pdbfile=os.path.join(pdbdir,pdbfile) if os.path.isfile(pdbfile): print 'Could not find file' #a=raw_input('Get file from pdb dir? ') #a='y' a='n' if a=='y': destination=os.path.join(os.getcwd(),dir,os.path.split(pdbfile)[1]) print destination os.system('cp '+pdbfile+' '+destination) os.system(gunzip+' '+destination) destination=destination[:-3] print destination os.link(destination,os.path.join(os.getcwd(),dir,initial_pdbfile)) done=1 if not done: print initial_pdbfile raise 'Huh? - could not clean PDB file' else: fd=open(pkafile,'w') fd2=open(pkafile+'.backup','w') for line in files[fs[0]]: fd2.write(line) fd.write(line) fd.close() fd2.close() print 'Cleaned PDB file written' # # Prepare the pKa calculation (write the Invocation file) # import splitpdb splitpdb.prep_pKa(dir,os.path.split(pkafile)[1]) os.chdir(dir) import pKa # # Read the parameters # infile='Invocation' fd=open(infile) line=fd.readline() fd.close() argv=string.split(line) # # Do we need to run the pKa calculations for this dir? # pdbfile=argv[1] if not os.path.isfile(pdbfile+'.PKA.DAT'): print 'Running pKa calculations for: %s ' %dir print print 'Using command:',string.join(argv) # # Parse parameters # x=pKa.pKamisc() params=x.parse_parameterlist(argv) X=pKa.pKarun(os.getcwd(),pdbfile,params) X.runseq() print '=============================' print os.chdir(top) return
def main(): # # Run pKa calculations in all subdirs given as argument # import sys print print 'Run pKa calculations in all subdirs. ' print print 'Looking for pdb files with the name: %s' % sys.argv[1] print 'Running pKa calculations for: ' import os, sys, string initial_pdbfile = 'pdbfile.pdb' dirs = sys.argv[1:] # # if the last argument is '-name', then the name of the dir is part of the pdbfile name # top = os.getcwd() for dir in dirs: if os.path.isdir(dir): print dir print print '----------------------' for dir in dirs: if os.path.isdir(dir): initial_pdbfile = dir + '.pdb' pkafile = os.path.join(dir, 'clean.pka.pdb') if not os.path.isfile(pkafile): import WI_tools logfile, files = WI_tools.delwat_dellig_corall( os.path.join(os.getcwd(), dir, initial_pdbfile), None, 1) print os.path.join(os.getcwd(), dir, initial_pdbfile) for line in logfile: print line, fs = files.keys() print fs if len(fs) != 1: done = None print dir import string pdbfile = string.lower(dir[-4:]) + '.pdb.gz' pdbdir = '/net/scratch67/jnielsen/pdb' pdbfile = os.path.join(pdbdir, pdbfile) if os.path.isfile(pdbfile): print 'Could not find file' #a=raw_input('Get file from pdb dir? ') #a='y' a = 'n' if a == 'y': destination = os.path.join( os.getcwd(), dir, os.path.split(pdbfile)[1]) print destination os.system('cp ' + pdbfile + ' ' + destination) os.system(gunzip + ' ' + destination) destination = destination[:-3] print destination os.link( destination, os.path.join(os.getcwd(), dir, initial_pdbfile)) done = 1 if not done: print initial_pdbfile raise 'Huh? - could not clean PDB file' else: fd = open(pkafile, 'w') fd2 = open(pkafile + '.backup', 'w') for line in files[fs[0]]: fd2.write(line) fd.write(line) fd.close() fd2.close() print 'Cleaned PDB file written' # # Prepare the pKa calculation (write the Invocation file) # import splitpdb splitpdb.prep_pKa(dir, os.path.split(pkafile)[1]) os.chdir(dir) import pKa # # Read the parameters # infile = 'Invocation' fd = open(infile) line = fd.readline() fd.close() argv = string.split(line) # # Do we need to run the pKa calculations for this dir? # pdbfile = argv[1] if not os.path.isfile(pdbfile + '.PKA.DAT'): print 'Running pKa calculations for: %s ' % dir print print 'Using command:', string.join(argv) # # Parse parameters # x = pKa.pKamisc() params = x.parse_parameterlist(argv) X = pKa.pKarun(os.getcwd(), pdbfile, params) X.runseq() print '=============================' print os.chdir(top) return
# Check that we didn't do this already # pkafile=pdbfile+'.PKA.DAT' # # Got the PDB file # # Make symlinks # source='/enzyme/nielsen/pkaparms' files=['DELRAD.DAT','DELCRG.DAT','TOPOLOGY.H'] for file in files: r_s=os.path.join(source,file) r_d=os.path.join(pwd,file) os.system('ln -s %s %s' %(r_s,r_d)) # # Start pKa calc # import pKa params={'dbcrit':1000,'lowph':0.1,'highph':20.0,'phstep':0.1,'pairene':10.0} Y=pKa.pKarun(os.getcwd(),pdbfile,params) if not os.path.isfile(pkafile): Y.runseq() # # Do the design # import Design_dist_nummuts Design_dist_nummuts.main(pdbfile) # # All done #