Segment the genome into chromatin states by integrating multiple histone modification and chromatin factor ChIP-seq tracks. Covers ChromHMM (canonical multivariate HMM on binarized signal), Segway (Dynamic Bayesian Network on continuous signal), EpiSegMix (flexible-distribution HMM, 2024), EpiLogos (multi-biosample visualization), IDEAS (cell-type-aware joint), and full-stack ChromHMM (Vu Ernst 2022). Embeds state-count selection logic (15 vs 18 vs 25), Roadmap canonical model interpretation, bin-size trade-offs, and downstream OverlapEnrichment / NeighborhoodEnrichment for functional characterization.
# ChromHMM (canonical)
wget http://compbio.mit.edu/ChromHMM/ChromHMM.zip
unzip ChromHMM.zip
# Requires Java 8+
# Segway (continuous signal alternative)
pip install segway
# Other utilities
conda install -c bioconda samtools bedtools
Tell the agent what to do:
- "Run ChromHMM on H3K4me3, H3K27ac, H3K4me1, H3K36me3, H3K27me3 BAMs at 15-state resolution for GM12878"
- "Binarize ChIP-seq BAMs with BinarizeBam, learn 18-state model, then OverlapEnrichment with CGI / repeats / lncRNA / TSS anchors"
- "Compare ChromHMM 15-state vs 18-state vs 25-state segmentations and pick the smallest N where biology is interpretable"
- "Apply the precomputed Roadmap 25-state model to my new sample for cross-cell-type consistency"
- "Use EpiSegMix instead of ChromHMM for continuous signal handling"
- "Visualize ChromHMM segmentations across 12 cell types with EpiLogos"
"Build cellMarkFileTable for GM12878 with the 5 core Roadmap marks (H3K4me3, H3K4me1, H3K36me3, H3K27me3, H3K9me3) and matching input controls. Binarize with
BinarizeBam, learn a 15-state model, generate emission heatmap and segmented BED."
"I have 5 marks in 3 cell types (GM12878, K562, HepG2). Build a joint cellMarkFileTable and learn a 25-state model so states are comparable across cell types. Map state labels to Roadmap conventions where possible."
"After learning the model, run
OverlapEnrichmentagainst CGI / refseq exons / lncRNA / repeats / ENCODE blacklist anchor files. RunNeighborhoodEnrichmentagainst TSS positions."
"Use the 18-state model (extends 15-state with bivalent enhancer + bivalent flanking states) for an ESC-like cell type where bivalent domains are common (Bernstein 2006)."
"ChromHMM binarized; switch to Segway for continuous-signal segmentation that preserves signal magnitudes."
"Visualize learned 25-state segmentations across 12 biosamples in EpiLogos to identify tissue-specific regulatory states."
"Apply the Roadmap Epigenomics 25-state model to my new tissue sample without retraining (use
MakeSegmentationwith the precomputed model)."
cellMarkFileTable.txt: tab-separated: cell_type, mark, BAM, control_BAMChromHMM BinarizeBam produces per-chromosome 200 bp bin matricesOverlapEnrichment against CGI, exons, lncRNA, repeats, blacklistNeighborhoodEnrichment against TSS, transcription factor binding sitesTrain with more states (try 18 or 25). Inspect emission heatmap to verify distinct states.
Some states have nearly identical emission profiles. Use smaller N; or merge states post-hoc.
If only 2-3 marks available, segmentation is unreliable. Either: 1. Add more marks 2. Use simpler peak-based annotation (chip-seq/peak-annotation) 3. Use a precomputed model with matching mark panel
OutOfMemoryError in JavaIncrease JVM heap: java -mx32G -jar ChromHMM.jar .... For very large samples, use -mx64G.
samtools idxstats that marks have coverageTrained model independently. Apply Roadmap precomputed model OR map states by emission similarity to Roadmap states.
Insufficient marks or biological variability. Increase mark panel or use joint training across replicates.
MakeSegmentation error with precomputed modelMark panel must match the model exactly (same marks in same order as binarized data).