062fa28f0527d332659f1d31f3a9a3f8df16d00c angie Fri Jun 20 15:30:19 2014 -0700 In asvSetRegion, don't try to set tabix region if chrom is NULL (position is genome)because that call will fail and then we'd get the wrong idea and set self->eof, oops. diff --git src/lib/annoStreamVcf.c src/lib/annoStreamVcf.c index 2d60f07..2c652b5 100644 --- src/lib/annoStreamVcf.c +++ src/lib/annoStreamVcf.c @@ -22,31 +22,31 @@ int numFileCols; // Number of columns in VCF file. int maxRecords; // Maximum number of annoRows to return. int recordCount; // Number of annoRows we have returned so far. boolean isTabix; // True if we are accessing compressed VCF via tabix index boolean eof; // True when we have hit end of file or maxRecords }; static void asvSetRegion(struct annoStreamer *vSelf, char *chrom, uint regionStart, uint regionEnd) /* Set region -- and free current sqlResult if there is one. */ { annoStreamerSetRegion(vSelf, chrom, regionStart, regionEnd); struct annoStreamVcf *self = (struct annoStreamVcf *)vSelf; self->indelQ = self->nextPosQ = NULL; self->eof = FALSE; -if (self->isTabix) +if (self->isTabix && chrom != NULL) { // If this region is not in tabix index, set self->eof so we won't keep grabbing rows // from the old position. boolean gotRegion = lineFileSetTabixRegion(self->vcff->lf, chrom, regionStart, regionEnd); if (! gotRegion) self->eof = TRUE; } } static char *asvGetHeader(struct annoStreamer *vSelf) /* Return VCF header (e.g. for use by formatter) */ { struct annoStreamVcf *self = (struct annoStreamVcf *)vSelf; return cloneString(self->vcff->headerString); }