6823728f16334d9b53bd595688c8f5780cf833fe
braney
  Sun Feb 16 12:13:13 2025 -0800
ongoing work on quickLift.  Added support for SQL beds

diff --git src/hg/hgConvert/hgConvert.c src/hg/hgConvert/hgConvert.c
index 197cf201578..0e3c59fddfd 100644
--- src/hg/hgConvert/hgConvert.c
+++ src/hg/hgConvert/hgConvert.c
@@ -11,32 +11,32 @@
 #include "hCommon.h"
 #include "fa.h"
 #include "cheapcgi.h"
 #include "htmshell.h"
 #include "hdb.h"
 #include "hui.h"
 #include "cart.h"
 #include "web.h"
 #include "chain.h"
 #include "liftOver.h"
 #include "liftOverChain.h"
 #include "chromInfo.h"
 #include "net.h"
 #include "genark.h"
 #include "trackHub.h"
+#include "hubConnect.h"
 #include "quickLift.h"
-#include "exportedDataHubs.h"
 
 
 /* CGI Variables */
 #define HGLFT_TOORG_VAR   "hglft_toOrg"           /* TO organism */
 #define HGLFT_TODB_VAR   "hglft_toDb"           /* TO assembly */
 #define HGLFT_DO_CONVERT "hglft_doConvert"	/* Do the actual conversion */
 
 /* Global Variables */
 static struct cart *cart;	        /* CGI and other variables */
 static struct hash *oldVars = NULL;
 static char *organism = NULL;
 static char *database = NULL;
 
 /* Javascript to support New Assembly pulldown when New Genome changes. */
 /* Copies selected values to a hidden form */
@@ -50,31 +50,31 @@
     {
     if (sameString(name, db->name))
         return db;
     }
 errAbort("Can't find %s in matchingDb", name);
 return NULL;
 }
 
 static void askForDestination(struct liftOverChain *liftOver, char *fromPos,
 	struct dbDb *fromDb, struct dbDb *toDb)
 /* set up page for entering data */
 {
 struct dbDb *dbList;
 boolean askAboutQuickLift = FALSE;
 
-if (exportedDataHubsEnabled())
+if (quickLiftEnabled())
     askAboutQuickLift = TRUE;
 
 cartWebStart(cart, database, "Convert %s to New Assembly", fromPos);
 
 /* create HMTL form */
 puts("<FORM ACTION=\"../cgi-bin/hgConvert\" NAME=\"mainForm\">\n");
 cartSaveSession(cart);
 
 /* create HTML table for layout purposes */
 puts("\n<TABLE WIDTH=\"100%%\">\n");
 
 /* top row -- labels */
 cgiSimpleTableRowStart();
 cgiTableField("Old genome: ");
 cgiTableField("Old assembly: ");
@@ -282,45 +282,48 @@
 char *fileName = liftOverChainFile(fromDb->name, toDb->name);
 fileName = hReplaceGbdbMustDownload(fileName);
 char *chrom;
 int start, end;
 int origSize;
 struct chain *chainList, *chain;
 struct dyString *visDy = NULL;
 
 cartWebStart(cart, database, "%s %s %s to %s %s", fromDb->organism, fromDb->description,
 	fromPos, toDb->organism, toDb->description);
 if (!hgParseChromRange(database, fromPos, &chrom, &start, &end))
     errAbort("position %s is not in chrom:start-end format", fromPos);
 origSize = end - start;
 
 boolean doQuickLift = cartUsualBoolean(cart, "doQuickLift", FALSE);
+cartRemove(cart, "doQuickLift");
 
 unsigned quickChain = 0;
 unsigned quickHub = 0;
 
 if (doQuickLift)
     {
     quickChain = quickLiftGetChain(fromDb->name, toDb->name);
 
     if (quickChain == 0)
         errAbort("can't find quickChain from %s to %s", fromDb->name, toDb->name);
 
     visDy = newDyString(1024);
     char *newHub = trackHubBuild(fromDb->name, cart, visDy);
-    if ((quickHub = registerExportedDataHub(fromDb->name, newHub)) == 0)
-        errAbort("can't register exportedDataHub %s\n", newHub);
+    char *error;
+    quickHub = hubFindOrAddUrlInStatusTable(cart, newHub, &error);
+    if (error != NULL)
+        errAbort("can't add quickLift hub");
     }
 
 chainList = chainLoadAndTrimIntersecting(fileName, chrom, start, end);
 if (chainList == NULL)
     printf("Sorry this position couldn't be found in new assembly");
 else
     {
     for (chain = chainList; chain != NULL; chain = chain->next)
         {
 	int blockSize;
 	int qStart, qEnd;
 	if (chain->qStrand == '-')
 	    {
 	    qStart = chain->qSize - chain->qEnd;
 	    qEnd = chain->qSize - chain->qStart;