ba33f2c600399d5b4b97dd5fd987ed2db3c891ba
chmalee
  Tue May 19 13:40:42 2026 -0700
myVariants related fixes from code review. Standardize how the code determines we are about to do something myVariants related by #defining some strings and using sameOk to check for them, remove a dead code block, and have hgc use autoSql to load the myVariants item rather than check the raw sql result, refs #37528

diff --git src/hg/hgTables/custom.c src/hg/hgTables/custom.c
index 89ffca70632..1dd727b3ce2 100644
--- src/hg/hgTables/custom.c
+++ src/hg/hgTables/custom.c
@@ -483,38 +483,38 @@
 /* Get list of beds from custom track of given name that are
  * in current regions and that pass filters.  You can bedFree
  * this when done. */
 {
 struct customTrack *ct = ctLookupName(name);
 struct bedFilter *bf = NULL;
 struct bed *bedList = NULL;
 struct hash *idHash = NULL;
 struct region *region;
 int fieldCount;
 
 if (ct == NULL)
     errAbort("Can't find custom track %s", name);
 char *type = ct->dbTrackType;
 
-if (type != NULL && (startsWithWord("myVariants", type) ||
+if (type != NULL && (isMyVariantsType(type) ||
         sameWord("bedDetail", type) ||
         sameWord("barChart", type) ||
         sameWord("interact", type) ||
         sameWord("bedMethyl", type) ||
         sameWord("pgSnp", type)))
     {
-    if (sameWord("myVariants", type) && ct->dbTableName == NULL)
+    if (isMyVariantsType(type) && ct->dbTableName == NULL)
         ct->dbTableName = myVariantsResolveDbTableForCustomTrack(ct->tdb->table, cart);
     struct sqlConnection *conn = hAllocConn(CUSTOM_TRASH);
     bedList = dbGetFilteredBedsOnRegions(conn, CUSTOM_TRASH, db, ct->dbTableName, name,
     	regionList, lm, retFieldCount);
     hFreeConn(&conn);
     fieldCount = 9;
     if (sameWord("bedDetail", type))
         fieldCount = *retFieldCount;
     else if (sameWord("pgSnp", type))
         fieldCount = 4;
     else if (sameWord("barChart", type))
         fieldCount = 6;
     else if (sameWord("interact", type))
         fieldCount = 5;
     else if (sameWord("bedMethyl", type))
@@ -595,38 +595,38 @@
 	++count;
 	}
     lmCleanup(&lm);
     }
 if (count == 0)
     explainWhyNoResults(f);
 }
 
 void doTabOutCustomTracks(char *db, char *table, struct sqlConnection *conn,
 	char *fields, FILE *f, char outSep)
 /* Print out selected fields from custom track.  If fields
  * is NULL, then print out all fields. */
 {
 struct customTrack *ct = ctLookupName(table);
 char *type = ct->tdb->type;
-if (startsWithWord("myVariants", type) ||
+if (isMyVariantsType(type) ||
         sameWord("bedDetail", type) ||
         sameWord("barChart", type) ||
         sameWord("interact", type) ||
         sameWord("bedMethyl", type) ||
         sameWord("pgSnp", type))
     {
-    if (sameWord("myVariants", type))
+    if (isMyVariantsType(type))
         {
         ct->dbTableName = myVariantsResolveDbTableForCustomTrack(ct->tdb->table, cart);
         }
     struct sqlConnection *conn = hAllocConn(CUSTOM_TRASH);
     doTabOutDb(CUSTOM_TRASH, db, ct->dbTableName, table, f, conn, fields, outSep);
     hFreeConn(&conn);
     }
 else
     doTabOutBedLike(ct, table, conn, fields, f, outSep);
 }
 
 
 void removeNamedCustom(struct customTrack **pList, char *name)
 /* Remove named custom track from list if it's on there. */
 {