File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
src/spatialdata_io/readers Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -133,6 +133,14 @@ def visium_hd(
133133 CELL_GEOJSON_PATH = SEGMENTED_OUTPUTS_PATH / VisiumHDKeys .CELL_SEGMENTATION_GEOJSON_PATH
134134 NUCLEUS_GEOJSON_PATH = SEGMENTED_OUTPUTS_PATH / VisiumHDKeys .NUCLEUS_SEGMENTATION_GEOJSON_PATH
135135 SCALE_FACTORS_PATH = SEGMENTED_OUTPUTS_PATH / VisiumHDKeys .SPATIAL / VisiumHDKeys .SCALEFACTORS_FILE
136+ if not SCALE_FACTORS_PATH .exists ():
137+ # Visium HD 3.0.0 does not have the SEGMENTATION_OUTPUTS folder
138+ scale_factors_file = next (
139+ (file for file in path .rglob ("*" ) if file .name .endswith (VisiumHDKeys .SCALEFACTORS_FILE )),
140+ None ,
141+ )
142+ assert scale_factors_file is not None , "Scale factors file not found in any of the subdirectories."
143+ SCALE_FACTORS_PATH = scale_factors_file
136144 BARCODE_MAPPINGS_PATH = next (
137145 (file for file in path .rglob ("*" ) if file .name .endswith (VisiumHDKeys .BARCODE_MAPPINGS_FILE )),
138146 None ,
You can’t perform that action at this time.
0 commit comments