/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
$ npx -y skills add ammawla/encode-toolkit --skill motif-analysis --agent claude-codeHow 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
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.mdname: 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
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
Showing the first part of this file.
Search ENCODE, cross-reference 14 databases, run 7 analysis pipelines, and generate publication-ready methods — all from natural language in Claude Code.
Repo: ammawla/encode-toolkit
Other skills on encode-toolkit.
- /accessibility-aggregation
Build comprehensive chromatin accessibility maps by aggregating ATAC-seq and DNase-seq narrowPeak data across multiple ENCODE experiments, donors, and labs. Use when the user wants to answer "where is chromatin accessible in my tissue?" by combining peak calls into a union peak
Open skill - /batch-analysis
Guide for multi-experiment batch operations: QC screening, batch download, comparison, and report generation across many ENCODE experiments simultaneously. Use when users need to process 5+ experiments together, create experiment comparison tables, perform batch quality checks,
Open skill - /bioinformatics-installer
Install bioinformatics tools for ENCODE data analysis. Covers CLI tools (BWA, STAR, samtools, MACS2), R/Bioconductor packages (DESeq2, Seurat, ChIPseeker), Python packages (Scanpy, deeptools), and Nextflow pipeline infrastructure. Generates conda environments, R install scripts,
Open skill - /cellxgene-context
Guide for integrating CellxGene Census single-cell data with ENCODE bulk experiments. Use when users need cell-type-specific expression context for ENCODE regulatory data, want to deconvolve bulk ENCODE signals, or validate regulatory elements at single-cell resolution. Trigger
Open skill - /cite-encode
Generate proper ENCODE citations for publications, grants, and presentations. Use when the user needs to cite ENCODE data, create bibliography entries, write acknowledgment sections, or ensure compliance with ENCODE data use policy.
Open skill - /clinvar-annotation
Guide for annotating ENCODE regulatory variants with ClinVar clinical significance. Use when users need to check if variants in ENCODE peaks have clinical associations, find pathogenic variants in regulatory regions, or assess variant clinical impact. Trigger on: ClinVar,
Open skill

