Install any skill in seconds. Free to start, no credit card required.
Get Started Free →End-to-end ATAC-seq workflow from FASTQ files to differential accessibility and TF footprinting. Covers alignment, peak calling with MACS3, QC metrics, and optional TOBIAS footprinting. Use when running end-to-end ATAC-seq analysis from FASTQ to differential accessibility.
.claude/skills/bio-workflows-atacseq-pipeline/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 48% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 408% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 61% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 173% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 96% | 0% |
<!--
#
#
-->
Complete workflow from raw ATAC-seq FASTQ files to accessibility peaks, differential analysis, and TF footprinting.
FASTQ files
|
v
[1. QC & Trimming] -----> fastp (Nextera adapters)
|
v
[2. Alignment] ---------> Bowtie2
|
v
[3. BAM Processing] ----> filter, shift, dedup
|
v
[4. Peak Calling] ------> MACS3
|
v
[5. QC] ----------------> TSS enrichment, FRiP, fragment size
|
v
[6. Differential] ------> DiffBind (optional)
|
v
[7. Footprinting] ------> TOBIAS (optional)
|
v
Accessibility peaks + TF activitybash# ATAC-seq uses Nextera adapters NEXTERA_R1="CTGTCTCTTATACACATCT" NEXTERA_R2="CTGTCTCTTATACACATCT" for sample in sample1 sample2 sample3; do fastp -i ${sample}_R1.fastq.gz -I ${sample}_R2.fastq.gz \ -o trimmed/${sample}_R1.fq.gz -O trimmed/${sample}_R2.fq.gz \ --adapter_sequence ${NEXTERA_R1} \ --adapter_sequence_r2 ${NEXTERA_R2} \ --qualified_quality_phred 20 \ --length_required 25 \ --html qc/${sample}_fastp.html done
bash# Build index (once) bowtie2-build genome.fa bt2_index/genome # Align with ATAC-seq specific settings for sample in sample1 sample2 sample3; do bowtie2 -p 8 -x bt2_index/genome \ -1 trimmed/${sample}_R1.fq.gz \ -2 trimmed/${sample}_R2.fq.gz \ --very-sensitive \ --no-mixed --no-discordant \ -X 2000 \ 2> aligned/${sample}.log | \ samtools view -@ 4 -bS -q 30 -f 2 - | \ samtools sort -@ 4 -o aligned/${sample}.bam done
ATAC-seq requires special processing: removing mitochondrial reads, shifting reads for Tn5 insertion, and removing duplicates.
bashfor sample in sample1 sample2 sample3; do # Remove mitochondrial reads samtools view -h aligned/${sample}.bam | \ grep -v chrM | \ samtools view -b - > aligned/${sample}.noMT.bam # Mark and remove duplicates samtools fixmate -m aligned/${sample}.noMT.bam - | \ samtools sort - | \ samtools markdup -r - aligned/${sample}.dedup.bam samtools index aligned/${sample}.dedup.bam # Shift reads for Tn5 (+ strand +4bp, - strand -5bp) alignmentSieve -b aligned/${sample}.dedup.bam \ -o aligned/${sample}.shifted.bam \ --ATACshift \ -p 8 samtools index aligned/${sample}.shifted.bam done
Alternative manual Tn5 shift with bedtools:
bash# Convert to BED and shift bedtools bamtobed -i aligned/${sample}.dedup.bam | \ awk 'BEGIN{OFS="\t"} {if($6=="+"){$2=$2+4} else if($6=="-"){$3=$3-5} print}' | \ sort -k1,1 -k2,2n > aligned/${sample}.shifted.bed
bash# Call peaks (use --shift and --extsize for shifted reads) macs3 callpeak \ -t aligned/sample1.shifted.bam \ -f BAMPE \ -g hs \ -n sample1 \ --outdir peaks \ --nomodel \ --shift -75 \ --extsize 150 \ --keep-dup all \ -q 0.01 # For calling on all samples together macs3 callpeak \ -t aligned/*.shifted.bam \ -f BAMPE \ -g hs \ -n consensus \ --outdir peaks \ --nomodel \ --shift -75 \ --extsize 150 \ -q 0.01
bash# TSS enrichment (using deepTools) computeMatrix reference-point \ -S bigwig/sample1.bw \ -R genes.bed \ --referencePoint TSS \ -a 2000 -b 2000 \ -o tss_matrix.gz plotProfile -m tss_matrix.gz -o qc/tss_enrichment.pdf # Fragment size distribution samtools view aligned/sample1.dedup.bam | \ awk '{print sqrt($9^2)}' | \ sort | uniq -c | \ awk '{print $2"\t"$1}' > qc/fragment_sizes.txt # FRiP calculation total=$(samtools view -c aligned/sample1.shifted.bam) in_peaks=$(bedtools intersect -a aligned/sample1.shifted.bam \ -b peaks/sample1_peaks.narrowPeak -u | samtools view -c) echo "FRiP: $(echo "scale=4; $in_peaks/$total" | bc)"
QC Checkpoint: Assess ATAC quality
rlibrary(DiffBind) # Create sample sheet samples <- data.frame( SampleID = c('control_1', 'control_2', 'treated_1', 'treated_2'), Condition = c('control', 'control', 'treated', 'treated'), Replicate = c(1, 2, 1, 2), bamReads = c('aligned/control_1.shifted.bam', 'aligned/control_2.shifted.bam', 'aligned/treated_1.shifted.bam', 'aligned/treated_2.shifted.bam'), Peaks = c('peaks/control_1_peaks.narrowPeak', 'peaks/control_2_peaks.narrowPeak', 'peaks/treated_1_peaks.narrowPeak', 'peaks/treated_2_peaks.narrowPeak') ) # Create DBA object dba <- dba(sampleSheet = samples) # Count reads in peaks dba <- dba.count(dba) # Normalize dba <- dba.normalize(dba) # Contrast dba <- dba.contrast(dba, categories = DBA_CONDITION) # Differential analysis dba <- dba.analyze(dba) # Report report <- dba.report(dba) write.csv(as.data.frame(report), 'differential_peaks.csv') # Visualization dba.plotMA(dba) dba.plotVolcano(dba)
bash# Correct Tn5 bias TOBIAS ATACorrect \ -b aligned/sample1.shifted.bam \ -g genome.fa \ -p peaks/consensus_peaks.narrowPeak \ --outdir footprinting \ --cores 8 # Score footprints TOBIAS ScoreBigwig \ --signal footprinting/sample1_corrected.bw \ --regions peaks/consensus_peaks.narrowPeak \ --output footprinting/sample1_footprints.bw \ --cores 8 # Bind detection TOBIAS BINDetect \ --motifs motifs.jaspar \ --signals footprinting/sample1_footprints.bw \ --genome genome.fa \ --peaks peaks/consensus_peaks.narrowPeak \ --outdir footprinting/bindetect \ --cores 8 # Differential footprinting (two conditions) TOBIAS BINDetect \ --motifs motifs.jaspar \ --signals footprinting/control_footprints.bw footprinting/treated_footprints.bw \ --genome genome.fa \ --peaks peaks/consensus_peaks.narrowPeak \ --outdir footprinting/differential \ --cores 8
| Step | Parameter | Value | |------|-----------|-------| | fastp | adapter | Nextera (CTGTCTCTTATACACATCT) | | Bowtie2 | -X | 2000 (max insert size) | | samtools | -q | 30 (MAPQ filter) | | MACS3 | --shift | -75 (for Tn5 shift) | | MACS3 | --extsize | 150 | | MACS3 | -q | 0.01-0.05 |
| Issue | Likely Cause | Solution | |-------|--------------|----------| | High mitochondrial | Normal for ATAC | Filter chrM reads | | Low TSS enrichment | Poor library, overdigestion | Check Tn5 concentration | | Many small peaks | Tn5 insertion noise | Increase -q threshold | | No nucleosome periodicity | Overdigestion | Adjust Tn5:DNA ratio |
bash#!/bin/bash set -e THREADS=8 INDEX="bt2_index/genome" GENOME="genome.fa" SAMPLES="sample1 sample2 sample3" OUTDIR="atac_results" mkdir -p ${OUTDIR}/{trimmed,aligned,peaks,qc,bigwig} # Step 1: QC for sample in $SAMPLES; do fastp -i ${sample}_R1.fastq.gz -I ${sample}_R2.fastq.gz \ -o ${OUTDIR}/trimmed/${sample}_R1.fq.gz \ -O ${OUTDIR}/trimmed/${sample}_R2.fq.gz \ --adapter_sequence CTGTCTCTTATACACATCT \ --html ${OUTDIR}/qc/${sample}_fastp.html -w ${THREADS} done # Step 2-3: Align and process for sample in $SAMPLES; do bowtie2 -p ${THREADS} -x ${INDEX} \ -1 ${OUTDIR}/trimmed/${sample}_R1.fq.gz \ -2 ${OUTDIR}/trimmed/${sample}_R2.fq.gz \ --very-sensitive --no-mixed --no-discordant -X 2000 \ 2> ${OUTDIR}/qc/${sample}_bowtie2.log | \ samtools view -@ ${THREADS} -bS -q 30 -f 2 - | \ grep -v chrM | \ samtools fixmate -m - - | \ samtools sort -@ ${THREADS} - | \ samtools markdup -r - - | \ alignmentSieve --ATACshift -b /dev/stdin -o ${OUTDIR}/aligned/${sample}.bam samtools index ${OUTDIR}/aligned/${sample}.bam done # Step 4: Peak calling macs3 callpeak -t ${OUTDIR}/aligned/*.bam -f BAMPE -g hs \ -n consensus --outdir ${OUTDIR}/peaks \ --nomodel --shift -75 --extsize 150 -q 0.01 echo "Pipeline complete. Peaks: ${OUTDIR}/peaks/consensus_peaks.narrowPeak"
<!-- AUTHOR_SIGNATURE: 9a7f3c2e-MD-BABU-MIA-2026-MSSM-SECURE -->
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 16,682 | 9,455 | -43% | 1 | 1 | 0% | 3,618 | 5,337 | +48% | 0 | 0 | — |
case-02 | fail→fail | 14,306 | 18,964 | +33% | 1 | 1 | 0% | 2,594 | 6,454 | +149% | 0 | 0 | — |
case-07 | fail→pass | 16,946 | 10,003 | -41% | 1 | 1 | 0% | 982 | 4,989 | +408% | 0 | 0 | — |
case-17 | fail→pass | 14,720 | 7,787 | -47% | 1 | 1 | 0% | 2,751 | 4,441 | +61% | 0 | 0 | — |
case-03 | fail→pass | 9,533 | 14,708 | +54% | 1 | 1 | 0% | 1,947 | 5,321 | +173% | 0 | 0 | — |
case-04 | pass→pass | 8,144 | 2,950 | -64% | 1 | 1 | 0% | 1,879 | 3,679 | +96% | 0 | 0 | — |
case-05 | pass→pass | 8,990 | 5,679 | -37% | 1 | 1 | 0% | 1,630 | 4,118 | +153% | 0 | 0 | — |
case-06 | pass→pass | 15,653 | 9,935 | -37% | 1 | 1 | 0% | 2,891 | 4,984 | +72% | 0 | 0 | — |
case-08 | fail→fail | 9,250 | 4,589 | -50% | 1 | 1 | 0% | 1,660 | 3,854 | +132% | 0 | 0 | — |
case-09 | pass→pass | 10,568 | 5,273 | -50% | 1 | 1 | 0% | 1,910 | 3,963 | +107% | 0 | 0 | — |
case-10 | fail→fail | 9,620 | 6,014 | -37% | 1 | 1 | 0% | 1,805 | 4,208 | +133% | 0 | 0 | — |
case-11 | pass→pass | 8,508 | 5,863 | -31% | 1 | 1 | 0% | 1,715 | 4,236 | +147% | 0 | 0 | — |
case-12 | pass→pass | 13,726 | 7,677 | -44% | 1 | 1 | 0% | 2,619 | 4,600 | +76% | 0 | 0 | — |
case-13 | pass→pass | 7,448 | 2,352 | -68% | 1 | 1 | 0% | 1,374 | 3,409 | +148% | 0 | 0 | — |
case-14 | pass→pass | 10,890 | 4,631 | -57% | 1 | 1 | 0% | 1,756 | 3,888 | +121% | 0 | 0 | — |
case-15 | pass→pass | 14,110 | 8,669 | -39% | 1 | 1 | 0% | 2,468 | 4,494 | +82% | 0 | 0 | — |
case-16 | pass→pass | 17,430 | 12,338 | -29% | 1 | 1 | 0% | 2,826 | 5,123 | +81% | 0 | 0 | — |
case-18 | pass→pass | 9,450 | 3,768 | -60% | 1 | 1 | 0% | 1,586 | 3,702 | +133% | 0 | 0 | — |
case-19 | pass→pass | 10,970 | 7,369 | -33% | 1 | 1 | 0% | 2,062 | 4,327 | +110% | 0 | 0 | — |
case-20 | pass→pass | 21,828 | 13,078 | -40% | 1 | 1 | 0% | 3,505 | 5,766 | +65% | 0 | 0 | — |
case-21 | pass→pass | 8,699 | 5,508 | -37% | 1 | 1 | 0% | 1,657 | 4,016 | +142% | 0 | 0 | — |
case-22 | pass→pass | 9,460 | 5,457 | -42% | 1 | 1 | 0% | 1,707 | 4,028 | +136% | 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. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +18 percentage points is the difference between those two pass rates over the 21 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.
| Model | Method | Date | Lift |
|---|---|---|---|
| gemini-3.6-flash | verified | 7/24/2026 | +23% |
Other measured skills in the registry, with their headline benchmark lift.