b5cbbe9353e85ec653bb18eee381c6989f529289 braney Sun Apr 12 12:21:24 2026 -0700 Show alternative chromosome names from chromAlias on hgTracks position line, refs #29201 Co-Authored-By: Claude Opus 4.6 (1M context) diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index dd30ecafb77..10f38be4c45 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -8830,42 +8830,61 @@ // put the track download interface behind hg.conf control if (cfgOptionBooleanDefault("showDownloadUi", TRUE)) jsInline("var showDownloadButton = true;\n"); // remove the hg.conf option once this feature is released if (cfgOptionBooleanDefault("showIgv", FALSE)) { puts(" "); //jsInline("document.getElementById('hgtIgv').addEventListener('click', onIgvClick);"); } } -#ifdef NOTNOW -static void printAliases(char *name) -/* Print out the aliases for this sequence. */ +static void printAliases(char *nativeName, char *displayName) +/* Print out the alternative names for this sequence next to the position. */ { -struct slName *names = chromAliasFindAliases(name); +struct slName *aliases = chromAliasFindAliases(nativeName); +if (aliases == NULL) + return; -printf("
Aliases
"); +// Build comma-separated list of aliases, skipping the display name and native name +struct dyString *dy = dyStringNew(256); +struct slName *a; +for (a = aliases; a != NULL; a = a->next) + { + if (isEmpty(a->name)) + continue; + if (sameString(a->name, displayName) || sameString(a->name, nativeName)) + continue; + if (dy->stringSize > 0) + dyStringAppend(dy, ", "); + dyStringAppend(dy, a->name); + } + +if (dy->stringSize == 0) + { + dyStringFree(&dy); + return; + } + +printf("" + "ⓘ Aliases", dy->string); +dyStringFree(&dy); } -#endif unsigned getParaLoadTimeout() // get the parallel load timeout in seconds (defaults to 90) { char *paraLoadTimeoutStr = cartOptionalString(cart, "parallelFetch.timeout"); if (paraLoadTimeoutStr == NULL) paraLoadTimeoutStr = cfgOptionDefault("parallelFetch.timeout", "90"); // wait up to default 90 seconds. unsigned paraLoadTimeout = sqlUnsigned(paraLoadTimeoutStr); return paraLoadTimeout; } static char *hubPublicEmailFromHubName(char *hubName) @@ -9639,31 +9658,32 @@ pressedClass = "pressed"; showVirtRegions = "show multi-region position ranges and "; } hPrintf("%s", pressedClass, showVirtRegions, addCommasToPos(database, position)); hPrintf("\n", buf); sprintLongWithCommas(buf, virtWinEnd - virtWinStart); hPrintf(" %s bp. ", buf); hPrintf("\n", multiRegionButtonTop ? 51 : 61); hWrites(" "); hButton("goButton", "Search"); printSearchHelpLink(); - // printAliases(displayChromName); + if (cfgOptionBooleanDefault("showAliases", FALSE) && sameString(virtModeType, "default")) + printAliases(chromName, virtChromName); printPatchNote(); if (!trackHubDatabase(database)) { jsonObjectAdd(jsonForClient, "assemblySupportsGeneSuggest", newJsonBoolean(assemblySupportsGeneSuggest(database))); if (assemblySupportsGeneSuggest(database)) hPrintf("\n", assemblyGeneSuggestTrack(database)); } // hg.conf controlled links // database-specific link: 2 hg.conf settings, format _TopLink{Label} struct slName *dbLinks = cfgNamesWithPrefix(database);