7f4579f5b69be16ca391924dce94d17599db2873 hiram Mon Feb 25 09:49:27 2019 -0800 counting up track types for UCSC db same as hub refs #18869 diff --git src/hg/hubApi/hubApi.c src/hg/hubApi/hubApi.c index e0cb06b..dd0eddd 100644 --- src/hg/hubApi/hubApi.c +++ src/hg/hubApi/hubApi.c @@ -92,44 +92,58 @@ ++publicHubCount; } return list; } static boolean timeOutReached() { long nowTime = clock1000(); timedOut = FALSE; if ((nowTime - enteredMainTime) > (1000 * timeOutSeconds)) timedOut= TRUE; return timedOut; } static void trackSettings(struct trackDb *tdb) -/* process the settingsHash for a track */ +/* process the settingsHash for a trackDb, recursive if subtracks */ { hPrintf(" \n"); } static int bbiBriefMeasure(char *type, char *bigDataUrl, char *bigDataIndex, long *chromCount, long *itemCount, struct dyString *errors) /* check a bigDataUrl to find chrom count and item count */ { int retVal = 0; *chromCount = 0; *itemCount = 0; struct errCatch *errCatch = errCatchNew(); if (errCatchStart(errCatch)) { if (startsWithWord("bigNarrowPeak", type) || startsWithWord("bigBed", type) || startsWithWord("bigGenePred", type) @@ -204,75 +218,48 @@ retVal = 1; } } errCatchEnd(errCatch); if (errCatch->gotError) { retVal = 1; dyStringPrintf(errors, "%s", errCatch->message->string); } errCatchFree(&errCatch); return retVal; } /* static int bbiBriefMeasure() */ -#ifdef NOT -static void cloneTdb(struct trackDb *source, struct trackDb *destination) -/* TBD: is there a cloneTdb() function somewhere else ? */ -{ -destination->track = cloneString(source->track); -destination->shortLabel = cloneString(source->shortLabel); -destination->type = cloneString(source->type); -destination->longLabel = cloneString(source->longLabel); -destination->visibility = source->visibility; -destination->priority = source->priority; -destination->colorR = source->colorR; -destination->colorG = source->colorG; -destination->colorB = source->colorB; -destination->altColorR = source->altColorR; -destination->altColorG = source->altColorG; -destination->altColorB = source->altColorB; -destination->useScore = source->useScore; -destination->private = source->private; -destination->url = cloneString(source->url); -destination->html = cloneString(source->html); -destination->grp = cloneString(source->grp); -destination->canPack = source->canPack; -destination->settings = cloneString(source->settings); -destination->settingsHash = source->settingsHash; -} -#endif - static void hubTrackList(struct trackDb *topTrackDb, struct trackHubGenome *genome) /* process the track list to show all tracks, return trackDb list */ { if (topTrackDb) { struct hash *countTracks = hashNew(0); hPrintf(" \n"); } +else + hPrintf("
  • no trackTopDb
  • \n"); } /* static struct trackDb *hubTrackList() */ -static struct trackDb * assemblySettings(struct trackHubGenome *genome) +static void assemblySettings(struct trackHubGenome *genome) /* display all the assembly 'settingsHash' */ { -struct trackDb *retTbd = NULL; +struct trackDb *tdb = trackHubTracksForGenome(genome->trackHub, genome); +tdb = trackDbLinkUpGenerations(tdb); + +int elCount = 0; hPrintf(" \n"); -return retTbd; } struct slName *genomeList(struct trackHub *hubTop, struct trackDb **dbTrackList, char *selectGenome) /* follow the pointers from the trackHub to trackHubGenome and around * in a circle from one to the other to find all hub resources * return slName list of the genomes in this track hub * optionally, return the trackList from this hub for the specified genome */ { struct slName *retList = NULL; long totalAssemblyCount = 0; struct trackHubGenome *genome = hubTop->genomeList; hPrintf("

    genome sequences (and tracks) present in this track hub

    \n"); @@ -373,34 +364,31 @@ { if ( differentStringNullOk(selectGenome, genome->name) ) continue; } ++totalAssemblyCount; struct slName *el = slNameNew(genome->name); slAddHead(&retList, el); if (genome->organism) { hPrintf("
  • %s - %s - %s
  • \n", genome->organism, genome->name, genome->description); } else { /* can there be a description when organism is empty ? */ hPrintf("
  • %s
  • \n", genome->name); } - if (dbTrackList) - *dbTrackList = assemblySettings(genome); - else - (void) assemblySettings(genome); + assemblySettings(genome); if (measureTiming) { long thisTime = clock1000(); hPrintf("processing time %s: %ld millis
    \n", genome->name, thisTime - lastTime); } if (timeOutReached()) break; } if (trackCounter->elCount) { hPrintf("
  • total genome assembly count: %ld
  • \n", totalAssemblyCount); hPrintf("
  • %ld total tracks counted, %d different track types:
  • \n", totalTracks, trackCounter->elCount); hPrintf("