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/buildGeneReviews.sh src/hg/utils/otto/geneReviews/buildGeneReviews.sh
index a4924193365..01df03328c1 100755
--- src/hg/utils/otto/geneReviews/buildGeneReviews.sh
+++ src/hg/utils/otto/geneReviews/buildGeneReviews.sh
@@ -51,35 +51,36 @@
 db=$1
 perl ../geneRevsAddDiseases.pl $geneDiseaseFile geneReviews.$db.tab > geneReviewsExt.$db.tab
 bedSort geneReviewsExt.$db.tab  stdout | uniq > geneReviewsExt.$db.bed
 gbdb="/gbdb/$db/geneReviews"
 mkdir -p $gbdb
 
 # validate
 oldLc=`bigBedToBed $gbdb/geneReviews.bb stdout | wc -l`
 newLc=`wc -l < geneReviewsExt.$db.bed`
 echo rowcount: old $oldLc new: $newLc
 if [ $oldLc -ne 0 ]; then
     echo $oldLc $newLc | \
         awk '{if (($2-$1)/$1 > 0.1) {printf "validate $db GENE REVIEWS failed: old count: %d, new count: %d\n", $1,$2; exit 1;}}'
 fi
 
-#install
+# Build the bigBed, but leave /gbdb pointing at the previous build for now.
+# checkGeneReviews.sh moves the link after validation passes, so the browser
+# image and the geneReviews/geneReviewsDetail tables always come from the same
+# build.
 bedToBigBed -tab -type=bed9+2 -as=../geneReviews.as geneReviewsExt.$db.bed \
          /hive/data/genomes/$db/chrom.sizes geneReviews.$db.bb
-rm -f $gbdb/geneReviews.bb
-ln -s `pwd`/geneReviews.$db.bb $gbdb/geneReviews.bb
 
 # Create and load geneReviewsDetail table
 hgsql $1 -N -e \
     "SELECT  s.geneSymbol, s.grShort, t.NBKid, t.grTitle \
         FROM geneReviewsGrshortNBKidNew s, geneReviewsGrshortTitleNBKidNew t \
         WHERE s.grShort = t.grShort ORDER BY s.geneSymbol;" > geneReviewsDetail.tab
 
 hgsql $1 -e 'drop table if exists geneReviewsDetailNew'
 hgsql $1 -e 'create table geneReviewsDetailNew select * from geneReviewsDetail limit 0'
 hgsql $1 -e \
 'load data local infile "geneReviewsDetail.tab" into table geneReviewsDetailNew'
 }
 
 ####### main ##########