4043be9096df4ee0a1514f68bf3c7e145d7f496b
angie
  Thu Jun 20 07:28:07 2013 -0700
Oops, .bed4 wasn't taking precedence as intended.
diff --git src/hg/hgVai/hgVai.c src/hg/hgVai/hgVai.c
index 779a76b..d7f8845 100644
--- src/hg/hgVai/hgVai.c
+++ src/hg/hgVai/hgVai.c
@@ -515,38 +515,41 @@
     return FALSE;
 boolean foundIt = FALSE;
 // Skip to last in list -- highest number (show tables can't use rlike or 'order by'):
 struct slName *table = snpNNNTables;
 while (table->next != NULL && isdigit(table->next->name[4]) && isdigit(table->next->name[5]))
     table = table->next;
 // Do we happen to have a bigBed version?  Better yet, bed4 only for current uses:
 char fileName[HDB_MAX_PATH_STRING];
 safef(fileName, sizeof(fileName), "/gbdb/%s/vai/%s.bed4.bb", database, table->name);
 if (fileExists(fileName))
     {
     if (retFileName != NULL)
 	*retFileName = cloneString(fileName);
     foundIt = TRUE;
     }
+else
+    {
 // Not bed4; try just .bb:
 safef(fileName, sizeof(fileName), "/gbdb/%s/vai/%s.bb", database, table->name);
 if (fileExists(fileName))
     {
     if (retFileName != NULL)
 	*retFileName = cloneString(fileName);
     foundIt = TRUE;
     }
+    }
 if (foundIt && retTdb == NULL)
     return TRUE;
 struct trackDb *tdb = tdbForTrack(database, table->name, &fullTrackList);
 if (tdb != NULL)
     {
     if (retTdb != NULL)
 	*retTdb = tdb;
     return TRUE;
     }
 return foundIt;
 }
 
 void selectDbSnp(boolean gotSnp)
 /* Offer to include rsID (and other fields, or leave that for advanced output??) if available */
 {