2b19cd11a40b973defb2f4c00b9002634bd6c9bd
lrnassar
  Thu Aug 7 15:11:10 2025 -0700
Flipping the file names because the item count check was comparing the new count as the old count and vice versa. This did not change the check at all, since it was looking for 10% absolute difference, but led to a confusing output. No RM.

diff --git src/hg/utils/otto/panelApp/doPanelApp.py src/hg/utils/otto/panelApp/doPanelApp.py
index 07ff72860f3..d9cc6170a58 100755
--- src/hg/utils/otto/panelApp/doPanelApp.py
+++ src/hg/utils/otto/panelApp/doPanelApp.py
@@ -81,35 +81,35 @@
     else:
         print(oldFname+" vs. new count: "+str(oldItemCount)+" - "+str(newItemCount))
 
 def flipFiles(country):
     " rename the .tmp files to the final filenames "
     if country == "Australia":
         subtracks = ["genesAus", "tandRepAus", "cnvAus"]
     else:
         subtracks = ["genes", "tandRep", "cnv"]
     for db in ["hg19", "hg38"]:
         archDir = getArchDir(db)
         for subTrack in subtracks:
             if db=="hg19" and "cnv" in subTrack:
                 # no cnvs for hg19 yet
                 continue
-            oldFname = "current/%s/%s.bb.tmp" % (db, subTrack)
-            newFname = "current/%s/%s.bb" % (db, subTrack)
+            oldFname = "current/%s/%s.bb.tmp" % (db, subTrack) #New data just generated
+            newFname = "current/%s/%s.bb" % (db, subTrack) #Existing .bb
 
             #Check if files are more than 10% different
-            checkIfFilesTooDifferent(oldFname,newFname)
+            checkIfFilesTooDifferent(newFname,oldFname)
             
             os.replace(oldFname, newFname)
 
 def getAllPages(url, results=[]):
     " recursively download all pages. Stack should be big enough "
     try:
         myResponse = requests.get(url)
         if (myResponse.ok):
             jData = json.loads(myResponse.content.decode())
             # If jData is empty create, else append
             if "error" in jData.keys() or not "results" in jData.keys():
                 raise Exception("Error in keys when downloading %s" % url)
 
             if "count" in jData and not "page" in url:
                 print("API says that there are %d results for url %s" % (jData["count"], url))