Annotate ChIP-seq peaks to genomic features (promoter, exon, intron, intergenic), nearest or host genes, ENCODE candidate cis-regulatory elements (cCREs: PLS, pELS, dELS, CA-CTCF, CA-H3K4me3), regulatory domains via GREAT, and cell-type-specific enhancer-gene targets via ENCODE-rE2G. Supports ChIPseeker (R), HOMER annotatePeaks.pl (CLI), pyranges (Python), rGREAT, chipenrich, Broad-Enrich, and direct cCRE BED intersection.
BiocManager::install(c('ChIPseeker', 'GenomicFeatures', 'rtracklayer',
'rGREAT', 'chipenrich',
'TxDb.Hsapiens.UCSC.hg38.knownGene', 'org.Hs.eg.db'))
conda install -c bioconda homer bedtools
pip install pandas pyranges
Tell the agent what to do: - "Annotate my peaks to nearest genes with the provided GTF, host-gene convention" - "Classify each peak as promoter / exon / intron / intergenic with 2 kb promoter window" - "Intersect peaks with ENCODE cCREs and tell me what fraction are PLS / pELS / dELS / CA-CTCF" - "Run GREAT regulatory-domain gene-set enrichment for distal H3K27ac peaks" - "Run ChIP-Enrich with locus-length adjustment for GO enrichment on TF peaks" - "Annotate broad H3K27me3 domains using broadenrich method" - "Plot the peak distribution by feature type and signed distance to TSS"
"Annotate my H3K4me3 narrowPeak file using ChIPseeker with TxDb.Hsapiens.UCSC.hg38.knownGene, 2 kb promoter window, host-gene convention (
overlap='all')."
"Annotate peaks using a GENCODE v44 GTF I'm providing. Build TxDb from the GTF, map gene symbols from the GTF directly (annoDb doesn't work for custom TxDb), strip Ensembl version suffixes when joining."
"Download the ENCODE cCRE BED from SCREEN and intersect my peaks to classify them as PLS, pELS, dELS, CA-CTCF, or CA-H3K4me3. Report counts per class."
"I have ~5000 distal H3K27ac peaks. Run rGREAT with default basal+extension regulatory domain rules for GO:BP enrichment. Filter out hyper-ChIPable peaks first."
"Run chipenrich on my CTCF peaks with
locusdef='nearest_tss'andmethod='chipenrich'for GO:BP enrichment. The locus-length adjustment is important for fair comparison."
"Run broadenrich on H3K27me3 broadPeak file; the method accounts for region width which is critical for broad domains."
"Link H3K27ac enhancer peaks to target genes using ENCODE-rE2G for K562 cells."
"Show me peaks where the nearest-TSS gene differs from the host gene (peak in gene body)."
overlap='all') based on biologyannoDb parameter doesn't work with makeTxDbFromGFF; map symbols from the GTF directly.c(-3000, 3000); many studies use c(-2000, 2000) or c(-1000, 500). Match to the analysis requirements.ENSG00000142192.25; the TxDb may store version-less IDs.seqlevels mismatch in ChIPseekerChromosome naming convention (chr1 vs 1) differs between peaks and TxDb. Fix with:
seqlevelsStyle(peaks) <- 'UCSC' # or 'Ensembl'
Using annoDb='org.Hs.eg.db' with a custom makeTxDbFromGFF TxDb. Map symbols from the original GTF post-hoc; strip Ensembl version suffixes before joining.
Genome not configured for HOMER. Run perl configureHomer.pl -install hg38 once.
rGREAT v2.x runs locally without biomart; rGREAT v1.x used biomart over the network. For large peak sets, use rGREAT::great() with pre-loaded TxDb and gene sets.
Hyper-ChIPable artifacts at ribosomal protein genes and rRNA processing factors. Filter peaks against blacklist + custom hyper-ChIPable BED (top-1% input signal) before enrichment.
ENCODE-rE2G has cell-type-specific weights for a fixed set of cell types. For other cell types, use ABC with cell-type-matched ATAC + H3K27ac + Hi-C contact freq.
When peak boundaries shift (e.g., differential peaks are summit-recentered ±250 bp), nearest-TSS can change. Run annotation consistently on the original consensus peakset, then map differential calls.