Repository navigation
Add control_quantile_mapping: control-anchored per-population quantile maps - #152
Open
Ephemeral6 wants to merge 2 commits into
Open
Ephemeral6 wants to merge 2 commits into
Ephemeral6 wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Add new method:
control_quantile_mappingMethod
The control samples (
is_control > 0) are aliquots of the same donor measured in every batch. The differencesbetween their per-marker distributions across batches are therefore technical. For every batch and every marker
with
to_correct:reference distribution: the 1D Wasserstein barycenter over batches, i.e. a "mid" target. Maps are averaged over
control donors.
lineage markers) and shrunk towards the global map with weight n / (n + 200).
population. This keeps the correction stable when the controls are in a different biological state than the
other samples.
The maps are applied to every cell of the batch; other markers are returned unchanged. The method uses only
batch,is_control, thepreprocessedlayer and the varto_correct/marker_typecolumns of the censored input.Python only (numpy, scipy, scikit-learn); a few minutes per split on a laptop CPU.
Local benchmark
I scored the method with the metric components of the published run (commit 3321360, 9 metrics) and scaled the
scores with the control methods as on the website (
mean(clip(scaled, 0, 1))). Published values were taken fromthat run's
score_uns.yaml.Pipeline check.
no_integrationreproduces all 27 published dataset × metric values (max difference 4.8e-7).cycombine_no_controls_to_midre-run locally reproduces its published values exactly: all metrics onhuman_blood and lille; batch R² and EMD on mouse_spleen (the remaining mouse metrics were not re-run).
[0.0075, 0.0133].
dataset.
Caveats (please read)
human_blood it ties with cyCombine, and
cytonorm_no_controls_to_midis better there (0.7506).peaks (about 0.70 vs 0.76) and human FlowSOM mapping similarity (0.67–0.68 vs 0.70).
published best. The result, +0.0175, is just below it; I'm submitting because it beats every published method on
the leaderboard metric, consistently across seeds.
datasets. Non-control donors were relabelled so the metrics ignored them, and their labels were never used. The
configuration was frozen before the final runs. Still, this is not an independent dataset.
mainhas addedabundance_preservation(Add DA metric #143), the R sva ComBat (Adapt combat #149) and parameter-optimisation ranges (Note on parameter optimization added in config files #151), which may changethe ranking.
abundance_preservationwas not scored here.viash testwas not run (no viash/Docker on this machine); the script was run with theconfig's default arguments by injecting
parthe way viash does. I'm happy to fix anything CI flags.Changes
src/methods/control_quantile_mapping/(config.vsh.yaml,script.py).src/workflows/run_benchmark/config.vsh.yamlandmain.nf.AI assistance disclosure
An AI agent (Anthropic Claude, via Claude Code) designed, implemented, evaluated and wrote up this method, operating
the Ephemeral6 account. All numbers come from logged runs. A separate agent independently recomputed the scores from
the raw metric outputs, re-ran the official metrics and the method, and checked for label leakage.
🤖 Generated with Claude Code