[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EFKREMCJJV0KQWRWCBENT2":3,"skill-same:01M7EFKREMCJJV0KQWRWCBENT2":68},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7EFKREMCJJV0KQWRWCBENT2","bio-single-cell-perturb-seq",null,"Analyze Perturb-seq \u002F CROP-seq single-cell CRISPR screens. Use when assigning guides as a mixture problem, removing non-perturbed escaper cells with Mixscape, choosing a calibrated test (SCEPTRE conditional resampling) over naive DE, quantifying effect size with E-distance, separating compositional shifts from within-state expression change, or judging whether a perturbation-prediction foundation model actually beats a baseline.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-single-cell-perturb-seq\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: bio-single-cell-perturb-seq\ndescription: Analyze Perturb-seq \u002F CROP-seq single-cell CRISPR screens. Use when assigning guides as a mixture problem, removing non-perturbed escaper cells with Mixscape, choosing a calibrated test (SCEPTRE conditional resampling) over naive DE, quantifying effect size with E-distance, separating compositional shifts from within-state expression change, or judging whether a perturbation-prediction foundation model actually beats a baseline.\ntool_type: python\nprimary_tool: Pertpy\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"single-cell\u002Fperturb-seq\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: pertpy 0.9+, scanpy 1.10+, anndata 0.10+, sceptre 0.10+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n- R: `packageVersion('\u003Cpkg>')` then `?function_name` to verify parameters\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Perturb-seq Analysis\n\n**\"Analyze my Perturb-seq CRISPR screen\"** -> Assign guides, remove cells that received a guide but were not perturbed, test each perturbation with a calibrated method, and separate \"moves cells\" from \"changes cells\".\n- Python: `pertpy.pp.GuideAssignment`, `pertpy.tl.Mixscape`, `pertpy.tl.Distance`\u002F`DistanceTest`, `pertpy.tl.Milo`\u002F`Sccoda`\n- R: `sceptre` (conditional-resampling test), `Seurat` Mixscape, `scMAGeCK`\n\n## Governing Principle\n\nGuide assignment is a mixture problem, not a threshold. Each cell's per-guide UMI vector mixes true integration with ambient guide contamination (free transcripts, index hopping, doublets), and the ambient pool is structured: it is dominated by whichever guides are most abundant in the library, so a flat UMI cutoff preferentially mis-assigns cells to common guides and calls rare-guide cells negative. Call guides by a per-guide background\u002Fforeground mixture posterior, and report the perturbed fraction. MOI changes the meaning: low-MOI (~1 guide\u002Fcell) gives clean single-gene attribution but discards 70-90% of cells; high-MOI is for combinatorial designs but measures every single-gene effect in a co-perturbed background.\n\nAssignment is not effective perturbation. A cell can carry a guide yet be transcriptionally wild-type: incomplete CRISPR-KO editing, in-frame indels, escapers, or weak CRISPRi knockdown. The \"perturbed\" population is a mixture of truly perturbed and effectively-wild-type cells, which attenuates every effect-size estimate toward the null. Mixscape removes the non-perturbed cells via a local non-targeting-neighbor perturbation signature before testing. Deep caveat: an all-NP result is not evidence the gene is non-functional, because it is confounded with low guide efficiency; Mixscape cannot distinguish \"no phenotype\" from \"no editing\".\n\nNaive DE is miscalibrated by depth and pseudoreplication. The probability of detecting a guide covaries with sequencing depth, and depth also drives expression detection, so a plain Wilcoxon\u002FNB test between guide-positive and NT cells has inflated type-I error. SCEPTRE fixes this with conditional resampling: it models P(cell receives this guide | technical covariates incl. depth) and resamples the assignment to build a calibrated null, robust to misspecification of the expression model. Separately, treating thousands of cells from one transfection as independent replicates inflates significance (pseudoreplication, Squair 2021); the replication unit is the transfection, so pseudobulk-per-replicate is required for calibrated inference.\n\nE-distance is the modern effect-size. Energy distance in PCA space, `E = 2*sigma_between - sigma_within_X - sigma_within_Y`, measures separation magnitude (not direction or mechanism), with a permutation E-test. It is interpretable only relative to a fixed embedding and is not comparable across studies with different pipelines.\n\nSeparate the compositional shift from the within-state change. A perturbation can (a) shift the proportions of pre-existing cell states (differential abundance) without changing any state's program, or (b) change expression within a state (differential expression). A perturbation that only redistributes cells produces a large pseudobulk \"DE signature\" that is entirely a composition artifact. These need different tools and answer different questions; report both.\n\n## Guide Assignment: Mixture vs Threshold\n\n| Method | Model | Use when | Fails when |\n|---|---|---|---|\n| Mixture (posterior) | Per-guide 2-component mixture (background Poisson + foreground Gaussian); `pt.pp.GuideAssignment.assign_mixture_model` | Default; ambient varies by guide abundance; low and high MOI | Very few cells per guide (mixture unstable); verify against NT contamination floor |\n| Threshold | Flat UMI cutoff; `assign_by_threshold` | Quick sanity check, uniform high-signal libraries | Ambient scales with abundant guides -> mis-assigns to common guides, calls rare-guide cells negative |\n\nCell Ranger and Replogle's `guide_calling` fit mixtures on log counts; require a minimum dominant-guide UMI fraction, not just an absolute count, and gate doublets (they masquerade as combinatorial cells).\n\n## Method Decision Table (Testing and Effect Size)\n\n| Method | What it answers | Use when | Fails when |\n|---|---|---|---|\n| Mixscape (pertpy\u002FSeurat) | Which cells were effectively perturbed; per-perturbation DE after removing escapers | CRISPR-KO with heterogeneous editing; need escaper removal | All-NP confounded with low guide efficiency; KO posteriors not comparable across targets |\n| SCEPTRE | Calibrated perturbation-gene association | Rigorous testing under the depth confounder; element-level screens | Needs the assignment model roughly right; conservative by design |\n| scMAGeCK (LR \u002F RRA) | Per-gene effect across many genes; high-MOI deconvolution | Multi-guide cells; ridge-regression effect estimates | NEGCTRL choice defines the null; runs on scale.data so covariates propagate |\n| E-distance + E-test (pertpy) | Effect-size magnitude; perturbation similarity | Ranking\u002Fclustering perturbations by how far they move cells | Embedding-dependent, not cross-study comparable; floored by permutation count |\n| Pseudobulk DE (DESeq2\u002FedgeR) | Average within-state program change | >=2-3 biological replicates per condition | One replicate per guide -> no valid inference; sum raw counts, not means |\n| Milo \u002F scCODA \u002F Augur | Differential abundance \u002F composition | \"Does the perturbation move cells across states?\" | Conflated with within-state DE if reported alone |\n\nVerify the current best-practice default and parameter names against the installed pertpy\u002Fsceptre docs before committing; the APIs drift across releases.\n\n## Foundation-Model Reality Check\n\nThis is settled as of 2026, not hype. scGPT, Geneformer, scFoundation, scBERT, UCE are pretrained with masked-expression objectives and learn the co-expression manifold of observational data; perturbation prediction is a causal\u002Finterventional question, and there is no theorem that co-expression transfers to intervention. The empirical result across benchmarks: none reliably beat trivial baselines on unseen perturbations (Ahlmann-Eltze 2025; Kernfeld 2025; Csendes 2025).\n- For unseen single perturbations, predicting the mean perturbed profile across training perturbations is hard to beat; for unseen doubles, an additive model (sum the two single effects) captures most variance because genetic interactions are the exception.\n- All-gene MSE\u002Fcorrelation is dominated by unchanged genes, so a \"predict no change\"\u002Fmean model scores deceptively high. Evaluate on DE genes against mean\u002Fadditive baselines.\n- Train-test leakage inflates reported success: random cell-level splits put the same perturbation in train and test. True generalization holds out entire perturbations (and ideally cell-type contexts), not random cells.\n\nThe defensible reviewer stance: demand whole-perturbation holdout, DE-gene metrics, and an explicit additive\u002Fmean baseline. Without these, a positive result is not credible.\n\n## Guide Assignment (pertpy)\n\n**Goal:** Call which guide each cell actually received using a mixture posterior, not a flat threshold.\n\n**Approach:** Fit a per-guide Poisson-Gaussian mixture to the guide-count modality and assign by posterior, allowing negative and multi-guide calls.\n\n```python\nimport pertpy as pt\nimport scanpy as sc\n\ngdo = mdata.mod['gdo']                       # guide-count modality (cells x guides)\ngdo.layers['counts'] = gdo.X.copy()\n\nga = pt.pp.GuideAssignment()\nga.assign_mixture_model(gdo, assigned_guides_key='assigned_guide')   # background Poisson + foreground Gaussian\n# Inspect NT\u002Fabundant-guide UMI distributions as a contamination floor before trusting calls\nga.plot_heatmap(gdo, layer='counts')\n```\n\n## Mixscape: Remove Non-Perturbed Escapers (pertpy)\n\n**Goal:** Separate effectively-perturbed (KO) from non-perturbed (NP) cells before any DE.\n\n**Approach:** Build a local perturbation signature by subtracting each cell's NT neighbors, then fit a per-target 2-component mixture to classify cells; drop NP cells.\n\n```python\nms = pt.tl.Mixscape()\nms.perturbation_signature(adata, pert_key='perturbation', control='NT', n_neighbors=20)   # pert_key here = the broad perturbed-vs-control column\nms.mixscape(adata, pert_key='target_gene', control='NT', layer='X_pert')   # pert_key here = the per-target column (intentionally different); renamed from labels; writes adata.obs['mixscape_class_global'] KO\u002FNP\u002FNT\n# An all-NP target is confounded with low guide efficiency: report perturbed fraction, do not call the gene non-functional\nadata.obs['mixscape_class_global'].value_counts()\n```\n\n## E-distance and the E-test (pertpy)\n\n**Goal:** Quantify how far each perturbation moves cells and test it against a permutation null.\n\n**Approach:** Compute energy distance in a fixed PCA embedding; pin the embedding and metric, and run the permutation E-test against the control.\n\n```python\nsc.pp.pca(adata, n_comps=50)\ndist = pt.tl.Distance(metric='edistance', obsm_key='X_pca')   # pin obsm; sqeuclidean vs euclidean default changed across versions\npairwise = dist.pairwise(adata, groupby='target_gene')\n\netest = pt.tl.DistanceTest('edistance', n_perms=1000)         # smallest p ~ 1\u002F(n_perms+1); crushed by multiple testing\nresults = etest(adata, groupby='target_gene', contrast='NT')\n```\n\n## SCEPTRE: Calibrated Testing (R)\n\n**Goal:** Test perturbation-gene associations with calibration verified on the data itself.\n\n**Approach:** Import counts and guide matrices, set parameters, assign guides by mixture, then run the calibration check (negative controls) before the discovery analysis.\n\n```r\nlibrary(sceptre)\n\nobj \u003C- import_data(response_matrix = rna_counts, grna_matrix = grna_counts,\n                   grna_target_data_frame = grna_targets, moi = 'low')\nobj \u003C- set_analysis_parameters(obj, discovery_pairs = pairs)\nobj \u003C- assign_grnas(obj, method = 'mixture')        # mixture | thresholding | maximum\nobj \u003C- run_qc(obj)\nobj \u003C- run_calibration_check(obj)                   # negative-control pairs must be well-calibrated FIRST\nobj \u003C- run_discovery_analysis(obj)\nresults \u003C- get_result(obj, analysis = 'discovery_analysis')\n```\n\n## Pseudobulk DE (Within-State Change)\n\n**Goal:** Test the average program change per perturbation with valid biological replication.\n\n**Approach:** Sum RAW counts per (target gene, replicate), filter tiny pseudobulk samples, then run DESeq2\u002FedgeR; this respects the replication unit and avoids pseudoreplication.\n\n```python\nimport pertpy as pt\n\nadata.layers['counts'] = adata.layers.get('counts', adata.X.copy())   # stash RAW counts before any log1p\npb = pt.tl.PseudobulkSpace()\npdata = pb.compute(adata, target_col='target_gene', groups_col='replicate', layer_key='counts', mode='sum')   # sum RAW counts, not .X (log-normalized)\n# Drop pseudobulk samples below ~10 cells (verify the per-sample cell-count obs column name with help(pb.compute))\n# Hand pdata to pertpy EdgeR \u002F pydeseq2 with design ~ replicate + target_gene; needs >=2-3 replicates per condition\n```\n\nOne transfection per guide means no valid biological-replicate inference exists; using guides targeting the same gene as pseudo-replicates partially helps but conflates guide-specific off-targets.\n\n## Compositional vs Expression (Separate the Questions)\n\n**Goal:** Decide whether a perturbation moves cells across states or changes a state's program.\n\n**Approach:** Run a differential-abundance test (Milo neighborhoods or scCODA) for composition, and report it alongside the within-state pseudobulk DE.\n\n```python\nmilo = pt.tl.Milo()\nmdata_milo = milo.load(adata)\nmilo.make_nhoods(mdata_milo['rna'])\nmilo.count_nhoods(mdata_milo, sample_col='replicate')\nmilo.da_nhoods(mdata_milo, design='~ target_gene')   # differential abundance: does the perturbation shift proportions?\n```\n\n## Common Errors\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| Rare-guide cells called negative | Flat UMI threshold; ambient biased to abundant guides | Mixture-model assignment by posterior; require a dominant-guide UMI fraction |\n| Effect sizes weaker than expected | Escapers\u002Fincomplete KO dilute the perturbed population | Run Mixscape, remove NP cells, report perturbed fraction |\n| \"Gene is non-functional\" from all-NP | All-NP confounds no-phenotype with no-editing | Do not claim non-functional; check guide efficiency independently |\n| Hundreds of \"significant\" hits | Naive Wilcoxon\u002FNB miscalibrated by depth + pseudoreplication | SCEPTRE conditional resampling; pseudobulk-per-replicate DE |\n| Huge DE signature but no program change | Perturbation only redistributes cells across states | Run Milo\u002FscCODA; attribute the signal to composition |\n| E-distances disagree with another paper | Embedding\u002Fmetric\u002FPC count differ; default metric changed | Pin pertpy version, obsm key, and cell_wise_metric; do not cross-compare |\n| Combinatorial cells everywhere | Doublets masquerade as multi-guide | Gate doublets (Scrublet\u002FscDblFinder) before multi-guide analysis |\n| Foundation model \"beats\" baselines | Cell-level split leakage; all-gene metric hides failure | Hold out whole perturbations; score DE genes vs additive\u002Fmean baseline |\n\n## Related Skills\n\n- single-cell\u002Fpreprocessing - scRNA-seq QC and normalization upstream of the screen\n- single-cell\u002Fdoublet-detection - gating doublets before multi-guide analysis\n- single-cell\u002Fmarkers-annotation - interpreting per-perturbation DE genes\n- single-cell\u002Fdifferential-abundance - compositional shift testing (Milo\u002FscCODA) for perturbations that change cell-state proportions\n- single-cell\u002Fbatch-integration - multi-sample\u002Freplicate integration\n- crispr-screens\u002Fmageck-analysis - bulk CRISPR screen analysis (MAGeCK RRA\u002FMLE)\n- crispr-screens\u002Fperturb-seq-analysis - related single-cell CRISPR screen workflow\n- differential-expression\u002Fdeseq2-basics - pseudobulk DESeq2 testing on summed counts\n- pathway-analysis\u002Fgo-enrichment - pathway interpretation of perturbation signatures\n\n## References\n\nDixit A, Parnas O, Li B, et al. Perturb-Seq: dissecting molecular circuits with scalable single-cell RNA profiling of pooled genetic screens. Cell 167(7):1853-1866 (2016).\nDatlinger P, Rendeiro AF, Schmidl C, et al. Pooled CRISPR screening with single-cell transcriptome readout (CROP-seq). Nat Methods 14(3):297-301 (2017).\nReplogle JM, Norman TM, Xu A, et al. Combinatorial single-cell CRISPR screens by direct guide RNA capture and targeted sequencing. Nat Biotechnol 38(8):954-961 (2020).\nPapalexi E, Mimitou EP, Butler AW, et al. Characterizing the molecular regulation of inhibitory immune checkpoints with multimodal single-cell screens (Mixscape). Nat Genet 53(3):322-331 (2021).\nYang L, Zhu Y, Yu H, et al. scMAGeCK links genotypes with multiple phenotypes in single-cell CRISPR screens. Genome Biol 21:19 (2020).\nBarry T, Wang X, Morris JA, Roeder K, Katsevich E. SCEPTRE improves calibration and sensitivity in single-cell CRISPR screen analysis. Genome Biol 22:344 (2021).\nSquair JW, Gautier M, Kathe C, et al. Confronting false discoveries in single-cell differential expression. Nat Commun 12:5692 (2021).\nPeidli S, Green TD, Shen C, et al. scPerturb: harmonized single-cell perturbation data (E-distance). Nat Methods 21(3):531-540 (2024).\nHeumos L, Ji Y, May L, et al. Pertpy: an end-to-end framework for perturbation analysis. Nat Methods 23(2):350-359 (2026).\nDann E, Henderson NC, Teichmann SA, Morgan MD, Marioni JC. Differential abundance testing on single-cell data using k-nearest neighbor graphs (Milo). Nat Biotechnol 40(2):245-253 (2022).\nAhlmann-Eltze C, Huber W, Anders S. Deep-learning-based gene perturbation effect prediction does not yet outperform simple linear baselines. Nat Methods 22(8):1657-1661 (2025).\nKernfeld E, Yang Y, Weinstock JS, et al. A comparison of computational methods for expression forecasting. Genome Biol 26:388 (2025).\nCsendes G, et al. Benchmarking foundation cell models for post-perturbation RNA-seq prediction. BMC Genomics 26:393 (2025).\n","## Version Compatibility\n\nReference examples tested with: pertpy 0.9+, scanpy 1.10+, anndata 0.10+, sceptre 0.10+\n\nBefore using code patterns, verify installed versions match. If versions differ:\n- Python: `pip show \u003Cpackage>` then `help(module.function)` to check signatures\n- R: `packageVersion('\u003Cpkg>')` then `?function_name` to verify parameters\n\nIf code throws ImportError, AttributeError, or TypeError, introspect the installed\npackage and adapt the example to match the actual API rather than retrying.\n\n# Perturb-seq Analysis\n\n**\"Analyze my Perturb-seq CRISPR screen\"** -> Assign guides, remove cells that received a guide but were not perturbed, test each perturbation with a calibrated method, and separate \"moves cells\" from \"changes cells\".\n- Python: `pertpy.pp.GuideAssignment`, `pertpy.tl.Mixscape`, `pertpy.tl.Distance`\u002F`DistanceTest`, `pertpy.tl.Milo`\u002F`Sccoda`\n- R: `sceptre` (conditional-resampling test), `Seurat` Mixscape, `scMAGeCK`\n\n## Governing Principle\n\nGuide assignment is a mixture problem, not a threshold. Each cell's per-guide UMI vector mixes true integration with ambient guide contamination (free transcripts, index hopping, doublets), and the ambient pool is structured: it is dominated by whichever guides are most abundant in the library, so a flat UMI cutoff preferentially mis-assigns cells to common guides and calls rare-guide cells negative. Call guides by a per-guide background\u002Fforeground mixture posterior, and report the perturbed fraction. MOI changes the meaning: low-MOI (~1 guide\u002Fcell) gives clean single-gene attribution but discards 70-90% of cells; high-MOI is for combinatorial designs but measures every single-gene effect in a co-perturbed background.\n\nAssignment is not effective perturbation. A cell can carry a guide yet be transcriptionally wild-type: incomplete CRISPR-KO editing, in-frame indels, escapers, or weak CRISPRi knockdown. The \"perturbed\" population is a mixture of truly perturbed and effectively-wild-type cells, which attenuates every effect-size estimate toward the null. Mixscape removes the non-perturbed cells via a local non-targeting-neighbor perturbation signature before testing. Deep caveat: an all-NP result is not evidence the gene is non-functional, because it is confounded with low guide efficiency; Mixscape cannot distinguish \"no phenotype\" from \"no editing\".\n\nNaive DE is miscalibrated by depth and pseudoreplication. The probability of detecting a guide covaries with sequencing depth, and depth also drives expression detection, so a plain Wilcoxon\u002FNB test between guide-positive and NT cells has inflated type-I error. SCEPTRE fixes this with conditional resampling: it models P(cell receives this guide | technical covariates incl. depth) and resamples the assignment to build a calibrated null, robust to misspecification of the expression model. Separately, treating thousands of cells from one transfection as independent replicates inflates significance (pseudoreplication, Squair 2021); the replication unit is the transfection, so pseudobulk-per-replicate is required for calibrated inference.\n\nE-distance is the modern effect-size. Energy distance in PCA space, `E = 2*sigma_between - sigma_within_X - sigma_within_Y`, measures separation magnitude (not direction or mechanism), with a permutation E-test. It is interpretable only relative to a fixed embedding and is not comparable across studies with different pipelines.\n\nSeparate the compositional shift from the within-state change. A perturbation can (a) shift the proportions of pre-existing cell states (differential abundance) without changing any state's program, or (b) change expression within a state (differential expression). A perturbation that only redistributes cells produces a large pseudobulk \"DE signature\" that is entirely a composition artifact. These need different tools and answer different questions; report both.\n\n## Guide Assignment: Mixture vs Threshold\n\n| Method | Model | Use when | Fails when |\n|---|---|---|---|\n| Mixture (posterior) | Per-guide 2-component mixture (background Poisson + foreground Gaussian); `pt.pp.GuideAssignment.assign_mixture_model` | Default; ambient varies by guide abundance; low and high MOI | Very few cells per guide (mixture unstable); verify against NT contamination floor |\n| Threshold | Flat UMI cutoff; `assign_by_threshold` | Quick sanity check, uniform high-signal libraries | Ambient scales with abundant guides -> mis-assigns to common guides, calls rare-guide cells negative |\n\nCell Ranger and Replogle's `guide_calling` fit mixtures on log counts; require a minimum dominant-guide UMI fraction, not just an absolute count, and gate doublets (they masquerade as combinatorial cells).\n\n## Method Decision Table (Testing and Effect Size)\n\n| Method | What it answers | Use when | Fails when |\n|---|---|---|---|\n| Mixscape (pertpy\u002FSeurat) | Which cells were effectively perturbed; per-perturbation DE after removing escapers | CRISPR-KO with heterogeneous editing; need escaper removal | All-NP confounded with low guide efficiency; KO posteriors not comparable across targets |\n| SCEPTRE | Calibrated perturbation-gene association | Rigorous testing under the depth confounder; element-level screens | Needs the assignment model roughly right; conservative by design |\n| scMAGeCK (LR \u002F RRA) | Per-gene effect across many genes; high-MOI deconvolution | Multi-guide cells; ridge-regression effect estimates | NEGCTRL choice defines the null; runs on scale.data so covariates propagate |\n| E-distance + E-test (pertpy) | Effect-size magnitude; perturbation similarity | Ranking\u002Fclustering perturbations by how far they move cells | Embedding-dependent, not cross-study comparable; floored by permutation count |\n| Pseudobulk DE (DESeq2\u002FedgeR) | Average within-state program change | >=2-3 biological replicates per condition | One replicate per guide -> no valid inference; sum raw counts, not means |\n| Milo \u002F scCODA \u002F Augur | Differential abundance \u002F composition | \"Does the perturbation move cells across states?\" | Conflated with within-state DE if reported alone |\n\nVerify the current best-practice default and parameter names against the installed pertpy\u002Fsceptre docs before committing; the APIs drift across releases.\n\n## Foundation-Model Reality Check\n\nThis is settled as of 2026, not hype. scGPT, Geneformer, scFoundation, scBERT, UCE are pretrained with masked-expression objectives and learn the co-expression manifold of observational data; perturbation prediction is a causal\u002Finterventional question, and there is no theorem that co-expression transfers to intervention. The empirical result across benchmarks: none reliably beat trivial baselines on unseen perturbations (Ahlmann-Eltze 2025; Kernfeld 2025; Csendes 2025).\n- For unseen single perturbations, predicting the mean perturbed profile across training perturbations is hard to beat; for unseen doubles, an additive model (sum the two single effects) captures most variance because genetic interactions are the exception.\n- All-gene MSE\u002Fcorrelation is dominated by unchanged genes, so a \"predict no change\"\u002Fmean model scores deceptively high. Evaluate on DE genes against mean\u002Fadditive baselines.\n- Train-test leakage inflates reported success: random cell-level splits put the same perturbation in train and test. True generalization holds out entire perturbations (and ideally cell-type contexts), not random cells.\n\nThe defensible reviewer stance: demand whole-perturbation holdout, DE-gene metrics, and an explicit additive\u002Fmean baseline. Without these, a positive result is not credible.\n\n## Guide Assignment (pertpy)\n\n**Goal:** Call which guide each cell actually received using a mixture posterior, not a flat threshold.\n\n**Approach:** Fit a per-guide Poisson-Gaussian mixture to the guide-count modality and assign by posterior, allowing negative and multi-guide calls.\n\n```python\nimport pertpy as pt\nimport scanpy as sc\n\ngdo = mdata.mod['gdo']                       # guide-count modality (cells x guides)\ngdo.layers['counts'] = gdo.X.copy()\n\nga = pt.pp.GuideAssignment()\nga.assign_mixture_model(gdo, assigned_guides_key='assigned_guide')   # background Poisson + foreground Gaussian\n# Inspect NT\u002Fabundant-guide UMI distributions as a contamination floor before trusting calls\nga.plot_heatmap(gdo, layer='counts')\n```\n\n## Mixscape: Remove Non-Perturbed Escapers (pertpy)\n\n**Goal:** Separate effectively-perturbed (KO) from non-perturbed (NP) cells before any DE.\n\n**Approach:** Build a local perturbation signature by subtracting each cell's NT neighbors, then fit a per-target 2-component mixture to classify cells; drop NP cells.\n\n```python\nms = pt.tl.Mixscape()\nms.perturbation_signature(adata, pert_key='perturbation', control='NT', n_neighbors=20)   # pert_key here = the broad perturbed-vs-control column\nms.mixscape(adata, pert_key='target_gene', control='NT', layer='X_pert')   # pert_key here = the per-target column (intentionally different); renamed from labels; writes adata.obs['mixscape_class_global'] KO\u002FNP\u002FNT\n# An all-NP target is confounded with low guide efficiency: report perturbed fraction, do not call the gene non-functional\nadata.obs['mixscape_class_global'].value_counts()\n```\n\n## E-distance and the E-test (pertpy)\n\n**Goal:** Quantify how far each perturbation moves cells and test it against a permutation null.\n\n**Approach:** Compute energy distance in a fixed PCA embedding; pin the embedding and metric, and run the permutation E-test against the control.\n\n```python\nsc.pp.pca(adata, n_comps=50)\ndist = pt.tl.Distance(metric='edistance', obsm_key='X_pca')   # pin obsm; sqeuclidean vs euclidean default changed across versions\npairwise = dist.pairwise(adata, groupby='target_gene')\n\netest = pt.tl.DistanceTest('edistance', n_perms=1000)         # smallest p ~ 1\u002F(n_perms+1); crushed by multiple testing\nresults = etest(adata, groupby='target_gene', contrast='NT')\n```\n\n## SCEPTRE: Calibrated Testing (R)\n\n**Goal:** Test perturbation-gene associations with calibration verified on the data itself.\n\n**Approach:** Import counts and guide matrices, set parameters, assign guides by mixture, then run the calibration check (negative controls) before the discovery analysis.\n\n```r\nlibrary(sceptre)\n\nobj \u003C- import_data(response_matrix = rna_counts, grna_matrix = grna_counts,\n                   grna_target_data_frame = grna_targets, moi = 'low')\nobj \u003C- set_analysis_parameters(obj, discovery_pairs = pairs)\nobj \u003C- assign_grnas(obj, method = 'mixture')        # mixture | thresholding | maximum\nobj \u003C- run_qc(obj)\nobj \u003C- run_calibration_check(obj)                   # negative-control pairs must be well-calibrated FIRST\nobj \u003C- run_discovery_analysis(obj)\nresults \u003C- get_result(obj, analysis = 'discovery_analysis')\n```\n\n## Pseudobulk DE (Within-State Change)\n\n**Goal:** Test the average program change per perturbation with valid biological replication.\n\n**Approach:** Sum RAW counts per (target gene, replicate), filter tiny pseudobulk samples, then run DESeq2\u002FedgeR; this respects the replication unit and avoids pseudoreplication.\n\n```python\nimport pertpy as pt\n\nadata.layers['counts'] = adata.layers.get('counts', adata.X.copy())   # stash RAW counts before any log1p\npb = pt.tl.PseudobulkSpace()\npdata = pb.compute(adata, target_col='target_gene', groups_col='replicate', layer_key='counts', mode='sum')   # sum RAW counts, not .X (log-normalized)\n# Drop pseudobulk samples below ~10 cells (verify the per-sample cell-count obs column name with help(pb.compute))\n# Hand pdata to pertpy EdgeR \u002F pydeseq2 with design ~ replicate + target_gene; needs >=2-3 replicates per condition\n```\n\nOne transfection per guide means no valid biological-replicate inference exists; using guides targeting the same gene as pseudo-replicates partially helps but conflates guide-specific off-targets.\n\n## Compositional vs Expression (Separate the Questions)\n\n**Goal:** Decide whether a perturbation moves cells across states or changes a state's program.\n\n**Approach:** Run a differential-abundance test (Milo neighborhoods or scCODA) for composition, and report it alongside the within-state pseudobulk DE.\n\n```python\nmilo = pt.tl.Milo()\nmdata_milo = milo.load(adata)\nmilo.make_nhoods(mdata_milo['rna'])\nmilo.count_nhoods(mdata_milo, sample_col='replicate')\nmilo.da_nhoods(mdata_milo, design='~ target_gene')   # differential abundance: does the perturbation shift proportions?\n```\n\n## Common Errors\n\n| Symptom | Cause | Fix |\n|---|---|---|\n| Rare-guide cells called negative | Flat UMI threshold; ambient biased to abundant guides | Mixture-model assignment by posterior; require a dominant-guide UMI fraction |\n| Effect sizes weaker than expected | Escapers\u002Fincomplete KO dilute the perturbed population | Run Mixscape, remove NP cells, report perturbed fraction |\n| \"Gene is non-functional\" from all-NP | All-NP confounds no-phenotype with no-editing | Do not claim non-functional; check guide efficiency independently |\n| Hundreds of \"significant\" hits | Naive Wilcoxon\u002FNB miscalibrated by depth + pseudoreplication | SCEPTRE conditional resampling; pseudobulk-per-replicate DE |\n| Huge DE signature but no program change | Perturbation only redistributes cells across states | Run Milo\u002FscCODA; attribute the signal to composition |\n| E-distances disagree with another paper | Embedding\u002Fmetric\u002FPC count differ; default metric changed | Pin pertpy version, obsm key, and cell_wise_metric; do not cross-compare |\n| Combinatorial cells everywhere | Doublets masquerade as multi-guide | Gate doublets (Scrublet\u002FscDblFinder) before multi-guide analysis |\n| Foundation model \"beats\" baselines | Cell-level split leakage; all-gene metric hides failure | Hold out whole perturbations; score DE genes vs additive\u002Fmean baseline |\n\n## Related Skills\n\n- single-cell\u002Fpreprocessing - scRNA-seq QC and normalization upstream of the screen\n- single-cell\u002Fdoublet-detection - gating doublets before multi-guide analysis\n- single-cell\u002Fmarkers-annotation - interpreting per-perturbation DE genes\n- single-cell\u002Fdifferential-abundance - compositional shift testing (Milo\u002FscCODA) for perturbations that change cell-state proportions\n- single-cell\u002Fbatch-integration - multi-sample\u002Freplicate integration\n- crispr-screens\u002Fmageck-analysis - bulk CRISPR screen analysis (MAGeCK RRA\u002FMLE)\n- crispr-screens\u002Fperturb-seq-analysis - related single-cell CRISPR screen workflow\n- differential-expression\u002Fdeseq2-basics - pseudobulk DESeq2 testing on summed counts\n- pathway-analysis\u002Fgo-enrichment - pathway interpretation of perturbation signatures\n\n## References\n\nDixit A, Parnas O, Li B, et al. Perturb-Seq: dissecting molecular circuits with scalable single-cell RNA profiling of pooled genetic screens. Cell 167(7):1853-1866 (2016).\nDatlinger P, Rendeiro AF, Schmidl C, et al. Pooled CRISPR screening with single-cell transcriptome readout (CROP-seq). Nat Methods 14(3):297-301 (2017).\nReplogle JM, Norman TM, Xu A, et al. Combinatorial single-cell CRISPR screens by direct guide RNA capture and targeted sequencing. Nat Biotechnol 38(8):954-961 (2020).\nPapalexi E, Mimitou EP, Butler AW, et al. Characterizing the molecular regulation of inhibitory immune checkpoints with multimodal single-cell screens (Mixscape). Nat Genet 53(3):322-331 (2021).\nYang L, Zhu Y, Yu H, et al. scMAGeCK links genotypes with multiple phenotypes in single-cell CRISPR screens. Genome Biol 21:19 (2020).\nBarry T, Wang X, Morris JA, Roeder K, Katsevich E. SCEPTRE improves calibration and sensitivity in single-cell CRISPR screen analysis. Genome Biol 22:344 (2021).\nSquair JW, Gautier M, Kathe C, et al. Confronting false discoveries in single-cell differential expression. Nat Commun 12:5692 (2021).\nPeidli S, Green TD, Shen C, et al. scPerturb: harmonized single-cell perturbation data (E-distance). Nat Methods 21(3):531-540 (2024).\nHeumos L, Ji Y, May L, et al. Pertpy: an end-to-end framework for perturbation analysis. Nat Methods 23(2):350-359 (2026).\nDann E, Henderson NC, Teichmann SA, Morgan MD, Marioni JC. Differential abundance testing on single-cell data using k-nearest neighbor graphs (Milo). Nat Biotechnol 40(2):245-253 (2022).\nAhlmann-Eltze C, Huber W, Anders S. Deep-learning-based gene perturbation effect prediction does not yet outperform simple linear baselines. Nat Methods 22(8):1657-1661 (2025).\nKernfeld E, Yang Y, Weinstock JS, et al. A comparison of computational methods for expression forecasting. Genome Biol 26:388 (2025).\nCsendes G, et al. Benchmarking foundation cell models for post-perturbation RNA-seq prediction. BMC Genomics 26:393 (2025).\n",{"name":5,"source":24,"license":15,"tool_type":25,"description":7,"imported_at":26,"source_path":27,"primary_tool":28,"source_repository":29},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills","python","2026-09-20","single-cell\u002Fperturb-seq\u002FSKILL.md","Pertpy","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fbiology\u002Fbio-single-cell-perturb-seq","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-single-cell-perturb-seq",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-single-cell-perturb-seq",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-single-cell-perturb-seq","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-single-cell-perturb-seq\u002FSKILL.md",true,[50,56,62],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fmixscape_analysis.R","OTHER","其他",1566,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-single-cell-perturb-seq\u002Fexamples\u002Fmixscape_analysis.R",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"examples\u002Fpertpy_analysis.py","SCRIPT","脚本",1737,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-single-cell-perturb-seq\u002Fexamples\u002Fpertpy_analysis.py",{"path":63,"resourceType":64,"resourceTypeDesc":65,"sizeBytes":66,"sourceHtmlUrl":67},"usage-guide.md","REFERENCE","参考文档",5863,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fbiology\u002Fbio-single-cell-perturb-seq\u002Fusage-guide.md",[69,77,84,91,98,105],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":76},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],"2026-11-16 10:05:34",{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":76},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":76},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":76},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":76},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":76},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]