char *hubPublicTableName() /* Get the name of the table that lists public hubs. Don't free the result. */ { if (_hubPublicTableName == NULL) _hubPublicTableName = cfgOptionEnvDefault("HGDB_HUB_PUBLIC_TABLE", hubPublicTableConfVariable, defaultHubPublicTableName); return _hubPublicTableName; }
char *sessionDbTable() /* Return the name of the sessionDb table. */ { static char *sessionDbTable = NULL; if (sessionDbTable == NULL) sessionDbTable = cfgOptionEnvDefault("HGDB_SESSIONDBTABLE", sessionDbTableConfVariable, defaultSessionDbTableName); return sessionDbTable; }
char *userDbTable() /* Return the name of the userDb table. */ { static char *userDbTable = NULL; if (userDbTable == NULL) userDbTable = cfgOptionEnvDefault("HGDB_USERDBTABLE", userDbTableConfVariable, defaultUserDbTableName); return userDbTable; }
static char *getHubStatusTableName() /* return the hubStatus table name from the environment, * or hg.conf, or use the default. Cache the result */ { if (hubStatusTableName == NULL) hubStatusTableName = cfgOptionEnvDefault("HGDB_HUB_STATUS_TABLE", hubStatusTableConfVariable, defaultHubStatusTableName); return hubStatusTableName; }
struct hash *hgHubConnectPublic() /* Put up the list of public hubs and other controls for the page. */ { struct hash *retHash = NULL; struct sqlConnection *conn = hConnectCentral(); char *publicTable = cfgOptionEnvDefault("HGDB_HUB_PUBLIC_TABLE", hubPublicTableConfVariable, defaultHubPublicTableName); if (!(sqlTableExists(conn, publicTable) && (retHash = outputPublicTable(conn, publicTable)) != NULL )) { printf("<div id=\"publicHubs\" class=\"hubList\"> \n"); printf("No Public Track Hubs for this genome assembly<BR>"); printf("</div>"); } hDisconnectCentral(&conn); return retHash; }
static struct aHubMatch *searchPublicHubs(struct dbDb *dbDbList, char *term) /* Search for term in public hub trix files -- return a list of matches to assembly hubs * (i.e. hubs that host an assembly with 2bit etc as opposed to only providing tracks.) */ { struct aHubMatch *aHubMatchList = NULL; char *trixFile = cfgOptionEnvDefault("HUBSEARCHTRIXFILE", "hubSearchTrixFile", hReplaceGbdb("/gbdb/hubs/public.ix")); if (fileExists(trixFile)) { struct trix *trix = trixOpen(trixFile); char termCopy[strlen(term)+1]; safecpy(termCopy, sizeof(termCopy), term); tolowers(termCopy); char *words[512]; int wordCount = chopByWhite(termCopy, words, ArraySize(words)); struct trixSearchResult *tsrList = trixSearch(trix, wordCount, words, tsmFirstFive); aHubMatchList = filterTrixSearchMatches(dbDbList, tsrList); trixClose(&trix); } return aHubMatchList; }