Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

Commit

Permalink
(fix): sparse check
Browse files Browse the repository at this point in the history
  • Loading branch information
ilan-gold committed Jan 2, 2024
1 parent dd23d80 commit 9325d05
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/multi_condition_comparisions/tl/de.py
Original file line number Diff line number Diff line change
Expand Up @@ -488,8 +488,8 @@ def _test_single_contrast(self, contrast, **kwargs) -> pd.DataFrame:
x0 = adata0.X if self.layer is None else adata0.layers[self.layer]
x1 = adata1.X if self.layer is None else adata1.layers[self.layer]
pval = scipy.stats.mannwhitneyu(
x=np.asarray(x0.todense()).flatten() if isinstance(x0, scipy.sparse.csr_matrix) else x0,
y=np.asarray(x1.todense()).flatten() if isinstance(x0, scipy.sparse.csr_matrix) else x1,
x=np.asarray(x0.todense()).flatten() if scipy.sparse.issparse(x0) else x0,
y=np.asarray(x1.todense()).flatten() if scipy.sparse.issparse(x1) else x1,
use_continuity=True,
alternative="two-sided"
).pvalue
Expand Down

0 comments on commit 9325d05

Please sign in to comment.