a345d17f7912a5f0e121951f6d261b496cce608b braney Fri May 10 09:25:54 2013 -0700 first cut at track item search in track hubs that have bigBed files with a searchIndex field refs #10426 diff --git src/hg/lib/hdb.c src/hg/lib/hdb.c index 7b8eba9..da66b98 100644 --- src/hg/lib/hdb.c +++ src/hg/lib/hdb.c @@ -60,32 +60,35 @@ /* cached list of tables in databases. This keeps a hash of databases to * hashes of track/table name to slName list of actual table names, which * might be split. Since individual tables can be mapped to different * profiles, and this information is only available when processing trackDb, * another table is kept to determine if these need to be checked. */ static struct hash *tableList = NULL; // db to track to tables static struct hash *tableListProfChecked = NULL; // profile:db that have been check static struct chromInfo *lookupChromInfo(char *db, char *chrom) /* Query db.chromInfo for the first entry matching chrom. */ { struct chromInfo *ci = NULL; -if (trackHubDatabase(db) && ((ci = trackHubChromInfo(db, chrom)) != NULL)) +if (trackHubDatabase(db)) + { + ci = trackHubMaybeChromInfo(db, chrom); return ci; + } struct sqlConnection *conn = hAllocConn(db); struct sqlResult *sr = NULL; char **row = NULL; char query[256]; safef(query, sizeof(query), "select * from chromInfo where chrom = '%s'", chrom); sr = sqlGetResult(conn, query); if ((row = sqlNextRow(sr)) != NULL) { ci = chromInfoLoad(row); } sqlFreeResult(&sr); hFreeConn(&conn); return ci; @@ -4075,30 +4078,37 @@ { char query[512]; safef(query, sizeof(query), "select tableName,settings from %s", trackTable->name); struct sqlResult *sr = sqlGetResult(conn, query); char **row; while ((row = sqlNextRow(sr)) != NULL) { struct hash *settings = trackDbSettingsFromString(row[1]); hashAdd(hash, row[0], settings); } sqlFreeResult(&sr); } } slNameFreeList(&trackTableList); hFreeConn(&conn); + +// now we need to get the track hubs +struct trackDb *hubTdbList = hubCollectTracks(db, NULL), *tdb; + +for(tdb = hubTdbList; tdb; tdb = tdb->next) + hashAdd(hash, tdb->table, tdb->settingsHash); + return hash; } struct hash *hTdbGetTrackSettingsHash(char *db) /* Get a hash of hashes with all track settings for database. * The returned hash is keyed by track. The contained hashes * are keyed by tags and contain generic text values, corresponding * to the trackDb.ra settings for that track. The result returned * is cached, and should not be altered. */ { static struct hash *dbHash = NULL; if (dbHash == NULL) dbHash = hashNew(0); struct hash *hoh = hashFindVal(dbHash, db); if (hoh == NULL)