for l in open(args.l): info = l.strip().split('/') subdir = info[-2] name = General.getBase(os.path.basename(info[-1])) pid, cid = name.split('_') pdbf = subdir + '/' + pid + '.pdb' outf = subdir + '/' + name + '.' + args.ext if (not os.path.isfile(pdbf)) or (os.path.isfile(outf) and os.path.getsize(outf) > 0): continue outfs.append(outf) selstr = '"NAME CA WITHIN 25 OF CHAIN ' + cid + '"' cmd = ' '.join([PDB.confindPath, '--p', pdbf, '--o', outf, '--rLib', PDB.rotLib, '--pp', '--psel', selstr, '--sel', selstr]) cmds.append(cmd) count += 1 if count == args.bs: General.qsub(cmds) count = 0 outfs = [] cmds = [] if len(outfs) != 0: General.qsub(cmds) else: # for batch size > 1, cannot use chain selection listid = 0 visited = {} sublist_pdb = open('sl_pdb.'+str(listid), 'w') sublist_cmap = open('sl_' + args.ext + '.' + str(listid), 'w') for l in open(args.l): info = l.strip().split('/') subdir = info[-2] name = General.getBase(os.path.basename(info[-1]))
"--p", pdb, "--he", args.he, "--oh", args.oh, ], ) if not args.bbrmsd == None: cmd.append("--bbrmsd " + args.bbrmsd) if not args.nohomo == None: cmd.append("--nohomo " + args.nohomo) if args.uniq: cmd.append("--uniq") if args.nonat: cmd.append("--nonat") if args.smart: cmd.append("--smart") cmd = " ".join(cmd) cmds.append(cmd) if len(cmds) != 0: General.qsub(cmds) sleep(0.5) # print str(count), '/', str(all), ' directories finished...' os.chdir(odir)
batchsize = 30 # will run 30 command in a single job count = 0 pdbfs = [] for l in open(args.l): info = l.strip().split('/') subdir = info[-2] name = General.getBase(info[-1]) pdbf = subdir + '/' + name + '.pdb' outf = subdir + '/' + name + '.' + args.ext if (not os.path.isfile(pdbf)) or (os.path.isfile(outf)): continue pdbfs.append(pdbf) count += 1 if count == 30: cmd = ['python', selfbin+'/extractSCcontacts.py', '--ext', args.ext, '--p'] + pdbfs cmd = ' '.join(cmd) General.qsub([cmd]) pdbfs = [] count = 0 if len(pdbfs) != 0: cmd = ['python', selfbin+'/extractSCcontacts.py', '--ext', args.ext, '--p'] + pdbfs cmd = ' '.join(cmd) General.qsub([cmd])