Repository navigation
Adapt combat - #149
Merged
Merged
Adapt combat#149
Conversation
LuLeom
requested review from
ghar1821 and
rcannood
and
a balanced review from Copilot
October 20, 2026 12:26
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No blocking issues were identified in correction logic, output handling, or parameterised workflow integration.
No open issues 🎉
What changed in this PR
Replaces Scanpy-based ComBat with R’s sva::ComBat, enabling reference-batch correction within the existing parameterised-method workflow.
Changes:
- Adds
goalcorrection towards batch 1 and defaultmidcorrection across batches. - Declares no-control variants and switches runtime dependencies to R.
- Documents the implementation change.
| File | Description |
|---|---|
| src/methods/combat/script.R | Implements correction targets and AnnData output. |
| src/methods/combat/script.py | Removes the Scanpy implementation. |
| src/methods/combat/config.vsh.yaml | Configures targets, variants, and R dependencies. |
| CHANGELOG.md | Records the ComBat implementation switch. |
Review effort: Balanced
ghar1821
approved these changes
Oct 20, 2026
Contributor
|
LGTM! |
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
Re-implements
methods/combatin R withsva::ComBat, replacing the Python (scanpy) version.The reason for the switch is that
sva::ComBatsupportsref.batch, so batches can be corrected towards a reference batch. The scanpy implementation can't do that.Following the convention for parameterised methods introduced in #142,
combatis implemented as a single component with a--targetargument and two paramsets ininfo.variants:to_goal(--target goal):ref.batch = "1". Batch 1 is left unchanged and the other batches are corrected towards it.to_mid(--target mid, default):ref.batch = NULL. All batches are corrected towards the pooled mean (like the previous implementation).As combat does not make use of specific control samples, I am using the prefix
no_controls_.Tested via:
viash test src/methods/combat/config.vsh.yamlpasses.viash runwith--target goal.Fixes #148
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!