Assume you have 2 segmented files called foo1_nuclear.tiff and foo10_nuclear.tiff
In the case fov_name=foo1, this line of code in marker_quantification.generate_cell_tablemask_files = io_utils.list_files(segmentation_dir, substrs=fov_name) matches both files like foo1_nuclear and foo10_nuclear, creating subsequent confusion when the prefix is stripped in the line process_lists
I suggest to use regex and do something like this:
mask_files = io_utils.list_files(segmentation_dir, substrs=r''+fov_name+'_')#avoid matching both foo1 and foo10 files
mask_types = process_lists(fov_names=[fov_name], mask_names=mask_files)
Assume you have 2 segmented files called foo1_nuclear.tiff and foo10_nuclear.tiff
In the case
fov_name=foo1
, this line of code inmarker_quantification.generate_cell_table
mask_files = io_utils.list_files(segmentation_dir, substrs=fov_name)
matches both files like foo1_nuclear and foo10_nuclear, creating subsequent confusion when the prefix is stripped in the lineprocess_lists
I suggest to use regex and do something like this:mask_files = io_utils.list_files(segmentation_dir, substrs=r''+fov_name+'_')
#avoid matching both foo1 and foo10 filesmask_types = process_lists(fov_names=[fov_name], mask_names=mask_files)