sciagent-skill-creator
Scaffold a new SciAgent-Skills entry. Picks pipeline/toolkit/database/guide template, creates skills/{category}/{name}/SKILL.md with valid frontmatter, appends…
Poisson-model peak caller for ChIP-seq/ATAC-seq BAMs. MACS3 callpeak finds enriched regions (TF sites or histone marks) vs input/IgG; outputs BED narrowPeak/broadPeak for motif analysis, annotation, and differential binding. Use narrow peaks for TF ChIP-seq and ATAC-seq; broad
$ npx -y skills add jaechang-hits/SciAgent-Skills --skill macs3-peak-calling --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/macs3-peak-callingContext preview
The summary Claude sees to decide when to auto-load this skill.
Poisson-model peak caller for ChIP-seq/ATAC-seq BAMs. MACS3 callpeak finds enriched regions (TF sites or histone marks) vs input/IgG; outputs BED narrowPeak/broadPeak for motif analysis, annotation, and differential binding. Use narrow peaks for TF ChIP-seq and ATAC-seq; broad
name: "macs3-peak-calling" description: "Poisson-model peak caller for ChIP-seq/ATAC-seq BAMs. MACS3 callpeak finds enriched regions (TF sites or histone marks) vs input/IgG; outputs BED narrowPeak/broadPeak for motif analysis, annotation, and differential binding. Use narrow peaks for TF ChIP-seq and ATAC-seq; broad for H3K27me3, H3K9me3, and other broad marks." license: "BSD-3-Clause"
MACS3 (Model-based Analysis of ChIP-seq) identifies regions of significant read enrichment (peaks) from ChIP-seq, ATAC-seq, CUT&RUN, and CUT&TAG experiments. It models the fragment length distribution from paired-end data or estimates it from mono-nucleosomal read shifting in single-end data, then applies a Poisson model to identify fold-enrichment over an input/IgG control. MACS3 produces BED-format narrowPeak (for transcription factors) or broadPeak (for histone marks) files with signal and q-value tracks for visualization in IGV or UCSC Genome Browser.
> **Check before installing**: The tool may already be available in the current environment (e.g., inside a `pixi` / `conda` env). Run `command -v macs3` first and skip the install commands below if it returns a path. When running inside a pixi project, invoke the tool via `pixi run macs3` rather than bare `macs3`.
# Install with pip or conda pip install macs3 # or conda install -c bioconda macs3 # Verify macs3 --version # macs3 3.0.2
# Call peaks for TF ChIP-seq (narrow peaks, with input control)
macs3 callpeak \
-t chip.bam \
-c input.bam \
-f BAM \
-g hs \
-n sample_tf \
--outdir peaks/ \
-q 0.05
# Output: peaks/sample_tf_peaks.narrowPeak
wc -l peaks/sample_tf_peaks.narrowPeakMACS3 requires sorted, indexed BAM files from genome alignment.
# Sort and index ChIP and control BAMs (if not already done) samtools sort -@ 8 chip_raw.bam -o chip.bam samtools sort -@ 8 input_raw.bam -o input.bam samtools index chip.bam samtools index input.bam # Check read counts echo "ChIP reads: $(samtools view -c -F 4 chip.bam)" echo "Input reads: $(samtools view -c -F 4 input.bam)"
Use the default mode for transcription factor binding site identification.
# TF ChIP-seq with input control
macs3 callpeak \
-t chip.bam \
-c input.bam \
-f BAM \
-g hs \
-n tf_chip \
--outdir peaks/ \
-q 0.05 \
--keep-dup auto
echo "Peaks called: $(wc -l < peaks/tf_chip_peaks.narrowPeak)"
echo "Summit file: peaks/tf_chip_summits.bed"
# Without input control (less recommended)
macs3 callpeak \
-t chip.bam \
-f BAM \
-g hs \
-n tf_noinput \
--outdir peaks/ \
--nolambdaUse `--broad` for spread histone modifications like H3K27me3 or H3K36me3.
# H3K27me3 broad histone mark
macs3 callpeak \
-t h3k27me3.bam \
-c input.bam \
-f BAM \
-g hs \
-n h3k27me3 \
--outdir peaks/ \
--broad \
--broad-cutoff 0.1 \
-q 0.05
echo "Broad peaks: $(wc -l < peaks/h3k27me3_peaks.broadPeak)"
# H3K4me3 (sharp mark — use narrow peaks)
macs3 callpeak \
-t h3k4me3.bam \
-c input.bam \
-f BAM \
-g hs \
-n h3k4me3 \
--outdir peaks/ \
-q 0.05ATAC-seq requires special handling for the Tn5 insertion site.
# ATAC-seq with paired-end BAM (recommended)
macs3 callpeak \
-t atac.bam \
-f BAMPE \
-g hs \
-n atac_sample \
--outdir peaks/ \
--nomodel \
--nolambda \
-q 0.05 \
--keep-dup all
echo "ATAC peaks: $(wc -l < peaks/atac_sample_peaks.narrowPeak)"
# Single-end ATAC-seq: shift reads to center on Tn5 cut site
macs3 callpeak \
-t atac_se.bam \
-f BAM \
-g hs \
-n atac_se \
--outdir peaks/ \
--nomodel \
--shift -100 \
--extsize 200 \
--keep-dup allProduce bedGraph and bigWig files for genome browser visualization.
# Generate bedGraph normalized to million reads (SPMR)
macs3 callpeak \
-t chip.bam \
-c input.bam \
-f BAM \
-g hs \
-n chip_track \
--outdir tracks/ \
-B \
--SPMR \
--keep-dup auto
# Convert bedGraph to bigWig for IGV/UCSC
# Requires bedGraphToBigWig and chrom.sizes
sort -k1,1 -k2,2n tracks/chip_track_treat_pileup.bdg > tracks/chip_sorted.bdg
bedGraphToBigWig tracks/chip_sorted.bdg genome/hg38.chrom.sizes tracks/chip.bw
echo "BigWig track: tracks/chip.bw"Parse narrowPeak output and annotate peaks to genomic features.
import pandas as pd
# Load narrowPeak file
# Columns: chrom, start, end, name, score, strand, signalValue, pValue, qValue, peak
cols = ["chrom", "start", "end", "name", "score", "strand",
"signalValue", "pValue", "qValue", "peak"]
peaks = pd.reaTurn your AI coding agent into a life sciences expert — 199 bioinformatics skills for Claude Code covering RNA-seq, single-cell analysis, genomics, proteomics, drug discovery, and more. Boosted BixBench from 65% to 92%. Open source.
Scaffold a new SciAgent-Skills entry. Picks pipeline/toolkit/database/guide template, creates skills/{category}/{name}/SKILL.md with valid frontmatter, appends…
Bayesian modeling with PyMC 5: priors, likelihood, NUTS/ADVI sampling, diagnostics (R-hat, ESS), LOO/WAIC comparison, prediction. Hierarchical, logistic, GP…
Time-to-event modeling with scikit-survival: Cox PH (elastic net), Random Survival Forests, Boosting, SVMs for censored data. C-index, Brier, time-dependent…
Guided statistical analysis: test choice, assumption checks, effect sizes, power, APA reporting. Pick tests, verify assumptions, or format results for…
Python statistical modeling: regression (OLS, WLS, GLM), discrete (Logit, Poisson, NegBin), time series (ARIMA, SARIMAX, VAR), with rigorous inference,…
DL cell/nucleus segmentation for fluorescence and brightfield microscopy. Pre-trained models (cyto3, nuclei, tissuenet) and a generalist flow-based algorithm…