diff --git a/src/rapids_singlecell/preprocessing/_scrublet/pipeline.py b/src/rapids_singlecell/preprocessing/_scrublet/pipeline.py index 711b91ca..7f52ece0 100644 --- a/src/rapids_singlecell/preprocessing/_scrublet/pipeline.py +++ b/src/rapids_singlecell/preprocessing/_scrublet/pipeline.py @@ -78,9 +78,9 @@ def pca( self._counts_obs_norm = self._counts_obs_norm.astype(cp.float32) self._counts_sim_norm = self._counts_sim_norm.astype(cp.float32) - pca = PCA(n_components=n_prin_comps, random_state=random_state).fit( - self._counts_obs_norm - ) - X_obs = pca.transform(self._counts_obs_norm) - X_sim = pca.transform(self._counts_sim_norm) + X_obs = _sparse_to_dense(self._counts_obs_norm) + + pca = PCA(n_components=n_prin_comps, random_state=random_state).fit(X_obs) + X_obs = pca.transform(X_obs) + X_sim = pca.transform(_sparse_to_dense(self._counts_sim_norm)) self.set_manifold(X_obs, X_sim)