angelolab / ark-analysis

Integrated pipeline for multiplexed image analysis
https://ark-analysis.readthedocs.io/en/latest/
MIT License
69 stars 25 forks source link

marker_quantification.process_lists() returning inappropriate mask_types #1103

Closed bryjcannon closed 4 months ago

bryjcannon commented 6 months ago

Describe the bug Screenshot 2024-01-08 at 4 58 41 PM

When trying to run segmentation, an error propped up where a mask file that didn't exist was being loaded for csv writing. After troubleshooting, the problem occurs in marker_quantification.process_lists code. In this example, while only file names with 'R6C1' were desired, files with R6C10' were also being extracted due to the way marker_quantification.process_lists matches substrings in file names. Similar to list_files issue in alpineer.

Expected behavior marker_quantification.process_lists currently finds files using the code below based on a matching file prefix. Instead of returning "whole_cell" and "nuclear", the returned list is "_whole_cell", "0_whole_cell", etc.

To Reproduce Ping me for access to my mask files.

Proposed solution: Similar to the list_files and list_folders fix in alpineer, token matching will be used instead of string subsetting to find matching files (code pic below) Screenshot 2024-01-08 at 4 59 03 PM