68cc14ec70003fd37e8d3d0e28e54c349fe00ff0 braney Wed Feb 5 12:28:50 2020 -0800 check identifier list when outputing sequence for bigBeds (refs #24916) diff --git src/hg/hgTables/bigBed.c src/hg/hgTables/bigBed.c index 1dfb4e1..de4de9e 100644 --- src/hg/hgTables/bigBed.c +++ src/hg/hgTables/bigBed.c @@ -116,35 +116,40 @@ struct sqlFieldType *list = sqlFieldTypesFromAs(as); bbiFileClose(&bbi); return list; } static void addFilteredBedsOnRegion(struct bbiFile *bbi, struct region *region, char *table, struct asFilter *filter, struct lm *bedLm, struct bed **pBedList) /* Add relevant beds in reverse order to pBedList */ { struct lm *bbLm = lmInit(0); struct bigBedInterval *ivList = NULL, *iv; ivList = bigBedIntervalQuery(bbi, region->chrom, region->start, region->end, 0, bbLm); char *row[bbi->fieldCount]; char startBuf[16], endBuf[16]; +struct hash *idHash = NULL; +if (bbi->fieldCount >= 4) + idHash = identifierHash(database, table); for (iv = ivList; iv != NULL; iv = iv->next) { bigBedIntervalToRow(iv, region->chrom, startBuf, endBuf, row, bbi->fieldCount); if (asFilterOnRow(filter, row)) { + if ((idHash != NULL) && (hashLookup(idHash, row[3]) == NULL)) + continue; struct bed *bed = bedLoadN(row, bbi->definedFieldCount); struct bed *lmBed = lmCloneBed(bed, bedLm); slAddHead(pBedList, lmBed); bedFree(&bed); } } lmCleanup(&bbLm); } struct bed *bigBedGetFilteredBedsOnRegions(struct sqlConnection *conn, char *db, char *table, struct region *regionList, struct lm *lm, int *retFieldCount) /* Get list of beds from bigBed, in all regions, that pass filtering. */ {