5ad55adbb6a5cc72a393700130584aa87fef2c89
lrnassar
Tue Jun 30 06:15:44 2026 -0700
varFreqs: add Top 3 source AFs to mouseOvers; audit excludes SGDP and SVatalog. refs #36642
Adds a Top 3 source AFs ranking to the varFreqsAffected and varFreqsBackground
mouseOvers. Alongside the pooled allele frequency, the mouseOver now lists the
three cohorts/arms with the highest per-source AF, formatted as
"Source (AF), Source (AF), Source (AF)". Disease cohorts with phenotype splits
carry the arm label (SPARK ASD, SCHEMA case, GREGoR unaffected); population
cohorts use the bare key. Per-population sub-ancestries are deliberately
excluded so a high sub-pop AF cannot crowd out actual project-level signals.
vcfToBigBed.py adds a top_n_source_afs helper, collects per-arm AFs into
affected_arm_afs / background_arm_afs, and emits two new fields
topAffectedSources and topBackgroundSources. AS schema field count 163 -> 165.
An AF-distribution sweep across all 28 source cohorts identified SGDP and
SVatalog as encoding allele counts per genotyped individual (small N, AF
defaults near 0.5), making their per-source AF unreliable for the ranking.
Adds a skip_top_ranking column (col 9) to databases.tsv, set to 1 for SGDP
and SVatalog, and gates the per-arm AF append in vcfToBigBed.py on this
flag. Both cohorts still contribute to pooled backgroundAC/AN/AF and still
appear in backgroundSources; they are only suppressed from the Top 3.
Description pages varFreqsAffected.html and varFreqsBackground.html document
the ranking; the latter also documents the SGDP/SVatalog exclusion. Build
documentation in varFreqs.txt is updated.
diff --git src/hg/makeDb/trackDb/human/varFreqsBackground.html src/hg/makeDb/trackDb/human/varFreqsBackground.html
index 5d2f82eb6ef..598b693e6ba 100644
--- src/hg/makeDb/trackDb/human/varFreqsBackground.html
+++ src/hg/makeDb/trackDb/human/varFreqsBackground.html
@@ -49,30 +49,59 @@
backgroundAC sums the allele counts and backgroundAN sums the allele
numbers across each cohort/arm that provides both AC and AF (the per-arm AN is derived as
round(AC / AF)). Two cohorts that publish only AF (ABraOM, ALFA) are still
pooled by assigning them an assumed allele number, set as a default_an in the
build configuration; their per-arm AC is then derived as round(AF × default_an).
Cohorts that publish
only AC with no default_an set (currently MGRB and the GREGoR unaffected and
unknown arms), and cohorts that contribute only through per-population AC/AF (currently
AllOfUs), are listed in backgroundSources but do not contribute to the pool
numerator or denominator; their data remain visible in the per-database and per-population
AC/AF columns. The pooled rate is preferred over a max-across-cohorts statistic so a small
cohort with a high local AF (for example AllOfUs Oceanian) cannot dominate the displayed
frequency.
+Alongside the pooled rate, the mouseover lists the top 3 contributing
+background sources ranked by their own per-source AF, formatted as
+Source (AF). This surfaces population cohorts where a variant
+is specifically enriched, even when the pooled rate is small; the
+East-Asian founder allele
+rs4986893,
+for example, ranks ToMMo Japan and KOVA Korea at the top while the pooled
+rate across all contributing sources sits much lower. For disease cohorts
+that ship a phenotype split (SPARK, SFARI WGS, SCHEMA, GREGoR), the
+displayed AF is the unaffected-arm AF and the label includes the arm (for
+example SPARK non-ASD, SCHEMA ctrl); for
+population cohorts, the label is the cohort name and the AF is the unified
+cohort AF. Per-population sub-ancestries of a cohort (such as gnomAD
+HGDP+1kG continental groups) are deliberately excluded from this ranking so
+sub-population frequencies do not crowd out actual project-level signals.
+
+Two source cohorts are also excluded from the Top-3 ranking: SGDP
+and SVatalog. Their VCFs encode allele counts per genotyped site
+rather than per population (each variant in a single individual produces
+AC=1, AN=2, AF=0.5), so the per-source AF is not a population
+frequency and would always sit near the top of the ranking with a
+meaningless value. Both cohorts still appear in backgroundSources
+and still contribute their (small) AC and AN to the pooled
+backgroundAF; they are only suppressed from the Top-3 list.
+