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/joining.c src/hg/hgTables/joining.c index 97e46691bf3..e6e0c9c47d0 100644 --- src/hg/hgTables/joining.c +++ src/hg/hgTables/joining.c @@ -286,44 +286,44 @@ struct slName *fieldList = sqlListFields(conn, split); makeOrderedCommaFieldList(fieldList, dtfList, dy); slFreeList(&fieldList); freez(&split); } static void makeCtOrderedCommaFieldList(struct joinerDtf *dtfList, struct dyString *dy) /* Make comma-separated field list in same order as fields are in * custom track. */ { char *track = dtfList->table; struct customTrack *ct = ctLookupName(track); char *type = ct->dbTrackType; struct slName *fieldList = NULL; -if (startsWithWord("myVariants", type) || +if (isMyVariantsType(type) || sameWord("bedDetail", type) || sameWord("barChart", type) || sameWord("interact", type) || sameWord("bedMethyl", type) || sameWord("pgSnp", type)) { struct sqlConnection *conn = hAllocConn(CUSTOM_TRASH); - if (sameWord("myVariants", type)) + if (isMyVariantsType(type)) { ct->dbTableName = myVariantsResolveDbTableForCustomTrack(ct->tdb->table, cart); } fieldList = sqlListFields(conn, ct->dbTableName); - if (startsWith("myVariants_shared_", track)) + if (isMyVariantsSharedTrack(track)) myVariantsStripHiddenFields(&fieldList); hFreeConn(&conn); } else { fieldList = getBedFields(15); } makeOrderedCommaFieldList(fieldList, dtfList, dy); slFreeList(&fieldList); } static void makeBigBedOrderedCommaFieldList(struct joinerDtf *dtfList, struct dyString *dy) /* Make comma-separated field list in same order as fields are in * big bed. */ @@ -1089,31 +1089,31 @@ if (!trackHubDatabase(database)) conn = hAllocConn(dtfList->database); struct dyString *dy = dyStringNew(0); if (isBigBed(database, dtfList->table, NULL, ctLookupName)) makeBigBedOrderedCommaFieldList(dtfList, dy); else if (isLongTabixTable(dtfList->table)) makeLongTabixOrderedCommaFieldList(dtfList, dy); else if (isBamTable(dtfList->table)) makeBamOrderedCommaFieldList(dtfList, dy); else if (isVcfTable(dtfList->table, NULL)) makeVcfOrderedCommaFieldList(dtfList, dy); else if (isHicTable(dtfList->table)) makeHicOrderedCommaFieldList(dtfList, dy); - else if (isCustomTrack(dtfList->table) || startsWith("myVariants_", dtfList->table)) + else if (isCustomTrack(dtfList->table) || isMyVariantsTrack(dtfList->table)) makeCtOrderedCommaFieldList(dtfList, dy); else makeDbOrderedCommaFieldList(conn, dtfList->table, dtfList, dy); doTabOutTable(dtfList->database, dtfList->table, f, conn, dy->string, outSep); hFreeConn(&conn); } else { struct joiner *joiner = allJoiner; struct joinedTables *joined = joinedTablesCreate(joiner, primaryDb, primaryTable, dtfList, filterTables, 1000000, getRegions()); joinedTablesSepOutFile(joined, f, outSep); joinedTablesFree(&joined); } joinerDtfFreeList(&dtfList);