From 2a2ff1474d63bc0683a026faa61395ff7b476acc Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Tue, 28 Jul 2026 15:28:02 +0200 Subject: [PATCH 1/3] fix obsm key in cellmapper_scvi cellmapper's map_obsm() writes f"{key}{prediction_postfix}", so map_obsm(key="mod2", prediction_postfix="pred") produces "mod2pred", not "mod2_pred" -- as cellmapper_linear already had it right. --- CHANGELOG.md | 6 ++++++ src/methods/cellmapper_scvi/script.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9a8396c..e1e459be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# task_predict_modality 0.2.0 + +## BUG FIXES + +* `cellmapper_scvi`: Read the prediction from `obsm["mod2pred"]` instead of `obsm["mod2_pred"]`, which raised a `KeyError` after every scVI/PoissonVI training run (PR #23). + # task_predict_modality 0.1.1 ## NEW FUNCTIONALITY diff --git a/src/methods/cellmapper_scvi/script.py b/src/methods/cellmapper_scvi/script.py index b0d2aa79..00a5f3f1 100644 --- a/src/methods/cellmapper_scvi/script.py +++ b/src/methods/cellmapper_scvi/script.py @@ -70,7 +70,7 @@ print("Predict on test data", flush=True) cmap.map_obsm(key="mod2", prediction_postfix="pred") -mod2_pred = csc_matrix(cmap.query.obsm["mod2_pred"]) +mod2_pred = csc_matrix(cmap.query.obsm["mod2pred"]) print("Write output AnnData to file", flush=True) output = ad.AnnData( From 98540c433ee51a52633d99cac1be714429d179cb Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Wed, 29 Jul 2026 11:55:52 +0200 Subject: [PATCH 2/3] Fix prediction postfix in map_obsm call --- src/methods/cellmapper_scvi/script.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/methods/cellmapper_scvi/script.py b/src/methods/cellmapper_scvi/script.py index 00a5f3f1..ef873109 100644 --- a/src/methods/cellmapper_scvi/script.py +++ b/src/methods/cellmapper_scvi/script.py @@ -69,8 +69,8 @@ cmap.compute_mapping_matrix(kernel_method=par['kernel_method']) print("Predict on test data", flush=True) -cmap.map_obsm(key="mod2", prediction_postfix="pred") -mod2_pred = csc_matrix(cmap.query.obsm["mod2pred"]) +cmap.map_obsm(key="mod2", prediction_postfix="_pred") +mod2_pred = csc_matrix(cmap.query.obsm["mod2_pred"]) print("Write output AnnData to file", flush=True) output = ad.AnnData( From 45e2339db2affa6aec4f36c1afd19118dee38d9e Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Wed, 29 Jul 2026 11:56:43 +0200 Subject: [PATCH 3/3] Fix changelog entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e1e459be..0629fe80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## BUG FIXES -* `cellmapper_scvi`: Read the prediction from `obsm["mod2pred"]` instead of `obsm["mod2_pred"]`, which raised a `KeyError` after every scVI/PoissonVI training run (PR #23). +* `cellmapper_scvi`: Fix postfix due to breaking changes in package. # task_predict_modality 0.1.1