04456b0be37a7d7b57551e0d9596e3ef0b8f0393
max
  Thu Jul 16 00:34:37 2026 -0700
Add HPRC Release 2 hg38 native tracks (alignments, coverage, breaks, rearrangements, chains), refs #35415

#Preview2 week - bugs introduced now will need a build patch to fix
New pan-genome track container (group hprc) derived from the HPRC Release 2
per-assembly chains to GRCh38 (462 haplotypes), running in parallel to the
existing HPRC release 1 tracks:
- hprc2Coverage: fraction of assemblies aligning across GRCh38
- hprc2Breaks:   alignment breaks, colored by prevalence
- hprc2Rearr:    insertions/deletions/inversions/duplications/complex indels,
lrSv color palette, numeric size field, 50 bp default filter
- hprc2Chains:   per-haplotype bigChain composite, grouped by superpopulation
Container hidden by default. Scripts, autoSql, and makeDoc included.

diff --git src/hg/makeDb/scripts/hprc2/hprc2SampleSuperpop.py src/hg/makeDb/scripts/hprc2/hprc2SampleSuperpop.py
new file mode 100755
index 00000000000..3a72ce71153
--- /dev/null
+++ src/hg/makeDb/scripts/hprc2/hprc2SampleSuperpop.py
@@ -0,0 +1,25 @@
+#!/usr/bin/env python3
+"""Read the HPRC release2 sample metadata CSV (which has quoted fields containing
+commas) and print "sample_id<TAB>superpopulation" for each sample.
+Redmine #35415
+Usage: hprc2SampleSuperpop.py <hprc_release2_sample_metadata.csv>
+"""
+import csv, sys
+
+# 1000 Genomes population_abbreviation -> superpopulation
+SUPERPOP = {
+    "YRI": "AFR", "LWK": "AFR", "GWD": "AFR", "MSL": "AFR", "ESN": "AFR",
+    "ASW": "AFR", "ACB": "AFR", "MKK": "AFR",
+    "MXL": "AMR", "PUR": "AMR", "CLM": "AMR", "PEL": "AMR",
+    "CHB": "EAS", "JPT": "EAS", "CHS": "EAS", "CDX": "EAS", "KHV": "EAS",
+    "CEU": "EUR", "TSI": "EUR", "FIN": "EUR", "GBR": "EUR", "IBS": "EUR",
+    "GIH": "SAS", "PJL": "SAS", "BEB": "SAS", "STU": "SAS", "ITU": "SAS",
+}
+
+with open(sys.argv[1], newline="") as fh:
+    for row in csv.DictReader(fh):
+        sid = (row.get("sample_id") or "").strip()
+        if not sid:
+            continue
+        abbr = (row.get("population_abbreviation") or "").strip().upper()
+        print("%s\t%s" % (sid, SUPERPOP.get(abbr, "OTH")))