def run_preprocessing(runner, outdir):
t = runner.preprocess()
print '\nFINISHED preprocessing. Output directory:'
print " ", os.path.abspath(outdir)
resultjson = {}
for field in t.outputfields:
if field == 'pdbstring':
with open(os.path.join(outdir, 'prep.pdb'), 'w') as outfile:
print >> outfile, t.getoutput('pdbstring')
else:
resultjson[field] = t.getoutput(field)
with open(os.path.join(outdir, 'prep.json'), 'w') as outfile:
json.dump(resultjson, outfile)
with open(os.path.join(outdir, 'workflow_state.dill'), 'w') as outfile:
dill.dump(runner, outfile)
评论列表
文章目录