From 110914212afef3d3779c8c060016afb9124462ae Mon Sep 17 00:00:00 2001 From: Daniel Schaffer <55718373+schafferde@users.noreply.github.com> Date: Mon, 17 Aug 2026 16:37:47 -0400 Subject: [PATCH 1/2] Correct behavior for no-jitter OHE --- src/control_methods/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/control_methods/utils.py b/src/control_methods/utils.py index 954e24af2..d83c30fbb 100644 --- a/src/control_methods/utils.py +++ b/src/control_methods/utils.py @@ -40,7 +40,7 @@ def _randomize_graph(adata, partition=None, neighbors_key="neighbors"): return adata -def _perfect_embedding(partition, jitter=0.01): +def _perfect_embedding(partition, jitter=None): """ Taken and adapted from opsca-v1: https://github.com/openproblems-bio/openproblems/blob/acf5c95a7306b819c4a13972783433d0a48f769b/openproblems/tasks/_batch_integration/_common/methods/baseline.py#L37 @@ -51,6 +51,7 @@ def _perfect_embedding(partition, jitter=0.01): embedding = OneHotEncoder().fit_transform( LabelEncoder().fit_transform(partition)[:, None] ) + embedding = embedding.toarray() if jitter is not None: embedding = embedding + np.random.uniform(-1 * jitter, jitter, embedding.shape) return np.asarray(embedding) From 0f13c1a0e51246f17511300ee4acd0ec51527c4c Mon Sep 17 00:00:00 2001 From: Daniel Schaffer <55718373+schafferde@users.noreply.github.com> Date: Mon, 17 Aug 2026 16:39:19 -0400 Subject: [PATCH 2/2] Note fix to OHE Jitter --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b88e8d69..a55100e66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,12 +54,12 @@ * Fix `methods/scgpt_zeroshot` and `methods/scgpt_finetuned` failing to build: stop installing `flash-attn`. Both scripts pass `use_fast_transformer=False`, so it was never used. Behind it sat three more pins with no python 3.12 wheels, now `numpy<2`, `torchtext==0.17.2` and `transformers==4.36.2`. - * Split Scanorama into two methods/scores - Split Scanorama into embedding (integrate) and count-correction (correct) modes, instead of running both together. This makes clear what the reported score(s) are describing, and also corrects the misleadingly low score that the combined method receives. The scores for each component are in line with their scores from v1, where the modes - were separated. + were separated. +* Remove jitter from the `embed_cell_types` control method, distinguishing its behavior from `embed_cell_types_jittered`. # task_batch_integration 2.0.0