e8144b87c64b0e60e475886e3ced5353f139cf43
max
  Fri Sep 18 07:24:42 2026 -0700
hg38 episignatures: EpigenCentral CpG probes as a second subtrack

#Preview2 week - bugs introduced now will need a build patch to fix
The EpigenCentral group at the Centre for Computational Medicine and the
Weksberg lab, Hospital for Sick Children, publishes its curated episignatures
as a track hub and asked us to host it natively instead. 15,035 CpG sites from
24 episignatures for 23 rare disorders, alongside MethaDory in the same
container. The two were compiled independently and neither contains the other:
14,236 sites are in both, at identical coordinates, and 799 are only here.

Built from the lab's own bigBed by makeEpigenCentral.sh, so a refresh is one
command rather than the hand edits it started as. Every feature in the hub is
in the track; no coordinates or values were changed. Four things were rewritten
on the way in: the OMIM column went from a full URL to the entry number so
trackDb builds the link, the hub's pre-rendered mouse-over column became the
direction alone with the text assembled from the fields, the disorder of the
strongest signature was added as its own column, and 215 rows of the per-site
comparison table on 137 sites were dropped as exact duplicates, which the
site's own signature count had already collapsed. Two columns were renamed to
what MethaDory calls the same numbers, height to maxAbsDelta and nSignatures to
sigCount.

Coordinates check out two ways: 5,000 sampled sites all land on a CG
dinucleotide, and every probe shared with MethaDory, which was positioned from
the Illumina manifests independently, is at the same base in both.

The description page keeps the structure and wording written for the hub but
not its markup. Its reference table had all 24 links pointing at one PMID while
displaying another, so that table is now generated from the data joined to a
checked-in PMID list, each one verified against PubMed. tableBrowser is off at
the request of the data providers, so Data Access points at EpigenCentral's own
portal and repository.

refs #38112

diff --git src/hg/makeDb/scripts/episignatures/makeEpigenCentral.sh src/hg/makeDb/scripts/episignatures/makeEpigenCentral.sh
new file mode 100755
index 00000000000..88e38361768
--- /dev/null
+++ src/hg/makeDb/scripts/episignatures/makeEpigenCentral.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+# Build the EpigenCentral episignature track for hg38 from the lab's track hub.
+# Run from /hive/data/genomes/hg38/bed/episignatures/epigenCentral.
+set -beEu -o pipefail
+
+scripts=$(dirname $(readlink -f $0))
+sizes=/hive/data/genomes/hg38/chrom.sizes
+url=https://raw.githubusercontent.com/ccmbioinfo/EpigenCentral-UCSC-Genome-Browser/refs/heads/main/episignatures.bb
+
+# Download into .part and only then move it into place, so a resumed or failed
+# fetch can never leave a half-written file that looks finished.
+if [ ! -s episignatures.upstream.bb ]; then
+    curl -sSL -o episignatures.upstream.bb.part "$url"
+    mv episignatures.upstream.bb.part episignatures.upstream.bb
+fi
+md5sum episignatures.upstream.bb
+
+bigBedToBed episignatures.upstream.bb stdout \
+    | python3 $scripts/epigenCentralToBed.py \
+        --raOut epigenCentralFilters.ra \
+        --htmlOut epigenCentralTable.html \
+        --refs $scripts/epigenCentralRefs.tsv \
+    > epigenCentral.bed
+
+# -extraIndex=name lets the position box find a probe by its cg number; it needs
+# the searchTable stanza in episignatures.ra to actually be reachable
+bedToBigBed -tab -type=bed9+8 -as=$scripts/epigenCentral.as -extraIndex=name \
+    epigenCentral.bed $sizes epigenCentral.bb
+
+bigBedInfo epigenCentral.bb