a071c9a0e1db6bc5db3aec2c0fbd421a4a7389ee tdreszer Wed Jan 26 17:17:13 2011 -0800 filterBy setting should allow spaces by wrapping strings in quotes. Beds should be filterable by filterBy diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c index 7270b63..fdfacfe 100644 --- src/hg/hgTracks/simpleTracks.c +++ src/hg/hgTracks/simpleTracks.c @@ -1944,32 +1944,32 @@ safef(pos, sizeof(pos), "%s:%d-%d", chromName, winStart+1, winEnd); cartSetString(cart, "position", cloneString(pos)); } } enum {blackShadeIx=9,whiteShadeIx=0}; char *getScoreFilterClause(struct cart *cart,struct trackDb *tdb,char *scoreColumn) // Returns "score >= ..." extra where clause if one is needed { if (scoreColumn == NULL) scoreColumn = "score"; struct dyString *extraWhere = newDyString(128); boolean and = FALSE; -extraWhere = dyAddFilterByClause(cart,tdb,extraWhere,"score",&and); -if (and == FALSE) // Cannot have both 'filterBy' score and 'scoreFilter' +extraWhere = dyAddFilterByClause(cart,tdb,extraWhere,NULL,&and); // gets trackDb 'filterBy' clause, which may filter by 'score', 'name', etc +if (and == FALSE || strstrNoCase(extraWhere->string,"score in ") == NULL) // Cannot have both 'filterBy' score and 'scoreFilter' extraWhere = dyAddFilterAsInt(cart,tdb,extraWhere,SCORE_FILTER,"0:1000",scoreColumn,&and); if (sameString(extraWhere->string, "")) return NULL; return dyStringCannibalize(&extraWhere); } void loadLinkedFeaturesWithLoaders(struct track *tg, struct slList *(*itemLoader)(char **row), struct linkedFeatures *(*lfFromWhatever)(struct slList *item), char *scoreColumn, char *moreWhere, boolean (*itemFilter)(struct slList *item)) /* Make a linkedFeatures loader by providing three functions: (1) a regular */ /* item loader found in all autoSql modules, (2) a custom myStruct->linkedFeatures */ /* translating function, and (3) a function to free the the thing loaded in (1). */ { struct sqlConnection *conn = hAllocConn(database); @@ -12319,15 +12319,16 @@ { char *matchLine = NULL; struct slName *nameList = NULL, *name = NULL; matchLine = cartOptionalString(cart, "hgFind.matches"); if(matchLine == NULL) return; nameList = slNameListFromString(matchLine,','); hgFindMatches = newHash(5); for(name = nameList; name != NULL; name = name->next) { hashAddInt(hgFindMatches, name->name, 1); } slFreeList(&nameList); } + \ No newline at end of file