Skip to content

Commit 3fb2ee5

Browse files
committed
Do not overwrite PanDDA2 results
1 parent 866d847 commit 3fb2ee5

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/dlstbx/services/trigger_xchem.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class PanDDA_PostParameters(pydantic.BaseModel):
7474

7575

7676
class DLSTriggerXChem(CommonService):
77-
"""A service that creates and runs downstream processing jobs."""
77+
"""A service that creates and runs downstream processing jobs for XChem."""
7878

7979
# Human readable service name
8080
_service_name = "DLS TriggerXChem"
@@ -701,14 +701,22 @@ def trigger_pandda_xchem(
701701
)
702702
return {"success": True}
703703

704-
# 3. Create the dataset directory
704+
# 3. Create dataset directory structure
705705
analysis_dir = processed_dir / "analysis"
706706
pandda_dir = analysis_dir / "pandda2"
707707
model_dir = pandda_dir / "model_building"
708708
dataset_dir = model_dir / dtag
709709
compound_dir = dataset_dir / "compound"
710+
710711
self.log.info(f"Creating directory {dataset_dir}")
711-
pathlib.Path(compound_dir).mkdir(parents=True, exist_ok=True)
712+
try:
713+
compound_dir.mkdir(parents=True, exist_ok=False)
714+
except FileExistsError:
715+
self.log.info(
716+
f"Exiting PanDDA2/Pipedream trigger: directory already exists for {dtag}"
717+
)
718+
return {"success": True}
719+
712720
dataset_list = sorted([p.parts[-1] for p in model_dir.iterdir() if p.is_dir()])
713721
dataset_count = sum(1 for p in model_dir.iterdir() if p.is_dir())
714722
self.log.info(f"Dataset count is: {dataset_count}")

src/dlstbx/wrapper/pandda_xchem.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def run(self):
310310

311311
try:
312312
cropped_event_map = save_cropped_map(
313-
str(pandda_model), str(z_map), "LIG", radius=6
313+
str(pandda_model), str(event_map), "LIG", radius=6
314314
)
315315
cropped_z_map = save_cropped_map(
316316
str(pandda_model), str(z_map), "LIG", radius=6

0 commit comments

Comments
 (0)