4178716a1446bb583ac890e1304689b9d6a9ff1d
jnavarr5
  Tue Mar 3 11:34:59 2026 -0800
Fixing a logic bug found in code review, refs #37192

diff --git src/hg/utils/otto/clinGen/makeClinGenCspec.sh src/hg/utils/otto/clinGen/makeClinGenCspec.sh
index c18fa751152..df40940b5a2 100755
--- src/hg/utils/otto/clinGen/makeClinGenCspec.sh
+++ src/hg/utils/otto/clinGen/makeClinGenCspec.sh
@@ -1,76 +1,76 @@
 #! /bin/bash
 
 export LANG=en_US.UTF-8
 export LC_ALL=en_US.UTF-8
 
 cd /hive/data/outside/otto/clinGen/clinGenCspec
 
 # Check to see if svis.json is available for download and quit if it fails
 # after 4 attempts
-for i in 1 2 3; do
+for i in 1 2 3 4; do
     wget -q -O svis.json https://cspec.genome.network/cspec/api/svis && break
-    if [ $i -lt 3 ]; then
+    if [ $i -lt 4 ]; then
         echo "Warning: Failed to download SVIs data.\n"
         echo "Retrying in 5 minutes (attempt $i of 3)..."
         sleep 300
     fi
 done
-if [ $i -eq 3 ]; then
+if [ $i -eq 4 ]; then
     echo "Error: Failed to download the SVIs data. The ClinGen CSpec API appears to be down.\n"
     echo "Please try again later or check https://cspec.genome.network for service status."
     exit 1
 fi
 
 # Check if the files are the same
 if cmp -s svis.json svis.json.old; then
   # Files are the same, exit silently
   rm svis.json
   exit 0
 else
   # Files are different, continue with the script or add actions
   echo "Updating ClinGen VCEP track..."
 fi
 
 # Check to see if mondo.json is available, and quit if it fails
 # after 3 attempts
-for i in 1 2 3; do
+for i in 1 2 3 4; do
     wget -q http://purl.obolibrary.org/obo/mondo.json && break
-    if [ $i -lt 3 ]; then
+    if [ $i -lt 4 ]; then
         echo "Warning: Failed to download MONDO disease ontology.\n"
         echo "Retrying in 5 minutes (attempt $i of 3)..."
         sleep 300
     fi
 done
-if [ $i -eq 3 ]; then
+if [ $i -eq 4 ]; then
     echo "Error: Failed to download the MONDO disease ontology.\n"
     echo "The OBO Foundry API appears to be down.\n"
     echo "Please try again later or check https://obofoundry.org for service status."
     exit 1
 fi
 
 # Try to get the geneToDisease.csv file, and quit if it fails
 # after 3 attempts
-for i in 1 2 3; do
+for i in 1 2 3 4; do
     wget -q -O geneToDisease.csv https://search.clinicalgenome.org/kb/gene-validity/download && break
-    if [ $i -lt 3 ]; then
+    if [ $i -lt 4 ]; then
         echo "Warning: Failed to download gene-disease data.\n"
         echo "Retrying in 5 minutes (attempt $i of 3)..."
         sleep 300
     fi
 done
-if [ $i -eq 3 ]; then
+if [ $i -eq 4 ]; then
     echo "Error: Failed to download gene-disease data. The ClinGen API appears to be down.\n"
     echo "Please try again later or check https://clinicalgenome.org for service status."
     exit 1
 fi
 
 bigBedToBed /gbdb/hg38/hgnc/hgnc.bb hgnc.bed
 
 python3 - << END | sort -k1,1 -k2,2n > cspec.bed
 import json
 import re
 import sys
 
 # create a dict that matches MONDO ID with disease
 mondoDict = dict()
 jsonData = json.load(open("mondo.json"))