Repository navigation
Add new method: MCV-calibrated diffusion (mcv_diffusion) - #39
Closed
Ephemeral6 wants to merge 3 commits into
Closed
Ephemeral6 wants to merge 3 commits into
Ephemeral6 wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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: MCV-calibrated diffusion (
mcv_diffusion)Method
Graph. Cells are connected by a symmetrised kNN graph (k = 15) on the PCA (50 components) of log1p-CP10k highly
variable genes.
Smoothing. The log1p-CP10k matrix Y is smoothed by a lazy random walk with restart,
Z = (1 - b) Y + b P^t Y.Output. expm1(Z), rescaled to each cell's library size.
Calibration. The amount of smoothing, (t, b), is not fixed. It is chosen per dataset by molecular
cross-validation (Batson et al., 2019) on the training counts only:
benchmark test set.
This adapts the smoothing to the depth and technology of each dataset (UMI vs full-length). For example, it picks
t = 16 on mouse_blood_olsson and t = 1, b = 0.3 on allen_brain_atlas.
It runs on CPU only: scanpy, scikit-learn exact kNN, and sparse matrix products. Runtime is 0.5–9 min per dataset on
a laptop.
Local benchmark (all 17 datasets of run 2025-08-11, official metric scripts, 3 seeds)
I ran the component on every official
train.h5adand scoredtest.h5adwithsrc/metrics/mseandsrc/metrics/poissonunchanged.Pipeline check.
no_denoisingreproduces the published values within 1e-7 on all 17 datasets.magiccomponent reproduces them within 1e-5 (MSE) and 2e-4 (Poisson).Scores are scaled with the control bounds as in the website/report (
mean(clip(scaled, 0, 1))):bootstrap: 95% CI [0.057, 0.101]. Better on 15/17 datasets, tied on 2 (both scaled 0).
Caveats (please read)
proposes to fix.
no_denoisingon 15/17 datasets but MAGIC on only5/17; it is slightly worse on the rest.
low-cell-count), its MSE is worse than
no_denoising, so both score 0 there.depth), estimated from the training molecules. No test data is used.
test files were scored once, after the protocol was fixed.
viash testwas not run here (no viash on this machine). I'm happy to fix anything CI flags.Changes
src/methods/mcv_diffusion/(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, and a separate agent independently re-scored and audited
the results.
🤖 Generated with Claude Code