Skip to content

Commit

Permalink
make mypy shut up
Browse files Browse the repository at this point in the history
  • Loading branch information
melonora committed Mar 12, 2024
1 parent 8574e5e commit ee093f3
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/cell_gater/utils/csv_df.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ def stack_csv_files(csv_dir: Path) -> pd.DataFrame | None:
Parameters
----------
csv_dir : Path
csv_dir : str
Path to the directory containing the regionprops csvs
Returns
-------
pd.DataFrame
Dataframe containing the data of all regionprops csvs in the directory.
"""
csv_files = list(Path(csv_dir).glob("*.csv"))
csv_files = list(csv_dir.glob("*.csv"))
if len(csv_files) == 0:
napari_notification("No csv files found in the loaded regionprops directory. Please load the proper directory.")
return None
Expand Down Expand Up @@ -82,9 +82,9 @@ def get_markers_of_interest(df: pd.DataFrame, up_to: str, subset: tuple[int, int
Discussion
----------
We might want to filter out some markers that are usually not gated:
We might want to filter out some markers that are usually not gated:
the nuclear stains (DAPI/DNA/Hoechst) should be removed from the list (not sure if at this step or before)
In Cylinter, there was a congifg.yml parameter that denoted the list of markers to ignore.
In Cylinter, there was a congifg.yml parameter that denoted the list of markers to ignore.
For now I think that just removing the nuclear stains is enough. I will do this on the get_markers_of_interest function.
Also an option is to take the markers.csv file from MCMICRO and use it to filter the markers.
Expand All @@ -98,7 +98,5 @@ def get_markers_of_interest(df: pd.DataFrame, up_to: str, subset: tuple[int, int
markers = df.columns[1:x_centroid_col]
if subset_slice is not None:
markers = markers[subset_slice].tolist()
#remove nuclear stains
markers = [item for item in markers if not any(item.startswith(prefix) for prefix in ['DNA', 'DAPI', 'Hoechst'])]

return markers
# remove nuclear stains
return [item for item in markers if not any(item.startswith(prefix) for prefix in ["DNA", "DAPI", "Hoechst"])]

0 comments on commit ee093f3

Please sign in to comment.