af8f5fbc7beacd00970cc8d3d37109f6e979f431 braney Mon Aug 17 10:35:18 2026 -0700 hgc: read the BAM pairEndsByName setting under the name the UI writes, refs #37979 The BAM track UI writes the checkbox as <track>.pairEndsByName, with a dot, and hgTracks reads it back with cartUsualBooleanClosestToHome. The details page built the name with an underscore instead, so it never saw the user's choice and always fell back to the trackDb setting: a reader who turned pairing off still got the joined-pair view when they clicked a read. Nothing in the tree writes the underscore spelling, and no saved session on hgwdev holds it, so there is no old name to keep working. 214 sessions hold the dot spelling. Verified with a two-read paired BAM in a hub: with the box checked the details page shows the pair, and with it unchecked it now shows the single read. diff --git src/hg/hgc/bamClick.c src/hg/hgc/bamClick.c index 53e6c45826f..76e73c81998 100644 --- src/hg/hgc/bamClick.c +++ src/hg/hgc/bamClick.c @@ -1,26 +1,27 @@ /* bamClick - handler for alignments in BAM format (produced by MAQ, * BWA and some other short-read alignment tools). */ /* Copyright (C) 2014 The Regents of the University of California * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */ #include "common.h" #include "hash.h" #include "hdb.h" #include "hgBam.h" #include "hgc.h" +#include "hui.h" #include "knetUdc.h" #include "udc.h" #include "chromAlias.h" #include "hgBam.h" #include "hgConfig.h" struct bamTrackData { int itemStart; char *itemName; struct hash *pairHash; boolean foundIt; }; @@ -255,34 +256,34 @@ errAbort("doBamDetails: NULL item name"); int start = cartInt(cart, "o"); if (!tdb || !trackDbSetting(tdb, "bamSkipPrintQualScore")) skipQualityScore = FALSE; else skipQualityScore = TRUE; // TODO: libify tdb settings table_pairEndsByName, stripPrefix and pairSearchRange knetUdcInstall(); if (udcCacheTimeout() < 300) udcSetCacheTimeout(300); if (sameString(item, "zoom in")) printf("Zoom in to a region with fewer items to enable 'detail page' links for individual items.<BR>"); -char varName[1024]; -safef(varName, sizeof(varName), "%s_pairEndsByName", tdb->track); -boolean isPaired = cartUsualBoolean(cart, varName, - (trackDbSetting(tdb, "pairEndsByName") != NULL)); +/* Read the same cart variable the track UI writes and hgTracks reads, which is + * separated with a dot and looked up through the container hierarchy. */ +boolean isPaired = cartUsualBooleanClosestToHome(cart, tdb, FALSE, BAM_PAIR_ENDS_BY_NAME, + (trackDbSettingClosestToHome(tdb, BAM_PAIR_ENDS_BY_NAME) != NULL)); char position[512]; struct hash *pairHash = isPaired ? hashNew(0) : NULL; struct bamTrackData btd = {start, item, pairHash, FALSE}; char *fileName = hReplaceGbdb(trackDbSetting(tdb, "bigDataUrl")); if (fileName == NULL) { if (isCustomTrack(tdb->table)) { errAbort("bamLoadItemsCore: can't find bigDataUrl for custom track %s", tdb->track); } else { struct sqlConnection *conn = hAllocConnTrack(database, tdb); fileName = hReplaceGbdb(bamFileNameFromTable(conn, tdb->table, seqName)); hFreeConn(&conn);