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/bedList.c src/hg/hgTables/bedList.c index a4950f2e20a..f3a33e646e5 100644 --- src/hg/hgTables/bedList.c +++ src/hg/hgTables/bedList.c @@ -211,34 +211,34 @@ int *retFieldCount) /* Number of fields. */ /* Return a bed list of all items in the given range in table. * Cleanup result via lmCleanup(&lm) rather than bedFreeList. */ { char *fields = NULL; struct sqlResult *sr; struct hTableInfo *hti; struct bed *bedList=NULL, *bed; char **row; int fieldCount; boolean isPsl, isGenePred, isBedWithBlocks; boolean pslKnowIfProtein = FALSE, pslIsProtein = FALSE; struct sqlConnection *conn = NULL; char *dbTable = NULL; -if (isCustomTrack(table) || startsWith("myVariants_", table)) +if (isCustomTrack(table) || isMyVariantsTrack(table)) { struct customTrack *ct = ctLookupName(table); - if (startsWith("myVariants_", table) && ct->dbTableName == NULL) + if (isMyVariantsTrack(table) && ct->dbTableName == NULL) ct->dbTableName = myVariantsResolveDbTableForCustomTrack(ct->tdb->table, cart); dbTable = ct->dbTableName; conn = hAllocConn(CUSTOM_TRASH); hti = hFindTableInfo(CUSTOM_TRASH, region->chrom, dbTable); } else { dbTable = table; struct trackDb *tdb; if(sameWord(db, database)) tdb = tdbForTrack(db, table, &fullTrackList); else tdb = hTrackDbForTrack(db, table); conn = (tdb ? hAllocConnTrack(db, tdb) : hAllocConn(db)); hti = hFindTableInfo(db, region->chrom, table); @@ -295,31 +295,31 @@ struct region *oldNext = region->next; struct bed *bedList = NULL; region->next = NULL; if (isBigBed(database, table, curTrack, ctLookupName)) bedList = bigBedGetFilteredBedsOnRegions(conn, database, table, region, lm, retFieldCount); else if (isLongTabixTable(table)) bedList = longTabixGetFilteredBedsOnRegions(conn, database, table, region, lm, retFieldCount); else if (isBamTable(table)) bedList = bamGetFilteredBedsOnRegions(conn, database, table, region, lm, retFieldCount); else if (isVcfTable(table, &isTabix)) bedList = vcfGetFilteredBedsOnRegions(conn, database, table, region, lm, retFieldCount, isTabix); else if (isHicTable(table)) bedList = hicGetFilteredBedsOnRegions(conn, database, table, region, lm, retFieldCount); -else if (isCustomTrack(table) || startsWith("myVariants_", table)) +else if (isCustomTrack(table) || isMyVariantsTrack(table)) bedList = customTrackGetFilteredBeds(database, table, region, lm, retFieldCount); else if (sameWord(table, WIKI_TRACK_TABLE)) bedList = wikiTrackGetFilteredBeds(table, region, lm, retFieldCount); else bedList = dbGetFilteredBedsOnRegions(conn, database, database, table, table, region, lm, retFieldCount); region->next = oldNext; return bedList; } /* Droplist menu for custom track visibility: */ char *ctVisMenu[] = { "hide", "dense",