332a47e0d16a980c4d5c2edb30c0758f42949412 angie Wed Aug 30 12:04:17 2017 -0700 Print out proper search description instead of table name for bigBed search result heading. Don't print out hgFindSpec search description to the right of each individual item from trix search. diff --git src/hg/lib/bigBedFind.c src/hg/lib/bigBedFind.c index 3031223..488f098 100644 --- src/hg/lib/bigBedFind.c +++ src/hg/lib/bigBedFind.c @@ -93,78 +93,77 @@ for (; oneIndex; oneIndex = oneIndex->next) { struct hgPos *posList2 = getPosFromBigBed(bigDataUrl, oneIndex->name, tsList->itemId, description); posList = slCat(posList, posList2); } } return posList; } boolean findBigBedPosInTdbList(char *db, struct trackDb *tdbList, char *term, struct hgPositions *hgp, struct hgFindSpec *hfs) /* Given a list of trackDb entries, check each of them for a searchIndex */ { +char *description = NULL; +if (hfs) + { + char buf[2048]; + if (isNotEmpty(hfs->searchDescription)) + truncatef(buf, sizeof(buf), "%s", hfs->searchDescription); + else + safef(buf, sizeof(buf), "%s", hfs->searchTable); + description = cloneString(buf); + } struct trackDb *tdb; boolean found = FALSE; - for(tdb=tdbList; tdb; tdb = tdb->next) { char *indexField = trackDbSetting(tdb, "searchIndex"); char *fileName = NULL; if (isHubTrack(tdb->table)) fileName = trackDbSetting(tdb, "bigDataUrl"); else { struct sqlConnection *conn = hAllocConnTrack(db, tdb); fileName = bbiNameFromSettingOrTable(tdb, conn, tdb->table); hFreeConn(&conn); } if (!(indexField && fileName)) continue; struct slName *indexList = slNameListFromString(indexField, ','); struct hgPos *posList1 = NULL, *posList2 = NULL; char *trixFile = trackDbSetting(tdb, "searchTrix"); // if there is a trix file, use it to search for the term if (trixFile != NULL) { - char *description = NULL; - if (hfs) - { - char buf[2048]; - if (isNotEmpty(hfs->searchDescription)) - truncatef(buf, sizeof(buf), "%s", hfs->searchDescription); - else - safef(buf, sizeof(buf), "%s", hfs->searchTable); - description = cloneString(buf); - } - posList1 = doTrixSearch(hReplaceGbdb(trixFile), indexList, fileName, term, description); + posList1 = doTrixSearch(hReplaceGbdb(trixFile), indexList, fileName, term, NULL); } // now search for the raw id's struct slName *oneIndex=indexList; for (; oneIndex; oneIndex = oneIndex->next) { posList2 = getPosFromBigBed(fileName, oneIndex->name, term, NULL); posList1 = slCat(posList1, posList2); } if (posList1 != NULL) { struct hgPosTable *table; found = TRUE; AllocVar(table); slAddHead(&hgp->tableList, table); - table->description = cloneString(tdb->table); + table->description = cloneString(description ? description : tdb->longLabel); table->name = cloneString(tdb->table); table->posList = posList1; } } - +freeMem(description); return found; }