# HepG2 chr4 — ENCFF960GTR

Open **chr4.json**:
https://vitessce.io/?url=https%3A%2F%2Fusers.abdenlab.org%2Fvoy%2Fvitessce_cvh%2Fhepg2_sci%2Fchr4.json

Source: ENCODE rE2G ENCFF960GTR / ENCSR411RGL, GRCh38. The chr4 matrix has 1,852 elements, 479 gene/TSS columns, and 2,519 reported links. ALB has 22 links; AFP has 18. Scores are preserved verbatim from the source. Zero means no reported link, not zero gene expression.

Layout: cCRE overlap → ClinVar counts → gene scores, with a gene list and overlap groups on the right. Only the leftmost panel displays the regulatory-element title. The stock Vitessce heatmap still reserves axis margins.

## Files

- `chr4.json`: the only viewer configuration.
- `chr4.matrix.csv`: element-by-gene rE2G scores.
- `chr4.ccre.matrix.csv` and `chr4.ccre_metadata.csv`: eight cCRE classes and interval-overlap labels.
- `chr4.clinvar.matrix.csv` and `chr4.clinvar.metadata.csv`: exact overlap counts and complete variant details (retained for download).
- `chr4.clinvar.obsSets.json`: selectable groups; an annotation file, not a viewer configuration.
- `chr4.clinvar.variants.csv`: all 159,047 chr4 records from the active ClinVar source.
- `chr4.clinvar.links.csv`: 7,036 element–variant pairs, representing 7,029 distinct variants across 415 elements.
- `validation.json`, `clinvar.validation.json`: provenance and validation reports.

Active ClinVar source: `https://users.abdenlab.org/voy/clinvar_hg38_all.vcf.gz`, with 4,471,367 records across all chromosomes. All clinical-significance categories are included; no phenotype filter is applied. Other source VCFs are preserved but not used by the builder. Overlap uses `[POS-1, POS-1+len(REF))`, including indel anchors. cCRE overlaps are recomputed against the GRCh38 registry. Element overlap does not imply overlap with the cCRE portion of the element, or demonstrate a HepG2 genotype or regulatory effect.

## Rebuild

Run `python build_chr4.py` here to rebuild every matrix, annotation, and config directly from ENCFF960GTR and the shared all-variants ClinVar VCF. Source/reference paths are at the top of that script; bedtools is required. Run `python validate_build.py` for independent overlap and consistency checks. `python serve.py` serves a local preview.

Published data URLs use `https://users.abdenlab.org/voy/vitessce_cvh/hepg2_sci/`. Original score preservation, ALB/AFP inclusion, row alignment, config references, and ClinVar overlaps have been verified. Browser rendering remains unverified.

Retired HepG2 source derivatives, scripts, view configurations, and hosted copies are collected under `external/outdated/hepg2_before_ENCFF960GTR/`, separated into `local/` and `hosted/` with an archive manifest. K562 and reference datasets are preserved.

## Compact hover metadata

The config selects metadata separately for each heatmap: cCRE IDs/classes and cCRE count on the left; ClinVar count in the middle; cCRE and ClinVar counts on the gene panel. Long ClinVar variant descriptions are omitted from hover but remain in `chr4.clinvar.metadata.csv` and `chr4.clinvar.links.csv`. These per-panel tooltip settings are unchanged by the all-variants refresh. The stock tooltip geometry is unchanged, so exceptionally long cCRE lists may still produce large popups. The builder preserves these per-panel settings.

## All-variants refresh (2026-10-08)

Only the existing ClinVar artifact files were replaced; config JSON, gene scores, cCRE annotations, layout and URLs were preserved. Counts now summarize all significance categories and are not pathogenicity scores. The existing config description is left for manual editing as requested; full rebuilds will generate the new source description.

`python update_clinvar.py --chrom chr4` refreshes only ClinVar artifacts without changing the config. The default source is `/net/public_html/users/voy/clinvar_hg38_all.vcf.gz`; use `--source PATH` to override it. Full builders call this same routine. New reports record the source checksum, significance-category counts, and overlap checks.
