eaa76b9f96a1509b9591a4492e7b363f11eb58c9 braney Mon Apr 4 16:22:40 2022 -0700 support genark hubs in hgConvert diff --git src/hg/hgConvert/hgConvert.c src/hg/hgConvert/hgConvert.c index 86778d1..39bedaf 100644 --- src/hg/hgConvert/hgConvert.c +++ src/hg/hgConvert/hgConvert.c @@ -9,30 +9,31 @@ #include "jksql.h" #include "linefile.h" #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" /* 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 */ @@ -292,35 +293,49 @@ { qStart = chain->qStart; qEnd = chain->qEnd; } blockSize = chainTotalBlockSize(chain); /* Check if the toDb database exists and if the chromosome sequence file (of the hgConvert result) exists in the location specified in chromInfo for the toDb. */ boolean chromSeqExists = (sqlDatabaseExists(toDb->name) && chromSeqFileExists(toDb->name, chain->qName)); /* Check if the toDb has active set to 1 in dbDb if the toDb database exists. If these conditions are met then print position link to browser for toDb, otherwise just print position without link. */ + boolean startedAnchor = FALSE; if (hDbIsActive(toDb->name) && chromSeqExists) + { printf("<A HREF=\"%s?db=%s&position=%s:%d-%d\">", hgTracksName(), toDb->name, chain->qName, qStart+1, qEnd); + startedAnchor = TRUE; + } + else if (sameString(toDb->nibPath, "genark")) + { + char *hubUrl = genarkUrl(toDb->name); + if (hubUrl) + { + startedAnchor = TRUE; + printf("<A HREF=\"%s?genome=%s&hubUrl=%s&position=%s:%d-%d\">", + hgTracksName(), toDb->name, hubUrl, chain->qName, qStart+1, qEnd); + } + } printf("%s:%d-%d", chain->qName, qStart+1, qEnd); - if (hDbIsActive(toDb->name) && chromSeqExists) + if (startedAnchor) printf("</A>"); printf(" (%3.1f%% of bases, %3.1f%% of span)<BR>\n", 100.0 * blockSize/origSize, 100.0 * (chain->tEnd - chain->tStart) / origSize); } } cartWebEnd(); } static struct liftOverChain *cleanLiftOverList(struct liftOverChain *list) /* eliminate from the list where toDb doesn't exist in dbDb */ { struct liftOverChain *cleanList = NULL; struct hash *dbDbHash = hDbDbHash(); struct liftOverChain *this = NULL;