Compute average_batch_r2 per cell type - #127
Merged
Merged
Conversation
* Pass the cell type subsets to batch_r2() instead of the donor-level views * Correct the cell count in the skip comment
Contributor
|
LGTM |
LuLeom
approved these changes
Jul 30, 2026
ghar1821
approved these changes
Jul 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
average_batch_r2reports a per-cell-type score (average_batch_r2_ct), but the R² it computes is the donor-level one, pooled over all cell types.In
src/metrics/average_batch_r2/script.pythe loop buildss1_view_ct/s2_view_ct, uses them for the 20-cell guard, and then handsbatch_r2()the donor-levels1_view/s2_view:Two consequences:
∑_{j=1}^{C}cell type sum in the description isn't what's computed.np.mean().This PR passes the cell type subsets, and corrects the "less than 10 cells" comment next to the
< 20guard.Note that this changes the value of
average_batch_r2_ctfor every method, so results from earlier runs are not comparable.Found while reviewing the task ahead of the next full benchmark run -- see also #TODO_ISSUE_A and the sibling PRs.
Checklist before requesting a review
I have performed a self-review of my code
Check the correct box. Does this PR contain:
Proposed changes are described in the CHANGELOG.md
CI Tests succeed and look good!