6670fb5fcdb4479bcfb11971733ad9f9b41b895d hiram Fri Jun 6 12:00:45 2025 -0700 correct URLs to hgdownload for chrom.sizes.txt and chromAlias.txt files refs #35870 diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index 758bf4db4b7..8df75c25832 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -11051,44 +11051,65 @@ safef(aliasFile, sizeof aliasFile, "http%s://%s/goldenPath/%s/bigZips/%s.chromAlias.txt", cgiAppendSForHttps(), hDownloadsServer(), db, db); struct udcFile *file = udcFileMayOpen(aliasFile, udcDefaultDir()); if (file) { udcFileClose(&file); printf("%s.chromAlias.txt", aliasFile, db); } else puts(" "); } } else if (hubAliasFile) { puts("Download the table below as a text file: "); if (chromSizesFile) + { + if (startsWith("/gbdb/genark/", chromSizesFile)) + { + char *stripped = cloneString(chromSizesFile); + stripString(stripped, "/gbdb/genark/"); + printf("%s.chrom.sizes.txt", hDownloadsServer(), stripped, trackHubSkipHubName(database)); + } + else { printf("%s.chrom.sizes.txt", chromSizesFile, trackHubSkipHubName(database)); + } puts("  "); } else puts(" "); - char *aliasUrl = cloneString(hubAliasFile); + + char *aliasUrl; /* this URL reference needs to be a text file to work as a click in the * html page. Both files chromAlias.bb and chromAlias.txt exist. */ if (endsWith(hubAliasFile, "chromAlias.bb")) aliasUrl = replaceChars(hubAliasFile, "chromAlias.bb", "chromAlias.txt"); + else + aliasUrl = cloneString(hubAliasFile); + + if (startsWith("/gbdb/genark/", aliasUrl)) + { + stripString(aliasUrl, "/gbdb/genark/"); + printf("%s.chromAlias.txt", hDownloadsServer(), aliasUrl, trackHubSkipHubName(database)); + } + else + { printf("%s.chromAlias.txt", aliasUrl, trackHubSkipHubName(database)); } + } puts("

"); } void chromInfoPage() /* Show list of chromosomes (or scaffolds, etc) on which this db is based. */ { boolean hasAlias = FALSE; char *chromSizesFile = NULL; char *aliasFile = NULL; if (trackHubDatabase(database)) { /* either one of these files present will work */ aliasFile = trackHubAliasFile(database); if (aliasFile) { hasAlias = TRUE;