9cc2351f465f585965408ff48fea2ad79a1aaa91
markd
  Mon Jun 6 17:40:11 2011 -0700
meger of GENCODE V7 tracks
diff --git src/hg/lib/hui.c src/hg/lib/hui.c
index 7dd0a06..7933b12 100644
--- src/hg/lib/hui.c
+++ src/hg/lib/hui.c
@@ -3354,69 +3354,74 @@
     while(*filterBySet != NULL)
         {
         filterBy_t *filterBy = slPopHead(filterBySet);
         if(filterBy->slValues != NULL)
             slNameFreeList(filterBy->slValues);
         if(filterBy->slChoices != NULL)
             slNameFreeList(filterBy->slChoices);
         if(filterBy->htmlName != NULL)
             freeMem(filterBy->htmlName);
         freeMem(filterBy->column);
         freeMem(filterBy);
         }
     }
 }
 
-static char *filterByClause(filterBy_t *filterBy)
-/* returns the "column in (...)" clause for a single filterBy struct */
+static char *filterByClauseStd(filterBy_t *filterBy)
+/* returns the SQL where clause for a single filterBy struct in
+ * the standard cases */
 {
 int count = slCount(filterBy->slChoices);
-if(count == 0)
-    return NULL;
-if(slNameInList(filterBy->slChoices,"All"))
-    return NULL;
-
 struct dyString *dyClause = newDyString(256);
 dyStringAppend(dyClause, filterBy->column);
 if(count == 1)
     dyStringPrintf(dyClause, " = ");
 else
     dyStringPrintf(dyClause, " in (");
 
 struct slName *slChoice = NULL;
-boolean notFirst = FALSE;
+boolean first = TRUE;
 for(slChoice = filterBy->slChoices;slChoice != NULL;slChoice=slChoice->next)
     {
-    if(notFirst)
-        dyStringPrintf(dyClause, ",");
-    notFirst = TRUE;
+    if(!first)
+        dyStringAppend(dyClause, ",");
+    first = FALSE;
     if(filterBy->useIndex)
         dyStringAppend(dyClause, slChoice->name);
     else
         dyStringPrintf(dyClause, "\"%s\"",slChoice->name);
     }
 if(dyStringLen(dyClause) == 0)
     {
     dyStringFree(&dyClause);
     return NULL;
     }
 if(count > 1)
     dyStringPrintf(dyClause, ")");
 
 return dyStringCannibalize(&dyClause);
 }
 
+char *filterByClause(filterBy_t *filterBy)
+/* returns the SQL where clause for a single filterBy struct */
+{
+if ((filterBy->slChoices == NULL) || (slNameInList(filterBy->slChoices,"All")))
+    return NULL;
+else
+    return filterByClauseStd(filterBy);
+}
+
 struct dyString *dyAddFilterByClause(struct cart *cart, struct trackDb *tdb,
        struct dyString *extraWhere,char *column, boolean *and)
 /* creates the where clause condition to support a filterBy setting.
    Format: filterBy column:Title=value,value [column:Title=value|label,value|label,value|label])
    filterBy filters are multiselect's so could have multiple values selected.
    thus returns the "column1 in (...) and column2 in (...)" clause.
    if 'column' is provided, and there are multiple filterBy columns, only the named column's clause is returned.
    The 'and' param and dyString in/out allows stringing multiple where clauses together
 */
 {
 filterBy_t *filterBySet = filterBySetGet(tdb, cart,NULL);
 if(filterBySet== NULL)
     return extraWhere;
 
 filterBy_t *filterBy = filterBySet;
@@ -5278,31 +5283,31 @@
 /* Put up gencode-specific controls */
 {
 char varName[64];
 boolean compositeLevel = isNameAtCompositeLevel(tdb,name);
 char *geneLabel = cartUsualStringClosestToHome(cart, tdb,compositeLevel, "label", "gene");
 
 boxed = cfgBeginBoxAndTitle(tdb, boxed, title);
 
 if (sameString(name, "acembly"))
     {
     char *acemblyClass = cartUsualStringClosestToHome(cart,tdb,compositeLevel,"type", acemblyEnumToString(0));
     printf("<p><b>Gene Class: </b>");
     acemblyDropDown("acembly.type", acemblyClass);
     printf("  ");
     }
-else if(sameString("wgEncodeGencode", name)
+else if(startsWith("wgEncodeGencode", name)
      || sameString("wgEncodeSangerGencode", name)
      || (startsWith("encodeGencode", name) && !sameString("encodeGencodeRaceFrags", name)))
     {
     printf("<B>Label:</B> ");
     safef(varName, sizeof(varName), "%s.label", name);
     cgiMakeRadioButton(varName, "gene", sameString("gene", geneLabel));
     printf("%s ", "gene");
     cgiMakeRadioButton(varName, "accession", sameString("accession", geneLabel));
     printf("%s ", "accession");
     cgiMakeRadioButton(varName, "both", sameString("both", geneLabel));
     printf("%s ", "both");
     cgiMakeRadioButton(varName, "none", sameString("none", geneLabel));
     printf("%s ", "none");
     }