15d0836b4dba65919e83ce5ef0aaafe5a0edc72f angie Wed Apr 17 12:49:53 2013 -0700 Making annoGratorGpVar able to handle VCF input too. In order for a grator tosee what type of input is coming from the primary source, the streamer should be passed in along with the primary row, as it is for formatters now. refs #6152 diff --git src/lib/annoGrateWig.c src/lib/annoGrateWig.c index ca05d3d..7872e0c 100644 --- src/lib/annoGrateWig.c +++ src/lib/annoGrateWig.c @@ -48,48 +48,49 @@ uint oldEnd = headRow->end; uint oldLen = oldEnd - headRow->start; uint newLen = thisEnd - headRow->start; headRow->data = lmAllocMoreMem(callerLm, headRow->data, oldLen*sizeof(vector[0]), newLen*sizeof(vector[0])); headRow->end = thisEnd; float *newData = (float *)rowIn->data + (oldEnd - rowIn->start); float *newSpace = (float *)headRow->data + oldLen; CopyArray(newData, newSpace, (thisEnd - oldEnd)); } start = thisEnd; } } } -static struct annoRow *agwIntegrate(struct annoGrator *gSelf, struct annoRow *primaryRow, +static struct annoRow *agwIntegrate(struct annoGrator *gSelf, struct annoStreamRows *primaryData, boolean *retRJFilterFailed, struct lm *callerLm) /* Return wig annoRows that overlap primaryRow position, with NANs weeded out. */ { struct annoGrateWig *self = (struct annoGrateWig *)gSelf; // Cleanup internal lm every so often: if (self->lmRowCount >= 4096) { lmCleanup(&(self->lm)); self->lmRowCount = 0; } if (self->lm == NULL) self->lm = lmInit(0); -struct annoRow *rowsIn = annoGratorIntegrate(self->mySource, primaryRow, retRJFilterFailed, +struct annoRow *rowsIn = annoGratorIntegrate(self->mySource, primaryData, retRJFilterFailed, self->lm); self->lmRowCount += slCount(rowsIn); if (retRJFilterFailed && *retRJFilterFailed) return NULL; +struct annoRow *primaryRow = primaryData->rowList; struct annoRow *rowIn, *rowOutList = NULL;; for (rowIn = rowsIn; rowIn != NULL; rowIn = rowIn->next) tidyUp(rowIn, &rowOutList, primaryRow->start, primaryRow->end, callerLm); slReverse(&rowOutList); return rowOutList; } struct annoGrator *annoGrateWigNew(struct annoStreamer *wigSource) /* Create an annoGrator subclass for source with rowType == arWig. */ { if (wigSource->rowType != arWig) errAbort("annoGrateWigNew: expected source->rowType arWig (%d), got %d from source %s", arWig, wigSource->rowType, wigSource->name); struct annoGrateWig *self; AllocVar(self);