Decision-grade batch correction for pooled CRISPR screens. Covers diagnosis (PCA + variance decomposition to decide whether batch dominates), the four primary correction strategies (ComBat empirical-Bayes, RUV, SVA, NTC-anchored normalization), the model-based alternative of including batch as a MAGeCK MLE / Chronos covariate (preferred for hit calling), screen-specific batch sources (cell-passage cohort, library lot, infection day, sequencing run, FBS lot, Cas9 lot), and the failure modes when correction destroys biology.
pip install combat # provides combat.pycombat; PyPI 'pycombat' is a different project pandas numpy scipy scikit-learn matplotlib seaborn
conda install -c bioconda mageck # not on PyPI
# R (for SVA, RUVSeq, limma)
R -e "BiocManager::install(c('sva', 'RUVSeq', 'limma'))"
Required inputs: count matrix (rows=sgRNA, columns=samples), metadata table with at least batch, condition, and replicate columns, and (for NTC-anchored norm) a list of non-targeting control sgRNAs.
Tell the AI agent what to do: - "Diagnose batch effects in my screen: PCA, variance decomposition, is correction needed?" - "Apply ComBat correction with biological_covariate=condition; verify PR-AUC is preserved post-correction" - "Add batch as a covariate to MAGeCK MLE design matrix instead of pre-correcting" - "Compare ComBat vs NTC-anchored normalization on my multi-batch screen" - "Decide if I should correct or redesign because batch is fully confounded with condition"
"Run PCA on my multi-batch screen colored by batch and condition. Compute F-statistics for batch and condition in each PC. Decide whether batch dominates (correction needed) or condition dominates (no correction needed)."
"Replicate Pearson within batches is 0.95+ but across-batch is 0.78. Confirm batch effects are present; recommend ComBat vs NTC-anchored vs covariate modeling."
"Check whether batch is confounded with condition. If yes (e.g., all drug arm in batch 2), correction will destroy biology -- explicit covariate modeling required instead."
"Apply ComBat to log10(counts+1) with biological_covariate=condition. Verify post-correction PCA shows batches overlap and CEGv2 PR-AUC is preserved."
"Compare ComBat with mod (biological covariate) vs without. Quantify how much biological signal is preserved in each case."
"Build a MAGeCK MLE design matrix with explicit batch indicator columns. Run mageck mle on the multi-batch screen and report per-condition beta scores after batch adjustment. Compare to ComBat-then-MAGeCK approach."
"Add SVA-discovered latent factors as covariates in MAGeCK MLE design matrix to capture unknown batch confounders."
"Use the 800 non-targeting controls in my library as normalization anchor. Scale each sample so NTC median = 1000. Then run hit calling on NTC-anchored counts."
"I have 12 cancer cell lines screened across 4 batches. Switch to Chronos (built-in batch + CN modeling) instead of ComBat + MAGeCK; explain why this is preferred."
"After ComBat, my essentialome PR-AUC dropped from 0.78 to 0.41. Diagnose: did ComBat eliminate biological signal? Re-run with mod covariate or revert and use MLE-with-batch-covariate."
mod.| Diagnostic finding | Action |
|---|---|
| PC1 batch F >> condition F | Apply ComBat with mod |
| Batch ⊥ condition | ComBat or MLE-with-covariate |
| Batch fully ⊆ condition | Redesign or only MLE-with-covariate |
| Multi-cell-line cancer | Chronos (preferred) |
| Multi-screen with same library | JACKS (joint efficacy) |
| Day-0 separates by batch but endpoint doesn't | Pre-screen technical bias; ComBat |
| Endpoint separates by batch but Day-0 doesn't | Selection-driven (FBS, drug lot); covariate model |
| <3 samples per batch | Cannot estimate batch; use covariate or redesign |
After applying correction: - [ ] PCA: batches now overlap (visual) - [ ] Within-batch Pearson preserved (should be unchanged) - [ ] Across-batch Pearson improved - [ ] CEGv2 PR-AUC preserved or higher - [ ] NTC distribution stable across batches - [ ] No new outlier samples introduced