Back to list
GPTomics

bio-chipseq-peak-calling

by GPTomics

a set of SKILLS.md for doing bioinformatics with agents like claude code

65🍴 17📅 Jan 24, 2026

SKILL.md


name: bio-chipseq-peak-calling description: ChIP-seq peak calling using MACS3 (or MACS2). Call narrow peaks for transcription factors or broad peaks for histone modifications. Supports input control, fragment size modeling, and various output formats including narrowPeak and broadPeak BED files. Use when calling peaks from ChIP-seq alignments. tool_type: cli primary_tool: macs3

Peak Calling with MACS3

MACS3 is the actively developed successor to MACS2. Commands are identical except the binary name. MACS2 is in maintenance mode.

Basic Peak Calling

# Call peaks with input control (recommended)
macs3 callpeak -t chip.bam -c input.bam -f BAM -g hs -n sample --outdir peaks/

# For MACS2 (legacy), replace 'macs3' with 'macs2' - syntax is identical

Without Input Control

# Not recommended, but possible
macs3 callpeak -t chip.bam -f BAM -g hs -n sample --outdir peaks/

Narrow Peaks (TF, H3K4me3, H3K27ac)

macs3 callpeak \
    -t chip.bam \
    -c input.bam \
    -f BAM \
    -g hs \                        # hs=human, mm=mouse, ce=worm, dm=fly
    -n sample_narrow \
    --outdir peaks/ \
    -q 0.05                        # q-value threshold

Broad Peaks (H3K36me3, H3K27me3, H3K9me3)

macs3 callpeak \
    -t chip.bam \
    -c input.bam \
    -f BAM \
    -g hs \
    -n sample_broad \
    --outdir peaks/ \
    --broad \                      # Broad peak mode
    --broad-cutoff 0.1             # Broad peak q-value

Paired-End Data

# MACS3 uses BAMPE format for paired-end
macs3 callpeak \
    -t chip.bam \
    -c input.bam \
    -f BAMPE \                     # Paired-end BAM
    -g hs \
    -n sample_pe \
    --outdir peaks/

Multiple Replicates

# Pool replicates (MACS3 handles internally)
macs3 callpeak \
    -t rep1.bam rep2.bam rep3.bam \
    -c input.bam \
    -f BAM \
    -g hs \
    -n pooled \
    --outdir peaks/

Custom Genome Size

# For non-model organisms or custom genomes
macs3 callpeak \
    -t chip.bam \
    -c input.bam \
    -f BAM \
    -g 2.7e9 \                     # Effective genome size in bp
    -n sample \
    --outdir peaks/

Common Genome Sizes

GenomeFlagEffective Size
Humanhs2.7e9
Mousemm1.87e9
C. elegansce9e7
D. melanogasterdm1.2e8

Fixed Fragment Size

# If modeling fails or for ATAC-seq
macs3 callpeak \
    -t chip.bam \
    -c input.bam \
    -f BAM \
    -g hs \
    --nomodel \                    # Skip model building
    --extsize 200 \                # Fixed extension size
    -n sample \
    --outdir peaks/

Generate Signal Tracks

# Generate bedGraph and bigWig files
macs3 callpeak \
    -t chip.bam \
    -c input.bam \
    -f BAM \
    -g hs \
    -n sample \
    --outdir peaks/ \
    -B \                           # Generate bedGraph
    --SPMR                         # Signal per million reads

# Convert to bigWig (requires UCSC tools)
sort -k1,1 -k2,2n peaks/sample_treat_pileup.bdg > peaks/sample.sorted.bdg
bedGraphToBigWig peaks/sample.sorted.bdg chrom.sizes peaks/sample.bw

Local Lambda for Broad Marks

# Recommended for very broad marks
macs3 callpeak \
    -t chip.bam \
    -c input.bam \
    -f BAM \
    -g hs \
    --broad \
    --nolambda \                   # Use local lambda only
    -n sample \
    --outdir peaks/

Cutoff Analysis

# Test different q-value cutoffs
macs3 callpeak \
    -t chip.bam \
    -c input.bam \
    -f BAM \
    -g hs \
    --cutoff-analysis \            # Generate cutoff analysis file
    -n sample \
    --outdir peaks/

Output Files

FileDescription
*_peaks.narrowPeakPeak coordinates (BED6+4)
*_peaks.broadPeakBroad peak coordinates
*_summits.bedPeak summit positions
*_model.rR script for model visualization
*_treat_pileup.bdgTreatment signal (with -B)
*_control_lambda.bdgControl signal (with -B)

narrowPeak Format

chr1  100  200  peak_1  100  .  5.2  10.5  8.3  50

Columns: chr, start, end, name, score, strand, signalValue, pValue, qValue, peak

Filter Peaks

# Filter by q-value
awk '$9 > 2' peaks.narrowPeak > peaks.filtered.narrowPeak  # -log10(q) > 2 means q < 0.01

# Sort by signal strength
sort -k7,7nr peaks.narrowPeak > peaks.sorted.narrowPeak

Key Parameters

ParameterDefaultDescription
-trequiredTreatment BAM file(s)
-cnoneControl BAM file(s)
-fAUTOFormat (BAM, BAMPE, BED)
-ghsGenome size
-nNAOutput prefix
-q0.05Q-value cutoff
-pnoneP-value cutoff (overrides -q)
--broadfalseBroad peak calling
--nomodelfalseSkip model building
--extsize200Extension size (with --nomodel)
-BfalseGenerate bedGraph
--SPMRfalseSignal per million reads
  • peak-annotation - Annotate peaks to genes
  • differential-binding - Compare peaks between conditions
  • alignment-files - Prepare BAM files
  • chipseq-visualization - Visualize peaks

Score

Total Score

65/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

+5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

Reviews

💬

Reviews coming soon