219f66fde04ded54d6992855d1fef738aa5b6a6f
mspeir
  Thu Aug 27 17:12:34 2026 -0700
Give the RefSeq Historical subtrack its own dataVersion, refs #35766

The Historical track inherited the composite's dataVersion file, which
tracks the current RefSeq annotation release, so the track advertised
RS_2025_08 while its data is RS_2024_08. This affected three places: the
long label in the browser image (simpleTracks.c appends the version for
any track whose name starts with ncbiRef), the track settings page, and
the details pages.

A subtrack may carry its own dataVersion; trackDbSetting reads the local
value first and only climbs to the parent when there isn't one. Same
pattern already used by clinGenHaplo and the nmdEsc* subtracks.

Also adds the version file step to the makedoc, and a reminder to the
weekly notifier mail so the next refresh doesn't leave it stale again.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

diff --git src/hg/makeDb/doc/hg38/ncbiRefSeq.txt src/hg/makeDb/doc/hg38/ncbiRefSeq.txt
index de2a6506f92..e8e294eae5c 100644
--- src/hg/makeDb/doc/hg38/ncbiRefSeq.txt
+++ src/hg/makeDb/doc/hg38/ncbiRefSeq.txt
@@ -470,31 +470,31 @@
     pragmaLabels.cleaned.txt \
     continueOnParentErrors \
     2> refLink.stderr \
     | sort > refLink.tab
 # join the refLink metadata with curated+predicted names
 cut -f1 refSeqHistorical.gp | sort -u > name.list
 join -t$'\t' name.list refLink.tab > ncbiRefSeqLinkOld.tab
 # loading the cross reference data
 hgLoadSqlTab hg38 ncbiRefSeqLinkHistorical ~/kent/src/hg/lib/ncbiRefSeqLink.sql ncbiRefSeqLinkOld.tab
 
 #############################################################################
 # Update RefSeq Historical to RS_2024_08 (DONE - Lou - 2026-06-02)
 #############################################################################
 # NCBI published a newer historical release, GCF_000001405.40-RS_2024_08
 # (2024-10-22), superseding the RS_2023_03 build above. One-off refresh of the
-# same six tables (names unchanged, no trackDb change). Full script kept at
+# same six tables (names unchanged). Full script kept at
 # /hive/data/outside/refSeqHistorical/RS_2024_08/build.RS_2024_08.sh
 mkdir /hive/data/outside/refSeqHistorical/RS_2024_08
 cd /hive/data/outside/refSeqHistorical/RS_2024_08
 REL=GCF_000001405.40-RS_2024_08
 BASE=https://ftp.ncbi.nlm.nih.gov/refseq/H_sapiens/historical/GRCh38
 
 # get the four source files
 wget "$BASE/current/${REL}_genomic.gff.gz"
 wget "$BASE/current/${REL}_knownrefseq_alns.bam"
 wget "$BASE/current/${REL}_knownrefseq_alns.bam.bai"
 wget "$BASE/${REL}_historical/${REL}_knownrefseq_rna.gbff.gz"
 
 cp /hive/data/genomes/hg38/goldenPath/bigZips/p14/hg38.p14.chromAlias.txt chromAlias.txt
 
 # sequences from the BAM.
@@ -537,15 +537,32 @@
 # seq/ext tables + gbdb symlink
 ln -sf `pwd`/refSeqHistorical.deDuped.fa /gbdb/hg38/ncbiRefSeq/refSeqHistorical.fa
 hgLoadSeq -drop -seqTbl=seqNcbiRefSeqHistorical -extFileTbl=extNcbiRefSeqHistorical hg38 /gbdb/hg38/ncbiRefSeq/refSeqHistorical.fa
 
 # link metadata table for the hgvs xref search
 zcat ${REL}_knownrefseq_rna.gbff.gz | (grep ' :: ' || true) \
   | perl -wpe 's/\s+::.*//; s/^\s+//;' | sort -u > pragmaLabels.txt
 /hive/data/outside/genbank/bin/x86_64/gbProcess /dev/null raFile.txt ${REL}_knownrefseq_rna.gbff.gz 2>gbProcess.err
 cat pragmaLabels.txt | tr -s '[:blank:]' | cut -d':' -f1 | sort -u | cut -d' ' -f2- > pragmaLabels.cleaned.txt
 ~/kent/src/hg/utils/automation/gff3ToRefLink.pl \
     raFile.txt ${REL}_genomic.gff.gz pragmaLabels.cleaned.txt continueOnParentErrors \
     2> refLink.stderr | LC_ALL=C sort > refLink.tab
 cut -f1 refSeqHistorical.gp | LC_ALL=C sort -u > name.list
 LC_ALL=C join -t$'\t' name.list refLink.tab > ncbiRefSeqLinkOld.tab
 hgLoadSqlTab hg38 ncbiRefSeqLinkHistorical ~/kent/src/hg/lib/ncbiRefSeqLink.sql ncbiRefSeqLinkOld.tab
+
+# version string for the track (DONE - Matt - 2026-08-27)
+#############################################################################
+# This subtrack has its own dataVersion, separate from the composite's
+# /gbdb/hg38/ncbiRefSeq/ncbiRefSeqVersion.txt, which tracks the current RefSeq
+# annotation release and is years ahead of the historical data. Without this
+# file the Historical track advertises the current release in its long label,
+# on its track settings page and on its details pages.
+# Redo this step on every historical refresh, with the release NCBI published.
+cd /hive/data/outside/refSeqHistorical/RS_2024_08
+echo "NCBI RefSeq ${REL} (2024-10-22)" > ncbiRefSeqHistoricalVersion.txt
+ln -sf `pwd`/ncbiRefSeqHistoricalVersion.txt \
+    /gbdb/hg38/ncbiRefSeq/ncbiRefSeqHistoricalVersion.txt
+
+# trackDb: dataVersion on the ncbiRefSeqHistorical stanza in
+# kent/src/hg/makeDb/trackDb/human/trackDb.ra
+#   dataVersion /gbdb/$D/ncbiRefSeq/ncbiRefSeqHistoricalVersion.txt