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/lib/customTrack.c src/hg/lib/customTrack.c index 198a98ade7f..fd4f8f563cf 100644 --- src/hg/lib/customTrack.c +++ src/hg/lib/customTrack.c @@ -542,31 +542,31 @@ #ifdef DEBUG struct dyString *ds = dyStringNew(100); if (!fileExists(fileName)) { dyStringPrintf(ds, "chmod 666 %s", fileName); system(ds->string); } #endif struct customTrack *track; struct dyString *ds = dyStringNew(0); for (track = trackList; track != NULL; track = track->next) { /* myVariants tracks live in mvCtfile_; skip so they aren't duplicated here. */ - if (track->tdb && track->tdb->type && startsWithWord("myVariants", track->tdb->type)) + if (track->tdb && isMyVariantsType(track->tdb->type)) continue; /* may be coming in here from the table browser. It has wiggle * ascii data waiting to be encoded into .wib and .wig */ if (track->wigAscii) { /* HACK ALERT - calling private method function in customFactory.c */ track->maxChromName = hGetMinIndexLength(genomeDb); /* for the loaders */ #ifdef PROGRESS_METER track->progressFile = 0; #endif wigLoaderEncoding(track, track->wigAscii, ctDbUseAll()); ctAddToSettings(track, "tdbType", track->tdb->type); ctAddToSettings(track, "wibFile", track->wibFile); } @@ -596,31 +596,31 @@ } } dyStringFree(&ds); carefulClose(&f); } void customTracksSaveCart(char *genomeDb, struct cart *cart, struct customTrack *ctList) /* Save custom tracks to trash file for database in cart */ { char *ctFileVar = customTrackFileVar(cartString(cart, "db")); boolean hadRegular = isNotEmpty(cartOptionalString(cart, ctFileVar)); /* Count only tracks that customTracksSaveFile will actually persist. */ int persistCount = 0; struct customTrack *ct; for (ct = ctList; ct != NULL; ct = ct->next) - if (!(ct->tdb && ct->tdb->type && startsWithWord("myVariants", ct->tdb->type))) + if (!(ct->tdb && isMyVariantsType(ct->tdb->type))) persistCount++; if (persistCount > 0) { static struct tempName tn; trashDirFile(&tn, "ct", CT_PREFIX, ".bed"); char *ctFileName = tn.forCgi; cartSetString(cart, ctFileVar, ctFileName); if (printSaveList) fprintf(stderr, "customTrack: saved %d in %s\n", persistCount, ctFileName); customTracksSaveFile(genomeDb, ctList, ctFileName); } else if (hadRegular) { /* user just emptied this assembly's regular ctfile; drop the pointer * and the per-track ct_* cart vars tied to it. */