bio-chipseq-super-enhancers
This Claude Code skill identifies super-enhancers from H3K27ac ChIP-seq data using the ROSE algorithm, which stitches nearby enhancer peaks and ranks them by signal intensity to detect large regulatory domains. Use this skill when analyzing cell identity genes, cancer-associated regulatory elements, or master transcription factor binding sites that cluster into enhancer domains spanning multiple peaks.
git clone --depth 1 https://github.com/FreedomIntelligence/OpenClaw-Medical-Skills /tmp/bio-chipseq-super-enhancers && cp -r /tmp/bio-chipseq-super-enhancers/skills/bio-chipseq-super-enhancers ~/.claude/skills/bio-chipseq-super-enhancersSKILL.md
## Version Compatibility
Reference examples tested with: GenomicRanges 1.54+, bedtools 2.31+, ggplot2 3.5+, samtools 1.19+
Before using code patterns, verify installed versions match. If versions differ:
- R: `packageVersion('<pkg>')` then `?function_name` to verify parameters
- CLI: `<tool> --version` then `<tool> --help` to confirm flags
If code throws ImportError, AttributeError, or TypeError, introspect the installed
package and adapt the example to match the actual API rather than retrying.
# Super-Enhancer Calling
**"Identify super-enhancers from H3K27ac ChIP-seq"** → Stitch nearby enhancer peaks and rank by signal to find large regulatory domains controlling cell identity genes.
- CLI: `ROSE_main.py -g hg38 -i peaks.gff -r chip.bam -c input.bam`
Identify super-enhancers (SEs) - large clusters of enhancers that control cell identity genes.
## Background
Super-enhancers are:
- Large clusters of enhancer regions
- Marked by H3K27ac, Med1, BRD4
- Control cell identity genes
- Often altered in disease/cancer
## ROSE (Rank Ordering of Super-Enhancers)
### Installation
```bash
git clone https://github.com/stjude/ROSE.git
cd ROSE
# Requires samtools, R, bedtools
```
### Input Requirements
1. **BAM file** - H3K27ac ChIP-seq aligned reads
2. **Peak file** - Called peaks (BED or GFF)
3. **Genome annotation** - TSS annotations
### Run ROSE
**Goal:** Identify super-enhancers by stitching nearby enhancer peaks and ranking by H3K27ac signal.
**Approach:** Run ROSE_main.py with a GFF peak file, ChIP-seq BAM, and optional input control to stitch enhancers within 12.5 kb, rank by signal, and identify the inflection point separating super-enhancers from typical enhancers.
```bash
# Basic usage
python ROSE_main.py \
-g HG38 \
-i peaks.gff \
-r h3k27ac.bam \
-o output_dir \
-s 12500 \
-t 2500
# With control/input
python ROSE_main.py \
-g HG38 \
-i peaks.gff \
-r h3k27ac.bam \
-c input.bam \
-o output_dir
```
### Key Parameters
| Parameter | Description | Default |
|-----------|-------------|---------|
| `-s` | Stitching distance | 12500 bp |
| `-t` | TSS exclusion | 2500 bp |
| `-c` | Control BAM | None |
### Output Files
```
output_dir/
├── *_AllEnhancers.table.txt # All enhancer regions
├── *_SuperEnhancers.table.txt # Super-enhancers only
├── *_Enhancers_withSuper.bed # BED with SE annotation
└── *_Plot_points.png # Hockey stick plot
```
## Prepare Input Files
### Convert BED to GFF
```bash
# ROSE requires GFF format for peaks
awk 'BEGIN{OFS="\t"} {print $1,"peaks","enhancer",$2,$3,".",$6,".","ID="NR}' \
peaks.bed > peaks.gff
```
### Filter Peaks for Enhancers
```bash
# Remove promoter peaks (within 2.5kb of TSS)
bedtools intersect -a peaks.bed -b promoters.bed -v > enhancer_peaks.bed
```
## Alternative: HOMER Super-Enhancers
```bash
# Call super-enhancers with HOMER
findPeaks tag_dir/ -style super -o auto
# Or from existing peaks
findPeaks tag_dir/ -style super -i input_tag_dir/ \
-typical typical_enhancers.txt \
-superSlope -1000 \
> super_enhancers.txt
```
## Alternative: SEanalysis
```bash
# R-based analysis
Rscript << 'EOF'
library(SEanalysis)
# Load H3K27ac signal at enhancers
signal <- read.table('enhancer_signal.txt', header=TRUE)
# Rank and identify super-enhancers
se_result <- identifySE(signal$signal, method='ROSE')
# Get super-enhancer IDs
super_enhancers <- signal$id[se_result$is_super]
write.table(super_enhancers, 'super_enhancers.txt', quote=FALSE, row.names=FALSE)
EOF
```
## Custom Hockey Stick Analysis (R)
**Goal:** Classify enhancers as super-enhancers vs typical using a custom hockey stick plot and inflection-point detection.
**Approach:** Rank enhancers by normalized signal, compute the slope at each point, find where the tangent exceeds 1 (inflection point), and classify all enhancers above the inflection as super-enhancers.
```r
library(ggplot2)
# Load enhancer signal data
enhancers <- read.table('enhancer_signal.txt', header=TRUE)
# Rank by signal
enhancers <- enhancers[order(enhancers$signal), ]
enhancers$rank <- 1:nrow(enhancers)
# Find inflection point (tangent = 1)
# Normalize ranks and signal to 0-1
enhancers$rank_norm <- enhancers$rank / max(enhancers$rank)
enhancers$signal_norm <- enhancers$signal / max(enhancers$signal)
# Calculate slope at each point
n <- nrow(enhancers)
slopes <- diff(enhancers$signal_norm) / diff(enhancers$rank_norm)
inflection <- which(slopes > 1)[1]
# Classify
enhancers$type <- ifelse(enhancers$rank >= inflection, 'Super-Enhancer', 'Typical')
# Plot
ggplot(enhancers, aes(rank, signal, color = type)) +
geom_point(size = 0.5) +
scale_color_manual(values = c('Super-Enhancer' = 'red', 'Typical' = 'grey60')) +
geom_vline(xintercept = inflection, linetype = 'dashed') +
labs(x = 'Enhancer Rank', y = 'H3K27ac Signal', title = 'Super-Enhancer Identification') +
theme_bw()
ggsave('hockey_stick_plot.pdf', width = 8, height = 6)
# Output super-enhancers
super_enhancers <- enhancers[enhancers$type == 'Super-Enhancer', ]
write.table(super_enhancers, 'super_enhancers.txt', sep = '\t', quote = FALSE, row.names = FALSE)
```
## Calculate Enhancer Signal
```bash
# Get H3K27ac signal at peak regions
bedtools multicov -bams h3k27ac.bam -bed enhancer_peaks.bed > enhancer_counts.txt
# Normalize by peak size
awk 'BEGIN{OFS="\t"} {
size = $3 - $2
rpm = ($NF / TOTAL_READS) * 1e6
rpkm = rpm / (size / 1000)
print $0, rpkm
}' enhancer_counts.txt > enhancer_signal.txt
```
## Downstream Analysis
### Gene Assignment
```bash
# Assign super-enhancers to nearest genes
bedtools closest -a super_enhancers.bed -b genes.bed -d > se_gene_assignment.txt
```
### Compare Conditions
**Goal:** Find super-enhancers gained or lost between two experimental conditions.
**Approach:** Convert super-enhancer tables to GRanges objects and use subsetByOverlaps with invert to identify condition-specific super-enhancersCloud laboratory platform for automated protein testing and validation. Use when designing proteins and needing experimental validation including binding assays, expression testing, thermostability measurements, enzyme activity assays, or protein sequence optimization. Also use for submitting experiments via API, tracking experiment status, downloading results, optimizing protein sequences for better expression using computational tools (NetSolP, SoluProt, SolubleMPNN, ESM), or managing protein design workflows with wet-lab validation.
Time-blind friendly planning, executive function support, and daily structure for ADHD brains. Specializes in realistic time estimation, dopamine-aware task design, and building systems that
This skill should be used for time series machine learning tasks including classification, regression, clustering, forecasting, anomaly detection, segmentation, and similarity search. Use when working with temporal data, sequential patterns, or time-indexed observations requiring specialized algorithms beyond standard ML approaches. Particularly suited for univariate and multivariate time series analysis with scikit-learn compatible APIs.
Browse the web for any task — research topics, read articles, interact with web apps, fill forms, take screenshots, extract data, and test web pages. Use whenever a browser would be useful, not just when the user explicitly asks.
AI驱动的综合健康分析系统,整合多维度健康数据、识别异常模式、预测健康风险、提供个性化建议。支持智能问答和AI健康报告生成。
Access AlphaFold's 200M+ AI-predicted protein structures. Retrieve structures by UniProt ID, download PDB/mmCIF files, analyze confidence metrics (pLDDT, PAE), for drug discovery and structural biology.