a75cfac22803c312074299aa0dcf286ca336ce89 braney Wed Aug 27 13:28:08 2025 -0700 ongoing work on quickLift hgc page plus a fix for genepreds that don't successfully quickLift diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c index ddc85e64f12..f3da11ba9cb 100644 --- src/hg/hgTracks/simpleTracks.c +++ src/hg/hgTracks/simpleTracks.c @@ -5169,31 +5169,30 @@ /* Loop through and draw each item individually */ for (sn = tg->ss->nodeList; sn != NULL; sn = sn->next) { if (sn->row >= overflowRow) { genericDrawOverflowItem(tg, sn, hvg, xOff, yOff, width, font, color, scale, overflowRow, firstOverflow); firstOverflow = FALSE; } else genericDrawItem(tg, sn, hvg, xOff, yOff, width, font, color, color, vis, scale, withLeftLabels); } -maybeDrawQuickLiftLines(tg, seqStart, seqEnd, hvg, xOff, yOff, width, font, color, vis); hvGfxUnclip(hvg); } void genericDrawNextItem(struct track *tg, void *item, struct hvGfx *hvg, int xOff, int y, double scale, Color color, enum trackVisibility vis) /* Draw next item buttons and map boxes */ //TODO: Use this to clean up genericDrawItemsFullDense (will require wading thru ifdefs) { boolean isNextItemCompatible = nextItemCompatible(tg); boolean isExonNumberMapsCompatible = exonNumberMapsCompatible(tg, vis); if (!isNextItemCompatible && !isExonNumberMapsCompatible) return; boolean doButtons = (isExonNumberMapsCompatible ? FALSE: TRUE); // Convert start/end coordinates to pix @@ -5328,31 +5327,30 @@ { color = colorFromCart(tg, color); if (tg->items == NULL && vis == tvDense && canDrawBigBedDense(tg)) { bigBedDrawDense(tg, seqStart, seqEnd, hvg, xOff, yOff, width, font, color); } else { if (vis == tvDense && tg->colorShades) slSort(&tg->items, cmpLfWhiteToBlack); genericDrawItems(tg, seqStart, seqEnd, hvg, xOff, yOff, width, font, color, vis); } -maybeDrawQuickLiftLines(tg, seqStart, seqEnd, hvg, xOff, yOff, width, font, color, vis); // put up the color key for the gnomAD pLI track // If you change this code below, you must also change hgTracks.js:hideLegends if (startsWith("pliBy", tg->track)) doPliColors = TRUE; } void incRange(UBYTE *start, int size) /* Add one to range of bytes, taking care to not overflow. */ { int i; UBYTE b; for (i=0; i<size; ++i) { b = start[i]; if (b < 254) @@ -6297,31 +6295,35 @@ struct hash *chainHash = newHash(8); struct sqlConnection *conn = hAllocConn(liftDb); char *quickLiftFile = cloneString(trackDbSetting(tg->tdb, "quickLiftUrl")); // using this loader on genePred tables with less than 15 fields may be a problem. extern struct genePred *genePredExtLoad15(char **row); struct genePred *gpList = (struct genePred *)quickLiftSql(conn, quickLiftFile, table, chromName, winStart, winEnd, NULL, NULL, (ItemLoader2)genePredExtLoad15, 0, chainHash); hFreeConn(&conn); calcLiftOverGenePreds( gpList, chainHash, 0.0, 1.0, TRUE, NULL, NULL, TRUE, FALSE); struct genePred *gp = gpList; struct linkedFeatures *lfList = NULL; for(;gp; gp = gp->next) + { + if (gp->chrom == NULL) // if the lift failed, ignore this one + continue; slAddHead(&lfList, linkedFeaturesFromGenePred(tg, gp, TRUE)); + } slReverse(&lfList); tg->items = lfList; } else { struct sqlConnection *conn = hAllocConn(database); tg->items = connectedLfFromGenePredInRangeExtra(tg, conn, tg->table, chromName, winStart, winEnd, extra); hFreeConn(&conn); } } struct linkedFeatures *lfFromGenePredInRange(struct track *tg, char *table, char *chrom, int start, int end) /* Return linked features from range of a gene prediction table. */