Skip to content

fix: preserve gene pool alignment in score_genes - #4534

Open
rpinho wants to merge 2 commits into
scverse:mainfrom
rpinho:fix-score-genes-pool-order
Open

rpinho wants to merge 2 commits into
scverse:mainfrom
rpinho:fix-score-genes-pool-order

Conversation

@rpinho

@rpinho rpinho commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor
  • Closes #
  • Tests included or not required because:
  • Release notes not necessary because:
  • LLM or coding agent used: GPT-6.1 (OpenAI) via Codex wrote the patch and the test; Claude Opus 5.5 via Claude Code reproduced the bug separately and opened this PR
  • If one was used, I, a human, have reviewed, understood and tested every changed line

score_genes can assign expression means to the wrong gene names when gene_pool contains every gene in a different order. Score a gene with the full pool reversed and ctrl_size large enough to use every control in its bin to reproduce it. The patch skips column indexing only when the gene index equals var_names in order. The test compares scores with a name-aligned reference across stored, reversed, rotated and shorter pools for dense and sparse arrays and both ctrl_as_ref settings.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LKxc9GKLwnyeV2jaZBxH9N

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant