6b285a53b036b309e3c7a9b61d3741731088a172
lrnassar
  Fri Jun 12 02:35:01 2026 -0700
varFreqs: switch affectedAF/backgroundAF from max-across-cohorts to pooled
sum(AC)/sum(AN) so the rate matches the carrier count scale.

Per-arm AN is derived as round(AC/AF) when both are reported. An optional
"default_an" column was added to databases.tsv so AF-only cohorts (ABraOM,
ALFA) can synthesize a denominator from their cohort size; without it
those cohorts had been silently dropped from the pooled rate.

New affectedAN and backgroundAN columns expose the pool denominator. The
mouseOver now reads "Affected AC/AN: 33238 / 213153" so the ratio is
visible. Per-arm cohorts that ship only AC and no default_an (MGRB,
GREGoR AC_AFFECTED/UNAFFECTED/UNKNOWN, AllOfUs per-population) are still
listed in affectedCohorts/backgroundSources but contribute 0 to the
pool, preserving the invariant pool_AF <= 1.

The build pipeline is unchanged: re-run vcfToBigBed.py --split-affected
against the existing merged.annotated.vcf.gz. refs #36642

diff --git src/hg/makeDb/trackDb/human/varFreqs.ra src/hg/makeDb/trackDb/human/varFreqs.ra
index 8bf3d890953..7e8a3c3d634 100644
--- src/hg/makeDb/trackDb/human/varFreqs.ra
+++ src/hg/makeDb/trackDb/human/varFreqs.ra
@@ -4,68 +4,72 @@
 group varRep
 type bed 12
 visibility hide
 superTrack on
 
         track varFreqsAffected
         shortLabel Disease cohorts
         longLabel SNV Frequencies: variants in ~130,000 affected or case individuals (autism, schizophrenia, rare disease cohorts)
         type bigBed 9 +
         parent varFreqs on
         bigDataUrl /gbdb/$D/varFreqs/_affected/varFreqsAffected.bb
         visibility pack
         itemRgb on
         maxWindowToDraw 5000000
         priority 0.11
-        mouseOver <b>Var:</b> ${name}<br><b>AA change:</b> ${aaChange}<br><b>Var type:</b> ${varType}<br><b>Conseq:</b> ${consequence}<br><b>Affected AF:</b> ${affectedAF}<br><b>Affected AC:</b> ${affectedAC}<br><b>Affected cohorts:</b> ${affectedCohorts}<br><b>Background AF:</b> ${backgroundAF}
+        mouseOver <b>Var:</b> ${name}<br><b>AA change:</b> ${aaChange}<br><b>Var type:</b> ${varType}<br><b>Conseq:</b> ${consequence}<br><b>Affected AF:</b> ${affectedAF}<br><b>Affected AC/AN:</b> ${affectedAC} / ${affectedAN}<br><b>Affected cohorts:</b> ${affectedCohorts}<br><b>Background AF:</b> ${backgroundAF}
         filterValues.affectedCohorts SPARK|SFARI SPARK WES,SFARI_WGS|SFARI SPARK WGS,GREGoR|GREGoR,SCHEMA|SCHEMA,GA4K|GA4K PacBio LR
         filterType.affectedCohorts multipleListOr
         filterLabel.affectedCohorts Affected/case cohort
         filterValues.backgroundSources AllOfUs|AllOfUs,SPARK|SFARI SPARK WES,SFARI_WGS|SFARI SPARK WGS,GenomeAsia|GenomeAsia SNVs,GenomeAsiaIndel|GenomeAsia Indels,NPM|NPM Singapore,KOVA|KOVA Korea,ToMMo|ToMMo Japan,FinnGen|FinnGen Finland,Saudi|Saudi,SweGen|SweGen Sweden,TOPMed|TOPMed,ABraOM|ABraOM Brazil,ALFA|ALFA,MGRB|MGRB Australia,HRC|HRC,SGDP|SGDP,HGDP1kG|gnomAD HGDP+1kG,GREGoR|GREGoR,SCHEMA|SCHEMA,CoLoRSdb|CoLoRSdb PacBio LR,SVatalog|SVatalog 101 10XG SR,Tishkoff180|Tishkoff 180 African WGS,WBBC|WBBC China,ChinaMAP|China ChinaMAP,GenomeIndia|GenomeIndia 9.7k WGS,GoNL|GoNL Netherlands ~13x SR
         filterType.backgroundSources multipleListOr
         filterLabel.backgroundSources Background source (population or unaffected)
         # Variant type and consequence filters
         filterValues.varType SNV|SNV,INS|Insertion,DEL|Deletion,MNV|MNV
         filterLabel.varType Variant Type
         filterValues.consequence missense|Missense,synonymous|Synonymous,stop_gained|Stop Gained,frameshift|Frameshift,splice_donor|Splice Donor,splice_acceptor|Splice Acceptor,intron|Intron,3_prime_utr|3' UTR,5_prime_utr|5' UTR,non_coding|Non-coding,.|Intergenic,others|Other
         filterType.consequence multipleListOr
         filterLabel.consequence Consequence
         # Length filters
         filterByRange.refLen on
         filterLabel.refLen Reference Length
         filter.refLen 1:28037
         filterLimits.refLen 1:28037
         filterByRange.altLen on
         filterLabel.altLen Alternate Length
         filter.altLen 1:6294
         filterLimits.altLen 1:6294
         filterByRange.varLen on
         filterLabel.varLen Length Change
         filter.varLen -28036:6293
         filterLimits.varLen -28036:6293
         # Affected/case frequency summary
         filterByRange.affectedAF on
-        filterLabel.affectedAF Affected/case AF
+        filterLabel.affectedAF Affected/case AF (pooled)
         filterLimits.affectedAF 0:1
         filterByRange.affectedAC on
         filterLabel.affectedAC Affected/case AC
+        filterByRange.affectedAN on
+        filterLabel.affectedAN Affected/case AN (pool denominator)
         # Background (population + unaffected) frequency summary
         filterByRange.backgroundAF on
-        filterLabel.backgroundAF Background AF (population + unaffected)
+        filterLabel.backgroundAF Background AF (pooled)
         filterLimits.backgroundAF 0:1
         filterByRange.backgroundAC on
         filterLabel.backgroundAC Background AC (population + unaffected)
+        filterByRange.backgroundAN on
+        filterLabel.backgroundAN Background AN (pool denominator)
         # Affected/case membership flag
         filterByRange.inAffected on
         filterLabel.inAffected Seen in an affected/case arm (1=yes, 0=no)
         filter.inAffected 0:1
         filterLimits.inAffected 0:1
         # Per-database AF filters
         filterByRange.AllOfUsAF on
         filterLabel.AllOfUsAF AllOfUs AF
         filterByRange.SPARKAF on
         filterLabel.SPARKAF SFARI SPARK WES AF
         filterByRange.SFARI_WGSAF on
         filterLabel.SFARI_WGSAF SFARI SPARK WGS AF
         filterByRange.GenomeAsiaAF on
         filterLabel.GenomeAsiaAF GenomeAsia SNVs AF
         filterByRange.GenomeAsiaIndelAF on
@@ -339,68 +343,72 @@
         filterLabel.WBBCAC_South WBBC China South Han AC
         filterByRange.WBBCAC_Lingnan on
         filterLabel.WBBCAC_Lingnan WBBC China Lingnan Han AC
         skipEmptyFields on
 
         track varFreqsBackground
         shortLabel Population reference
         longLabel SNV Frequencies: variants in ~1.5 million individuals from population cohorts and unaffected or control arms
         type bigBed 9 +
         parent varFreqs on
         bigDataUrl /gbdb/$D/varFreqs/_background/varFreqsBackground.bb
         visibility pack
         itemRgb on
         maxWindowToDraw 5000000
         priority 0.1
-        mouseOver <b>Var:</b> ${name}<br><b>AA change:</b> ${aaChange}<br><b>Var type:</b> ${varType}<br><b>Conseq:</b> ${consequence}<br><b>Background AF:</b> ${backgroundAF}<br><b>Background AC:</b> ${backgroundAC}<br><b>Sources:</b> ${backgroundSources}<br><b>Affected AF:</b> ${affectedAF}
+        mouseOver <b>Var:</b> ${name}<br><b>AA change:</b> ${aaChange}<br><b>Var type:</b> ${varType}<br><b>Conseq:</b> ${consequence}<br><b>Background AF:</b> ${backgroundAF}<br><b>Background AC/AN:</b> ${backgroundAC} / ${backgroundAN}<br><b>Sources:</b> ${backgroundSources}<br><b>Affected AF:</b> ${affectedAF}
         filterValues.affectedCohorts SPARK|SFARI SPARK WES,SFARI_WGS|SFARI SPARK WGS,GREGoR|GREGoR,SCHEMA|SCHEMA,GA4K|GA4K PacBio LR
         filterType.affectedCohorts multipleListOr
         filterLabel.affectedCohorts Affected/case cohort
         filterValues.backgroundSources AllOfUs|AllOfUs,SPARK|SFARI SPARK WES,SFARI_WGS|SFARI SPARK WGS,GenomeAsia|GenomeAsia SNVs,GenomeAsiaIndel|GenomeAsia Indels,NPM|NPM Singapore,KOVA|KOVA Korea,ToMMo|ToMMo Japan,FinnGen|FinnGen Finland,Saudi|Saudi,SweGen|SweGen Sweden,TOPMed|TOPMed,ABraOM|ABraOM Brazil,ALFA|ALFA,MGRB|MGRB Australia,HRC|HRC,SGDP|SGDP,HGDP1kG|gnomAD HGDP+1kG,GREGoR|GREGoR,SCHEMA|SCHEMA,CoLoRSdb|CoLoRSdb PacBio LR,SVatalog|SVatalog 101 10XG SR,Tishkoff180|Tishkoff 180 African WGS,WBBC|WBBC China,ChinaMAP|China ChinaMAP,GenomeIndia|GenomeIndia 9.7k WGS,GoNL|GoNL Netherlands ~13x SR
         filterType.backgroundSources multipleListOr
         filterLabel.backgroundSources Background source (population or unaffected)
         # Variant type and consequence filters
         filterValues.varType SNV|SNV,INS|Insertion,DEL|Deletion,MNV|MNV
         filterLabel.varType Variant Type
         filterValues.consequence missense|Missense,synonymous|Synonymous,stop_gained|Stop Gained,frameshift|Frameshift,splice_donor|Splice Donor,splice_acceptor|Splice Acceptor,intron|Intron,3_prime_utr|3' UTR,5_prime_utr|5' UTR,non_coding|Non-coding,.|Intergenic,others|Other
         filterType.consequence multipleListOr
         filterLabel.consequence Consequence
         # Length filters
         filterByRange.refLen on
         filterLabel.refLen Reference Length
         filter.refLen 1:28037
         filterLimits.refLen 1:28037
         filterByRange.altLen on
         filterLabel.altLen Alternate Length
         filter.altLen 1:6294
         filterLimits.altLen 1:6294
         filterByRange.varLen on
         filterLabel.varLen Length Change
         filter.varLen -28036:6293
         filterLimits.varLen -28036:6293
         # Affected/case frequency summary
         filterByRange.affectedAF on
-        filterLabel.affectedAF Affected/case AF
+        filterLabel.affectedAF Affected/case AF (pooled)
         filterLimits.affectedAF 0:1
         filterByRange.affectedAC on
         filterLabel.affectedAC Affected/case AC
+        filterByRange.affectedAN on
+        filterLabel.affectedAN Affected/case AN (pool denominator)
         # Background (population + unaffected) frequency summary
         filterByRange.backgroundAF on
-        filterLabel.backgroundAF Background AF (population + unaffected)
+        filterLabel.backgroundAF Background AF (pooled)
         filterLimits.backgroundAF 0:1
         filterByRange.backgroundAC on
         filterLabel.backgroundAC Background AC (population + unaffected)
+        filterByRange.backgroundAN on
+        filterLabel.backgroundAN Background AN (pool denominator)
         # Affected/case membership flag
         filterByRange.inAffected on
         filterLabel.inAffected Seen in an affected/case arm (1=yes, 0=no)
         filter.inAffected 0:1
         filterLimits.inAffected 0:1
         # Per-database AF filters
         filterByRange.AllOfUsAF on
         filterLabel.AllOfUsAF AllOfUs AF
         filterByRange.SPARKAF on
         filterLabel.SPARKAF SFARI SPARK WES AF
         filterByRange.SFARI_WGSAF on
         filterLabel.SFARI_WGSAF SFARI SPARK WGS AF
         filterByRange.GenomeAsiaAF on
         filterLabel.GenomeAsiaAF GenomeAsia SNVs AF
         filterByRange.GenomeAsiaIndelAF on