[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7FFC40VJSGVFX4CGHP98YN1":3,"skill-same:01M7FFC40VJSGVFX4CGHP98YN1":62},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":14,"repositoryHtmlUrl":33,"repositoryHomepageUrl":33,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":35,"install":36,"resources":49},"01M7FFC40VJSGVFX4CGHP98YN1","bio-chipseq-chromatin-state-segmentation",null,"Segments the genome into chromatin states from combinatorial histone modification and chromatin factor ChIP-seq data. Uses ChromHMM (multivariate HMM on binarized signal, v1.27), Segway (Dynamic Bayesian Network on continuous signal), EpiSegMix (flexible-distribution HMM with duration modeling, 2024), EpiLogos (multi-biosample visualization), IDEAS (cell-type-aware joint), and full-stack ChromHMM (Vu Ernst 2022) for cross-cell-type segmentations. Handles state-count selection (15 vs 18 vs 25 states), binarization choice, OverlapEnrichment \u002F NeighborhoodEnrichment downstream analysis, and cross-biosample integration. Use when learning chromatin states from a histone mark panel, characterizing learned states by genomic feature enrichment, or comparing chromatin landscapes across cell types.","Mr-Nobody-Anonymous\u002FAll-skills","Mr-Nobody-Anonymous","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F184253119?v=4","01M7AEXFJHKTYQW5R0ZCQQTWFV","anonymous","01M7C00M3GQR4QKP9GZA42GFAK",0,"MIT","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fbio-chipseq-chromatin-state-segmentation\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: bio-chipseq-chromatin-state-segmentation\ndescription: Segments the genome into chromatin states from combinatorial histone modification and chromatin factor ChIP-seq data. Uses ChromHMM (multivariate HMM on binarized signal, v1.27), Segway (Dynamic Bayesian Network on continuous signal), EpiSegMix (flexible-distribution HMM with duration modeling, 2024), EpiLogos (multi-biosample visualization), IDEAS (cell-type-aware joint), and full-stack ChromHMM (Vu Ernst 2022) for cross-cell-type segmentations. Handles state-count selection (15 vs 18 vs 25 states), binarization choice, OverlapEnrichment \u002F NeighborhoodEnrichment downstream analysis, and cross-biosample integration. Use when learning chromatin states from a histone mark panel, characterizing learned states by genomic feature enrichment, or comparing chromatin landscapes across cell types.\ntool_type: cli\nprimary_tool: ChromHMM\nsource: \"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills\"\nsource_repository: \"GPTomics\u002FbioSkills\"\nsource_path: \"chip-seq\u002Fchromatin-state-segmentation\u002FSKILL.md\"\nlicense: \"MIT\"\nimported_at: \"2026-09-20\"\n---\n\n## Version Compatibility\n\nReference examples tested with: ChromHMM 1.27+, Segway 3.0+, EpiSegMix 1.0+, EpiLogos (Meuleman lab), IDEAS 1.20+, samtools 1.19+, bedtools 2.31+. ChromHMM requires Java 8+; runs as `java -mx\u003CMEMORY> -jar ChromHMM.jar \u003Ccommand>`.\n\n# Chromatin State Segmentation\n\n**\"Integrate multiple histone modification ChIP-seq tracks into chromatin states\"** -> Learn a small set of recurring combinatorial patterns of histone marks (active promoter, active enhancer, poised enhancer, polycomb-repressed, heterochromatic, transcribed, etc.) and segment the genome by which state each region belongs to. Output: per-state genomic intervals, state-by-mark emission matrix, and state-state transition matrix.\n\n- CLI (canonical): ChromHMM `BinarizeBam` -> `LearnModel` -> `OverlapEnrichment` \u002F `NeighborhoodEnrichment`\n- CLI (continuous signal): Segway `train` -> `posterior` -> `annotate`\n- CLI (flexible distributions): EpiSegMix (2024)\n- Visualization across biosamples: EpiLogos (Meuleman lab)\n- Cell-type-aware joint: IDEAS\n\nChromatin state segmentation requires a panel of histone marks; minimum 4-5 marks (e.g., H3K4me3, H3K27ac, H3K4me1, H3K36me3, H3K27me3) for meaningful states. With fewer marks, simpler peak-based annotation (chipseq\u002Fpeak-annotation) is more appropriate.\n\n## Tool Taxonomy\n\n| Tool | Method | Strength | Fails when |\n|------|--------|----------|------------|\n| **ChromHMM** (Ernst & Kellis 2012; v1.27 current) | Multivariate HMM on binarized 200 bp bins | Canonical; widely used; integrated with Roadmap Epigenomics 15-state model; mature toolchain | Binarization throws away signal quantitation; default 200 bp bins may be too coarse for sharp boundaries |\n| **Segway** (Hoffman 2012) | Dynamic Bayesian Network on continuous signal | Higher resolution; uses signal magnitudes not binarized | More complex setup; slower; less standardized output |\n| **EpiSegMix** (Schmitz, Aggarwal, Laufer, Walter, Salhab, Rahmann 2024 Bioinformatics 40:btae178) | HMM with flexible read-count distributions + duration modeling | Modern; handles both narrow and broad mark distributions in one model | Newer; smaller user base |\n| **EpiLogos** (Meuleman lab) | Multi-biosample visualization tool | Built on top of ChromHMM\u002FSegway segmentations; compare ChromHMM states across 100s of biosamples | Visualization tool, not a segmentation method itself |\n| **IDEAS** (Zhang 2016) | Cell-type-aware joint inference | Across-cell-type segmentation respecting cell-type identity | Slower; complex parameter tuning |\n| **EpiCSeg** (Mammana 2015) | Negative binomial mixture | Read-count-based; doesn't need binarization | Less standardized output |\n| **GenoSTAN** | HMM with various emission distributions | Flexible | Less actively developed |\n| **Roadmap 25-state model** (Kundaje 2015) | ChromHMM 25-state precomputed model | Reference for cross-cell-type interpretation | Requires the Roadmap imputed 12-mark panel |\n| **Full-stack ChromHMM** (Vu Ernst 2022) | 100-state segmentation across 1032 datasets \u002F 127 reference epigenomes | Comprehensive cross-tissue annotation | Computationally intensive to retrain |\n\n## ChromHMM Workflow\n\nChromHMM is the de facto standard. The workflow has 4 stages:\n\n### Step 1: Binarize ChIP-seq signal\n\n```bash\n# Build cellMarkFileTable: cell_type\u003CTAB>mark\u003CTAB>file\u003CTAB>(optional control)\ncat > cellMarkFileTable.txt \u003C\u003C EOF\nGM12878\tH3K4me3\tgm12878_h3k4me3.bam\tgm12878_input.bam\nGM12878\tH3K27me3\tgm12878_h3k27me3.bam\tgm12878_input.bam\nGM12878\tH3K27ac\tgm12878_h3k27ac.bam\tgm12878_input.bam\nGM12878\tH3K4me1\tgm12878_h3k4me1.bam\tgm12878_input.bam\nGM12878\tH3K36me3\tgm12878_h3k36me3.bam\tgm12878_input.bam\nEOF\n\n# Binarize BAMs into 200 bp bins; emission = whether mark exceeds Poisson threshold\njava -mx16G -jar ChromHMM.jar BinarizeBam \\\n    -b 200 \\\n    chromsizes_hg38.txt \\\n    bam_dir\u002F \\\n    cellMarkFileTable.txt \\\n    binarized_output\u002F\n```\n\nOutput: per-chromosome `_binary.txt` files, one row per 200 bp bin, columns = marks, values 0\u002F1.\n\n### Step 2: Learn model\n\n```bash\n# Train HMM with N states; common choices: 15, 18, 25\n# 15 states: Ernst & Kellis 2011 model; canonical\n# 18 states: extends with additional regulatory states\n# 25 states: Roadmap Epigenomics extended model\njava -mx16G -jar ChromHMM.jar LearnModel \\\n    -p 8 \\\n    binarized_output\u002F \\\n    model_15state\u002F \\\n    15 \\\n    hg38\n\n# Output: model_15state.txt (emission + transition matrices),\n# emissions_15.png (visualization), transitions_15.png,\n# per-chromosome _segments.bed (state assignments)\n# AND automatically runs OverlapEnrichment + NeighborhoodEnrichment\n```\n\n### Step 3: Interpret states from emission matrix\n\n| Roadmap 15-state assignments (canonical) |\n|-------------------------------------------|\n| 1_TssA — Active TSS (high H3K4me3, H3K27ac) |\n| 2_TssAFlnk — Flanking TSS (H3K4me3, H3K27ac, lower) |\n| 3_TxFlnk — Transcript flanking |\n| 4_Tx — Strong transcription (H3K36me3, H3K79me2 if available) |\n| 5_TxWk — Weak transcription |\n| 6_EnhG — Enhancer in gene body (H3K4me1, H3K27ac) |\n| 7_Enh — Generic enhancer (H3K4me1, H3K27ac) |\n| 8_ZNF\u002FRpts — Zinc-finger \u002F repeats |\n| 9_Het — Heterochromatin (H3K9me3) |\n| 10_TssBiv — Bivalent TSS (H3K4me3 + H3K27me3) |\n| 11_BivFlnk — Bivalent flanking |\n| 12_EnhBiv — Bivalent enhancer (H3K4me1 + H3K27me3) |\n| 13_ReprPC — Polycomb-repressed (H3K27me3) |\n| 14_ReprPCWk — Weak Polycomb |\n| 15_Quies — Quiescent (no signal) |\n\n### Step 4: Functional enrichment of states\n\n```bash\n# OverlapEnrichment: enrichment of each state for external feature sets.\n# Options (e.g. -labels) MUST precede the three positional args.\njava -mx16G -jar ChromHMM.jar OverlapEnrichment \\\n    -labels \\\n    model_15state\u002FGM12878_15_segments.bed \\\n    \u002Fpath\u002Fto\u002Fanchor_files\u002F \\\n    enrichment_output\u002FGM12878\n\n# NeighborhoodEnrichment: enrichment relative to anchor positions (e.g., TSS)\njava -mx16G -jar ChromHMM.jar NeighborhoodEnrichment \\\n    -labels \\\n    model_15state\u002FGM12878_15_segments.bed \\\n    \u002Fpath\u002Fto\u002Ftss_anchors.txt \\\n    enrichment_output\u002FGM12878_TSS\n```\n\nAnchor files: BED files of features (CGIs, repeats, conserved elements, etc.) for OverlapEnrichment; position files for NeighborhoodEnrichment.\n\n## Choosing State Count\n\n| States | Use case | Mark panel size |\n|--------|----------|-----------------|\n| 8-10 | Initial exploration; small mark panel (3-4 marks) | 3-5 marks |\n| 15 | Roadmap Epigenomics canonical | 5 core (H3K4me3, H3K4me1, H3K36me3, H3K27me3, H3K9me3) |\n| 18 | Roadmap extended (adds H3K27ac -> fine enhancer subtypes) | 6 marks (core 5 + H3K27ac) |\n| 25 | Roadmap Epigenomics extended; cross-cell-type compatibility | 12 imputed marks |\n| 50+ | Full-stack model (Vu Ernst 2022) | Many marks across many cell types |\n\n**Practical workflow:** Train at N=15, 18, 25; compare emission matrices; choose the smallest N where biology is interpretable. Higher N risks over-segmentation (state splitting random variation).\n\n## Segway Workflow\n\n```bash\n# Segway reads only the Genomedata format, so first pack the signal tracks\n# (one track per bigWig) plus the genome sequence into an archive.\ngenomedata-load \\\n    -s hg38.fa \\\n    -t h3k4me3=h3k4me3.bw \\\n    -t h3k27ac=h3k27ac.bw \\\n    -t h3k4me1=h3k4me1.bw \\\n    -t h3k36me3=h3k36me3.bw \\\n    -t h3k27me3=h3k27me3.bw \\\n    signal.genomedata\n\n# Train Segway model; GENOMEDATA and TRAINDIR are positional\nsegway train \\\n    --num-labels=25 \\\n    --num-instances=3 \\\n    --resolution=100 \\\n    signal.genomedata traindir\u002F\n\n# Posterior probabilities + hard-call annotation (GENOMEDATA TRAINDIR OUTDIR, positional)\nsegway posterior signal.genomedata traindir\u002F posteriordir\u002F\nsegway annotate signal.genomedata traindir\u002F identifydir\u002F\n\n# Output: identifydir\u002Fsegway.bed.gz (state assignments)\n```\n\nSegway uses continuous signal (from the genomedata archive) vs ChromHMM's binarized bins. Trade-off: more information per region (continuous) but more complex training.\n\n## EpiLogos Visualization\n\nEpiLogos doesn't perform segmentation; it visualizes existing ChromHMM\u002FSegway segmentations across many biosamples (epilogos.org).\n\n```bash\n# Use precomputed ChromHMM segmentations across multiple cell types\n# Web interface: https:\u002F\u002Fepilogos.altius.org\u002F\n# Local: github.com\u002Fmeuleman\u002Fepilogos\n```\n\nUseful for: cross-cell-type comparison; identifying tissue-specific regulatory states; cohort-level chromatin landscape summaries.\n\n## Full-Stack ChromHMM (Vu Ernst 2022)\n\nThe full-stack model trained on 1032 datasets \u002F 127 reference epigenomes:\n\n```bash\n# Use precomputed model from Ernst lab\n# github.com\u002Fernstlab\u002Ffull_stack_ChromHMM_annotations\n# Annotate new sample by applying model to binarized data\njava -mx16G -jar ChromHMM.jar MakeSegmentation \\\n    full_stack_model_100states.txt \\\n    binarized_sample\u002F \\\n    full_stack_output\u002F\n```\n\nUseful for: applying a comprehensive cross-tissue annotation to a new sample; comparing to canonical Roadmap states.\n\n## Per-Tool Failure Modes\n\n### ChromHMM -- Bin size 200 bp too coarse for sharp boundaries\n\n**Trigger:** Studying TF binding boundaries or sharp enhancer transitions at 200 bp resolution.\n\n**Mechanism:** ChromHMM default 200 bp bins; biology may shift within a bin.\n\n**Fix:** Reduce to `-b 100` or `-b 50` (smaller bin); increases memory and compute time but improves boundary resolution. Re-train model at finer resolution.\n\n### ChromHMM -- Binarization throws away signal quantitation\n\n**Trigger:** Distinguishing low- from high-signal regions of the same state.\n\n**Mechanism:** ChromHMM binarizes each 200 bp bin to 0\u002F1 per mark; state assignment uses combinatorial pattern, not magnitude.\n\n**Fix:** Use Segway (continuous signal) or EpiSegMix (flexible distributions) for magnitude-aware segmentation.\n\n### ChromHMM \u002F Segway -- Wrong state count\n\n**Trigger:** Training with N=50 states on a 4-mark panel; or N=10 on a 7-mark panel.\n\n**Mechanism:** Excess states fragment biology; insufficient states force unrelated regions into the same state.\n\n**Symptom:** Emission matrix shows redundant states (multiple states with same emission profile) at high N; or biologically distinct regions lumped together at low N.\n\n**Fix:** Train at N=15, 18, 25; inspect emission matrix similarity; choose the smallest N where states are interpretable as distinct biology.\n\n### Mark panel mismatch with model\n\n**Trigger:** Applying Roadmap 25-state model to a sample with different mark panel.\n\n**Mechanism:** Model was trained on specific marks; emission probabilities are mark-specific. Applying to different mark panel produces nonsensical state assignments.\n\n**Fix:** Either train a new model on the available mark panel; OR ensure the exact same marks (and ordering) as used in the model.\n\n### IgG control instead of input\n\n**Trigger:** Using IgG controls in `BinarizeBam` for histone marks.\n\n**Mechanism:** ChromHMM's binarization compares mark signal to control; histone mark biology assumes input (sonicated chromatin) as background, not IgG.\n\n**Fix:** Use sonicated input as control for histone mark ChIP. IgG is not appropriate for ChromHMM binarization of histone marks.\n\n### Cross-cell-type state mapping\n\n**Trigger:** Training separate models per cell type and trying to compare state assignments.\n\n**Mechanism:** State 5 in cell type A may not correspond to state 5 in cell type B if trained independently.\n\n**Fix:** Train one model on concatenated data from all cell types (joint segmentation); or apply a single precomputed model (Roadmap 15-state, full-stack) to all samples for consistent state labels.\n\n## Reconciliation\n\n| Pattern | Likely cause | Action |\n|---------|--------------|--------|\n| ChromHMM and Segway segments differ | Different bin sizes \u002F binarization vs continuous | Both can be valid; inspect emission matrices; pick the tool matching the resolution needs |\n| State assignment varies wildly between replicates | Insufficient marks; over-binned | Increase mark panel; reduce state count |\n| Active TSS state overlaps polycomb state at promoters | Bivalent biology (Bernstein 2006) | Expected for ESC-like cells; not an error; consider bivalent-specific state in N=18 model |\n| Roadmap 25-state model annotates unknown cell type | Cross-cell-type generalization | Use cautiously; verify against tissue-specific tracks |\n| Heterochromatin (H3K9me3) state has too many bins | H3K9me3 covers large fraction of genome | Expected; heterochromatin is genome-wide |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| `java.lang.OutOfMemoryError` | Insufficient JVM heap | `java -mx32G -jar ChromHMM.jar ...` |\n| `BinarizeBam` very slow | Large BAMs without index | `samtools index` all BAMs first |\n| All states have similar emissions | Mark panel too small | Need at least 5 marks for canonical 15-state model |\n| Segments file empty for some chromosomes | Chromosome not in chromsizes file | Add or use `-chrom` flag to restrict |\n| State labels don't match Roadmap | Trained model independently | Use Roadmap precomputed model OR map states by emission similarity |\n| ChromHMM \"no signal in marks\" | All bins binarized to 0 | Check signal quality; verify control normalization |\n\n## References\n\n- Ernst J & Kellis M 2012 Nat Methods 9:215 (ChromHMM v1)\n- Ernst J & Kellis M 2017 Nat Protoc 12:2478 (ChromHMM protocol)\n- Hoffman MM et al 2012 Nat Methods 9:473 (Segway)\n- Schmitz JE, Aggarwal N, Laufer L, Walter J, Salhab A, Rahmann S 2024 Bioinformatics 40:btae178 (EpiSegMix)\n- Meuleman W et al 2020 Nature 584:244 (EpiLogos \u002F DHS index)\n- Zhang Y & Hardison 2016 Nucleic Acids Res 44:6721 (IDEAS)\n- Mammana A & Chung HR 2015 Genome Biol 16:151 (EpiCSeg)\n- Roadmap Epigenomics Consortium 2015 Nature 518:317 (Roadmap 25-state model)\n- Vu H & Ernst J 2022 Genome Biol 23:9 (full-stack ChromHMM)\n- Kundaje A et al 2015 Nature 518:317 (Roadmap integrative analysis)\n\n## Related Skills\n\n- chip-seq\u002Fpeak-calling - Peak calling per mark before segmentation\n- chip-seq\u002Fchipseq-qc - Replicate concordance per mark; QC before integration\n- chip-seq\u002Fpeak-annotation - cCRE classification (PLS\u002FpELS\u002FdELS) complementary to chromatin states\n- chip-seq\u002Fspike-in-normalization - Spike-in normalize per-mark BAMs before binarization for cross-condition state comparison\n- atac-seq\u002Fsingle-cell-atac - scATAC + ChIP integration via multimodal methods\n- machine-learning\u002Fmodel-validation - Model selection (state count); cross-validation\n- data-visualization\u002Fgenome-tracks - Visualize state segmentations\n- gene-regulatory-networks\u002Fcoexpression-networks - Cross-reference chromatin states with co-expression modules\n","## Version Compatibility\n\nReference examples tested with: ChromHMM 1.27+, Segway 3.0+, EpiSegMix 1.0+, EpiLogos (Meuleman lab), IDEAS 1.20+, samtools 1.19+, bedtools 2.31+. ChromHMM requires Java 8+; runs as `java -mx\u003CMEMORY> -jar ChromHMM.jar \u003Ccommand>`.\n\n# Chromatin State Segmentation\n\n**\"Integrate multiple histone modification ChIP-seq tracks into chromatin states\"** -> Learn a small set of recurring combinatorial patterns of histone marks (active promoter, active enhancer, poised enhancer, polycomb-repressed, heterochromatic, transcribed, etc.) and segment the genome by which state each region belongs to. Output: per-state genomic intervals, state-by-mark emission matrix, and state-state transition matrix.\n\n- CLI (canonical): ChromHMM `BinarizeBam` -> `LearnModel` -> `OverlapEnrichment` \u002F `NeighborhoodEnrichment`\n- CLI (continuous signal): Segway `train` -> `posterior` -> `annotate`\n- CLI (flexible distributions): EpiSegMix (2024)\n- Visualization across biosamples: EpiLogos (Meuleman lab)\n- Cell-type-aware joint: IDEAS\n\nChromatin state segmentation requires a panel of histone marks; minimum 4-5 marks (e.g., H3K4me3, H3K27ac, H3K4me1, H3K36me3, H3K27me3) for meaningful states. With fewer marks, simpler peak-based annotation (chipseq\u002Fpeak-annotation) is more appropriate.\n\n## Tool Taxonomy\n\n| Tool | Method | Strength | Fails when |\n|------|--------|----------|------------|\n| **ChromHMM** (Ernst & Kellis 2012; v1.27 current) | Multivariate HMM on binarized 200 bp bins | Canonical; widely used; integrated with Roadmap Epigenomics 15-state model; mature toolchain | Binarization throws away signal quantitation; default 200 bp bins may be too coarse for sharp boundaries |\n| **Segway** (Hoffman 2012) | Dynamic Bayesian Network on continuous signal | Higher resolution; uses signal magnitudes not binarized | More complex setup; slower; less standardized output |\n| **EpiSegMix** (Schmitz, Aggarwal, Laufer, Walter, Salhab, Rahmann 2024 Bioinformatics 40:btae178) | HMM with flexible read-count distributions + duration modeling | Modern; handles both narrow and broad mark distributions in one model | Newer; smaller user base |\n| **EpiLogos** (Meuleman lab) | Multi-biosample visualization tool | Built on top of ChromHMM\u002FSegway segmentations; compare ChromHMM states across 100s of biosamples | Visualization tool, not a segmentation method itself |\n| **IDEAS** (Zhang 2016) | Cell-type-aware joint inference | Across-cell-type segmentation respecting cell-type identity | Slower; complex parameter tuning |\n| **EpiCSeg** (Mammana 2015) | Negative binomial mixture | Read-count-based; doesn't need binarization | Less standardized output |\n| **GenoSTAN** | HMM with various emission distributions | Flexible | Less actively developed |\n| **Roadmap 25-state model** (Kundaje 2015) | ChromHMM 25-state precomputed model | Reference for cross-cell-type interpretation | Requires the Roadmap imputed 12-mark panel |\n| **Full-stack ChromHMM** (Vu Ernst 2022) | 100-state segmentation across 1032 datasets \u002F 127 reference epigenomes | Comprehensive cross-tissue annotation | Computationally intensive to retrain |\n\n## ChromHMM Workflow\n\nChromHMM is the de facto standard. The workflow has 4 stages:\n\n### Step 1: Binarize ChIP-seq signal\n\n```bash\n# Build cellMarkFileTable: cell_type\u003CTAB>mark\u003CTAB>file\u003CTAB>(optional control)\ncat > cellMarkFileTable.txt \u003C\u003C EOF\nGM12878\tH3K4me3\tgm12878_h3k4me3.bam\tgm12878_input.bam\nGM12878\tH3K27me3\tgm12878_h3k27me3.bam\tgm12878_input.bam\nGM12878\tH3K27ac\tgm12878_h3k27ac.bam\tgm12878_input.bam\nGM12878\tH3K4me1\tgm12878_h3k4me1.bam\tgm12878_input.bam\nGM12878\tH3K36me3\tgm12878_h3k36me3.bam\tgm12878_input.bam\nEOF\n\n# Binarize BAMs into 200 bp bins; emission = whether mark exceeds Poisson threshold\njava -mx16G -jar ChromHMM.jar BinarizeBam \\\n    -b 200 \\\n    chromsizes_hg38.txt \\\n    bam_dir\u002F \\\n    cellMarkFileTable.txt \\\n    binarized_output\u002F\n```\n\nOutput: per-chromosome `_binary.txt` files, one row per 200 bp bin, columns = marks, values 0\u002F1.\n\n### Step 2: Learn model\n\n```bash\n# Train HMM with N states; common choices: 15, 18, 25\n# 15 states: Ernst & Kellis 2011 model; canonical\n# 18 states: extends with additional regulatory states\n# 25 states: Roadmap Epigenomics extended model\njava -mx16G -jar ChromHMM.jar LearnModel \\\n    -p 8 \\\n    binarized_output\u002F \\\n    model_15state\u002F \\\n    15 \\\n    hg38\n\n# Output: model_15state.txt (emission + transition matrices),\n# emissions_15.png (visualization), transitions_15.png,\n# per-chromosome _segments.bed (state assignments)\n# AND automatically runs OverlapEnrichment + NeighborhoodEnrichment\n```\n\n### Step 3: Interpret states from emission matrix\n\n| Roadmap 15-state assignments (canonical) |\n|-------------------------------------------|\n| 1_TssA — Active TSS (high H3K4me3, H3K27ac) |\n| 2_TssAFlnk — Flanking TSS (H3K4me3, H3K27ac, lower) |\n| 3_TxFlnk — Transcript flanking |\n| 4_Tx — Strong transcription (H3K36me3, H3K79me2 if available) |\n| 5_TxWk — Weak transcription |\n| 6_EnhG — Enhancer in gene body (H3K4me1, H3K27ac) |\n| 7_Enh — Generic enhancer (H3K4me1, H3K27ac) |\n| 8_ZNF\u002FRpts — Zinc-finger \u002F repeats |\n| 9_Het — Heterochromatin (H3K9me3) |\n| 10_TssBiv — Bivalent TSS (H3K4me3 + H3K27me3) |\n| 11_BivFlnk — Bivalent flanking |\n| 12_EnhBiv — Bivalent enhancer (H3K4me1 + H3K27me3) |\n| 13_ReprPC — Polycomb-repressed (H3K27me3) |\n| 14_ReprPCWk — Weak Polycomb |\n| 15_Quies — Quiescent (no signal) |\n\n### Step 4: Functional enrichment of states\n\n```bash\n# OverlapEnrichment: enrichment of each state for external feature sets.\n# Options (e.g. -labels) MUST precede the three positional args.\njava -mx16G -jar ChromHMM.jar OverlapEnrichment \\\n    -labels \\\n    model_15state\u002FGM12878_15_segments.bed \\\n    \u002Fpath\u002Fto\u002Fanchor_files\u002F \\\n    enrichment_output\u002FGM12878\n\n# NeighborhoodEnrichment: enrichment relative to anchor positions (e.g., TSS)\njava -mx16G -jar ChromHMM.jar NeighborhoodEnrichment \\\n    -labels \\\n    model_15state\u002FGM12878_15_segments.bed \\\n    \u002Fpath\u002Fto\u002Ftss_anchors.txt \\\n    enrichment_output\u002FGM12878_TSS\n```\n\nAnchor files: BED files of features (CGIs, repeats, conserved elements, etc.) for OverlapEnrichment; position files for NeighborhoodEnrichment.\n\n## Choosing State Count\n\n| States | Use case | Mark panel size |\n|--------|----------|-----------------|\n| 8-10 | Initial exploration; small mark panel (3-4 marks) | 3-5 marks |\n| 15 | Roadmap Epigenomics canonical | 5 core (H3K4me3, H3K4me1, H3K36me3, H3K27me3, H3K9me3) |\n| 18 | Roadmap extended (adds H3K27ac -> fine enhancer subtypes) | 6 marks (core 5 + H3K27ac) |\n| 25 | Roadmap Epigenomics extended; cross-cell-type compatibility | 12 imputed marks |\n| 50+ | Full-stack model (Vu Ernst 2022) | Many marks across many cell types |\n\n**Practical workflow:** Train at N=15, 18, 25; compare emission matrices; choose the smallest N where biology is interpretable. Higher N risks over-segmentation (state splitting random variation).\n\n## Segway Workflow\n\n```bash\n# Segway reads only the Genomedata format, so first pack the signal tracks\n# (one track per bigWig) plus the genome sequence into an archive.\ngenomedata-load \\\n    -s hg38.fa \\\n    -t h3k4me3=h3k4me3.bw \\\n    -t h3k27ac=h3k27ac.bw \\\n    -t h3k4me1=h3k4me1.bw \\\n    -t h3k36me3=h3k36me3.bw \\\n    -t h3k27me3=h3k27me3.bw \\\n    signal.genomedata\n\n# Train Segway model; GENOMEDATA and TRAINDIR are positional\nsegway train \\\n    --num-labels=25 \\\n    --num-instances=3 \\\n    --resolution=100 \\\n    signal.genomedata traindir\u002F\n\n# Posterior probabilities + hard-call annotation (GENOMEDATA TRAINDIR OUTDIR, positional)\nsegway posterior signal.genomedata traindir\u002F posteriordir\u002F\nsegway annotate signal.genomedata traindir\u002F identifydir\u002F\n\n# Output: identifydir\u002Fsegway.bed.gz (state assignments)\n```\n\nSegway uses continuous signal (from the genomedata archive) vs ChromHMM's binarized bins. Trade-off: more information per region (continuous) but more complex training.\n\n## EpiLogos Visualization\n\nEpiLogos doesn't perform segmentation; it visualizes existing ChromHMM\u002FSegway segmentations across many biosamples (epilogos.org).\n\n```bash\n# Use precomputed ChromHMM segmentations across multiple cell types\n# Web interface: https:\u002F\u002Fepilogos.altius.org\u002F\n# Local: github.com\u002Fmeuleman\u002Fepilogos\n```\n\nUseful for: cross-cell-type comparison; identifying tissue-specific regulatory states; cohort-level chromatin landscape summaries.\n\n## Full-Stack ChromHMM (Vu Ernst 2022)\n\nThe full-stack model trained on 1032 datasets \u002F 127 reference epigenomes:\n\n```bash\n# Use precomputed model from Ernst lab\n# github.com\u002Fernstlab\u002Ffull_stack_ChromHMM_annotations\n# Annotate new sample by applying model to binarized data\njava -mx16G -jar ChromHMM.jar MakeSegmentation \\\n    full_stack_model_100states.txt \\\n    binarized_sample\u002F \\\n    full_stack_output\u002F\n```\n\nUseful for: applying a comprehensive cross-tissue annotation to a new sample; comparing to canonical Roadmap states.\n\n## Per-Tool Failure Modes\n\n### ChromHMM -- Bin size 200 bp too coarse for sharp boundaries\n\n**Trigger:** Studying TF binding boundaries or sharp enhancer transitions at 200 bp resolution.\n\n**Mechanism:** ChromHMM default 200 bp bins; biology may shift within a bin.\n\n**Fix:** Reduce to `-b 100` or `-b 50` (smaller bin); increases memory and compute time but improves boundary resolution. Re-train model at finer resolution.\n\n### ChromHMM -- Binarization throws away signal quantitation\n\n**Trigger:** Distinguishing low- from high-signal regions of the same state.\n\n**Mechanism:** ChromHMM binarizes each 200 bp bin to 0\u002F1 per mark; state assignment uses combinatorial pattern, not magnitude.\n\n**Fix:** Use Segway (continuous signal) or EpiSegMix (flexible distributions) for magnitude-aware segmentation.\n\n### ChromHMM \u002F Segway -- Wrong state count\n\n**Trigger:** Training with N=50 states on a 4-mark panel; or N=10 on a 7-mark panel.\n\n**Mechanism:** Excess states fragment biology; insufficient states force unrelated regions into the same state.\n\n**Symptom:** Emission matrix shows redundant states (multiple states with same emission profile) at high N; or biologically distinct regions lumped together at low N.\n\n**Fix:** Train at N=15, 18, 25; inspect emission matrix similarity; choose the smallest N where states are interpretable as distinct biology.\n\n### Mark panel mismatch with model\n\n**Trigger:** Applying Roadmap 25-state model to a sample with different mark panel.\n\n**Mechanism:** Model was trained on specific marks; emission probabilities are mark-specific. Applying to different mark panel produces nonsensical state assignments.\n\n**Fix:** Either train a new model on the available mark panel; OR ensure the exact same marks (and ordering) as used in the model.\n\n### IgG control instead of input\n\n**Trigger:** Using IgG controls in `BinarizeBam` for histone marks.\n\n**Mechanism:** ChromHMM's binarization compares mark signal to control; histone mark biology assumes input (sonicated chromatin) as background, not IgG.\n\n**Fix:** Use sonicated input as control for histone mark ChIP. IgG is not appropriate for ChromHMM binarization of histone marks.\n\n### Cross-cell-type state mapping\n\n**Trigger:** Training separate models per cell type and trying to compare state assignments.\n\n**Mechanism:** State 5 in cell type A may not correspond to state 5 in cell type B if trained independently.\n\n**Fix:** Train one model on concatenated data from all cell types (joint segmentation); or apply a single precomputed model (Roadmap 15-state, full-stack) to all samples for consistent state labels.\n\n## Reconciliation\n\n| Pattern | Likely cause | Action |\n|---------|--------------|--------|\n| ChromHMM and Segway segments differ | Different bin sizes \u002F binarization vs continuous | Both can be valid; inspect emission matrices; pick the tool matching the resolution needs |\n| State assignment varies wildly between replicates | Insufficient marks; over-binned | Increase mark panel; reduce state count |\n| Active TSS state overlaps polycomb state at promoters | Bivalent biology (Bernstein 2006) | Expected for ESC-like cells; not an error; consider bivalent-specific state in N=18 model |\n| Roadmap 25-state model annotates unknown cell type | Cross-cell-type generalization | Use cautiously; verify against tissue-specific tracks |\n| Heterochromatin (H3K9me3) state has too many bins | H3K9me3 covers large fraction of genome | Expected; heterochromatin is genome-wide |\n\n## Common Errors\n\n| Error \u002F symptom | Cause | Solution |\n|-----------------|-------|----------|\n| `java.lang.OutOfMemoryError` | Insufficient JVM heap | `java -mx32G -jar ChromHMM.jar ...` |\n| `BinarizeBam` very slow | Large BAMs without index | `samtools index` all BAMs first |\n| All states have similar emissions | Mark panel too small | Need at least 5 marks for canonical 15-state model |\n| Segments file empty for some chromosomes | Chromosome not in chromsizes file | Add or use `-chrom` flag to restrict |\n| State labels don't match Roadmap | Trained model independently | Use Roadmap precomputed model OR map states by emission similarity |\n| ChromHMM \"no signal in marks\" | All bins binarized to 0 | Check signal quality; verify control normalization |\n\n## References\n\n- Ernst J & Kellis M 2012 Nat Methods 9:215 (ChromHMM v1)\n- Ernst J & Kellis M 2017 Nat Protoc 12:2478 (ChromHMM protocol)\n- Hoffman MM et al 2012 Nat Methods 9:473 (Segway)\n- Schmitz JE, Aggarwal N, Laufer L, Walter J, Salhab A, Rahmann S 2024 Bioinformatics 40:btae178 (EpiSegMix)\n- Meuleman W et al 2020 Nature 584:244 (EpiLogos \u002F DHS index)\n- Zhang Y & Hardison 2016 Nucleic Acids Res 44:6721 (IDEAS)\n- Mammana A & Chung HR 2015 Genome Biol 16:151 (EpiCSeg)\n- Roadmap Epigenomics Consortium 2015 Nature 518:317 (Roadmap 25-state model)\n- Vu H & Ernst J 2022 Genome Biol 23:9 (full-stack ChromHMM)\n- Kundaje A et al 2015 Nature 518:317 (Roadmap integrative analysis)\n\n## Related Skills\n\n- chip-seq\u002Fpeak-calling - Peak calling per mark before segmentation\n- chip-seq\u002Fchipseq-qc - Replicate concordance per mark; QC before integration\n- chip-seq\u002Fpeak-annotation - cCRE classification (PLS\u002FpELS\u002FdELS) complementary to chromatin states\n- chip-seq\u002Fspike-in-normalization - Spike-in normalize per-mark BAMs before binarization for cross-condition state comparison\n- atac-seq\u002Fsingle-cell-atac - scATAC + ChIP integration via multimodal methods\n- machine-learning\u002Fmodel-validation - Model selection (state count); cross-validation\n- data-visualization\u002Fgenome-tracks - Visualize state segmentations\n- gene-regulatory-networks\u002Fcoexpression-networks - Cross-reference chromatin states with co-expression modules\n",{"name":5,"source":24,"license":15,"tool_type":25,"description":7,"imported_at":26,"source_path":27,"primary_tool":28,"source_repository":29},"https:\u002F\u002Fgithub.com\u002FGPTomics\u002FbioSkills","cli","2026-09-20","chip-seq\u002Fchromatin-state-segmentation\u002FSKILL.md","ChromHMM","GPTomics\u002FbioSkills","main","2d1750717747097b602acf30bd09a7cbd4b4c6ea","awesome_skills\u002Fhr-people\u002Fbio-chipseq-chromatin-state-segmentation","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous","2026-11-09 11:45:36",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-chipseq-chromatin-state-segmentation",{"tool":42,"command":43},"bunx","bunx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-chipseq-chromatin-state-segmentation",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Mr-Nobody-Anonymous\u002FAll-skills --skill bio-chipseq-chromatin-state-segmentation","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fbio-chipseq-chromatin-state-segmentation\u002FSKILL.md",true,[50,56],{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fchromhmm_pipeline.sh","SCRIPT","脚本",4011,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fbio-chipseq-chromatin-state-segmentation\u002Fexamples\u002Fchromhmm_pipeline.sh",{"path":57,"resourceType":58,"resourceTypeDesc":59,"sizeBytes":60,"sourceHtmlUrl":61},"usage-guide.md","REFERENCE","参考文档",7517,"https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fbio-chipseq-chromatin-state-segmentation\u002Fusage-guide.md",[63,70,77,84,91,98],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7FFFZPC2025JQQHPHDX154J","dei-assessment","Assess diversity, equity, and inclusion with metrics. TRIGGERS - Use when user needs help with dei-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-assessment\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7FFFWN8H4WA7A6Y398QKB6J","dei-action-plan","Create DEI action plans with goals and initiatives. TRIGGERS - Use when user needs help with dei-action-plan related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fdei-action-plan\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7FFFSHTM0QZRVZ2NRJTJ0PY","culture-fit-assessment","Design culture add assessment processes. TRIGGERS - Use when user needs help with culture-fit-assessment related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fculture-fit-assessment\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7FFFMA12RKEQA38KHJSXXPS","cowork-to-code-bridge","Use an already-installed, independently verified cowork-to-code bridge to run narrowly approved actions on the user's own macOS, Linux, or WSL2 machine through a local file queue.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcowork-to-code-bridge\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M7FFFH1F6M8YRGW5V487GH1K","counter-offer-response","Draft counter-offer responses for retention. TRIGGERS - Use when user needs help with counter-offer-response related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcounter-offer-response\u002FSKILL.md",[],[],{"skillNo":99,"name":100,"nameZh":6,"description":101,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":19},"01M7FFFDGEHV8Y7J9N40HZXW52","continuous-feedback-system","Design continuous feedback systems. TRIGGERS - Use when user needs help with continuous-feedback-system related tasks.","https:\u002F\u002Fgithub.com\u002FMr-Nobody-Anonymous\u002FAll-skills\u002Fblob\u002Fmain\u002Fawesome_skills\u002Fhr-people\u002Fcontinuous-feedback-system\u002FSKILL.md",[],[]]