Genomics epigenomics

From mdbabumiamssm/LLMs-Universal-Life-Science-and-Clinical-Skills- · View interactive version

Genomics epigenomics is an AI agent skill from the GitHub repository mdbabumiamssm/LLMs-Universal-Life-Science-and-Clinical-Skills-. Epigenomics analysis including ATAC-seq peak calling with MACS3, ChIP-seq analysis, motif enrichment, and chromatin accessibility.

How to use this skill

Skill file

<!--

COPYRIGHT NOTICE

This file is part of the "Universal Biomedical Skills" project.

Copyright (c) 2026 MD BABU MIA, PhD <md.babu.mia@mssm.edu>

All Rights Reserved.

#

This code is proprietary and confidential.

Unauthorized copying of this file, via any medium is strictly prohibited.

#

Provenance: Authenticated by MD BABU MIA

-->


name: bio-genomics-epigenomics

description: Epigenomics analysis including ATAC-seq peak calling with MACS3, ChIP-seq

analysis, motif enrichment, and chromatin accessibility.

tool_type: mixed

primary_tool: genomics

measurable_outcome: Execute skill workflow successfully with valid output within 15

minutes.

allowed-tools:


🧬 Epigenomics Analysis

Peak calling and chromatin accessibility analysis for ATAC-seq and ChIP-seq data.

Core Capabilities

  1. MACS3 peak calling: ATAC-specific and ChIP-seq peak detection
  2. Motif analysis: Homer, MEME motif enrichment in open chromatin regions
  3. Quality control: Fragment size distribution, TSS enrichment, FRiP scores
  4. Differential accessibility: Condition comparison of chromatin regions
  5. IDR replicate analysis: Irreproducible Discovery Rate for peak reproducibility

CLI Reference

python omicsclaw.py run epigenomics --demo
python omicsclaw.py run epigenomics --input <data.bam> --output <dir>

Algorithm / Methodology

MACS3 for ATAC-seq

Goal: Identify open chromatin regions from ATAC-seq data using ATAC-specific parameters.

Approach: Run MACS3 in paired-end mode with Tn5 shift correction, no model building, and duplicate retention.

macs3 callpeak \
    -t sample.bam \
    -f BAMPE \
    -g hs \
    -n sample \
    --outdir peaks/ \
    -q 0.05 \
    --nomodel \
    --shift -75 \
    --extsize 150 \
    --keep-dup all \
    -B \
    --call-summits

Why These Parameters?

| Parameter | Reason |

|-----------|--------|

| --nomodel | ATAC doesn't have control, can't build model |

| --shift -75 | Centers on Tn5 insertion site |

| --extsize 150 | Smooths signal around cut sites |

| --keep-dup all | Tn5 creates duplicate cuts at accessible sites |

| -f BAMPE | Uses actual fragment size from paired-end |

Call Peaks on NFR Only

# Filter to nucleosome-free reads (<100bp fragments)
samtools view -h sample.bam | \
    awk 'substr($0,1,1)=="@" || ($9>0 && $9<100) || ($9<0 && $9>-100)' | \
    samtools view -b > nfr.bam

# Call peaks on NFR
macs3 callpeak -t nfr.bam -f BAMPE -g hs -n sample_nfr \
    --nomodel --shift -37 --extsize 75 --keep-dup all -q 0.01

Broad Peaks (Optional)

macs3 callpeak -t sample.bam -f BAMPE -g hs -n sample_broad \
    --nomodel --shift -75 --extsize 150 --broad --broad-cutoff 0.1

Batch Processing

#!/bin/bash
GENOME=hs  # hs for human, mm for mouse
OUTDIR=peaks

mkdir -p $OUTDIR

for bam in *.bam; do
    sample=$(basename $bam .bam)
    macs3 callpeak -t $bam -f BAMPE -g $GENOME -n $sample --outdir $OUTDIR \
        --nomodel --shift -75 --extsize 150 --keep-dup all -q 0.05 -B --call-summits
done

IDR for Replicate Consistency

# Call peaks on each replicate separately
macs3 callpeak -t rep1.bam -f BAMPE -g hs -n rep1 ...
macs3 callpeak -t rep2.bam -f BAMPE -g hs -n rep2 ...

# Run IDR
idr --samples rep1_peaks.narrowPeak rep2_peaks.narrowPeak \
    --input-file-type narrowPeak --output-file idr_peaks.txt --plot

# Filter by IDR threshold
awk '$5 >= 540' idr_peaks.txt > reproducible_peaks.bed

Convert to BigWig

sort -k1,1 -k2,2n sample_treat_pileup.bdg > sample.sorted.bdg
bedGraphToBigWig sample.sorted.bdg chrom.sizes sample.bw

Output Files

| File | Description |

|------|-------------|

| _peaks.narrowPeak | Peak locations (BED-like) |

| _summits.bed | Peak summit positions |

| _peaks.xls | Peak statistics |

| _treat_pileup.bdg | Signal track (bedGraph) |

narrowPeak Format

Columns: chrom, start, end, name, score, strand, signalValue, pValue, qValue, summit_offset

Parameters

| Parameter | Default | Description |

|-----------|---------|-------------|

| --method | macs3 | macs3, homer, genrich |

| --mode | atac | atac, chipseq |

| --genome | hs | hs (human), mm (mouse) |

| --qvalue | 0.05 | FDR threshold |

Why This Exists

Workflow

  1. Calculate: Prepare cross-correlation and fragment histograms.
  2. Execute: Test local enrichment over poisson distribution null.
  3. Assess: Perform IDR replicates and FDR significance tests.
  4. Generate: Output structured summit maps and bedGraph.
  5. Report: Tabulate core peaks and TF motifs.

Example Queries

Output Structure

output_directory/
├── report.md
├── result.json
├── peaks.narrowPeak
├── figures/
│   └── footprint_plot.png
├── tables/
│   └── motif_enrichment.csv
└── reproducibility/
    ├── commands.sh
    ├── environment.yml
    └── checksums.sha256

Safety

Integration with Orchestrator

Trigger conditions:

Chaining partners:

Version Compatibility

Reference examples tested with: MACS3 3.0+, samtools 1.19+

Dependencies

Required: MACS3 (macs3), samtools

Optional: Homer, Genrich, IDR, bedtools, pyGenomeTracks

Citations

Related Skills

<!-- AUTHOR_SIGNATURE: 9a7f3c2e-MD-BABU-MIA-2026-MSSM-SECURE -->

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.