2ea6e837990eb39bc317f2b1aacacfe4ff77a7ce hiram Tue Jun 11 18:00:29 2024 -0700 correctly check boolean CGI variable and ouput the tracks in a single file track hub while in html mode no redmine diff --git src/hg/hubApi/hubApi.c src/hg/hubApi/hubApi.c index 95f479c..af5d541 100644 --- src/hg/hubApi/hubApi.c +++ src/hg/hubApi/hubApi.c @@ -384,30 +384,31 @@ * name of largest chrom and its size */ { int retVal = 0; *chromCount = 0; *itemCount = 0; struct errCatch *errCatch = errCatchNew(); if (errCatchStart(errCatch)) { if (startsWithWord("bigNarrowPeak", type) || startsWithWord("bigBed", type) || startsWithWord("bigGenePred", type) || startsWithWord("bigPsl", type) || startsWithWord("bigChain", type) || startsWithWord("bigMaf", type) + || startsWithWord("bigRmsk", type) || startsWithWord("bigBarChart", type) || startsWithWord("bigInteract", type)) { struct bbiFile *bbi = NULL; bbi = bigBedFileOpen(bigDataUrl); struct bbiChromInfo *chromList = bbiChromList(bbi); *chromCount = slCount(chromList); *itemCount = bigBedItemCount(bbi); bbiLargestChrom(chromList, chromName, chromSize); bbiChromInfoFreeList(&chromList); bbiFileClose(&bbi); } else if (startsWithWord("bigWig", type)) { struct bbiFile *bwf = bigWigFileOpen(bigDataUrl); @@ -471,31 +472,31 @@ } errCatchEnd(errCatch); if (errCatch->gotError) { retVal = 1; dyStringPrintf(errors, "%s", errCatch->message->string); } errCatchFree(&errCatch); return retVal; } /* static int bbiBriefMeasure() */ static void hubSubTracks(struct trackHub *hub, char *db, struct trackDb *tdb, struct hash *countTracks, long chromCount, long itemCount, char *chromName, unsigned chromSize, char *genome, char *errorString) -/* tdb has subtracks, show only subTracks, no details */ +/* tdb has subtracks, show only subTracks, no details, this is RECURSIVE */ { hPrintf("
  • \n"); } static void hubCountOneTdb(struct trackHub *hub, char *db, struct trackDb *tdb, char *bigDataIndex, struct hash *countTracks, char *chromName, unsigned chromSize, char *genome) { char *bigDataUrl = trackDbSetting(tdb, "bigDataUrl"); @@ -820,33 +822,31 @@ hPrintf("
  • \n"); } static unsigned largestChromInfo(struct chromInfo *ci, char **chromName) /* find largest chrom in this chromInfo, return name and size */ { unsigned size = 0; char *name = NULL; struct chromInfo *el; for (el = ci; el; el = el->next) @@ -904,30 +904,32 @@ char sizeString[64]; sprintLongWithCommas(sizeString, chromSize); hPrintf("
  • Sequence count %d, largest: %s at %s bases
  • \n", slCount(ci), chromName, sizeString); safef(urlReference, sizeof(urlReference), " JSON example sequence output: %s:%u-%u", urlPrefix, hubTop->url, genome->name, chromName, chromSize/4, (chromSize/4)+128, chromName, chromSize/4, (chromSize/4)+128); hPrintf("
  • %s
  • \n", urlReference); } safef(urlReference, sizeof(urlReference), " JSON example list tracks output", urlPrefix, hubTop->url, genome->name, trackLeavesOnly ? ";trackLeavesOnly=1" : ""); hPrintf("
  • %s
  • \n", urlReference); hubInfo("organism", genome->organism); hubInfo("name", genome->name); hubInfo("description", genome->description); hubInfo("groups", genome->groups); hubInfo("defaultPos", genome->defaultPos); hubInfo("trackDbFile", genome->trackDbFile); hubAssemblySettings(hubTop, genome); + struct trackDb *tdbList = obtainTdb(genome, NULL); + hubTrackList(hubTop, tdbList, genome); if (measureTiming) { long thisTime = clock1000(); hPrintf("
  • processing time %s: %ld millis
  • \n", genome->name, thisTime - lastTime); hPrintf("
    \n"); } 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("