Skip to content

Commit

Permalink
Merge pull request #90 from hlasimpk/master
Browse files Browse the repository at this point in the history
fixed bug in ensemble generation
  • Loading branch information
hlasimpk committed Oct 12, 2018
2 parents 38a8eae + f335c36 commit 141a2bb
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions simbad/command_line/simbad_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ def delete_erroneous_files(erroneous_paths):
tmp_d = tmp_dir(directory=run_dir)
get_model_output = os.path.join(tmp_d, code + ".pdb")
get_seq_output = os.path.join(tmp_d, code + ".seq")
mrbump_directory = os.path.join(tmp_d, 'search_mrbump_1')
cmd = [["export CCP4_SCR=", tmp_d],
["export MRD_DB=" + os.environ['MRD_DB']],
["cd", tmp_d],
Expand All @@ -612,7 +613,7 @@ def delete_erroneous_files(erroneous_paths):
script.append(' '.join(map(str, c)))
collector.add(script)
log = script.path.rsplit('.', 1)[0] + '.log'
files += [(script.path, log, tmp_d, (get_model_output, final_file))]
files += [(script.path, log, tmp_d, (mrbump_directory, final_file))]

scripts, _, tmps, files = zip(*files)

Expand All @@ -634,11 +635,13 @@ def delete_erroneous_files(erroneous_paths):
continue
os.makedirs(sub_dir)

for output, final in files:
if os.path.isfile(output):
simbad.db.convert_pdb_to_dat(output, final)
for mrbump_dir, final in files:
if os.path.isdir(mrbump_dir):
ensemble = glob.glob(os.path.join(mrbump_dir, 'models', 'domain_*', 'ensembles',
'gesamtEnsTrunc_*_100.0_SideCbeta.pdb'))
simbad.db.convert_pdb_to_dat(ensemble, final)
else:
logger.critical("File missing: {}".format(output))
logger.critical("Directory missing: {}".format(mrbump_dir))

for d in tmps:
shutil.rmtree(d)
Expand Down

0 comments on commit 141a2bb

Please sign in to comment.