6bd333f69401150f11cfa8d592165ad9b655f80f markd Wed Nov 2 23:01:02 2022 -0700 added track hub control to set max transcripts diff --git src/hg/hgTracks/gencodeTracks.c src/hg/hgTracks/gencodeTracks.c index f3d71db..7802183 100644 --- src/hg/hgTracks/gencodeTracks.c +++ src/hg/hgTracks/gencodeTracks.c @@ -273,33 +273,34 @@ { filterBy_t *filterBySet = filterBySetGetFunc(tg->tdb, cart, NULL); filterBy_t *filterBy; for (filterBy = filterBySet; filterBy != NULL; filterBy = filterBy->next) { if (!filterByAllChosen(filterBy)) gencodeFilterByQuery(tg, filterBy, gencodeQuery); } filterBySetFree(&filterBySet); } static void addFilterMaxTranscripsByRange(struct sqlConnection *conn, struct track *tg, struct gencodeQuery *gencodeQuery) /* Add query for the maximum number of transcripts to display if requested and * if transcriptRank is available in attrs */ { -// FIXME: tmp until we can get it in the UI -int maxTrans = cartCgiUsualInt(cart, "maxTrans", 0); -if (maxTrans == 0) +char varName[64]; +safef(varName, sizeof(varName), "%s.maxTrans", tg->track); +int maxTrans = cartCgiUsualInt(cart, varName, 0); +if (maxTrans <= 0) return; // zero disables // do we have transcriptRank column? if (!sqlColumnExists(conn, gencodeGetTableName(tg->tdb, "wgEncodeGencodeAttrs"), "transcriptRank")) return ; // rank starts at 1, so anything less than or equal to max will be included gencodeQueryBeginSubWhere(gencodeQuery); sqlDyStringPrintf(gencodeQuery->where, "attrs.transcriptRank <= %d", maxTrans); gencodeQuery->joinAttrs = TRUE; gencodeQueryEndSubWhere(gencodeQuery); gencodeQuery->isFiltered = TRUE; } static void addQueryTables(struct track *tg, struct gencodeQuery *gencodeQuery) /* add required from tables and joins */