Skip to content

Commit f819f4c

Browse files
committed
Make the raw directory optional when doing SPA processing
1 parent 2d3e030 commit f819f4c

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/murfey/server/api/workflow.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -369,14 +369,11 @@ async def request_spa_preprocessing(
369369
visit_idx = parts.index(visit_name)
370370
core = Path("/") / Path(*parts[: visit_idx + 1])
371371
ppath = Path("/") / Path(*parts)
372-
sub_dataset = ppath.relative_to(core).parts[0]
373-
extra_path = machine_config.processed_extra_directory
374-
for i, p in enumerate(ppath.parts):
375-
if p.startswith("raw"):
376-
movies_path_index = i
377-
break
372+
if machine_config.process_multiple_datasets:
373+
sub_dataset = ppath.relative_to(core).parts[0]
378374
else:
379-
raise ValueError(f"{proc_file.path} does not contain a raw directory")
375+
sub_dataset = ""
376+
extra_path = machine_config.processed_extra_directory
380377
mrc_out = (
381378
core
382379
/ machine_config.processed_directory_name
@@ -385,7 +382,7 @@ async def request_spa_preprocessing(
385382
/ "MotionCorr"
386383
/ "job002"
387384
/ "Movies"
388-
/ "/".join(ppath.parts[movies_path_index + 1 : -1])
385+
/ ppath.parent.relative_to(core / sub_dataset)
389386
/ str(ppath.stem + "_motion_corrected.mrc")
390387
)
391388
try:

src/murfey/util/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class MachineConfig(BaseModel): # type: ignore
5757
processing_enabled: bool = True
5858
process_by_default: bool = True
5959
gain_directory_name: str = "processing"
60+
process_multiple_datasets: bool = True
6061
processed_directory_name: str = "processed"
6162
processed_extra_directory: str = ""
6263
recipes: dict[str, str] = {

0 commit comments

Comments
 (0)