Skip to content

Commit 672d18c

Browse files
authored
CLEM workflow bug fixes (#408)
* Removes the '--Zxx--Cxx.tif' part of the file name before parsing the file path to generate a job name * Replaces '/' with '--' when generating series names to group the TIFF files under while parsing the transferred data
1 parent 0746057 commit 672d18c

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/murfey/client/contexts/clem.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def post_transfer(
164164
# Create a unique name for the series
165165
# For standard file name
166166
if len(transferred_file.stem.split("--")) == 3:
167-
series_name = "/".join(
167+
series_name = "--".join(
168168
[
169169
*destination_file.parent.parts[
170170
-2:
@@ -174,7 +174,7 @@ def post_transfer(
174174
)
175175
# When this a repeated position
176176
elif len(transferred_file.stem.split("--")) == 4:
177-
series_name = "/".join(
177+
series_name = "--".join(
178178
[
179179
*destination_file.parent.parts[
180180
-2:
@@ -217,7 +217,8 @@ def post_transfer(
217217
)
218218
return True
219219

220-
# Skip processing of "IOManagerConfiguation.xlif" files (yes, the typo IS part of the file name)
220+
# Skip processing of "IOManagerConfiguation.xlif" files
221+
# YES, the 'Configuation' typo IS part of the file name
221222
if "IOManagerConfiguation" in transferred_file.stem:
222223
logger.debug(
223224
f"File {transferred_file.name!r} is a Leica configuration file; skipping processing"
@@ -231,7 +232,7 @@ def post_transfer(
231232
# Create series name for XLIF file
232233
# XLIF files don't have the "--ZXX--CXX" additions in the file name
233234
# But they have "/Metadata/" as the immediate parent
234-
series_name = "/".join(
235+
series_name = "--".join(
235236
[*destination_file.parent.parent.parts[-2:], destination_file.stem]
236237
) # The previous 2 parent directories should be unique enough
237238
logger.debug(

src/murfey/workflows/clem/process_raw_tiffs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ def zocalo_cluster_request(
2424
):
2525
if messenger:
2626
# Construct path to session directory
27-
path_parts = list(tiff_list[0].parts)
27+
path_parts = list(
28+
(tiff_list[0].parent / (tiff_list[0].stem.split("--")[0])).parts
29+
)
2830
# Replace leading "/" in Unix paths
2931
path_parts[0] = "" if path_parts[0] == "/" else path_parts[0]
3032
try:

0 commit comments

Comments
 (0)