Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

bio-atac-seq-consensus-peakset

БесплатноЗапускает вложенные скриптыНе проверен

Build a differential-ready consensus peakset from per-replicate ATAC-seq peaks using iterative overlap removal, fixed-width re-centering, and majority-rule…

gabrielmoreiraот gabrielmoreira★ 23 звезды на GitHub

Об этом скилле

Version Compatibility

Reference examples tested with: bedtools 2.31+, samtools 1.19+, BEDOPS 2.4.41+, GenomicRanges 1.54+, DiffBind 3.12+, Subread 2.0+ (featureCounts), pybedtools 0.10+.

Before using code patterns, verify installed versions match. If versions differ:

  • Python: pip show <package> then help(module.function) to check signatures
  • R: packageVersion('<pkg>') then ?function_name to verify parameters
  • CLI: <tool> --version then <tool> --help to confirm flags

If code throws unexpected errors, introspect the installed package and adapt rather than retrying.

Consensus Peakset Construction

"Build a single peakset I can count reads against across all my samples" -> Combine per-replicate or per-condition peak calls into a non-redundant, fixed-width set of regions. The strategy chosen drives FDR calibration, peak-width fairness, and reproducibility downstream.

  • CLI: bedtools merge (simple union) and bedtools multiinter -j (per-sample membership)
  • CLI: Corces 2018 iterative overlap removal (custom shell)
  • R: DiffBind::dba.count(summits=250) (built-in fixed-width)
  • Python: pybedtools for programmatic merging

The peakset choice is rarely default-correct. Wrong width or wrong overlap rule propagates to every downstream analysis (differential, motif, footprint, ML).

Why a Consensus Peakset Matters

ATAC peaks vary in width across replicates: same regulatory element might be called 200 bp in rep1 and 800 bp in rep2 because of stochastic Tn5 cuts at edges. Counting reads in different-width intervals confounds peak width with biological signal. A fixed-width consensus avoids this.

For ENCODE-style differential analysis: ALL samples must be counted against the SAME peak coordinates; otherwise the count matrix is non-rectangular and statistical models are misspecified.

Strategy Taxonomy

Strategy Implementation Width When to use Fails when
Naive union bedtools merge of all peaks Variable, tends wide Quick exploratory; never for differential Width inflation drives spurious differential
Naive intersection bedtools multiinter requiring all samples Variable High-stringency reproducibility Loses real condition-specific peaks
Majority-rule overlap multiinter requiring >= n/2 samples Variable Balance; DiffBind default with minOverlap Width still varies; counts are width-biased
Iterative overlap removal (Corces 2018) Sort by significance, greedily keep non-overlapping at fixed width 501 bp fixed ML features; cross-study comparison; modern ATAC standard Loses sub-501bp resolution; overweights high-significance peaks
Summit-centered fixed width (DiffBind) dba.count(summits=250) re-centers all peaks on summit +/- 250 bp 501 bp fixed Default for DiffBind workflows; integrates with replicate counts Requires summit info (MACS narrowPeak); broad peaks lose width info
IDR-filtered union Union of IDR-passed peaks across rep pairs Variable ENCODE pipeline-compliant; reproducibility-aware Requires running IDR per pair; computationally heavier
Per-condition union, then global union Each group consensus separately, then merge Variable Different cell types / strong condition shift Same width issues as naive union
Width-controlled extension Extend each peak to median width centered on midpoint User-set Quick fixed-width without summit info Midpoint != summit; can shift biology

Methodology evolves; verify against current ENCODE 4 ATAC standards (encodeproject.org/atac-seq) and the Corces 2018 iterative overlap algorithm before locking pipelines.

Iterative Overlap Removal (Corces 2018)

This is the modern standard for fixed-width consensus peaksets used in cross-study comparison and machine-learning feature matrices.

Algorithm:

  1. Pool all peaks from all samples; re-center each on its summit; extend +/- 250 bp -> 501 bp fixed-width peaks.
  2. Sort by significance (narrowPeak column 7, signalValue, descending).
  3. Walk down the sorted list. Keep each peak if it does not overlap any previously kept peak. Drop if overlap.
  4. Output the kept peaks as the consensus.

Goal: Produce a non-overlapping, fixed-width peakset weighted toward strongest evidence.

Approach: Greedy non-overlap on summit-centered fixed-width peaks ranked by signalValue.

#!/bin/bash
# Corces 2018 iterative overlap removal
PEAKS_DIR=peaks/per_sample
GENOME_SIZES=hg38.chrom.sizes
WIDTH_HALF=250                                       # 501 bp total width

# 1. Pool all peaks, re-center on summit, extend
awk -v w=$WIDTH_HALF 'BEGIN{OFS="\t"}
    {summit=$2+$10; print $1, summit-w, summit+w, $4, $7, $6}' \
    $PEAKS_DIR/*.narrowPeak | \
    awk '$2 >= 0' | \
    bedtools slop -i - -g $GENOME_SIZES -b 0 | \
    sort -k1,1 -k2,2n > pooled_recentered.bed

# 2. Sort by signalValue descending (column 5 in our BED -- which was co
Полный SKILL.md на GitHub

Установить bio-atac-seq-consensus-peakset в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/iterative_overlap.shusage-guide.md

FAQ

Что делает скилл bio-atac-seq-consensus-peakset?

Build a differential-ready consensus peakset from per-replicate ATAC-seq peaks using iterative overlap removal, fixed-width re-centering, and majority-rule overlap. Use when generating a stable peak coordinate system for downstream differential accessibility, ML feature engineering, cross-sample comparison, or fixed-width peak counts; covers Corces 2018 iterative overlap (501 bp), DiffBind summit re-centering, and ENCODE consistency rules.

Как установить скилл bio-atac-seq-consensus-peakset?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл bio-atac-seq-consensus-peakset запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить bio-atac-seq-consensus-peakset с