450ebe8cb815a0fe3eb3870d3d309be0b7cc807b braney Tue Oct 26 11:22:15 2010 -0700 Fix for #1190: if no data was in range, and there wasn't a max range to view set, then the code would errnoneously put out a message about zooming into a window with fewer than 0 bases. Now it correctly says there is no data in the range if there is no data in range diff --git src/hg/hgc/wiggleClick.c src/hg/hgc/wiggleClick.c index 76b8047..8dd3dbf 100644 --- src/hg/hgc/wiggleClick.c +++ src/hg/hgc/wiggleClick.c @@ -228,31 +228,31 @@ bbi = bigWigFileOpen(fileName); bbList = bigWigIntervalQuery(bbi, chrom, winStart, winEnd, lm); } char num1Buf[64], num2Buf[64]; /* big enough for 2^64 (and then some) */ sprintLongWithCommas(num1Buf, BASE_1(winStart)); sprintLongWithCommas(num2Buf, winEnd); printf("<B>Position: </B> %s:%s-%s<BR>\n", chrom, num1Buf, num2Buf ); sprintLongWithCommas(num1Buf, winEnd-winStart); printf("<B>Total Bases in view: </B> %s <BR>\n", num1Buf); if (bbList != NULL) { bbiIntervalStatsReport(bbList, tdb->table, chrom, winStart, winEnd); } -else if (maxWTQ <= winEnd-winStart) +else if ((bbi == NULL) && (maxWTQ <= winEnd-winStart)) { sprintLongWithCommas(num1Buf, maxWTQ); printf("<P>Zoom in to a view less than %s bases to see data summary.</P>",num1Buf); } else { printf("<P>No data overlapping current position.</P>"); } lmCleanup(&lm); bbiFileClose(&bbi); } void genericBigWigClick(struct sqlConnection *conn, struct trackDb *tdb,