Skip to content

Commit

Permalink
fix for missing mtz files
Browse files Browse the repository at this point in the history
  • Loading branch information
tdudgeon committed Jan 12, 2024
1 parent ba4ea76 commit f640aa1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 7 additions & 4 deletions src/xchemalign/aligner.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,17 @@ def get_datasets_from_crystals(crystals, output_path):
reference_datasets = {}
new_datasets = {}
for dtag, crystal in crystals.items():
mtz_file = crystal[Constants.META_XTAL_FILES].get(Constants.META_XTAL_MTZ, {}).get(Constants.META_FILE)
if mtz_file is None:
mtz_path = "None"
else:
mtz_path = str(output_path / mtz_file)

dataset = dt.Dataset(
dtag=dtag,
pdb=str(output_path / crystal[Constants.META_XTAL_FILES][Constants.META_XTAL_PDB][Constants.META_FILE]),
xmap="",
mtz=str(
output_path
/ crystal[Constants.META_XTAL_FILES].get(Constants.META_XTAL_MTZ, {}).get(Constants.META_FILE)
),
mtz=mtz_path,
# ligand_binding_events=LigandBindingEvents(
# ligand_ids=[
# LigandID(
Expand Down
5 changes: 3 additions & 2 deletions src/xchemalign/collator.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,6 @@ def run(self, meta):
all_xtals, new_xtals = self._munge_history(meta)
self.logger.info("writing metadata ...")
self._write_metadata(new_meta)
self.logger.info("copying config ...")
self._copy_config()
self.logger.info("run complete")
return new_meta
Expand Down Expand Up @@ -933,7 +932,9 @@ def _write_metadata(self, meta, suffix=""):
yaml.dump(meta, stream, sort_keys=False)

def _copy_config(self):
f = shutil.copy2(self.config_file, self.output_path / self.version_dir / 'config.yaml')
to_path = self.output_path / self.version_dir / 'config.yaml'
self.logger.info("copying config file", self.config_file, "to", to_path)
f = shutil.copy2(self.config_file, to_path)
if not f:
self.logger.warn("Failed to copy config file to {}".format((self.output_path / self.version_dir)))
return False
Expand Down

0 comments on commit f640aa1

Please sign in to comment.