static void astSetRegion(struct annoStreamer *vSelf, char *chrom, uint regionStart, uint regionEnd)
/* Set region and re-open file or URL if necessary. */
{
struct annoStreamTab *self = (struct annoStreamTab *)vSelf;
boolean keepOpen = FALSE;
if (chrom != NULL && vSelf->chrom != NULL)
    {
    // If old region chrom precedes new region chrom, don't rewind to beginning of file.
    if (strcmp(vSelf->chrom, chrom) < 0)
	{
	keepOpen = TRUE;
	}
    else
	verbose(2, "annoStreamTab: inefficient when region chroms overlap or are out of order!"
		" (current region: %s:%d-%d, new region: %s:%d-%d)",
		vSelf->chrom, vSelf->regionStart, vSelf->regionEnd,
		chrom, regionStart, regionEnd);
    }
annoStreamerSetRegion(vSelf, chrom, regionStart, regionEnd);
if (keepOpen)
    self->eof = FALSE;
else
    {
    lineFileClose(&(self->lf));
    self->lf = astLFOpen(self->fileOrUrl);
    self->eof = FALSE;
    }
}
static void aswSetRegion(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 annoStreamWig *self = (struct annoStreamWig *)vSelf;
self->wigStr->setRegion(self->wigStr, chrom, regionStart, regionEnd);
}
Exemple #3
0
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;
if (self->isTabix)
    lineFileSetTabixRegion(self->vcff->lf, chrom, regionStart, regionEnd);
}
Exemple #4
0
static void asdSetRegion(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 annoStreamDb *self = (struct annoStreamDb *)vSelf;
sqlFreeResult(&(self->sr));
resetMergeState(self);
resetChunkState(self);
}
static void asbwSetRegion(struct annoStreamer *vSelf, char *chrom, uint regionStart, uint regionEnd)
/* Set region -- and free localmem from previous query if necessary. */
{
annoStreamerSetRegion(vSelf, chrom, regionStart, regionEnd);
struct annoStreamBigWig *self = (struct annoStreamBigWig *)vSelf;
self->nextInterval = self->intervalList = NULL;
self->queryChrom = NULL;
self->eof = FALSE;
lmCleanup(&(self->intervalQueryLm));
}