e7b98d8286de2133b30617a7eb9c78cd355fd21e
braney
  Thu Aug 13 14:32:17 2026 -0700
geneReviews otto: survive a knownGene rebuild, and keep the bigBed in step with the tables, refs #38098

hg19 and hg18 take their gene coordinates from knownGene. The hg19 knownGene
rebuild on 2026-07-15 moved the ends of most genes by a few bases, and the
validation step compared chrom, chromStart, chromEnd and name exactly. That made
1325 of 1939 rows look new, far past the 10 percent ceiling, so the job has
failed every week since July 21 and the tables have been stuck at their June 30
version.

validateGeneReviews.sh now compares the overall span of each gene on each
chromosome and counts a gene as unchanged when the old and new spans overlap.
geneReviewsDetail still compares whole rows exactly. A zero-overlap result now
fails with a message rather than an awk divide-by-zero.

checkGeneReviews.sh validates all three assemblies before deciding, so one bad
assembly no longer hides the state of the others. hg18 had not been checked
since July.

buildGeneReviews.sh pointed /gbdb at the new bigBed before validation ran, so a
failed run left the browser image and the geneReviews tables six weeks apart.
The relink moves to checkGeneReviews.sh, after validation passes and the tables
are installed.

diff --git src/hg/utils/otto/geneReviews/checkGeneReviews.sh src/hg/utils/otto/geneReviews/checkGeneReviews.sh
index d89adfb632f..2ca5b294971 100755
--- src/hg/utils/otto/geneReviews/checkGeneReviews.sh
+++ src/hg/utils/otto/geneReviews/checkGeneReviews.sh
@@ -16,58 +16,81 @@
 # with no output, which mail -E suppresses entirely. set -E (errtrace) makes the ERR
 # trap fire for failures inside functions too. No-update runs stay silent.
 set -E
 trap 'echo "ERROR: GeneReviews build failed (exit $?)"' ERR
 
 function installGeneReviewTables() {
 for i in `cat ../geneReviews.tables`
     do
     n=$i"New"
     o=$i"Old"
     hgsqlSwapTables $1 $n $i $o -dropTable3
     done
     echo "GENEREVIEWS Installed `date` in $1"
 }
 
+function installGeneReviewsBigBed() {
+# Point /gbdb at the bigBed built in the current directory.  buildGeneReviews.sh
+# makes the file but does not move the link, so this runs only after validation
+# passes and the tables are installed.
+gbdb="/gbdb/$1/geneReviews"
+mkdir -p $gbdb
+rm -f $gbdb/geneReviews.bb
+ln -s `pwd`/geneReviews.$1.bb $gbdb/geneReviews.bb
+}
+
 
 #	this is where we are going to work
 if [ ! -d "${WORKDIR}" ]; then
     echo "ERROR in GENEREVIEWS release watch, Can not find the directory:
     ${WORKDIR}" 
     exit 255
 fi
 
 cd "${WORKDIR}"
 wget -q --timestamping ftp://ftp.ncbi.nih.gov/pub/GeneReviews/*.txt
 chmod 660 *.txt
 if test NBKid_shortname_genesymbol.txt -nt lastUpdate
 then
     today=`date +%F`
     mkdir -p $today
     mv *.txt $today
 
     cd $today
 
     # build the new GENEREVIEWS track tables
     ../buildGeneReviews.sh
-    ../validateGeneReviews.sh hg38
-    ../validateGeneReviews.sh hg19
-    ../validateGeneReviews.sh hg18
+
+    # Validate all three assemblies before deciding, so one bad assembly does
+    # not hide the state of the others.
+    validateFailed=0
+    for db in "hg38" "hg19" "hg18"
+    do
+        ../validateGeneReviews.sh $db || validateFailed=1
+    done
+    if [ $validateFailed -ne 0 ]; then
+        echo "ERROR: GeneReviews validation failed, nothing installed"
+        exit 1
+    fi
+
     # now install
     installGeneReviewTables "hg38"
     installGeneReviewTables "hg19"
     installGeneReviewTables "hg18"
+    installGeneReviewsBigBed "hg38"
+    installGeneReviewsBigBed "hg19"
+    installGeneReviewsBigBed "hg18"
     # now archive
     for db in "hg18" "hg19" "hg38"
     do
         if [ ! -d ${WORKDIR}/archive/${db} ]; then
             mkdir -p ${WORKDIR}/archive/${db}
         fi
         cd ${WORKDIR}/archive/${db}
         mkdir ${today}
         cd ${today}
         printf "This directory contains a backup of the geneReviews track built on %s" "${today}" > README 
         for i in `cat ${WORKDIR}/geneReviews.tables`
         do
             hgsql -Ne "show create table ${i}" ${db} > ${i}.sql
             hgsql -Ne "select * from ${i}" ${db} | gzip >  ${i}.txt.gz
         done