CRISPR Screen Analyzer

MAGeCK pooled-screen analysis

by K-Dense-AI · MIT license · ★ 45,977 on GitHub · updated Sep 21

MAGeCK pooled-screen analysis cover

Analyzes pooled CRISPR screen FASTQ reads and guide-count matrices with MAGeCK, validates guide libraries and contrasts, measures replicate and library QC, and produces gene hit rankings with effect sizes and FDR. Use for new knockout,…

---
name: mageck
description: Analyzes pooled CRISPR screen FASTQ reads and guide-count matrices with MAGeCK, validates guide libraries and contrasts, measures replicate and library QC, and produces gene hit rankings with effect sizes and FDR. Use for new knockout, CRISPRi, or CRISPRa screen analysis, enrichment or depletion contrasts, and MAGeCK count/test workflows; existing public dependency-score lookup belongs to DepMap.
license: MIT
compatibility: Requires Python 3.10+ for the helper and MAGeCK 0.5.9.5 with its compiled RRA executable for analysis. Tested runtime uses Python 3.11, NumPy 1.26.4 and SciPy 1.13.1. Source installation needs a C++ compiler; network is needed only for installation. No credentials.
metadata:
  version: "1.1"
  skill-author: K-Dense Inc.
  upstream-version: "0.5.9.5"
  last-reviewed: "2026-10-01"
---

# MAGeCK pooled-screen analysis

## When to use

Use this skill to count existing sequencing reads against a supplied guide library or compare
already-counted pooled screens. Deliver the count matrix, QC, guide and gene results, contrast

Overview

Use this skill to count existing sequencing reads against a supplied guide library or compare already-counted pooled screens. Deliver the count matrix, QC, guide and gene results, contrast provenance, and a short interpretation of enrichment/depletion. This workflow analyzes screens; it does not design guides or infer gene function from a hit alone.

Manual install (npx, ZIP)
Claude Codenpx skills add K-Dense-AI/scientific-agent-skills --skill mageck -g -a claude-code
Claude Code (degit)npx degit K-Dense-AI/scientific-agent-skills/skills/mageck#main ~/.claude/skills/mageck
Claude.ai / desktopZip the folder and upload it under Settings → Capabilities → Skills.
Codex, Cursor, other agentsPoint them at SKILL.md. The other files are plain text.

Connects with Agent Alley MCP · agentalley.io/mcp

Files included

  • SKILL.md8.4 KB
Read SKILL.md here
K-Dense-AI/main1 file shown
SKILL.md
Show the full text125 lines

MAGeCK pooled-screen analysis

When to use

Use this skill to count existing sequencing reads against a supplied guide library or compare already-counted pooled screens. Deliver the count matrix, QC, guide and gene results, contrast provenance, and a short interpretation of enrichment/depletion. This workflow analyzes screens; it does not design guides or infer gene function from a hit alone.

Runtime

The tested source installation and external-runtime caveat are in references/runtime.md. Verify both mageck --version and mageck test --help before an analysis. The bundled Python helper is standard-library only. MAGeCK itself also needs NumPy, SciPy, and the RRA binary. PDF/R reporting is optional and not needed by the helper.

The official release directory still lists 0.5.9.5 as its latest MAGeCK release. Upstream now links the separate MAGeCK2 project; these commands and the helper target MAGeCK 0.5.9.5, not an interchangeable MAGeCK2 installation. This is a local CLI workflow with no service API or authentication.

Workflow

  1. Establish the library version, perturbation modality, sample names, selection direction, biological replicates, baseline material, time point, and batch. Separate sequencing lanes from independent biological replicates. A plasmid baseline and a cell day-zero baseline answer different questions. Require an explicit treatment/control contrast; the helper never silently assigns all unused samples to the control group.
  2. Validate a headerless TSV library containing guide ID, DNA sequence, gene. IDs and sequences must be unique. The helper requires a count-table header beginning sgRNA, Gene, followed by unique nonnumeric sample names such as c1. MAGeCK can interpret numeric names as column indices or count values; rename them before analysis. Guide/gene IDs must have no whitespace. The helper rejects ambiguous sequences and any count/library ID or gene mismatch; resolve intentional multi-target guides explicitly upstream. These are deliberate helper restrictions; native MAGeCK also accepts other input variants.
  3. For FASTQ, inspect read structure and known guide sequences to establish trimming and orientation. Use MAGeCK count, with one space-separated argument per biological sample; comma-join lanes only when they are technical replicates of that same sample. Preserve unmapped-read and count-summary evidence when mapping is poor. A zero-count guide remains in the library; do not drop it to improve QC.
  4. Run QC before statistical testing. Review library representation, median reads per guide, zero fractions, Gini coefficients, and within-condition replicate correlations. The helper's 10% zero and 0.8 correlation flags are review prompts, not universal acceptance thresholds. High correlation can coexist with systematic artifacts. Read depth is not experimental cell coverage. The helper uses a raw-count population Gini; MAGeCK's native count-summary Gini uses log(count + 1) with a finite-sample correction. Do not compare their values or thresholds as the same statistic.
  5. Choose normalization based on the screen. Median normalization assumes most guides are stable. For a strong global shift, supplied validated negative-control guides may support --normalization control. These must be guide IDs, one per line; a gene list is not interchangeable. Biological control samples and negative-control guides serve different roles. At least two controls must be present, and every guide assigned to a control gene must be designated a control. Supplying --control-guides also changes the RRA null distribution, even with median normalization. Record their origin and check their count distribution. MAGeCK 0.5.9.5 switches median normalization to total-count scaling for a zero median or more than 45% zero guides in any selected sample; for control normalization it evaluates the control-guide subset. Check the report's applied method, size factors, and warnings.
  6. Use test for a two-group comparison. --paired requires both lists in corresponding biological order and equal length; matching lengths alone do not establish pairing. The helper reports genes at the requested FDR in both directions and retains full rankings. For a multi-factor design, see references/design.md; do not collapse batches or time courses into an unjustified two-group test.
  7. Inspect guide concordance for leading genes, essential-gene recovery where appropriate, negative controls, replicate consistency, and copy-number artifacts in nuclease knockout screens. Report effect sizes alongside FDR. An enriched guide can indicate resistance, growth advantage, or a sampling artifact depending on the selection; depletion need not imply universal essentiality. Lack of replication or low-count guides weakens inference.

Commands

Run paths relative to the installed skill directory. Input and output paths refer to the user's analysis directory. The helper refuses to reuse an existing results directory.

# Single-end guide reads; trim and orientation must match the user's library preparation.
mageck count -l library.tsv --fastq c1.fastq.gz c2.fastq.gz t1.fastq.gz t2.fastq.gz \
  --sample-label c1,c2,t1,t2 --trim-5 0 --norm-method none -n counts

python scripts/screen_analysis.py qc --counts counts.count.txt --library library.tsv \
  --control c1 c2 --treatment t1 t2 --output qc.json

python scripts/screen_analysis.py test --counts counts.count.txt --library library.tsv \
  --control c1 c2 --treatment t1 t2 --normalization median --fdr 0.05 --output result

The FASTQ command structure was exercised with a synthetic two-guide library: counts of 30 and 12 were recovered exactly. A separate trimmed, reverse-complemented, two-lane fixture recovered 15, 7, and 0 reads. The two-group helper was exercised with 500 guides and two replicates per condition in unpaired and paired modes; known depleted and enriched genes ranked first in their respective directions and passed FDR 0.05. Sparse fixtures verified the total-normalization fallback. These tests establish execution and signal direction, not real-screen statistical calibration. Real-file paths above are illustrative.

result/report.json records count/library/control-guide SHA-256, control-guide IDs, MAGeCK version, actual arguments, QC, applied normalization, warnings, hit direction, FDR, log2 fold change and rank. The helper explicitly selects median guide LFC aggregation and --remove-zero both: all-zero guides remain in the input/QC but are excluded from ranking. Native MAGeCK also skips NA/na gene labels by default. The helper's --fdr filters completed gene results; it does not set MAGeCK's --gene-test-fdr-threshold, which controls the RRA guide-selection cutoff. Negative and positive FDRs are separate families; their union does not establish joint FDR control across directions or across multiple contrasts. screen.gene_summary.txt, screen.sgrna_summary.txt, normalized counts and the execution log retain the complete evidence. Include the original library, sample sheet and negative-control list in the analysis handoff; the count checksum cannot reconstruct them.

Primary references

1---
2name: mageck
3description: Analyzes pooled CRISPR screen FASTQ reads and guide-count matrices with MAGeCK, validates guide libraries and contrasts, measures replicate and library QC, and produces gene hit rankings with effect sizes and FDR. Use for new knockout, CRISPRi, or CRISPRa screen analysis, enrichment or depletion contrasts, and MAGeCK count/test workflows; existing public dependency-score lookup belongs to DepMap.
4license: MIT
5compatibility: Requires Python 3.10+ for the helper and MAGeCK 0.5.9.5 with its compiled RRA executable for analysis. Tested runtime uses Python 3.11, NumPy 1.26.4 and SciPy 1.13.1. Source installation needs a C++ compiler; network is needed only for installation. No credentials.
6metadata:
7 version: "1.1"
8 skill-author: K-Dense Inc.
9 upstream-version: "0.5.9.5"
10 last-reviewed: "2026-10-01"
11---
12 
13# MAGeCK pooled-screen analysis
14 
15## When to use
16 
17Use this skill to count existing sequencing reads against a supplied guide library or compare
18already-counted pooled screens. Deliver the count matrix, QC, guide and gene results, contrast
19provenance, and a short interpretation of enrichment/depletion. This workflow analyzes screens;
20it does not design guides or infer gene function from a hit alone.
21 
22## Runtime
23 
24The tested source installation and external-runtime caveat are in
25[references/runtime.md](references/runtime.md). Verify both `mageck --version` and
26`mageck test --help` before an analysis. The bundled Python helper is standard-library only.
27MAGeCK itself also needs NumPy, SciPy, and the `RRA` binary. PDF/R reporting is optional and not
28needed by the helper.
29 
30The [official release directory](https://sourceforge.net/projects/mageck/files/0.5/) still lists
310.5.9.5 as its latest MAGeCK release. Upstream now links the separate
32[MAGeCK2 project](https://github.com/davidliwei/mageck2); these commands and the helper target
33MAGeCK 0.5.9.5, not an interchangeable MAGeCK2 installation. This is a local CLI workflow with
34no service API or authentication.
35 
36## Workflow
37 
381. Establish the library version, perturbation modality, sample names, selection direction,
39 biological replicates, baseline material, time point, and batch. Separate sequencing lanes
40 from independent biological replicates. A plasmid baseline and a cell day-zero baseline
41 answer different questions. Require an explicit treatment/control contrast; the helper
42 never silently assigns all unused samples to the control group.
432. Validate a **headerless TSV library** containing guide ID, DNA sequence, gene. IDs and
44 sequences must be unique. The helper requires a count-table header beginning `sgRNA`, `Gene`,
45 followed by unique nonnumeric sample names such as `c1`. MAGeCK can interpret numeric names
46 as column indices or count values; rename them before analysis. Guide/gene IDs must have no
47 whitespace. The helper rejects ambiguous sequences and any count/library ID or gene mismatch;
48 resolve intentional multi-target guides explicitly upstream. These are deliberate helper
49 restrictions; native MAGeCK also accepts other input variants.
503. For FASTQ, inspect read structure and known guide sequences to establish trimming and
51 orientation. Use MAGeCK `count`, with one space-separated argument per biological sample;
52 comma-join lanes only when they are technical replicates of that same sample. Preserve
53 unmapped-read and count-summary evidence when mapping is poor. A zero-count guide remains
54 in the library; do not drop it to improve QC.
554. Run QC before statistical testing. Review library representation, median reads per guide,
56 zero fractions, Gini coefficients, and within-condition replicate correlations. The
57 helper's 10% zero and 0.8 correlation flags are review prompts, not universal acceptance
58 thresholds. High correlation can coexist with systematic artifacts. Read depth is not
59 experimental cell coverage. The helper uses a raw-count population Gini; MAGeCK's native
60 count-summary Gini uses log(count + 1) with a finite-sample correction. Do not compare their
61 values or thresholds as the same statistic.
625. Choose normalization based on the screen. Median normalization assumes most guides are
63 stable. For a strong global shift, supplied validated negative-control guides may support
64 `--normalization control`. These must be **guide IDs**, one per line; a gene list is not
65 interchangeable. Biological control samples and negative-control guides serve different
66 roles. At least two controls must be present, and every guide assigned to a control gene
67 must be designated a control. Supplying `--control-guides` also changes the RRA null distribution,
68 even with median normalization. Record their origin and check their count distribution.
69 MAGeCK 0.5.9.5 switches median normalization to total-count scaling for a zero median or
70 more than 45% zero guides in any selected sample; for control normalization it evaluates
71 the control-guide subset. Check the report's applied method, size factors, and warnings.
726. Use `test` for a two-group comparison. `--paired` requires both lists in corresponding
73 biological order and equal length; matching lengths alone do not establish pairing.
74 The helper reports genes at the requested FDR in both directions and retains full rankings.
75 For a multi-factor design, see [references/design.md](references/design.md); do not collapse
76 batches or time courses into an unjustified two-group test.
777. Inspect guide concordance for leading genes, essential-gene recovery where appropriate,
78 negative controls, replicate consistency, and copy-number artifacts in nuclease knockout
79 screens. Report effect sizes alongside FDR. An enriched guide can indicate resistance,
80 growth advantage, or a sampling artifact depending on the selection; depletion need not
81 imply universal essentiality. Lack of replication or low-count guides weakens inference.
82 
83## Commands
84 
85Run paths relative to the installed skill directory. Input and output paths refer to the user's
86analysis directory. The helper refuses to reuse an existing results directory.
87 
88```bash
89# Single-end guide reads; trim and orientation must match the user's library preparation.
90mageck count -l library.tsv --fastq c1.fastq.gz c2.fastq.gz t1.fastq.gz t2.fastq.gz \
91 --sample-label c1,c2,t1,t2 --trim-5 0 --norm-method none -n counts
92 
93python scripts/screen_analysis.py qc --counts counts.count.txt --library library.tsv \
94 --control c1 c2 --treatment t1 t2 --output qc.json
95 
96python scripts/screen_analysis.py test --counts counts.count.txt --library library.tsv \
97 --control c1 c2 --treatment t1 t2 --normalization median --fdr 0.05 --output result
98```
99 
100The FASTQ command structure was exercised with a synthetic two-guide library: counts of 30 and
10112 were recovered exactly. A separate trimmed, reverse-complemented, two-lane fixture recovered
10215, 7, and 0 reads. The two-group helper was exercised with 500 guides and two replicates per
103condition in unpaired and paired modes; known depleted and enriched genes ranked first in their
104respective directions and passed FDR 0.05. Sparse fixtures verified the total-normalization fallback.
105These tests establish execution and signal direction, not real-screen statistical calibration.
106Real-file paths above are illustrative.
107 
108`result/report.json` records count/library/control-guide SHA-256, control-guide IDs, MAGeCK version,
109actual arguments, QC, applied normalization, warnings, hit direction, FDR, log2 fold change and rank.
110The helper explicitly selects median guide LFC aggregation and `--remove-zero both`: all-zero
111guides remain in the input/QC but are excluded from ranking. Native MAGeCK also skips `NA`/`na`
112gene labels by default. The helper's `--fdr` filters completed gene results; it does not set MAGeCK's
113`--gene-test-fdr-threshold`, which controls the RRA guide-selection cutoff. Negative and positive
114FDRs are separate families; their union does not establish joint FDR control across directions or
115across multiple contrasts. `screen.gene_summary.txt`, `screen.sgrna_summary.txt`, normalized
116counts and the execution log retain the complete evidence. Include the original library, sample
117sheet and negative-control list in the analysis handoff; the count checksum cannot reconstruct them.
118 
119## Primary references
120 
121- [MAGeCK usage and command semantics](https://sourceforge.net/p/mageck/wiki/usage/)
122- [Official installation guidance](https://sourceforge.net/p/mageck/wiki/install/)
123- [Input formats](https://sourceforge.net/p/mageck/wiki/input/)
124- [Output field meanings](https://sourceforge.net/p/mageck/wiki/output/)
125 
View all files on GitHub →

Details

Updated
Sep 21, 2026
License
MIT
Stars on the repo
★ 45,977
Checked
Source
K-Dense-AI/scientific-agent-skills ↗
Creator
K-Dense-AI · 168 listings
View creator

Similar skills

See all →
SkillSingle-Cell Data StructureK-Dense-AI/scientific-agent-skills · by K-Dense-AIData structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.★ 46k GitHub starsSkillGene Regulatory Network InferrerK-Dense-AI/scientific-agent-skills · by K-Dense-AIInfer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for large-scale datasets.★ 46k GitHub starsSkillMolecular Biology ToolkitK-Dense-AI/scientific-agent-skills · by K-Dense-AIComprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use bioservices.★ 46k GitHub starsSkillBulk RNA-Seq PipelineK-Dense-AI/scientific-agent-skills · by K-Dense-AIEnd-to-end bulk RNA-seq orchestrator — takes raw FASTQ reads through QC and trimming (FastQC, fastp/Trim Galore), alignment and quantification (STAR, Salmon, featureCounts), assembles a gene-level counts matrix, then hands off to differential expression (pydeseq2), pathway/GSEA enrichment (pathway-enrichment), and publication figures (scientific-visualization). Use whenever the user has bulk RNA-seq reads or quant output and wants a complete, reproducible differential-expression workflow — e.g. "analyze my RNA-seq", "FASTQ to DESeq2", "run nf-core/rnaseq", "STAR/Salmon quantification", "build a counts matrix for DESeq2", or "go from reads to differentially expressed genes and enriched pathways". Routes between an nf-core/rnaseq (Nextflow) path and a standalone STAR/Salmon path, and covers experimental design, strandedness, and QC gates. For single-cell RNA-seq use the scanpy skill instead.★ 46k GitHub starsSkillCOBRApy Metabolic ModelerK-Dense-AI/scientific-agent-skills · by K-Dense-AIConstraint-based metabolic modeling (COBRA). FBA, FVA, gene knockouts, flux sampling, SBML models, for systems biology and metabolic engineering analysis.★ 46k GitHub starsSkillCZ CELLxGENE Census QueryK-Dense-AI/scientific-agent-skills · by K-Dense-AIQuery the CZ CELLxGENE Census programmatically for versioned public single-cell and spatial transcriptomics data. Use when you need population-scale cell metadata, gene expression slices, Census summary counts, source H5AD URIs/downloads, embeddings, spatial Census data, or reference atlas comparisons across organisms, tissues, diseases, assays, and cell types. For analyzing your own local single-cell data use scanpy, anndata, or scvi-tools.★ 46k GitHub stars

More from K-Dense-AI

SkillAdaptyv Bio Foundry APIK-Dense-AI/scientific-agent-skills · by K-Dense-AIHow to use the Adaptyv Bio Foundry API and Python SDK for protein experiment design, submission, and results retrieval. Use this skill whenever the user mentions Adaptyv, Foundry API, protein binding assays, protein screening experiments, BLI/SPR assays, thermostability assays, or wants to submit protein sequences for experimental characterization. Also trigger when code imports `adaptyv`, `adaptyv_sdk`, or `FoundryClient`, or references `foundry-api-public.adaptyvbio.com`.★ 46k GitHub starsSkillTime Series MLK-Dense-AI/scientific-agent-skills · by K-Dense-AIThis skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.★ 46k GitHub starsSkillAnalytical Method ValidatorK-Dense-AI/scientific-agent-skills · by K-Dense-AIPlan, execute, and document validation, verification, and transfer of analytical procedures under the governing framework - ICH Q2(R2) and Q14, USP <1220>/<1225>/<1226>, ICH M10 bioanalytical, CLSI EP, or ISO/IEC 17025. Use for HPLC, LC-MS/MS, GC, CE, ICP-MS, dissolution, qNMR, qPCR, NIR, and ligand binding or cell-based assays whenever the question is whether a procedure is fit for its intended purpose. Triggers include "method validation", "analytical method validation", "AMV", "validation protocol", "acceptance criteria", "linearity", "reportable range", "accuracy and precision", "repeatability", "intermediate precision", "recovery", "LOD", "LOQ", "detection limit", "quantitation limit", "specificity", "robustness", "method transfer", "method comparison", "Deming", "Passing-Bablok", "Bland-Altman", "equivalence testing", "OOS investigation", "ICH Q2", "Q2(R2)", "Q14", "USP 1225", "ICH M10", "incurred sample reanalysis", "ISR", "CLSI EP", and any request to show that an assay works.★ 46k GitHub starsSkillSingle-Cell Data StructureK-Dense-AI/scientific-agent-skills · by K-Dense-AIData structure for annotated matrices in single-cell analysis. Use when working with .h5ad files or integrating with the scverse ecosystem. This is the data format skill—for analysis workflows use scanpy; for probabilistic models use scvi-tools; for population-scale queries use cellxgene-census.★ 46k GitHub starsSkillAutonomous Artifact OptimizerK-Dense-AI/scientific-agent-skills · by K-Dense-AIAutonomously improve a real artifact (code, training recipe, agent harness, data pipeline, prompt) against an objective and an evaluator, using Hypothesis Tree Refinement (HTR) from the Arbor paper. Use this whenever someone wants to iteratively optimize something over many experiments without overfitting — e.g. "get my model's eval score up", "improve this agent/harness", "tune this pipeline", "beat the baseline on this benchmark", "run a search over approaches and keep the best", "do an MLE-bench / Kaggle-style optimization", or any long-horizon "make this artifact better and don't just memorize the dev set" task. Trigger it even when the user doesn't say "Arbor" or "hypothesis tree" but describes repeated experiment-and-evaluate loops, branching exploration of competing ideas, or worries about a dev/test gap. Runs Claude itself as the coordinator with subagent executors in isolated git worktrees; for the standalone `arbor` CLI tool see references/arbor-upstream.md.★ 46k GitHub starsSkillGene Regulatory Network InferrerK-Dense-AI/scientific-agent-skills · by K-Dense-AIInfer gene regulatory networks (GRNs) from gene expression data using scalable algorithms (GRNBoost2, GENIE3). Use when analyzing transcriptomics data (bulk RNA-seq, single-cell RNA-seq) to identify transcription factor-target gene relationships and regulatory interactions. Supports distributed computation for large-scale datasets.★ 46k GitHub stars