79c5090c373a449c3fa3e83949736e7515f03da2
braney
Tue Feb 5 09:36:59 2019 -0800
support schemas on bigWigs within composites. #22885
diff --git src/hg/hgTables/bigWig.c src/hg/hgTables/bigWig.c
index 81f3537..5939669 100644
--- src/hg/hgTables/bigWig.c
+++ src/hg/hgTables/bigWig.c
@@ -13,30 +13,41 @@
#include "cart.h"
#include "web.h"
#include "bed.h"
#include "hdb.h"
#include "trackDb.h"
#include "customTrack.h"
#include "wiggle.h"
#include "hmmstats.h"
#include "correlate.h"
#include "bbiFile.h"
#include "bigWig.h"
#include "hubConnect.h"
#include "hgTables.h"
#include "mathWig.h"
+boolean isBigWig(char *database, char *table, struct trackDb *parent,
+ struct customTrack *(*ctLookupName)(char *table))
+/* Local test to see if something is big wig. Handles hub tracks unlike hIsBigWig. */
+{
+struct trackDb *tdb = hashFindVal(fullTableToTdbHash, table);
+if (tdb)
+ return tdbIsBigWig(tdb);
+else
+ return hIsBigWig(database, table, parent, ctLookupName);
+}
+
boolean isBigWigTable(char *table)
/* Return TRUE if table corresponds to a bigWig file. */
{
struct trackDb *tdb = hashFindVal(fullTableToTdbHash, table);
if (tdb)
return tdbIsBigWig(tdb);
else
return trackIsType(database, table, curTrack, "bigWig", ctLookupName) || trackIsType(database, table, curTrack, "mathWig", ctLookupName);
}
static char *settingFromCtOrHub(char *table, struct sqlConnection *conn, char *settingName, boolean mustBeInHub)
/* If table is a custom track or hub track, return a setting;
* otherwise return NULL. Do a freeMem on returned string when done. */
{
char *settingVal = NULL;
@@ -428,22 +439,23 @@
/* Read in bigWig as dataVector and return it. Filtering, subtrack merge
* and intersection are handled. */
{
if (anySubtrackMerge(database, table))
return mergedWigDataVector(table, conn, region);
else
{
struct dataVector *dv = dataVectorNew(region->chrom, region->end - region->start);
bigWigFillDataVector(table, region, conn, dv);
return dv;
}
}
void showSchemaBigWigNoTable(char *db, char *table, struct trackDb *tdb)
{
+struct trackDb *tableTdb = hashFindVal(fullTableToTdbHash, table);
hPrintf("Database: %s", db);
printf("
The data for this track is provided by a file in "
""
"BigWig format.");
-hPrintf("
Data URL: %s", trackDbSetting(tdb, "bigDataUrl"));
-printTrackHtml(tdb);
+hPrintf("
Data URL: %s", trackDbSetting(tableTdb, "bigDataUrl"));
+printTrackHtml(tableTdb);
}