Generated banner for Mageck
Generated logo for Mageck

Mageck

K-DenseCommunityCreated by K-Dense Inc.

  • Skill
  • Tool integration
  • Science and research
  • MIT
  • Low risk
  • Has scripts

From the author

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.
— the description by K-Dense Inc.

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill provides a structured workflow for processing pooled CRISPR screen data, including knockout, CRISPRi, and CRISPRa experiments. It leverages the MAGeCK 0.5.9.5 toolset to perform read counting, replicate and library quality control, and statistical testing to identify enriched or depleted genes. The workflow includes a Python helper to manage input validation, normalization, and result reporting, ensuring that guide-level counts are correctly processed into gene-level rankings with FDR and effect sizes.

What it does

  • Counts sequencing reads from FASTQ files against a guide library.
  • Performs quality control on libraries and replicates, including Gini coefficient and correlation analysis.
  • Normalizes count data using median or control-guide methods.
  • Executes statistical tests to identify significantly enriched or depleted genes.
  • Generates comprehensive reports including FDR, log2 fold change, and gene rankings.
  • Supports advanced multi-factor analysis via MAGeCK MLE design matrices.

When to use it

  • When you need to process raw FASTQ reads from a pooled CRISPR screen.
  • When comparing treatment and control conditions to identify gene hits.
  • When performing quality assessment on CRISPR screen libraries and replicates.
  • When you require a reproducible workflow for RRA-based gene ranking.

Advantages

  • Automates complex MAGeCK command sequences and input validation.
  • Provides clear provenance for normalization methods and statistical results.
  • Enforces strict input formatting to prevent common analysis errors.
  • Includes built-in QC reporting to identify potential experimental artifacts.

Usage examples

“Count reads for my CRISPR screen samples c1, c2, t1, and t2 using library.tsv.”
The skill runs the MAGeCK count command, processes the FASTQ files, and generates a count matrix.
“Perform quality control on my count matrix counts.count.txt.”
The skill evaluates library representation, zero fractions, and replicate correlations, outputting a qc.json report.
“Run a statistical test to find enriched genes between control c1, c2 and treatment t1, t2.”
The skill executes the MAGeCK test workflow, calculates gene rankings with FDR, and saves the results to the specified output directory.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/k-dense-ai/mageck/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip mageck.zip -d .agents/skills

Documentation by K-Dense Inc.

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

Files

references/design.md

Contrasts and multi-condition designs

For RRA, explicitly list treatment and control sample labels, preserving biological replicate identity. Do not sum independent cultures; do combine separate sequencing lanes of one library preparation at counting. The helper checks labels, disjoint groups, paired lengths, negative-control membership and whole-gene grouping, nonnegative integer counts, duplicate IDs and count/library equality. It cannot verify whether sample labels represent the biology described by the user.

For a time course, genotype-by-treatment interaction or batch-adjusted comparison, MAGeCK MLE uses a design matrix. Consult the official MLE tutorial and the installed mageck mle --help. A small native MLE smoke test verifies named sample reordering and expected beta signs; realistic multi-factor designs remain untested here. An illustrative two-condition design is:

Samples  baseline  treatment
c1       1         0
c2       1         0
t1       1         1
t2       1         1

Write an actual tab-delimited matrix with unique row labels matching count-table samples and unique coefficient names. In 0.5.9.5 a named matrix file selects and reorders count columns using those row labels; it must not also receive --include-samples or --beta-labels. Keep baseline rows first and preserve row order for reproducibility. For an inline matrix without row labels, rows instead follow --include-samples, or the count-table order when that option is absent.

The first numeric column must be all ones. Include at least one baseline row with zeros in all remaining columns; do not treat MAGeCK MLE as an arbitrary regression accepting a centered or negative-valued design. Basic designs use 0/1 indicators. The advanced tutorial also permits positive time values under an explicit linear log-abundance assumption. All-zero columns and aliased factors make coefficients unidentifiable. Compute design rank, inspect condition/batch confounding, and preserve coefficient interpretation before running. A matrix cannot recover missing replication or separate perfectly confounded batch and treatment effects.

# Template; MLE runs directly, outside the count/test helper.
mageck mle -k counts.count.txt -d design.tsv -n mle --norm-method median

For RRA, retain direction-specific gene FDR and log2 fold change. MLE reports coefficient-specific beta, permutation fdr, and wald-fdr; state which test was used, and do not relabel beta as an RRA median log2 fold change. Retain guide support, normalization, sample inclusion and exclusions. FDR is not an individual hit's probability of being false. Validate leading hits independently; a synthetic fixture does not calibrate the experiment. The native smoke used only one permutation round to check execution; use adequately resolved permutations for a real inferential analysis.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs Python

The author says: 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.

Security

What our scanner noticed· Low risk

  • Instructions that use the network
  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
K-Dense Inc.
Publisher
K-Dense (Community)
Source
K-Dense-AI/scientific-agent-skills · skills/mageck · commit a25cf9e
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE.md)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by K-Dense Inc. or K-Dense.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download mageck.zip