fac2bb8685d03f5088e28c7c20acbcc455d44f5a braney Sat Aug 25 09:09:59 2012 -0700 print out chrom coordinates on zoom levels, added in response to #8871 diff --git src/utils/bigBedInfo/bigBedInfo.c src/utils/bigBedInfo/bigBedInfo.c index 4007b48..12ac39c 100644 --- src/utils/bigBedInfo/bigBedInfo.c +++ src/utils/bigBedInfo/bigBedInfo.c @@ -43,38 +43,51 @@ void bigBedInfo(char *fileName) /* bigBedInfo - Show information about a bigBed file.. */ { struct bbiFile *bbi = bigBedFileOpen(fileName); printf("version: %d\n", bbi->version); printf("isCompressed: %s\n", (bbi->uncompressBufSize > 0 ? "yes" : "no")); printf("isSwapped: %d\n", bbi->isSwapped); printLabelAndLongNumber("itemCount", bigBedItemCount(bbi)); printLabelAndLongNumber("primaryDataSize", bbi->unzoomedIndexOffset - bbi->unzoomedDataOffset); if (bbi->levelList != NULL) { long long indexEnd = bbi->levelList->dataOffset; printLabelAndLongNumber("primaryIndexSize", indexEnd - bbi->unzoomedIndexOffset); } +struct bbiChromInfo *chrom, *chromList = bbiChromList(bbi); printf("zoomLevels: %d\n", bbi->zoomLevels); if (optionExists("zooms")) { struct bbiZoomLevel *zoom; for (zoom = bbi->levelList; zoom != NULL; zoom = zoom->next) + { printf("\t%d\t%d\n", zoom->reductionLevel, (int)(zoom->indexOffset - zoom->dataOffset)); + for (chrom=chromList; chrom != NULL; chrom = chrom->next) + { + extern struct bbiSummary *bbiSummariesInRegion(struct bbiZoomLevel *zoom, struct bbiFile *bbi, int chromId, bits32 start, bits32 end); + struct bbiSummary *sum, *sumList = bbiSummariesInRegion(zoom, bbi, chrom->id,0, chrom->size); + for (sum = sumList; sum != NULL; sum = sum->next) + { + printf("\t\t%s:%d-%d\n",chrom->name, sum->start, sum->end); + } + + } + + } } -struct bbiChromInfo *chrom, *chromList = bbiChromList(bbi); printf("chromCount: %d\n", slCount(chromList)); if (optionExists("chroms")) for (chrom=chromList; chrom != NULL; chrom = chrom->next) printf("\t%s %d %d\n", chrom->name, chrom->id, chrom->size); if (optionExists("as")) { char *asText = bigBedAutoSqlText(bbi); if (asText == NULL) printf("as: n/a\n"); else { printf("as:\n"); printf("%s", asText); } }