00d6b45fd33ab330efcf6d6b88b0d6e9a7880281 kent Thu Oct 28 14:54:35 2010 -0700 Redoing dataHub using new trackHub library routines. Still pretty embryonic, but once again is displaying a couple of tracks for me, this time ones that are genuinely remote. Code is activated by having a 'tracksHub' variable in the cart, which currently is only possible by hacking with cartDump. diff --git src/hg/hgTracks/bigBedTrack.c src/hg/hgTracks/bigBedTrack.c index 7b1337f..3cdb8c2 100644 --- src/hg/hgTracks/bigBedTrack.c +++ src/hg/hgTracks/bigBedTrack.c @@ -5,49 +5,53 @@ #include "common.h" #include "hash.h" #include "linefile.h" #include "jksql.h" #include "hdb.h" #include "bedCart.h" #include "hgTracks.h" #include "hmmstats.h" #include "localmem.h" #include "wigCommon.h" #include "bbiFile.h" #include "obscure.h" #include "bigWig.h" #include "bigBed.h" -char *bbiNameFromTable(struct sqlConnection *conn, char *table) +char *bbiNameFromSettingOrTable(struct trackDb *tdb, struct sqlConnection *conn, char *table) /* Return file name from little table. */ { +char *fileName = cloneString(trackDbSetting(tdb, "bigDataUrl")); +if (fileName == NULL) + { char query[256]; safef(query, sizeof(query), "select fileName from %s", table); char *fileName = sqlQuickString(conn, query); if (fileName == NULL) errAbort("Missing fileName in %s table", table); + } return fileName; } static struct bbiFile *fetchBbiForTrack(struct track *track) /* Fetch bbiFile from track, opening it if it is not already open. */ { struct bbiFile *bbi = track->bbiFile; if (bbi == NULL) { struct sqlConnection *conn = hAllocConnTrack(database, track->tdb); - char *fileName = bbiNameFromTable(conn, track->table); + char *fileName = bbiNameFromSettingOrTable(track->tdb, conn, track->table); hFreeConn(&conn); bbi = track->bbiFile = bigBedFileOpen(fileName); } return bbi; } struct bigBedInterval *bigBedSelectRange(struct track *track, char *chrom, int start, int end, struct lm *lm) /* Return list of intervals in range. */ { struct bbiFile *bbi = fetchBbiForTrack(track); int maxItems = maximumTrackItems(track) + 1; struct bigBedInterval *result = bigBedIntervalQuery(bbi, chrom, start, end, maxItems, lm); if (slCount(result) >= maxItems) {