d947dcc75b04fd0dc921c0eb02ed988d7b4819f0
braney
  Mon Jun 30 16:00:56 2025 -0700
let genark hubs appear in hgConvert if we can figure out their UCSC org

diff --git src/hg/hgTracks/quickLift.c src/hg/hgTracks/quickLift.c
index 4c8e595d9bb..fba640ce31f 100644
--- src/hg/hgTracks/quickLift.c
+++ src/hg/hgTracks/quickLift.c
@@ -1,28 +1,32 @@
 
 #include "common.h"
 #include "hgTracks.h"
 #include "chromAlias.h"
 #include "hgConfig.h"
 #include "bigChain.h"
+#include "trackHub.h"
 
 struct highRegions
 // store highlight information
 {
 struct highRegions *next;
 long chromStart;
 long chromEnd;
+long oChromStart;
+long oChromEnd;
+char strand;
 unsigned hexColor;
 };
 
 #define INSERT_COLOR     0
 #define DEL_COLOR      1
 #define DOUBLE_COLOR     2
 
 static Color *highlightColors;
 static unsigned lengthLimit;
 
 static Color getColor(char *confVariable, char *defaultRgba)
 {
 Color color = 0xff0000ff;
 
 char *str = cloneString(cfgOptionDefault(confVariable, defaultRgba));
@@ -79,77 +83,114 @@
 
 int previousTEnd = -1;
 int previousQEnd = -1;
 for (bb = bbList; bb != NULL; bb = bb->next)
     {
     bigBedIntervalToRow(bb, chromName, startBuf, endBuf, bedRow, ArraySize(bedRow));
     int tStart = atoi(bedRow[1]);
     int tEnd = atoi(bedRow[2]);
     int qStart = atoi(bedRow[4]);
     int qEnd = qStart + (tEnd - tStart);
     struct highRegions *hr;
     if ((previousTEnd != -1) && (previousTEnd == tStart))
         {
         AllocVar(hr);
         slAddHead(&hrList, hr);
+        hr->strand = 
         hr->chromStart = previousTEnd;
         hr->chromEnd = tStart;
+        hr->oChromStart = previousQEnd;
+        hr->oChromEnd = qStart;
         hr->hexColor = highlightColors[DEL_COLOR];
         }
     if ( (previousQEnd != -1) && (previousQEnd == qStart))
         {
         AllocVar(hr);
         slAddHead(&hrList, hr);
         hr->chromStart = previousTEnd;
         hr->chromEnd = tStart;
+        hr->oChromStart = previousQEnd;
+        hr->oChromEnd = qStart;
         hr->hexColor = highlightColors[INSERT_COLOR];
         }
     if ( ((previousQEnd != -1) && (previousQEnd != qStart)) 
          && ((previousTEnd != -1) && (previousTEnd != tStart)))
         {
         AllocVar(hr);
         slAddHead(&hrList, hr);
         hr->chromStart = previousTEnd;
         hr->chromEnd = tStart;
+        hr->oChromStart = previousQEnd;
+        hr->oChromEnd = qStart;
         hr->hexColor = highlightColors[DOUBLE_COLOR];
         }
     previousQEnd = qEnd;
     previousTEnd = tEnd;
     }
 
 hashAdd(highLightsHash, quickLiftFile, hrList);
 
 return hrList;
 }
 
+static void drawTri(struct hvGfx *hvg, int x1, int x2, int y, Color color)
+/* Draw traingle. */
+{
+struct gfxPoly *poly = gfxPolyNew();
+int half = (x2 - x1) / 2;
+
+gfxPolyAddPoint(poly, x1, y);
+gfxPolyAddPoint(poly, x1+half, y+2*half);
+gfxPolyAddPoint(poly, x2, y);
+hvGfxDrawPoly(hvg, poly, color, TRUE);
+gfxPolyFree(&poly);
+}
+
 void maybeDrawQuickLiftLines( struct track *tg, int seqStart, int seqEnd,
                       struct hvGfx *hvg, int xOff, int yOff, int width,
                       MgFont *font, Color color, enum trackVisibility vis)
 /* Draw the indel regions in quickLifted tracks as a highlight. */
 {
 char *quickLiftFile = cloneString(trackDbSetting(tg->tdb, "quickLiftUrl"));
 if (quickLiftFile == NULL)
     return;
 
+boolean drawTriangle = FALSE;
+if (startsWith("quickLiftChain", trackHubSkipHubName(tg->track)))
+    drawTriangle = TRUE;
 struct highRegions *regions = getQuickLiftLines(quickLiftFile, seqStart, seqEnd);
 struct highRegions *hr = regions;
 
 int fontHeight = mgFontLineHeight(tl.font);
 int height = tg->height;
-if (isCenterLabelIncluded(tg))
+if (!drawTriangle && isCenterLabelIncluded(tg))
     {
     height += fontHeight;
     yOff -= fontHeight;
     }
 
 for(; hr; hr = hr->next)
     {
     unsigned int hexColor = hr->hexColor;
     double scale = scaleForWindow(width, seqStart, seqEnd);
     int x1 = xOff + scale * (hr->chromStart - seqStart);
     int w =  scale * (hr->chromEnd - hr->chromStart);
     if (w == 0) 
         w = 1;
     hvGfxSetClip(hvg, xOff, yOff, width, height);  // we're drawing in the center label at the moment
+    if (drawTriangle)
+        {
+        drawTri(hvg, x1 + w/2 - fontHeight/2, x1 + w/2 + fontHeight/2 , yOff, hexColor);
+        }
+    else
         hvGfxBox(hvg, x1, yOff, w, height, hexColor);
+
+    char mouseOver[4096];
+
+    if (hr->chromStart == hr->chromEnd)
+        safef(mouseOver, sizeof mouseOver, "deletion %ldbp", hr->oChromStart - hr->oChromStart);
+    else
+        safef(mouseOver, sizeof mouseOver, "insertion %ldbp", hr->oChromEnd - hr->oChromStart);
+    mapBoxHc(hvg, seqStart, seqEnd, x1, yOff, width, height, tg->track, "insert", mouseOver);
+
     }
 }