0564395ec363631f2ff8d295da6f6b50f873fda4 braney Mon Jan 24 17:01:53 2022 -0800 more chromAlias work: some name changes and support for the new genark chromAlias format diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c index 9f2f7b4..f2f15d3 100644 --- src/hg/hgTracks/hgTracks.c +++ src/hg/hgTracks/hgTracks.c @@ -4658,31 +4658,31 @@ /* Support setting to suppress display of empty subtracks. * If multiBed is available, return hash with subtrack names as keys */ char *multiBedFile = NULL; char *subtrackIdFile = NULL; if (!compositeHideEmptySubtracks(cart, track->tdb, &multiBedFile, &subtrackIdFile)) return NULL; if (!multiBedFile) return NULL; // load multiBed items in window // TODO: filters here ? // TODO: protect against temporary network error ? */ struct lm *lm = lmInit(0); -struct bbiFile *bbi = bigBedFileOpenAlias(multiBedFile, chromAliasGetHash(database)); +struct bbiFile *bbi = bigBedFileOpenAlias(multiBedFile, chromAliasChromToAliasHash(database)); struct bigBedInterval *bb, *bbList = bigBedIntervalQuery(bbi, chromName, winStart, winEnd, 0, lm); char *row[bbi->fieldCount]; char startBuf[16], endBuf[16]; struct hash *nonEmptySubtracksHash = hashNew(0); for (bb = bbList; bb != NULL; bb = bb->next) { bigBedIntervalToRow(bb, chromName, startBuf, endBuf, row, ArraySize(row)); // TODO: do this in bed3Sources.c char *idList = row[4]; struct slName *ids = slNameListFromComma(idList); struct slName *id = NULL; for (id = ids; id != NULL; id = id->next) hashStore(nonEmptySubtracksHash, id->name); // TODO: free some stuff ? } @@ -10197,31 +10197,31 @@ /* Compare to sort based on chrom size */ { const struct chromInfo *a = *((struct chromInfo **)va); const struct chromInfo *b = *((struct chromInfo **)vb); return b->size - a->size; } void chromInfoRowsNonChromTrackHub(int limit) /* Make table rows of non-chromosomal chromInfo name & size */ /* leaks chromInfo list */ { struct chromInfo *chromInfo = trackHubAllChromInfo(database); slSort(&chromInfo, chromInfoCmpSize); int seqCount = slCount(chromInfo); -struct hash *aliasHash = trackHubAllChromAlias(database); +struct hash *aliasHash = chromAliasMakeReverseLookupTable(database); boolean hasAlias = FALSE; if (aliasHash) hasAlias = TRUE; long long total = 0; char msg1[512], msg2[512]; boolean truncating; int lineCount = 0; truncating = (limit > 0) && (seqCount > limit); for( ;lineCount < seqCount && (chromInfo != NULL); ++lineCount, chromInfo = chromInfo->next) { unsigned size = chromInfo->size; if (lineCount < limit) {