From edca4fc312c3f0c37635cf54a6f196254a5e27de Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Thu, 19 Nov 2026 13:58:06 +0100 Subject: [PATCH] fix swapped pca variance and ratio --- CHANGELOG.md | 2 ++ src/processors/pca/script.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7fef24..95cc888 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,8 @@ * MINOR CHANGE: Component tests use the `cxg_mouse_pancreas_atlas` test resources instead of the deprecated `pancreas` ones. Its notebook now keeps every processing step. +* BUG FIX: `processors/pca` stored the explained variance and the variance ratio under each other's name in `uns['pca_variance']`. + * BUG FIX: `processors/subsample` no longer fails when the `--keep_*` filters leave fewer cells than `--n_obs`. * MINOR CHANGE: Failed Nextflow processes are no longer ignored, so a failing dataset fails the run. diff --git a/src/processors/pca/script.py b/src/processors/pca/script.py index 6119e02..b648fab 100644 --- a/src/processors/pca/script.py +++ b/src/processors/pca/script.py @@ -29,7 +29,7 @@ feature_mask = np.ones(adata.n_vars, dtype=bool) print(">> Run PCA", flush=True) -X_pca, loadings, variance, variance_ratio = sc.tl.pca( +X_pca, loadings, variance_ratio, variance = sc.tl.pca( layer[:, feature_mask], n_comps=par["num_components"], random_state=par["seed"],