Skip to content

Commit

Permalink
fix bug in cell-type specific background filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasmueboe committed Jul 8, 2024
1 parent 57b99e2 commit e8909ec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sainsc/lazykde/_LazyKDE.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,9 +493,9 @@ def _map_celltype_to_value(
raise ValueError("'min_cosine' does not contain all celltypes.")
idx2threshold = tuple(min_cosine[ct] for ct in self.celltypes)
threshold = _map_celltype_to_value(self.celltype_map, idx2threshold)
background &= self.cosine_similarity >= threshold
background |= self.cosine_similarity <= threshold
else:
background &= self.cosine_similarity >= min_cosine
background |= self.cosine_similarity <= min_cosine

if min_assignment is not None:
if self.assignment_score is None:
Expand All @@ -511,9 +511,9 @@ def _map_celltype_to_value(
raise ValueError("'min_assignment' does not contain all celltypes.")
idx2threshold = tuple(min_assignment[ct] for ct in self.celltypes)
threshold = _map_celltype_to_value(self.celltype_map, idx2threshold)
background &= self.assignment_score >= threshold
background |= self.assignment_score <= threshold
else:
background &= self.assignment_score >= min_assignment
background |= self.assignment_score <= min_assignment

self._background = background

Expand Down

0 comments on commit e8909ec

Please sign in to comment.