Repository navigation
quant finalize: bagged transfer classifier and neighbour donor rate for seed-stable transfer q-values - #207
Conversation
…ure, cached transfer scores The transfer classifier of each fold is now the mean margin of --transfer-models GBDTs (default 8), each trained on its own hashed sample of the training rows with its own seed; --transfer-models 1 is the single model. On 500 runs one model trained on a sample of 2.8 of 359 million rows moved the accepted transfers between seeds (Jaccard 0.49 at transfer q 0.01, 0.82 at 0.05) and more rows did not help. New transfer feature neighbour_donor_rate: the share of the 50 runs most similar to the transfer's run (Jaccard index of the target entries they identified) that identified the precursor. Computed from the donor runs only, the same for target and decoy precursors, never from the row's own run. Pass 3 keeps each run's held-out transfer scores in a temporary table and pass 5 reads them instead of scoring the transfer rows again.
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Entrapment check at 500 runs (all PXD042233 runs; study FASTA + 1:1 shuffled entrapment twins; ALL-accessions rule with the I/L rescue; factor 1.940). Same search, library and extracts for every arm; finalize with seeds 42 / 1 / 7. Arms: A = parent #203 (1 model, no feature); B = 8 members, Entrapment-measured false-donor share of accepted transfers vs the identity-decoy estimate (pooled over seeds, 95 % Poisson CI):
Verdict: by the agreed rule (measured transfer FDP at or below the estimate, within CI, at q 0.01 and 0.05), the feature can ship by default with 8 members. |
Bagged transfer classifier and neighbour_donor_rate (re-land of #207)
Stacked on #203 (
quant/finalize-mapreduce).Problem
On a 500-run LFQ study (464 M extract rows), changing only
quant finalize --seedon the same extract tables churned the accepted transfers: two seeds shared 49 % of the transfers accepted at transfer q 0.01 (66 k vs 96 k accepted) and 82 % at 0.05 (11 % of the accepted set lost). The transfer classifier is one GBDT per fold trained on a 2.8 M-row sample of 359 M rows (held-out AUC 0.655).Root cause (one variable at a time, 3 seeds each, 500 runs)
Change
--transfer-modelsGBDTs (hidden flag, default 8, 1–64), each trained on its own hashed sample with its own seed.--transfer-models 1reproduces the single model exactly. The identified-row classifier is unchanged.neighbour_donor_rate: the share of the 50 runs most similar to the transfer's run (Jaccard index of the target entries each run identified) that identified the precursor. It uses donor runs only, is computed the same way for target and decoy precursors, and never counts the row's own run, so a pseudo-transfer does not see its own identification.Results
500 runs, 3 seeds (42, 1, 7), mean pairwise Jaccard of the accepted (precursor, run) transfer sets and accepted counts:
Validation counts at 500 runs: pseudo-transfers accepted at q 0.05 rise from 26.5 % to 38.9 % at a wrong-peak rate of 4.3 % (4.0 % before); identity decoys accepted at q 0.05 are 0.24 % of the accepted transfers (0.14–0.19 % before; the pooled estimate counts them), and 0–2 at q 0.01.
Six-run LFQ benchmark (HYE, and HYE + 1:1 entrapment), default seed: precursors in at least 3 runs, median |log2 error|, E. coli error, CV and the four abundance quartiles are within ±0.1 % of the parent branch at q 0.01 and 0.05 (62,813 vs 62,797 precursors at q 0.01; 68,026 vs 68,017 at q 0.05). Entrapment-measured FDP of transferred rows 0.25 % vs 0.24 % at q 0.01 (93 vs 88 entrapment rows of 71.4 k vs 70.7 k) and 0.40 % vs 0.39 % at q 0.05; identity-decoy estimate 0.254 % and 0.395 % (0.255 %, 0.394 % before). At six runs the neighbour rate is the donor count over 5 and gives the same trees (single model output byte-identical to the parent); the change there is the bagging: seed-to-seed lost transfers 4.5 % → 3.2 % at q 0.01.
Gate
cargo clippy --locked --workspace --all-targets -- -D warningsclean;cargo test --locked --release --workspace1727 passed, 0 failed. New tests: one member equals the single model, bagged score is the mean of the members, bagging keeps a synthetic mixture calibrated and steadier across seeds,TrainingSample::wants, finalize with 3 members reproducible across batchings with every row reported. The map-reduce equivalence test still checks the score cache byte for byte.Not done