Install any skill in seconds. Free to start, no credit card required.
Get Started Free →NGS CLI for ChIP/RNA/ATAC-seq. BAM→bigWig with RPGC/CPM/RPKM, sample correlation/PCA, heatmaps/profiles around features, fingerprints. For alignment use STAR/BWA; for peak calling use MACS2.
.claude/skills/jaechang-hits-deeptools-ngs-analysis/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 137% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 124% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 192% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 277% | 0% |
| case-15 | ✗→✓ | ▲ Improved | 146% | 0% |
deepTools is a command-line toolkit for processing and visualizing high-throughput sequencing data. It converts BAM alignments to normalized coverage tracks (bigWig), performs quality control (correlation, PCA, fingerprint), and generates publication-quality heatmaps and profile plots around genomic features. Supports ChIP-seq, RNA-seq, ATAC-seq, and MNase-seq.
bashpip install deeptools # Verify installation bamCoverage --version
Input requirements: BAM files must be sorted and indexed (.bai file present). Generate index with samtools index input.bam. BED files for genomic regions (genes, peaks) in standard 3+ column format.
bash# Convert BAM to normalized bigWig bamCoverage --bam sample.bam --outFileName sample.bw \ --normalizeUsing RPGC --effectiveGenomeSize 2913022398 \ --binSize 10 --numberOfProcessors 8 # Create heatmap around TSS computeMatrix reference-point -S sample.bw -R genes.bed \ -b 3000 -a 3000 --referencePoint TSS -o matrix.gz plotHeatmap -m matrix.gz -o heatmap.png --colorMap RdBu
Convert BAM alignments to normalized coverage tracks (bigWig or bedGraph).
bash# Basic conversion with RPGC normalization bamCoverage --bam input.bam --outFileName output.bw \ --normalizeUsing RPGC --effectiveGenomeSize 2913022398 \ --binSize 10 --numberOfProcessors 8 \ --extendReads 200 --ignoreDuplicates # CPM normalization (simpler, no genome size needed) bamCoverage --bam input.bam --outFileName output.bw \ --normalizeUsing CPM --binSize 10 -p 8 # RNA-seq: strand-specific coverage bamCoverage --bam rnaseq.bam --outFileName forward.bw \ --filterRNAstrand forward --normalizeUsing CPM -p 8 # IMPORTANT: Never use --extendReads for RNA-seq (spans splice junctions)
Compare treatment vs control or generate ratio tracks.
bash# Log2 ratio: treatment / control bamCompare -b1 treatment.bam -b2 control.bam -o log2ratio.bw \ --operation log2 --scaleFactorsMethod readCount \ --extendReads 200 -p 8 # Subtract control from treatment bamCompare -b1 treatment.bam -b2 control.bam -o subtract.bw \ --operation subtract --scaleFactorsMethod readCount
Assess sample quality, replicate concordance, and enrichment strength.
bash# Sample correlation heatmap multiBamSummary bins --bamfiles rep1.bam rep2.bam rep3.bam \ -o counts.npz --binSize 10000 -p 8 plotCorrelation -in counts.npz --corMethod pearson \ --whatToShow heatmap -o correlation.png # Good: replicates cluster with r > 0.9 # PCA of samples plotPCA -in counts.npz -o pca.png --plotTitle "Sample PCA" # ChIP enrichment fingerprint plotFingerprint -b input.bam chip.bam -o fingerprint.png \ --extendReads 200 --ignoreDuplicates # Good ChIP: steep rise curve; flat diagonal = poor enrichment # Coverage depth assessment plotCoverage -b sample.bam -o coverage.png --ignoreDuplicates -p 8 # Fragment size distribution (paired-end) bamPEFragmentSize -b sample.bam -o fragsize.png
Visualize signal around genomic features (TSS, peaks, gene bodies).
bash# Reference-point mode: signal around TSS computeMatrix reference-point -S chip.bw -R genes.bed \ -b 3000 -a 3000 --referencePoint TSS -o matrix.gz -p 8 # Scale-regions mode: signal across gene bodies computeMatrix scale-regions -S chip.bw -R genes.bed \ -b 1000 -a 1000 --regionBodyLength 5000 -o matrix.gz -p 8 # Generate heatmap plotHeatmap -m matrix.gz -o heatmap.png \ --colorMap RdBu --kmeans 3 --sortUsing mean # Generate profile plot plotProfile -m matrix.gz -o profile.png \ --plotType lines --colors blue red # Multiple signal files: compare marks computeMatrix reference-point -S h3k4me3.bw h3k27me3.bw -R genes.bed \ -b 3000 -a 3000 --referencePoint TSS -o multi_matrix.gz plotHeatmap -m multi_matrix.gz -o multi_heatmap.png
Filter reads before analysis or correct for assay-specific biases.
bash# Filter by mapping quality and fragment size alignmentSieve --bam input.bam --outFile filtered.bam \ --minMappingQuality 10 --minFragmentLength 150 \ --maxFragmentLength 700 # ATAC-seq: apply Tn5 offset correction (+4/-5 bp shift) alignmentSieve --bam atac.bam --outFile shifted.bam --ATACshift # Then index: samtools index shifted.bam # GC bias correction (only if significant bias detected) computeGCBias -b input.bam --effectiveGenomeSize 2913022398 \ -g genome.2bit --GCbiasFrequenciesFile gc_freq.txt -p 8 correctGCBias -b input.bam --effectiveGenomeSize 2913022398 \ --GCbiasFrequenciesFile gc_freq.txt -o corrected.bam
Quantify signal enrichment at specific regions.
bash# Signal enrichment at peak regions plotEnrichment -b chip.bam input.bam --BED peaks.bed \ -o enrichment.png --ignoreDuplicates -p 8
| Method | Formula | When to Use | Requires | |--------|---------|-------------|----------| | RPGC | 1× genome coverage | ChIP-seq, ATAC-seq | --effectiveGenomeSize | | CPM | Counts per million | Any assay, quick comparison | Nothing | | RPKM | Per kb per million | RNA-seq gene-level | Nothing | | BPM | Bins per million | Similar to CPM | Nothing | | None | Raw counts | Not recommended for comparison | Nothing |
Rule: Use RPGC for ChIP-seq/ATAC-seq (accounts for genome size). Use CPM for quick comparisons. Use RPKM for RNA-seq gene-level analysis.
| Organism | Assembly | Effective Size | |----------|----------|---------------| | Human | GRCh38/hg38 | 2,913,022,398 | | Mouse | GRCm38/mm10 | 2,652,783,500 | | Zebrafish | GRCz11 | 1,368,780,147 | | Drosophila | dm6 | 142,573,017 | | C. elegans | ce10/ce11 | 100,286,401 |
| Mode | Use When | Key Params | |------|----------|------------| | reference-point | Signal around a fixed point (TSS, peak summit) | -b, -a, --referencePoint | | scale-regions | Signal across variable-length features (gene bodies) | -b, -a, --regionBodyLength |
bash#!/bin/bash # Complete ChIP-seq QC + visualization pipeline CHIP="chip.bam" INPUT="input.bam" GENES="genes.bed" PEAKS="peaks.bed" GSIZE=2913022398 THREADS=8 # 1. QC: sample correlation multiBamSummary bins --bamfiles $INPUT $CHIP -o summary.npz -p $THREADS plotCorrelation -in summary.npz --corMethod pearson --whatToShow heatmap -o correlation.png # 2. QC: enrichment fingerprint plotFingerprint -b $INPUT $CHIP -o fingerprint.png --extendReads 200 --ignoreDuplicates # 3. Convert to normalized bigWig bamCoverage --bam $CHIP --outFileName chip.bw --normalizeUsing RPGC \ --effectiveGenomeSize $GSIZE --extendReads 200 --ignoreDuplicates -p $THREADS # 4. Log2 ratio track bamCompare -b1 $CHIP -b2 $INPUT -o log2ratio.bw --operation log2 \ --scaleFactorsMethod readCount --extendReads 200 -p $THREADS # 5. Heatmap at TSS computeMatrix reference-point -S chip.bw log2ratio.bw -R $GENES \ -b 3000 -a 3000 --referencePoint TSS -o tss_matrix.gz -p $THREADS plotHeatmap -m tss_matrix.gz -o tss_heatmap.png --colorMap RdBu --kmeans 3 # 6. Profile at peaks computeMatrix reference-point -S chip.bw -R $PEAKS \ -b 2000 -a 2000 -o peak_matrix.gz -p $THREADS plotProfile -m peak_matrix.gz -o peak_profile.png
bash#!/bin/bash ATAC="atac.bam" PEAKS="atac_peaks.bed" GSIZE=2913022398 THREADS=8 # 1. Apply Tn5 offset correction (+4/-5 bp) alignmentSieve --bam $ATAC --outFile shifted.bam --ATACshift -p $THREADS samtools index shifted.bam # 2. Generate RPGC-normalized coverage bamCoverage --bam shifted.bam --outFileName atac.bw \ --normalizeUsing RPGC --effectiveGenomeSize $GSIZE \ --binSize 5 --extendReads -p $THREADS # 3. Check nucleosome periodicity (expect 200bp/400bp peaks) bamPEFragmentSize -b shifted.bam -o fragsize.png \ --maxFragmentLength 1000 --binSize 1 # 4. Heatmap at ATAC peaks computeMatrix reference-point -S atac.bw -R $PEAKS \ -b 2000 -a 2000 -o atac_matrix.gz -p $THREADS plotHeatmap -m atac_matrix.gz -o atac_heatmap.png --colorMap Blues --kmeans 2
| Parameter | Tool(s) | Default | Range | Effect | |-----------|---------|---------|-------|--------| | --normalizeUsing | bamCoverage, bamCompare | None | RPGC, CPM, RPKM, BPM, None | Coverage normalization method | | --effectiveGenomeSize | bamCoverage, bamCompare | — | See table above | Required for RPGC normalization | | --binSize | bamCoverage, multiBamSummary | 50 | 1–10000 | Resolution in bp; smaller = larger files | | --extendReads | bamCoverage, bamCompare | False | integer (bp) | Extend to fragment length (ChIP: YES, RNA: NO) | | --ignoreDuplicates | Most tools | False | True/False | Remove PCR duplicates | | --numberOfProcessors | Most tools | 1 | 1–N cores | Parallel processing | | --operation | bamCompare | log2 | log2, ratio, subtract, add, mean, reciprocal_ratio | Sample comparison operation | | --referencePoint | computeMatrix | TSS | TSS, TES, center | Anchor point for reference-point mode | | -b / -a | computeMatrix | 500 | 100–10000 bp | Upstream/downstream distance from reference | | --kmeans | plotHeatmap | None | 1–20 | Number of clusters for heatmap rows | | --minMappingQuality | Most tools | None | 0–60 | Minimum alignment quality filter |
--extendReads 200 (or actual fragment length) — ChIP fragments are longer than reads.--extendReads would span splice junctions, creating artifacts.--region for parameter testing: Test on a single chromosome (--region chr1:1-10000000) before running on the full genome — saves hours.--numberOfProcessors: Most tools parallelize well — use all available cores.--effectiveGenomeSize: Will silently produce wrong results. Always specify the correct genome size.bash# Compare 6 samples across the genome multiBamSummary bins --bamfiles sample{1..6}.bam \ -o all_samples.npz --binSize 10000 -p 8 \ --labels S1 S2 S3 S4 S5 S6 # Pearson correlation heatmap plotCorrelation -in all_samples.npz --corMethod pearson \ --whatToShow heatmap -o pearson_corr.png --plotNumbers # Spearman correlation + PCA plotCorrelation -in all_samples.npz --corMethod spearman \ --whatToShow heatmap -o spearman_corr.png plotPCA -in all_samples.npz -o pca.png
bash# Scale-regions mode for gene body analysis computeMatrix scale-regions -S sample.bw -R genes.bed \ -b 1000 -a 1000 --regionBodyLength 5000 -o gene_body.gz -p 8 plotProfile -m gene_body.gz -o gene_body_profile.png \ --plotType lines --perGroup
| Problem | Cause | Solution | |---------|-------|----------| | BAM index not found | Missing .bai file | Run samtools index input.bam | | Out of memory | Large genome, small bin size | Increase --binSize; process with --region chr1 | | Very slow processing | Single-threaded execution | Add -p 8 (or available cores) | | bigWig files very large | Bin size too small | Increase --binSize 50 or larger | | Flat ChIP fingerprint | Poor ChIP enrichment | Biological issue — consider repeating ChIP experiment | | RNA-seq artifacts at exon boundaries | --extendReads used with RNA-seq | Remove --extendReads for RNA-seq data | | ATAC-seq signal offset | Missing Tn5 correction | Apply alignmentSieve --ATACshift before analysis | | Mismatched genome assemblies | BAM and BED use different assemblies | Verify both use same genome build (hg38 vs hg19) |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 13,815 | 28,710 | +108% | 1 | 1 | 0% | 2,594 | 6,144 | +137% | 0 | 0 | — |
case-02 | pass→pass | 16,794 | 8,646 | -49% | 1 | 1 | 0% | 2,576 | 5,390 | +109% | 0 | 0 | — |
case-03 | pass→pass | 16,723 | 5,833 | -65% | 1 | 1 | 0% | 2,493 | 5,034 | +102% | 0 | 0 | — |
case-04 | fail→pass | 12,784 | 5,257 | -59% | 1 | 1 | 0% | 2,178 | 4,875 | +124% | 0 | 0 | — |
case-05 | pass→pass | 12,725 | 6,789 | -47% | 1 | 1 | 0% | 2,149 | 5,065 | +136% | 0 | 0 | — |
case-06 | fail→pass | 9,697 | 4,801 | -50% | 1 | 1 | 0% | 1,647 | 4,806 | +192% | 0 | 0 | — |
case-07 | pass→pass | 12,468 | 5,648 | -55% | 1 | 1 | 0% | 2,038 | 4,885 | +140% | 0 | 0 | — |
case-08 | pass→pass | 13,402 | 4,396 | -67% | 1 | 1 | 0% | 2,359 | 4,716 | +100% | 0 | 0 | — |
case-21 | pass→pass | 12,037 | 6,576 | -45% | 1 | 1 | 0% | 2,094 | 5,182 | +147% | 0 | 0 | — |
case-09 | pass→pass | 11,456 | 4,204 | -63% | 1 | 1 | 0% | 1,965 | 4,743 | +141% | 0 | 0 | — |
case-10 | pass→pass | 11,875 | 4,561 | -62% | 1 | 1 | 0% | 2,051 | 4,785 | +133% | 0 | 0 | — |
case-11 | fail→pass | 7,329 | 5,018 | -32% | 1 | 1 | 0% | 1,255 | 4,726 | +277% | 0 | 0 | — |
case-12 | pass→pass | 9,780 | 4,450 | -54% | 1 | 1 | 0% | 1,636 | 4,746 | +190% | 0 | 0 | — |
case-22 | pass→pass | 8,398 | 7,088 | -16% | 1 | 1 | 0% | 1,434 | 5,278 | +268% | 0 | 0 | — |
case-13 | pass→pass | 9,022 | 5,240 | -42% | 1 | 1 | 0% | 1,449 | 4,824 | +233% | 0 | 0 | — |
case-14 | pass→pass | 14,039 | 5,342 | -62% | 1 | 1 | 0% | 1,995 | 5,070 | +154% | 0 | 0 | — |
case-15 | fail→pass | 10,337 | 2,765 | -73% | 1 | 1 | 0% | 1,790 | 4,400 | +146% | 0 | 0 | — |
case-16 | fail→pass | 10,967 | 3,007 | -73% | 1 | 1 | 0% | 1,856 | 4,489 | +142% | 0 | 0 | — |
case-23 | fail→pass | 16,926 | 12,305 | -27% | 1 | 1 | 0% | 3,210 | 6,440 | +101% | 0 | 0 | — |
case-17 | pass→pass | 8,659 | 6,021 | -30% | 1 | 1 | 0% | 1,481 | 4,757 | +221% | 0 | 0 | — |
case-18 | pass→pass | 9,245 | 6,601 | -29% | 1 | 1 | 0% | 1,661 | 4,979 | +200% | 0 | 0 | — |
case-19 | pass→pass | 7,304 | 3,941 | -46% | 1 | 1 | 0% | 1,211 | 4,459 | +268% | 0 | 0 | — |
case-20 | pass→pass | 9,475 | 3,970 | -58% | 1 | 1 | 0% | 1,487 | 4,622 | +211% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +30 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.