c1e66c5c9d45f0965156318e2782714ee93b04ab braney Mon Oct 19 16:08:32 2015 -0700 more work on bigMaf. Works in hgc and hgTables now. #15935 diff --git src/hg/hgc/mafClick.c src/hg/hgc/mafClick.c index 9118366..8962529 100644 --- src/hg/hgc/mafClick.c +++ src/hg/hgc/mafClick.c @@ -3,30 +3,31 @@ /* Copyright (C) 2013 The Regents of the University of California * See README in this or parent directory for licensing information. */ #include "common.h" #include "hash.h" #include "linefile.h" #include "hgc.h" #include "maf.h" #include "obscure.h" #include "cheapcgi.h" #include "genePred.h" #include "botDelay.h" #include "hgMaf.h" #include "hui.h" #include "hCommon.h" +#include "hubConnect.h" #define ADDEXONCAPITAL /* Javascript to help make a selection from a drop-down * go back to the server. */ static char *autoSubmit = "onchange=\"document.gpForm.submit();\""; static void blueCapWrite(FILE *f, char *s, int size, char *r) /* Write capital letters in blue. */ { boolean isBlue = FALSE; int i; for (i=0; i%s", hgcPathAndSettings(), table, table, chrom, winStart, winEnd, winStart, database, tdb->track, label); } static void mafOrAxtClick2(struct sqlConnection *conn, struct sqlConnection *conn2, struct trackDb *tdb, char *axtOtherDb, char *fileName) /* Display details for MAF or AXT tracks. */ { hgBotDelay(); if (winEnd - winStart > 30000) { printf("Zoom so that window is 30,000 bases or less to see alignments and conservation statistics\n"); } else { - struct mafAli *mafList, *maf, *subList = NULL; + struct mafAli *mafList = NULL, *maf, *subList = NULL; int aliIx = 0, realCount = 0; char dbChrom[64]; char option[128]; char *capTrack; struct consWiggle *consWig, *consWiggles; struct hash *speciesOffHash = NULL; char *speciesOrder = NULL; char *speciesTarget = trackDbSetting(tdb, SPECIES_TARGET_VAR); char buffer[1024]; int useTarg = FALSE; int useIrowChains = FALSE; safef(option, sizeof(option), "%s.%s", tdb->track, MAF_CHAIN_VAR); if (cartCgiUsualBoolean(cart, option, FALSE) && trackDbSetting(tdb, "irows") != NULL) @@ -533,33 +534,40 @@ safef(buffer, sizeof(buffer), "%s.vis",tdb->track); if (useIrowChains) { if (!cartVarExists(cart, buffer) && (speciesTarget != NULL)) useTarg = TRUE; else { char *val; val = cartUsualString(cart, buffer, "useCheck"); useTarg = sameString("useTarg",val); } } + if (sameString(tdb->type, "bigMaf")) + { + char *fileName = trackDbSetting(tdb, "bigDataUrl"); + struct bbiFile *bbi = bigBedFileOpen(fileName); + mafList = bigMafLoadInRegion(bbi, seqName, winStart, winEnd); + } + else mafList = mafOrAxtLoadInRegion2(conn,conn2, tdb, seqName, winStart, winEnd, axtOtherDb, fileName); - safef(dbChrom, sizeof(dbChrom), "%s.%s", database, seqName); + safef(dbChrom, sizeof(dbChrom), "%s.%s", hubConnectSkipHubPrefix(database), seqName); safef(option, sizeof(option), "%s.speciesOrder", tdb->track); speciesOrder = cartUsualString(cart, option, NULL); if (speciesOrder == NULL) speciesOrder = trackDbSetting(tdb, "speciesOrder"); for (maf = mafList; maf != NULL; maf = maf->next) { int mcCount = 0; struct mafComp *mc; struct mafAli *subset; struct mafComp *nextMc; /* remove empty components and configured off components * from MAF, and ignore @@ -771,31 +779,33 @@ maf->components->start + maf->components->size, maf->components->size); mafPrettyOut(stdout, maf, 70,onlyDiff, aliIx); } mafAliFreeList(&subList); } else { printf("No multiple alignment in browser window"); } printf(""); } } static void mafOrAxtClick(struct sqlConnection *conn, struct trackDb *tdb, char *axtOtherDb) { -struct sqlConnection *conn2 = hAllocConn(database); +struct sqlConnection *conn2 = NULL; +if (!isHubTrack(tdb->track)) + conn2 = hAllocConn(database); // MAF file location is optionally in trackDb char *mafFile = hashFindVal(tdb->settingsHash, "mafFile"); mafOrAxtClick2(conn, conn2, tdb, axtOtherDb, mafFile); hFreeConn(&conn2); } static void blueCapWriteGsid(FILE *f, char *s, int size, char *r, boolean isProtein, int offset) /* Write capital letters in blue, with added logic specific for protein. */ { boolean isBlue = FALSE; int step; int i;