Skip to content

/motif-analysis

Guide for de novo and known motif enrichment analysis of ENCODE ChIP-seq and ATAC-seq peaks using HOMER and MEME Suite. Use when users need to discover TF binding motifs in peaks, validate ChIP-seq targets, or find co-binding partners. Trigger on: motif analysis, HOMER, MEME, de

From plugin
2994 skills7 agents10 commands
shell
$ npx -y skills add ammawla/encode-toolkit --skill motif-analysis --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/motif-analysis
How auto-invocation works

Context preview

The summary Claude sees to decide when to auto-load this skill.

Guide for de novo and known motif enrichment analysis of ENCODE ChIP-seq and ATAC-seq peaks using HOMER and MEME Suite. Use when users need to discover TF binding motifs in peaks, validate ChIP-seq targets, or find co-binding partners. Trigger on: motif analysis, HOMER, MEME, de

SKILL.md

motif-analysis.SKILL.md
name: motif-analysis
description: "Guide for de novo and known motif enrichment analysis of ENCODE ChIP-seq and ATAC-seq peaks using HOMER and MEME Suite. Use when users need to discover TF binding motifs in peaks, validate ChIP-seq targets, or find co-binding partners. Trigger on: motif analysis, HOMER, MEME, de novo motif, motif enrichment, findMotifsGenome, AME, MEME-ChIP, known motif, TF binding motif, co-factor, motif discovery."

Motif Analysis of ENCODE Peak Data

When to Use

  • User wants to discover transcription factor binding motifs in ChIP-seq or ATAC-seq peaks
  • User asks about "motif enrichment", "HOMER", "MEME", or "de novo motif discovery"
  • User needs to validate ChIP-seq targets by checking if the expected motif is enriched
  • User wants to find co-binding partners or co-factor motifs in peak regions
  • Example queries: "find motifs in my CTCF peaks", "run HOMER on ATAC-seq peaks", "what TFs co-bind with p300 in liver?"

Help the user perform de novo and known motif enrichment analysis on ENCODE ChIP-seq and ATAC-seq peaks. Motif analysis serves two critical purposes: (1) validating that ChIP-seq experiments pulled down the expected transcription factor, and (2) discovering co-regulatory partners that co-bind with the target factor. This skill covers the two major tool suites -- HOMER and MEME Suite -- from input preparation through result interpretation.

Literature Foundation

| Reference | Journal | Key Contribution | DOI | Citations | |-----------|---------|-----------------|-----|-----------| | Heinz et al. (2010) | Molecular Cell | HOMER: Simple combinations of lineage-determining TFs prime cis-regulatory elements; introduced findMotifsGenome.pl for ChIP-seq motif analysis | [10.1016/j.molcel.2010.05.004](https://doi.org/10.1016/j.molcel.2010.05.004) | ~6,000 | | Bailey et al. (2009) | Nucleic Acids Research | MEME Suite: comprehensive tools for motif discovery (MEME), enrichment (AME), scanning (FIMO), and spacing (SpaMo) | [10.1093/nar/gkp335](https://doi.org/10.1093/nar/gkp335) | ~2,500 | | Bailey & Elkan (1994) | ISMB | Foundational MEME algorithm: expectation maximization for discovering ungapped motifs in biopolymers | PMID: 7584402 | ~4,000 | | Machanick & Bailey (2011) | Bioinformatics | MEME-ChIP: all-in-one motif analysis pipeline optimized for large ChIP-seq datasets | [10.1093/bioinformatics/btr189](https://doi.org/10.1093/bioinformatics/btr189) | ~1,800 | | Fornes et al. (2020) | Nucleic Acids Research | JASPAR 2020: curated, non-redundant TF binding profile database; standard reference for known motifs | [10.1093/nar/gkz1001](https://doi.org/10.1093/nar/gkz1001) | ~2,200 | | Amemiya et al. (2019) | Scientific Reports | ENCODE Blacklist: regions producing artifact signal that can generate spurious motif hits | [10.1038/s41598-019-45839-z](https://doi.org/10.1038/s41598-019-45839-z) | ~1,372 |

Prerequisites: Input Preparation

Obtaining ENCODE Peaks

Search for and download ChIP-seq or ATAC-seq peaks:

encode_search_experiments(
    assay_title="TF ChIP-seq",
    target="CTCF",
    organ="pancreas",
    biosample_type="tissue"
)

encode_list_files(
    experiment_accession="ENCSR...",
    file_format="bed",
    output_type="IDR thresholded peaks",
    assembly="GRCh38",
    preferred_default=True
)

encode_download_files(
    file_accessions=["ENCFF..."],
    download_dir="/data/motif_analysis/"
)

Preparing Sequences from Peaks

Motif analysis requires DNA sequences, not just genomic coordinates. Extract sequences centered on peak summits:

# For TF ChIP-seq: extract summit +/- 100bp (200bp window)
awk 'BEGIN{OFS="\t"} {summit=$2+$10; print $1, summit-100, summit+100, $4, $5}' \
    peaks.narrowPeak > summits_200bp.bed

# Remove blacklisted regions (Amemiya et al. 2019)
bedtools intersect -a summits_200bp.bed \
    -b hg38-blacklist.v2.bed -v > summits_clean.bed

# Extract FASTA sequences (requires genome FASTA)
bedtools getfasta -fi hg38.fa -bed summits_clean.bed -fo summits.fa

# For ATAC-seq: use full peak regions (typically 200-500bp)
bedtools getfasta -fi hg38.fa -bed atac_peaks_clean.bed -fo atac_peaks.fa

**Critical**: For TF ChIP-seq, always center on the summit (column 10 in narrowPeak format) and use a narrow window (150-250bp). Using the full peak region dilutes the motif signal because TF binding sites are concentrated at the summit. For histone ChIP-seq, use the full peak or a broader window because histone marks cover larger domains.

Subsampling Large Peak Sets

For peak sets larger than 50,000, subsample the top peaks by signal strength:

# Sort by signalValue (column 7) descending, take top 10,000
sort -k7,7nr summits_clean.bed | head -10000 > top10k_summits.bed
bedtools getfasta -fi hg38.fa -bed top10k_summits.bed -fo top10k_summits.fa

This improves speed without sacrificing sensitivity, as the strongest peaks contain the most consistent motif instances.

Part 1: HOMER findMotifsGenome

HOMER (Heinz et al. 2010) performs both de novo motif discovery and known motif enrichment in a single command. It is the most widely used tool for ChIP-seq motif analysis.

1a. Basic Usage

findMotifsGenome.pl peaks.bed hg38 homer_output/ \
    -size 200 \
    -mask \
    -p 8 \
    -preparsedDir /data/homer_preparsed/

**Key parameters**:

| Parameter | Value | Rationale | |-----------|-------|-----------| | `-size` | 200 (TF ChIP-seq) | Window around peak center; 200bp captures typical TF binding site + flanking context | | `-size` | given (histone ChIP-seq) | Use actual peak boundaries for broad marks | | `-mask` | always include | Mask repeat sequences to avoid spurious repeat-derived motifs | | `-p` | 8 (or available cores) | Parallel threads for speed | | `-preparsedDir` | reusable directory | Cache parsed genome for repeated runs | | `-bg` | background.bed (optional) | Custom background regions; default uses matched GC regions from genome | | `-mknown` | motifs.m

Read more
Read it on GitHub ↗

Showing the first part of this file.

Ships withencode-toolkit

Search ENCODE, cross-reference 14 databases, run 7 analysis pipelines, and generate publication-ready methods — all from natural language in Claude Code.

Get the whole plugin, auto-invoked
Stats
29
Stars
0
Views
5
Forks
Active
Maintenance
Python
Language
AGPL-3.0
License
8d ago
Last commit
4mo ago
Created

Repo: ammawla/encode-toolkit

Other skills on encode-toolkit.