c18ab1c5577b32368f3cf24abfe1664567a8420e markd Mon Sep 22 08:59:48 2025 -0700 generate correct download link for BAMs in /gbdb #36390 diff --git src/hg/hgTables/bam.c src/hg/hgTables/bam.c index 8a42df6df97..c60ce61ed6a 100644 --- src/hg/hgTables/bam.c +++ src/hg/hgTables/bam.c @@ -373,33 +373,36 @@ lmCleanup(&lm); bamClose(&fh); freez(&fileName); return randomIdList; } void showSchemaBam(char *table, struct trackDb *tdb) /* Show schema on bam. */ { struct sqlConnection *conn = NULL; if (!trackHubDatabase(database)) conn = hAllocConn(database); char *fileName = bamFileName(table, conn, NULL); struct asObject *as = bamAsObj(); +char *downPrefix = ""; +if (startsWith("/gbdb", fileName)) + downPrefix = "https://hgdownload.soe.ucsc.edu"; hPrintf("Database: %s", database); hPrintf("    Primary Table: %s
", table); -hPrintf("BAM File: %s", fileName); +hPrintf("BAM File Download: %s%s", downPrefix, fileName, downPrefix, fileName); hPrintf("
\n"); hPrintf("Format description: %s
", as->comment); hPrintf("See the SAM Format Specification for more details
\n", "http://samtools.sourceforge.net/SAM1.pdf"); /* Put up table that describes fields. */ hTableStart(); hPrintf("field"); hPrintf("description "); puts("\n"); struct asColumn *col; int colCount = 0; for (col = as->columnList; col != NULL; col = col->next) { hPrintf("%s", col->name);