Skip to content

Commit b44e57c

Browse files
Debug _cosmx_morphology_coords
Returns morphology channel single-letter name when the channel is not used. This prevents an error caused by mismatching the shape of the dask array of the TIFs, which always include all 5 channels.
1 parent 69499a2 commit b44e57c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sopa/io/reader/cosmx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def _cosmx_morphology_coords(images_dir: Path) -> list[str]:
290290
channels = re.findall(r'"ChannelId": "(.*?)",', description)
291291
channel_order = list(re.findall(r'"ChannelOrder": "(.*?)",', description)[0])
292292

293-
return [substrings[channels.index(x)] for x in channel_order if x in channels]
293+
return [substrings[channels.index(x)] if x in channels else x for x in channel_order]
294294

295295

296296
def _get_cosmx_protein_name(image_path: Path) -> str:

0 commit comments

Comments
 (0)