| name | bio-crispr-screens-mageck-analysis |
| description | MAGeCK (Model-based Analysis of Genome-wide CRISPR-Cas9 Knockout) for pooled CRISPR screen analysis. Covers count normalization, gene ranking, and pathway analysis. Use when identifying essential genes, drug targets, or resistance mechanisms from dropout or enrichment screens. |
| tool_type | cli |
| primary_tool | mageck |
MAGeCK CRISPR Screen Analysis
Count sgRNAs from FASTQ
mageck count \
-l library.csv \
-n experiment \
--sample-label Day0,Treated1,Treated2,Control1,Control2 \
--fastq Day0.fastq.gz Treated1.fastq.gz Treated2.fastq.gz Control1.fastq.gz Control2.fastq.gz \
--norm-method median
Library File Format
# library.csv (tab-separated)
sgRNA_ID Gene Sequence
BRCA1_1 BRCA1 ATGGATTTATCTGCTCTTCG
BRCA1_2 BRCA1 CAGCAGATACTTGATGCATC
TP53_1 TP53 CCATTGTTCAATATCGTCCG
...
MAGeCK Test (RRA Algorithm)
mageck test \
-k experiment.count.txt \
-t Treated1,Treated2 \
-c Control1,Control2 \
-n results \
--norm-method median \
--gene-test-fdr-threshold 0.25
MAGeCK MLE (Maximum Likelihood)
mageck mle \
-k experiment.count.txt \
-d design.txt \
-n mle_results \
--norm-method median
Interpret Results
import pandas as pd
genes = pd.read_csv('results.gene_summary.txt', sep='\t')
essential = genes[(genes['neg|fdr'] < 0.05)].sort_values('neg|rank')
print(f'Essential genes (dropout): {len(essential)}')
print(essential[['id', 'neg|score', 'neg|fdr']].head(20))
resistant = genes[(genes['pos|fdr'] < 0.05)].sort_values('pos|rank')
print(f'Resistance genes (enriched): {len(resistant)}')
print(resistant[['id', 'pos|score', 'pos|fdr']].head(20))
Visualize Results
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
genes = pd.read_csv('results.gene_summary.txt', sep='\t')
fig, ax = plt.subplots(figsize=(10, 8))
x = genes['neg|lfc']
y = -np.log10(genes['neg|fdr'])
colors = ['red' if fdr < 0.05 else 'gray' for fdr in genes['neg|fdr']]
ax.scatter(x, y, c=colors, alpha=0.5, s=10)
top_hits = genes[genes['neg|fdr'] < 0.01].nsmallest(10, 'neg|rank')
for _, row in top_hits.iterrows():
ax.annotate(row['id'], (row['neg|lfc'], -np.log10(row['neg|fdr'])))
ax.axhline(-np.log10(0.05), linestyle='--', color='black', alpha=0.5)
ax.set_xlabel('Log2 Fold Change')
ax.set_ylabel('-log10(FDR)')
ax.set_title('MAGeCK Negative Selection')
plt.savefig('mageck_volcano.png', dpi=150)
MAGeCK Pathway Analysis
mageck pathway \
-g results.gene_summary.txt \
-c go_biological_process.gmt \
-n pathway_results \
--pathway-fdr-threshold 0.25
Time-Course Screens
mageck mle \
-k timecourse.count.txt \
-d timecourse_design.txt \
-n timecourse_results
CRISPR Activation (CRISPRa) Screens
mageck test \
-k crispra.count.txt \
-t Activated1,Activated2 \
-c Control1,Control2 \
-n crispra_results
MAGeCK-VISPR (Visualization)
mageck-vispr run \
-n vispr_report \
-c config.yaml
Related Skills
- screen-qc - Quality control before MAGeCK
- hit-calling - Alternative hit calling methods
- pathway-analysis/gsea - Downstream enrichment analysis