Skip to content

Commit

Permalink
Merge pull request #22 from fractal-napari-plugins-collection/21-move…
Browse files Browse the repository at this point in the history
…-condition-table-from-anndata-x-matrix-to-obs

Read condition from anndata obs
  • Loading branch information
fdsteffen authored Sep 23, 2024
2 parents 649cb54 + e068d1d commit 99d9299
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/napari_ome_zarr_navigator/img_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ def initialize_filters(self):
if self.zarr_root:
adt = self.load_table()
if adt:
self.df = adt.to_df()
self.df = adt.to_df() # keep for backwards compatibility
if self.df.empty:
self.df = adt.obs
self.df_without_pk = self.df.drop(
columns=["row", "col"]
).apply(pd.to_numeric, errors="ignore")
Expand Down Expand Up @@ -120,7 +122,7 @@ def initialize_filters(self):
msg = "No condition table is present in the OME-ZARR."
logger.info(msg)
napari.utils.notifications.show_info(msg)
wells = _validate_wells(self.zarr_dir.value, None)
wells = _validate_wells(self.zarr_root, self.zarr_dict["well"])
wells_str = sorted([f"{w[0]}{w[1]}" for w in wells])
self.well.choices = wells_str
self.well._default_choices = wells_str
Expand All @@ -131,6 +133,7 @@ def initialize_filters(self):
}
)
self.filter_names = None
self.well.value = wells_str[0]

self.select_well.enabled = True
self.btn_load_roi.enabled = True
Expand Down

0 comments on commit 99d9299

Please sign in to comment.