cc6ef4c74d072de9c22e8bb88ab0e0983e6f2f47
max
  Wed Jul 22 18:09:16 2026 -0700
lrSv cardSv: switch CARD count fields from carrier counts to allele counts

The NIH CARD provider republished the display bigBed with the count columns
changed to diploid allele counts (alleleCount = nabecAlleleCount +
hbccAlleleCount). Re-downloaded and rebuilt; renamed the schema fields to AC /
nabecAc / hbccAc, updated filter ranges (0:702, 0:410, 0:292) and labels to
allele counts, and reworded cardSv.html and the lrSv.html summary. Also noted
there are no Alzheimer's cases in these cohorts. Re-ran the merge so lrSvAll
carries CARD's allele counts. refs #36258

diff --git src/hg/makeDb/doc/hg38/lrSv.txt src/hg/makeDb/doc/hg38/lrSv.txt
index 4853d64177a..07a7fe15cc3 100644
--- src/hg/makeDb/doc/hg38/lrSv.txt
+++ src/hg/makeDb/doc/hg38/lrSv.txt
@@ -725,15 +725,47 @@
 #    significant trait associations in nGwas (for filtering).
 #  - Colors from the shared svColor() palette in lrSvCommon.py.
 #
 # Not added to the lrSvAll merge for now.
 
 # Added cardSv (NIH CARD 351) and noyvertSv (Noyvert 888) to the lrSvAll merge:
 # both appended to databases.tsv (CARD uses alleleFreq for max-AF aggregation,
 # Noyvert888 uses AF) and the merge re-run. The merge auto-regenerates
 # lrSvAll.as and trackDb/human/lrSvAll.ra (now 16 source databases,
 # filter.sourceCount 1:16).
 python3 ~/kent/src/hg/makeDb/scripts/lrSv/lrSvMergeAll.py
 # 3,018,404 input variants -> 2,582,278 merged (14.4% dedup), 16 databases
 # (was 2,682,104 -> 2,317,508 with 14 databases). All INS store svLen=1 across
 # every subtrack, so insertions merge on insLen; the merged median svLen is 1
 # (INS are 1.65M of 2.58M rows).
+
+##########
+# 2026-07-22 Claude max
+#
+# cardSv update: the NIH CARD provider (Melissa Meredith) republished the
+# display bigBed with the count columns changed from genotyped carrier/sample
+# counts to diploid ALLELE counts (alleleCount = nabecAlleleCount +
+# hbccAlleleCount), and renamed the .as fields accordingly. AF is unchanged;
+# item count and SV-type breakdown are unchanged (228,855: DEL 101,570,
+# INS 126,853, INV 431, DUP 1). No Alzheimer's disease cases are in either
+# cohort (confirmed by the author).
+#
+# Re-downloaded and rebuilt (converter now reads the allele-count columns,
+# lrSvCard.as fields renamed AC / nabecAc / hbccAc):
+cd /hive/data/genomes/hg38/bed/lrSv/card
+base=https://raw.githubusercontent.com/meredith705/card_genome_browserTrack/main/hg38
+curl -sL $base/NIH_CARD_longReadSVs.bb -o NIH_CARD_longReadSVs.bb
+bigBedToBed NIH_CARD_longReadSVs.bb stdout \
+  | python3 $HOME/kent/src/hg/makeDb/scripts/lrSv/lrSvCardBbToBed.py /dev/stdin cardSv.bed
+# CARD: 228,855 input records written; by type: DEL=101,570, DUP=1,
+#       INS=126,853, INV=431
+bedSort cardSv.bed cardSv.sorted.bed
+bedToBigBed -type=bed9+ -as=$HOME/kent/src/hg/makeDb/scripts/lrSv/lrSvCard.as \
+    -tab cardSv.sorted.bed /hive/data/genomes/hg38/chrom.sizes cardSv.bb
+# Max allele counts: AC=702 (2x351), nabecAc=410 (2x205), hbccAc=292 (2x146).
+# trackDb filter ranges/labels updated to allele counts; mouseOver and the
+# cardSv.html / lrSv.html wording changed from "carriers" to "allele counts".
+#
+# Re-ran the merge so lrSvAll carries CARD's allele counts (databases.tsv
+# unchanged; CARD still contributes via valueField=AC):
+python3 ~/kent/src/hg/makeDb/scripts/lrSv/lrSvMergeAll.py
+# 3,018,404 input -> 2,582,278 merged, 16 databases (unchanged structure).