Skip to content

Commit

Permalink
fix _infer_dataset_id issue in cosmx reader (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinblampey committed Nov 4, 2024
1 parent c25c20d commit 449b53f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sopa/io/reader/cosmx.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def _infer_dataset_id(path: Path, dataset_id: str | None) -> str:
counts_files = list(path.rglob(f"[!\\.]*_fov_positions_file{suffix}"))

if len(counts_files) == 1:
found = re.match(rf"(.*)_fov_positions_file{suffix}", str(counts_files[0]))
found = re.match(rf"(.*)_fov_positions_file{suffix}", counts_files[0].name)
if found:
return found.group(1)

Expand Down Expand Up @@ -166,9 +166,9 @@ def _read_fov_locs(path: Path, dataset_id: str) -> pd.DataFrame:
pixel_size = 0.120280945 # size of a pixel in microns

fov_locs["xmin"] = fov_locs["X_mm"] * 1e3 / pixel_size
fov_locs["xmax"] = 0 # will be filled when reading the images
fov_locs["xmax"] = 0.0 # will be filled when reading the images

fov_locs["ymin"] = 0 # will be filled when reading the images
fov_locs["ymin"] = 0.0 # will be filled when reading the images
fov_locs["ymax"] = fov_locs["Y_mm"] * 1e3 / pixel_size

return fov_locs
Expand Down

0 comments on commit 449b53f

Please sign in to comment.