Skip to content
Snippets Groups Projects
Commit 3619149f authored by Rafal Gumienny's avatar Rafal Gumienny
Browse files

fix: SCHWED-3121 Do not exit when PDBs cannot be saved

parent 674fd7dc
Branches
Tags
No related merge requests found
...@@ -466,7 +466,7 @@ def _ReadStructureFile(path): ...@@ -466,7 +466,7 @@ def _ReadStructureFile(path):
_RevertChainNames(entity) _RevertChainNames(entity)
entities.append(entity) entities.append(entity)
elif len(cif_info.biounits) > 1: elif len(cif_info.biounits) > 1:
for i, biounit in enumerate(cif_info.biounits): for i, biounit in enumerate(cif_info.biounits, 1):
entity = biounit.PDBize(tmp_entity, min_polymer_size=0) entity = biounit.PDBize(tmp_entity, min_polymer_size=0)
if not entity.IsValid(): if not entity.IsValid():
raise IOError( raise IOError(
...@@ -730,15 +730,21 @@ def _Main(): ...@@ -730,15 +730,21 @@ def _Main():
reference_name + opts.dump_suffix) reference_name + opts.dump_suffix)
ost.LogInfo("Saving cleaned up reference to %s" % ost.LogInfo("Saving cleaned up reference to %s" %
ref_output_path) ref_output_path)
SavePDB(qs_scorer.qs_ent_1.ent, try:
ref_output_path) SavePDB(qs_scorer.qs_ent_1.ent,
ref_output_path)
except Exception as ex:
ost.LogError("Cannot save reference: %s" % str(ex))
mdl_output_path = os.path.join( mdl_output_path = os.path.join(
os.path.dirname(opts.model), os.path.dirname(opts.model),
model_name + opts.dump_suffix) model_name + opts.dump_suffix)
ost.LogInfo("Saving cleaned up reference to %s" % ost.LogInfo("Saving cleaned up reference to %s" %
mdl_output_path) mdl_output_path)
SavePDB(qs_scorer.qs_ent_2.ent, try:
mdl_output_path) SavePDB(qs_scorer.qs_ent_2.ent,
mdl_output_path)
except Exception as ex:
ost.LogError("Cannot save model: %s" % str(ex))
result["result"][model_name] = model_results result["result"][model_name] = model_results
if opts.output is not None: if opts.output is not None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment