Annotate ChIP-seq peaks to genomic features and genes using ChIPseeker. Assign peaks to promoters, exons, introns, and intergenic regions. Find nearest genes and calculate distance to TSS. Generate annotation plots and statistics.
Standardmäßig ist der Prompt ausgewählt, der zuerst die Quelle prüft. Sie können zu einem direkten Befehl wechseln oder eine lokale Kopie herunterladen.
Quelldateien prüfen
Lesen Sie SKILL.md und alle von SkillsMP angezeigten Begleitdateien, bevor Sie sich für eine Installation entscheiden.
Mit Codex oder Claude installieren Kopieren Sie diesen Prompt, fügen Sie ihn in Codex, Claude oder einen anderen Assistant ein und lassen Sie die Skill-Seite prüfen und installieren.
Ein direkter Befehl überspringt den Prüf-Prompt. Prüfen Sie die Quelle, bevor Sie ihn ausführen.
Annotate ChIP-seq peaks to genomic features and genes using ChIPseeker. Assign peaks to promoters, exons, introns, and intergenic regions. Find nearest genes and calculate distance to TSS. Generate annotation plots and statistics.
tool_type
r
primary_tool
ChIPseeker
Peak Annotation with ChIPseeker
Load Peaks and Annotations
library(ChIPseeker)
library(TxDb.Hsapiens.UCSC.hg38.knownGene)
library(org.Hs.eg.db)
txdb <- TxDb.Hsapiens.UCSC.hg38.knownGene
# Read peaks from MACS2
peaks <- readPeakFile('sample_peaks.narrowPeak')
# Define promoter region (-3kb to +3kb from TSS)
peak_anno <- annotatePeak(
peaks,
TxDb = txdb,
tssRegion =c(-3000,3000),# Promoter definition
annoDb ='org.Hs.eg.db')
Extract Annotated Data Frame
# Convert to data frame
anno_df <- as.data.frame(peak_anno)# Key columns: seqnames, start, end, annotation, distanceToTSS, SYMBOL, GENENAME
head(anno_df)# Export to CSV
write.csv(anno_df,'annotated_peaks.csv', row.names =FALSE)
Get Genes with Peaks in Promoter
# Filter for promoter peaks
promoter_peaks <- anno_df[grep('Promoter', anno_df$annotation),]# Get unique genes
promoter_genes <- unique(promoter_peaks$SYMBOL)
Annotation Pie Chart
# Pie chart of genomic feature distribution
plotAnnoPie(peak_anno)# Bar plot alternative
plotAnnoBar(peak_anno)
Distance to TSS Plot
# Distribution of peaks relative to TSS
plotDistToTSS(peak_anno, title ='Distribution of peaks relative to TSS')
# Find overlapping peaks
genes_list <- lapply(anno_list,function(x) as.data.frame(x)$SYMBOL)
vennplot(genes_list)
Coverage Plot
# Plot peak coverage around TSS
covplot(peaks, weightCol ='V5')# V5 is score column in narrowPeak
Profile Heatmap Around TSS
# Get promoter coordinates
promoter <- getPromoters(TxDb = txdb, upstream =3000, downstream =3000)# Get tag matrix
tagMatrix <- getTagMatrix(peaks, windows = promoter)# Plot heatmap
tagHeatmap(tagMatrix, xlim =c(-3000,3000), color ='red')# Average profile
plotAvgProf(tagMatrix, xlim =c(-3000,3000), xlab ='Distance from TSS')
Functional Enrichment of Peak Genes
library(clusterProfiler)# Get genes from peaks
genes <- unique(anno_df$ENTREZID)# GO enrichment
ego <- enrichGO(
gene = genes,
OrgDb = org.Hs.eg.db,
ont ='BP',
pAdjustMethod ='BH',
pvalueCutoff =0.05)
Seq2Gene - All Genes in Peak Regions
# Find all genes overlapping peak regions (not just nearest)
genes_in_peaks <- seq2gene(peaks, tssRegion =c(-1000,1000), flankDistance =3000, TxDb = txdb)