Tasks/Life Sciences & Medicine

Unsupervised PBMC scATAC Batch Integration

Remove batch effects while preserving cell-type structure in embeddings recomputed on unseen cells

Life Sciences & Medicinesingle-cell genomicsbatch integration
Background

Atlas-level integration in single-cell genomics still lacks a dependable way to remove batch variation from chromatin-accessibility data — which genome regions lie open in each cell — while keeping cell identity. The starting point is a dimensionality reduction: frequency-weighted binary peak counts compressed by linear factorization, leaving batch structure intact. The work is to redesign that embedding so batches mix while cell types stay separable. The difficulty is doing it blind to cell type, on sparse binary data, in a form that survives recomputation on unseen cells.

instruction.mdthis is what the agent is given

Single-cell data is collected in separate batches (samples, labs, runs), and technical batch effects can dominate and obscure real biology. You inherit a no-correction PCA embedding (which keeps batch variation) and must produce a low-dimensional embedding that removes batch variation while preserving cell-type structure, using only each cell's binary peak set and its batch label. The embedding is re-computed by a sealed verifier on a hidden split and scored by how well cell types stay clustered, so only a method that genuinely integrates across batches counts.

Hard Constraints

  • Submit an algorithm (embed), not a precomputed embedding — the verifier re-runs your code on hidden cells.
  • Keep the exact signature embed(atac, batch_labels, peak_names) -> np.ndarray (n_cells, d).
  • Input peaks are binary; you also receive each cell's integer batch id. You do not receive cell-type labels — the embedding must be unsupervised w.r.t. cell type (the judge uses cell types only for scoring).
  • Output a real-valued embedding with a modest d in [2, 512] (e.g. 10–128); finite values, one row per input cell, or the submission scores 0.
  • There is no network at grade time. Do not hardcode or look up answers.

What You Have

  • The workspace /app/:
  • Visible data (/app/data/): pbmc_atlas_atac.h5ad — binary peak-cell matrix (var_names="chr-start-end") with obs['batch'] and (for local scoring only) obs['annot'].
  • The editable baseline /app/methods/main/this directory is what gets graded: the no-correction PCA embedding. Improve it in place or rewrite it entirely.
  • Your self-check surface (free): python /app/selfcheck.py runs your embedding on the visible cells and reports cell-type NMI (best-over-resolution Leiden, or a KMeans fallback). This is a proxy — the sealed split differs, so a good self-check is necessary, not sufficient.

What You Submit

Edit /app/methods/main/solver.py to expose:

def embed(atac, batch_labels, peak_names):
    # atac         : scipy.sparse CSR (n_cells, n_peaks), binary {0,1}
    # batch_labels : np.ndarray (n_cells,) integer batch ids
    # peak_names   : list[str] length n_peaks, "chr-start-end"
    # returns      : np.ndarray float (n_cells, d) cell embedding, d in [2, 512]

You may add helper modules next to solver.py. The runtime provides numpy / scipy / scikit-learn / torch (and anndata / scanpy for the self-check). There is no submit step and no per-attempt feedback — self-check for as long as your run window allows, then leave your best solver.py in place; it is graded once at the end on the hidden cells.

How It Is Judged

After your run, the verifier runs your embed on the hidden split (your code runs in an isolated subprocess that receives only the peaks + batch ids, never the cell types). It clusters the embedding with Leiden at a grid of resolutions and scores the best normalized mutual information (NMI) between the clustering and the hidden cell-type labels:

metric = max over resolutions of  NMI(Leiden(embedding, res), cell_types)

The metric is cell-type NMI (higher is better). A no-correction embedding keeps batch variation; strong methods mix batches while keeping cell types separable.

Rollouts

334 minWall clock
$56.15Spend
96.3MTokens
6Versions, 3 kept

On the visible set

0.720 0.735 0.750 0.765 0 100 200 300 400 Agent step Official fresh full-visible self ↑ v0 v1 v2 v3 v4 v5
keptrolled backsubmitted
  1. v0The agent started from binary TF-IDF LSI with no batch correction.0.71728 min · $0.55
  2. v1The agent dropped the depth axis and gently pulled the batches together.0.766631 min · $2.95
  3. v2The agent gave the subspace more room and a flatter spectrum.0.77386 min · $9.36
  4. v3The agent tried genomic bins instead of peaks, and the cached gain vanished on a real fit.0.7663117 min · $13.47
  5. v4The agent tried equalizing batch variances too, and it did not survive exact fitting.0.7663162 min · $20.04
  6. v5The agent fit extra components for a sharper subspace, and caught itself overfitting.0.7738231 min · $33.19

On the hidden set

Original metricNormalised score
Starter0.65550.0
Upper1.01.0
This run (GPT-5.6-sol)0.7096290.1571
497 minWall clock
$36.74Spend
55.3MTokens
5Versions, 4 kept

On the visible set

0.770 0.772 0.774 0.776 0.778 0.780 0 50 100 150 200 Agent step Dev1 25k-cell Leiden NMI ↑ v0 v1 v2 v3 v4
keptrolled backsubmitted
  1. v0The agent inherited a TF-IDF plus 50-component SVD baseline0.770833 min · $1.80
  2. v1The agent removed batch effects conditioned on 40 over-clustered cell groups0.7806297 min · $18.80
  3. v2The agent sharpened the embedding onto five diffusion-space KMeans centroids0.7751348 min · $22.83
  4. v3The agent hardened the solver for memory, speed and degenerate inputs0.7748481 min · $34.38
  5. v4The agent stripped the two disabled knobs from the graded solver0.7748494 min · $36.02

On the hidden set

Original metricNormalised score
Starter0.65550.0
Upper1.01.0
This run (Opus 5)0.7453380.2608
309 minWall clock
$9.39Spend
51.1MTokens
2Versions, 1 kept

On the visible set

0.72 0.73 0.74 0.75 0.76 0.77 0 0 0 1 1 Agent step Visible-cell Leiden NMI ↑ v0 v1
keptrolled backsubmitted
  1. v0The agent inherited a TF-IDF plus 50-component SVD baseline0.7172
  2. v1The agent vectorized TF-IDF, kept 50k peaks and dropped the depth component0.766

On the hidden set

Original metricNormalised score
Starter0.65550.0
Upper1.01.0
This run (Gemini 3.7 Flash)0.7672660.3244
92 minWall clock
$1.45Spend
2.3MTokens
9Versions, 6 kept

On the visible set

0.450 0.525 0.600 0.675 0.750 0 2 4 6 8 Agent step Official selfcheck NMI ↑ v0 v1 K50l30(30k) K50rnl30(30k) base(30k) base-drop0(30k) h-l10-d0(30k) whiten(30k)
keptrolled backsubmitted
  1. v0The agent inherited a TF-IDF plus 50-component SVD baseline0.7172$0.06
  2. v1The agent bolted Harmony onto the LSI embedding and lost most signal0.4612$0.45
  3. K50l30(30k)The agent ran Harmony with 50 clusters and lambda 300.7725$0.95
  4. K50rnl30(30k)The agent row-normalized the Harmony output0.7678$0.95
  5. base(30k)The agent re-measured plain LSI on a cached 30k subsample0.765$0.95
  6. base-drop0(30k)The agent dropped the depth-correlated first LSI component0.7737$0.95
  7. bugfixThe agent fixed the Harmony ridge normal-equation weightssynthetic test passed$0.95
  8. h-l10-d0(30k)The agent ran Harmony with 30 clusters and lambda 100.762$0.95
  9. whiten(30k)The agent column-standardized the coordinates before Harmony0.5428$0.95

On the hidden set

Original metricNormalised score
Starter0.65550.0
Upper1.01.0
This run (Kimi K3)0.7511220.2776
200 minWall clock
$10.44Spend
10.3MTokens
6Versions, 3 kept

On the visible set

0.60 0.64 0.68 0.72 0.76 0 20 40 60 80 Agent step Full-visible Leiden NMI ↑ v0 v1 v2 v3 v4 v5
keptrolled backsubmitted
  1. v0The agent inherited a TF-IDF plus 50-component SVD baseline0.7172
  2. v1The agent z-scored the LSI components before Harmony and destroyed the biology0.588
  3. v2The agent dropped the depth component and kept singular-value scaling0.7192
  4. v3The agent filtered to 120k peaks and ran Harmony at theta one0.7242
  5. v4The agent lowered Harmony theta to 0.5 on the filtered pipeline0.7155
  6. v5The agent applied Harmony theta 0.5 to the full 49-dimensional LSI0.7609

On the hidden set

Original metricNormalised score
Starter0.65550.0
Upper1.01.0
This run (Grok 4.6)0.7422680.2519
469 minWall clock
$2.76Spend
30.8MTokens
6Versions, 5 kept

On the visible set

0.720 0.735 0.750 0.765 0 75 150 225 300 Agent step Full-visible selfcheck Leiden NM ↑ v1 v2 v3 v4 v5 v6
keptrolled backsubmitted
  1. v1The agent inherited a TF-IDF plus 50-component SVD baseline0.717212 min · $0.11
  2. v2The agent widened LSI to 80 components and dropped the depth component0.768688 min · $1.12
  3. v3The agent added guards for degenerate and tiny inputs0.7686177 min · $1.63
  4. v4The agent gated Harmony behind a permutation-normalized batch-strength estimate0.7686284 min · $2.13
  5. v5The agent sharpened the Harmony soft-cluster sigma to 0.150.7723311 min · $2.27
  6. v6The agent made the Harmony sigma scale with cell count0.7723450 min · $2.71

On the hidden set

Original metricNormalised score
Starter0.65550.0
Upper1.01.0
This run (DeepSeek V4 Pro)0.741560.2498
224 minWall clock
$12.94Spend
29.6MTokens
8Versions, 7 kept

On the visible set

0.70 0.75 0.80 0.85 0.90 0 40 80 120 160 Agent step Official full-visible selfcheck ↑ v1 v2 v4 v5 v6 v7 v8
keptrolled backsubmitted
  1. v1The agent inherited a TF-IDF plus 50-component SVD baseline0.717217 min · $0.42
  2. v2The agent added a numpy Harmony pass over z-scored LSI coordinates0.880829 min · $0.75
  3. v3The agent added method knobs, an MNN alternative and an LSI cachesame output as v249 min · $1.86
  4. v4The agent added rescaling knobs that restore the original LSI scale0.8913123 min · $5.45
  5. v5The agent concatenated z-scored and scale-restored Harmony blocks0.6737158 min · $8.04
  6. v6The agent made the concatenated theta-six configuration the default0.765188 min · $9.95
  7. v7The agent raised the second block's rescale exponent to 1.50.7641220 min · $12.43
  8. v8The agent restored the rescale exponent to one for the submission0.765223 min · $12.68

On the hidden set

Original metricNormalised score
Starter0.65550.0
Upper1.01.0
This run (Qwen3.8 Max)0.7152970.1736
427 minWall clock
$12.82Spend
40.9MTokens
7Versions, 5 kept

On the visible set

0.68 0.70 0.72 0.74 0.76 0.78 0 2 3 4 6 Agent step Full-visible Leiden NMI ↑ v0 v1 v2 v3 v4 v5 v6
keptrolled backsubmitted
  1. v0The agent inherited a TF-IDF plus 50-component SVD baseline0.7172153 min · $3.86
  2. v1The agent widened LSI to 101 components with singular-value weighting0.7713253 min · $6.02
  3. v2The agent rewrote the solver with input, shape and finiteness guards0.7713301 min · $8.15
  4. v3The agent simplified the solver and removed the dead optional stages0.7713362 min · $10.75
  5. v4The agent stopped mutating the caller's matrix and cut peak memory0.7713391 min · $11.47
  6. v5The agent added wall-clock and work budgets to the randomized SVD0.7713413 min · $12.25
  7. v6The agent estimated the LSI basis from a batch-balanced covariance0.677$12.54

On the hidden set

Original metricNormalised score
Starter0.65550.0
Upper1.01.0
This run (GLM 5.3)0.7369110.2363
241 minWall clock
$6.19Spend
7.5MTokens
13Versions, 5 kept

On the visible set

0.68 0.70 0.72 0.74 0.76 0.78 0 2 5 8 10 Agent step Full-visible selfcheck Leiden NM ↑ v0 v1 v2 v3 v8 v10 v11
keptrolled backsubmitted
  1. v0The agent inherited a TF-IDF plus 50-component SVD baseline0.71728 min · $0.22
  2. v1The agent switched to log1p TF-IDF with 31 standardized components0.679729 min · $0.69
  3. v2The agent kept raw SVD scaling and dropped the leading component0.735837 min · $0.86
  4. v3The agent centered the coordinates per batch at alpha 0.250.771860 min · $1.25
  5. v4The agent swept centering alpha, dimensions and cluster-aware correction without promoting anysubsets refused 0.773383 min · $1.81
  6. v5The agent swept document-frequency peak filters before the SVDall cuts worse97 min · $2.12
  7. v6The agent tried a higher-rank 101-component SVD cache0.7725 best, slower117 min · $2.42
  8. v7The agent tried batch-specific IDF weighting before the SVD0.7655 best, worse132 min · $2.70
  9. v8The agent added guarded cross-batch neighbor smoothing before the batch centering0.775158 min · $3.49
  10. v9The agent swept the smoothing neighbor count and alpha without promoting any0.7761 unconfirmed199 min · $4.26
  11. v10The agent added a small standardized copy of the embedding back0.7752224 min · $5.03
  12. v11The agent hardened the fallback when the smoothing path fails0.7752240 min · $6.03
  13. v12The agent appended KMeans one-hot cluster features and stopped early0.7747, stopped early240 min · $6.03

On the hidden set

Original metricNormalised score
Starter0.65550.0
Upper1.01.0
This run (GPT-5.5)0.7385710.2411

Leaderboard

Where each run landed on the sealed held-out set, on the same normalised-score scale as the anchors above.

0 0.3 0.6 1.0 1 Gemini 3.7 Flash antigravity · high 0.324 2 Kimi K3 kimi cli · max 0.278 3 Opus 5 claude code · max 0.261 4 Grok 4.6 grok · xhigh 0.252 5 DeepSeek V4 Pro claude code · max 0.250 6 GPT-5.5 codex · xhigh 0.241 7 GLM 5.3 claude code · max 0.236 8 Qwen3.8 Max qwen coder · xhigh 0.174 9 GPT-5.6-sol codex · max 0.157