5fe6a3b2ce5a7099de38022ab8875d5651797780
tdreszer
  Fri Dec 16 11:41:01 2011 -0800
Just a changed name tree wide.  The 'compositeLevel' paramter to closestToHome cart functions was confusing.  What it means is the request is for a setting one step above the tdb passed in.  It is used for view level controls where the model tdb is a subtrack.  This checkin has NO functional affect.
diff --git src/hg/lib/hui.c src/hg/lib/hui.c
index 0bdceb6..1cc52e7 100644
--- src/hg/lib/hui.c
+++ src/hg/lib/hui.c
@@ -1117,31 +1117,31 @@
 				    BASE_COLOR_DRAW_OFF);
 stringVal = cartUsualStringClosestToHome(cart, tdb, FALSE, BASE_COLOR_VAR_SUFFIX,stringVal);
 
 return baseColorDrawOptStringToEnum(stringVal);
 }
 
 
 /*** Control of fancy indel display code: ***/
 
 static boolean tdbOrCartBoolean(struct cart *cart, struct trackDb *tdb,
                                 char *settingName, char *defaultOnOff)
 /* Query cart & trackDb to determine if a boolean variable is set. */
 {
 boolean alreadySet;
 alreadySet = !sameString("off",trackDbSettingOrDefault(tdb, settingName, defaultOnOff));
-alreadySet = cartUsualBooleanClosestToHome(cart, tdb, FALSE, settingName, alreadySet); // NOTE: viewLevel=FALSE because tdb param already is at appropriate level
+alreadySet = cartUsualBooleanClosestToHome(cart, tdb, FALSE, settingName, alreadySet); // NOTE: parentLevel=FALSE because tdb param already is at appropriate level
 return alreadySet;
 }
 
 static boolean indelAppropriate(struct trackDb *tdb)
 /* Return true if it makes sense to offer indel display options for tdb. */
 {
 return (tdb && (startsWith("psl", tdb->type) || sameString("bam", tdb->type)) &&
 	(cfgOptionDefault("browser.indelOptions", NULL) != NULL));
 }
 
 static void indelEnabledByName(struct cart *cart, struct trackDb *tdb, char *name,
                   float basesPerPixel, boolean *retDoubleInsert, boolean *retQueryInsert,
                   boolean *retPolyA)
 /* Query cart & trackDb to determine what indel display (if any) is enabled. Set
  * basesPerPixel to 0.0 to disable check for zoom level.  */
@@ -3349,32 +3349,32 @@
                     errAbort("filterBy values either all have labels (as value|label) or none do.");
                 *chipper++ = 0;  // The label is found inside the filters->svValues as the next string
                 strSwapChar(chipper,'_',' '); // Title does not have underscores
                 }
             else if (filterBy->valueAndLabel)
                 errAbort("filterBy values either all have labels in form of value|label or none do.");
         }
         }
 
     slAddTail(&filterBySet,filterBy); // Keep them in order (only a few)
 
     if(cart != NULL)
         {
         char suffix[256];
         safef(suffix, sizeof(suffix), "filterBy.%s", filterBy->column);
-        boolean viewLevel = isNameAtCompositeLevel(tdb,name);
-        if(cartLookUpVariableClosestToHome(cart,tdb,viewLevel,suffix,&(filterBy->htmlName)))
+        boolean parentLevel = isNameAtParentLevel(tdb,name);
+        if(cartLookUpVariableClosestToHome(cart,tdb,parentLevel,suffix,&(filterBy->htmlName)))
             filterBy->slChoices = cartOptionalSlNameList(cart,filterBy->htmlName);
         }
     if(filterBy->htmlName == NULL)
         {
         int len = strlen(name) + strlen(filterBy->column) + 15;
         filterBy->htmlName = needMem(len);
         safef(filterBy->htmlName, len, "%s.filterBy.%s", name,filterBy->column);
         }
     }
 freeMem(setting);
 
 return filterBySet;
 }
 
 void filterBySetFree(filterBy_t **filterBySet)
@@ -4577,71 +4577,71 @@
     radioButton(filterTypeVar, filterTypeVal, "none");
 }
 
 void radioButton(char *var, char *val, char *ourVal)
 /* Print one radio button */
 {
 cgiMakeRadioButton(var, ourVal, sameString(ourVal, val));
 printf("%s ", ourVal);
 }
 
 void oneMrnaFilterUi(struct controlGrid *cg, struct trackDb *tdb, char *text, char *var, char *suffix, struct cart *cart)
 /* Print out user interface for one type of mrna filter. */
 {
 controlGridStartCell(cg);
 printf("%s:<BR>", text);
-boolean viewLevel = isNameAtCompositeLevel(tdb,var);
-cgiMakeTextVar(var, cartUsualStringClosestToHome(cart, tdb, viewLevel,suffix, ""), 19);
+boolean parentLevel = isNameAtParentLevel(tdb,var);
+cgiMakeTextVar(var, cartUsualStringClosestToHome(cart, tdb, parentLevel,suffix, ""), 19);
 controlGridEndCell(cg);
 }
 
 void bedFiltCfgUi(struct cart *cart, struct trackDb *tdb, char *prefix, char *title, boolean boxed)
 /* Put up UI for an "bedFilter" tracks. */
 {
 struct mrnaUiData *mud = newBedUiData(prefix);
 struct mrnaFilter *fil;
 struct controlGrid *cg = NULL;
-boolean viewLevel = isNameAtCompositeLevel(tdb,prefix);
-char *filterTypeVal = cartUsualStringClosestToHome(cart, tdb, viewLevel, mud->filterTypeSuffix, "red");
+boolean parentLevel = isNameAtParentLevel(tdb,prefix);
+char *filterTypeVal = cartUsualStringClosestToHome(cart, tdb, parentLevel, mud->filterTypeSuffix, "red");
 boxed = cfgBeginBoxAndTitle(tdb, boxed, title);
 /* Define type of filter. */
 printf("<table width=400><tr><td align='left'>\n");
 char buffer[256];
 safef(buffer, sizeof buffer,"%s.%s",prefix,mud->filterTypeSuffix);
 filterButtons(buffer, filterTypeVal, FALSE);
 printf("</br>");
 /* List various fields you can filter on. */
 cg = startControlGrid(4, NULL);
 for (fil = mud->filterList; fil != NULL; fil = fil->next)
     {
     safef(buffer, sizeof buffer,"%s.%s",prefix,fil->suffix);
     oneMrnaFilterUi(cg, tdb, fil->label, buffer, fil->suffix, cart);
     }
 endControlGrid(&cg);
 cfgEndBox(boxed);
 }
 
 void mrnaCfgUi(struct cart *cart, struct trackDb *tdb, char *prefix, char *title, boolean boxed)
 /* Put up UI for an mRNA (or EST) track. */
 {
 boolean isXeno = (sameString(tdb->track, "xenoMrna") ||  sameString(tdb->track, "xenoEst"));
 struct mrnaUiData *mud = newMrnaUiData(prefix, isXeno);
 struct mrnaFilter *fil;
 struct controlGrid *cg = NULL;
-boolean viewLevel = isNameAtCompositeLevel(tdb,prefix);
-char *filterTypeVal = cartUsualStringClosestToHome(cart, tdb, viewLevel, mud->filterTypeSuffix,"red");
-char *logicTypeVal  = cartUsualStringClosestToHome(cart, tdb, viewLevel, mud->logicTypeSuffix, "and");
+boolean parentLevel = isNameAtParentLevel(tdb,prefix);
+char *filterTypeVal = cartUsualStringClosestToHome(cart, tdb, parentLevel, mud->filterTypeSuffix,"red");
+char *logicTypeVal  = cartUsualStringClosestToHome(cart, tdb, parentLevel, mud->logicTypeSuffix, "and");
 
 boxed = cfgBeginBoxAndTitle(tdb, boxed, title);
 /* Define type of filter. */
 char buffer[256];
 safef(buffer,sizeof buffer,"%s.%s",prefix,mud->filterTypeSuffix);
 filterButtons(buffer, filterTypeVal, FALSE);
 printf("  <B>Combination Logic:</B> ");
 safef(buffer,sizeof buffer,"%s.%s",prefix,mud->logicTypeSuffix);
 radioButton(buffer, logicTypeVal, "and");
 radioButton(buffer, logicTypeVal, "or");
 printf("<BR>\n");
 
 /* List various fields you can filter on. */
 printf("<table border=0 cellspacing=1 cellpadding=1 width=%d>\n", CONTROL_TABLE_WIDTH);
 cg = startControlGrid(4, NULL);
@@ -4649,42 +4649,42 @@
     {
     safef(buffer,sizeof buffer,"%s.%s",prefix,fil->suffix);
     oneMrnaFilterUi(cg, tdb, fil->label, buffer, fil->suffix, cart);
     }
 endControlGrid(&cg);
 baseColorDrawOptDropDown(cart, tdb);
 indelShowOptions(cart, tdb);
 cfgEndBox(boxed);
 }
 
 
 void scoreGrayLevelCfgUi(struct cart *cart, struct trackDb *tdb, char *prefix, int scoreMax)
 /* If scoreMin has been set, let user select the shade of gray for that score, in case
  * the default is too light to see or darker than necessary. */
 {
-boolean viewLevel = isNameAtCompositeLevel(tdb,prefix);
+boolean parentLevel = isNameAtParentLevel(tdb,prefix);
 char *scoreMinStr = trackDbSettingClosestToHome(tdb, GRAY_LEVEL_SCORE_MIN);
 if (scoreMinStr != NULL)
     {
     int scoreMin = atoi(scoreMinStr);
     // maxShade=9 taken from hgTracks/simpleTracks.c.  Ignore the 10 in shadesOfGray[10+1] --
     // maxShade is used to access the array.
     int maxShade = 9;
     int scoreMinGrayLevel = scoreMin * maxShade/scoreMax;
     if (scoreMinGrayLevel <= 0) scoreMinGrayLevel = 1;
     char *setting = trackDbSettingClosestToHome(tdb, MIN_GRAY_LEVEL);
-    int minGrayLevel = cartUsualIntClosestToHome(cart, tdb, viewLevel, MIN_GRAY_LEVEL,
+    int minGrayLevel = cartUsualIntClosestToHome(cart, tdb, parentLevel, MIN_GRAY_LEVEL,
                         setting ? atoi(setting) : scoreMinGrayLevel);
     if (minGrayLevel <= 0) minGrayLevel = 1;
     if (minGrayLevel > maxShade) minGrayLevel = maxShade;
     puts("\n<B>Shade of lowest-scoring items: </B>");
     // Add javascript to select so that its color is consistent with option colors:
     int level = 255 - (255*minGrayLevel / maxShade);
     printf("<SELECT NAME=\"%s.%s\" STYLE='color: #%02x%02x%02x' class='normalText'",
 	   prefix, MIN_GRAY_LEVEL, level, level, level);
     int i;
 #ifdef OMIT
     // IE works without this code and FF doesn't work with it.
     printf(" onchange=\"switch(this.value) {");
     for (i = 1;  i < maxShade;  i++)
         {
         level = 255 - (255*i / maxShade);
@@ -4770,205 +4770,205 @@
         {
         if(min && *min == NULL && minLoc != NULL)
             *min=minLoc;
         else
             freeMem(minLoc);
         if(max && *max == NULL && maxLoc != NULL)
             *max=maxLoc;
         else
             freeMem(maxLoc);
         return TRUE;
         }
     }
 return FALSE;
 }
 
-static void getScoreIntRangeFromCart(struct cart *cart, struct trackDb *tdb, boolean viewLimit,
+static void getScoreIntRangeFromCart(struct cart *cart, struct trackDb *tdb, boolean parentLevel,
                                  char *scoreName, int *limitMin, int *limitMax,int *min,int *max)
 /* gets an integer score range from the cart, but the limits from trackDb
    for any of the pointers provided, will return a value found, if found, else it's contents
    are undisturbed (use NO_VALUE to recognize unavaliable values) */
 {
 char scoreLimitName[128];
 char *deMin=NULL,*deMax=NULL;
 if((limitMin || limitMax) && getScoreLimitsFromTdb(tdb,scoreName,NULL,&deMin,&deMax))
     {
     if(deMin != NULL && limitMin)
         *limitMin = atoi(deMin);
     if(deMax != NULL && limitMax)
         *limitMax = atoi(deMax);
     freeMem(deMin);
     freeMem(deMax);
     }
 if((min || max) && getScoreDefaultsFromTdb(tdb,scoreName,NULL,&deMin,&deMax))
     {
     if(deMin != NULL && min)
         *min = atoi(deMin);
     if(deMax != NULL && max)
         *max =atoi(deMax);
     freeMem(deMin);
     freeMem(deMax);
     }
 if(max)
     {
     safef(scoreLimitName, sizeof(scoreLimitName), "%s%s", scoreName, _MAX);
-    deMax = cartOptionalStringClosestToHome(cart, tdb,viewLimit,scoreLimitName);
+    deMax = cartOptionalStringClosestToHome(cart, tdb,parentLevel,scoreLimitName);
     if(deMax != NULL)
         *max = atoi(deMax);
     }
 if(min)
     {
     safef(scoreLimitName, sizeof(scoreLimitName), "%s%s", scoreName, (max && deMax? _MIN:"")); // Warning: name changes if max!
-    deMin = cartOptionalStringClosestToHome(cart, tdb,viewLimit,scoreLimitName);
+    deMin = cartOptionalStringClosestToHome(cart, tdb,parentLevel,scoreLimitName);
     if(deMin != NULL)
         *min = atoi(deMin);
     }
 // Defaulting min and max within limits.  Sorry for the horizontal ifs, but stacking the group makes them easier to follow
 if (min && limitMin && *limitMin != NO_VALUE && (*min == NO_VALUE || *min < *limitMin)) *min = *limitMin;
 if (min && limitMax && *limitMax != NO_VALUE &&                      *min > *limitMax)  *min = *limitMax;
 if (max && limitMax && *limitMax != NO_VALUE && (*max == NO_VALUE || *max > *limitMax)) *max = *limitMax;
 if (max && limitMin && *limitMin != NO_VALUE &&                      *max < *limitMin)  *max = *limitMin;
 }
 
-static void getScoreFloatRangeFromCart(struct cart *cart, struct trackDb *tdb, boolean viewLevel,
+static void getScoreFloatRangeFromCart(struct cart *cart, struct trackDb *tdb, boolean parentLevel,
                          char *scoreName, double *limitMin,double *limitMax,double*min,double*max)
 /* gets an double score range from the cart, but the limits from trackDb
    for any of the pointers provided, will return a value found, if found, else it's contents
    are undisturbed (use NO_VALUE to recognize unavaliable values) */
 {
 char scoreLimitName[128];
 char *deMin=NULL,*deMax=NULL;
 if((limitMin || limitMax) && getScoreLimitsFromTdb(tdb,scoreName,NULL,&deMin,&deMax))
     {
     if(deMin != NULL && limitMin)
         *limitMin = strtod(deMin,NULL);
     if(deMax != NULL && limitMax)
         *limitMax =strtod(deMax,NULL);
     freeMem(deMin);
     freeMem(deMax);
     }
 if((min || max) && getScoreDefaultsFromTdb(tdb,scoreName,NULL,&deMin,&deMax))
     {
     if(deMin != NULL && min)
         *min = strtod(deMin,NULL);
     if(deMax != NULL && max)
         *max =strtod(deMax,NULL);
     freeMem(deMin);
     freeMem(deMax);
     }
 if(max)
     {
     safef(scoreLimitName, sizeof(scoreLimitName), "%s%s", scoreName, _MAX);
-    deMax = cartOptionalStringClosestToHome(cart, tdb,viewLevel,scoreLimitName);
+    deMax = cartOptionalStringClosestToHome(cart, tdb,parentLevel,scoreLimitName);
     if(deMax != NULL)
         *max = strtod(deMax,NULL);
     }
 if(min)
     {
     safef(scoreLimitName, sizeof(scoreLimitName), "%s%s", scoreName, _MIN); // name is always {filterName}Min
-    deMin = cartOptionalStringClosestToHome(cart, tdb,viewLevel,scoreLimitName);
+    deMin = cartOptionalStringClosestToHome(cart, tdb,parentLevel,scoreLimitName);
     if(deMin != NULL)
         *min = strtod(deMin,NULL);
     }
 // Defaulting min and max within limits.  Sorry for the horizontal ifs, but stacking the group makes them easier to follow
 if (min && limitMin && (int)(*limitMin) != NO_VALUE && ((int)(*min) == NO_VALUE || *min < *limitMin)) *min = *limitMin;
 if (min && limitMax && (int)(*limitMax) != NO_VALUE &&                             *min > *limitMax)  *min = *limitMax;
 if (max && limitMax && (int)(*limitMax) != NO_VALUE && ((int)(*max) == NO_VALUE || *max > *limitMax)) *max = *limitMax;
 if (max && limitMin && (int)(*limitMin) != NO_VALUE &&                             *max < *limitMin)  *max = *limitMin;
 }
 
 static boolean showScoreFilter(struct cart *cart, struct trackDb *tdb, boolean *opened, boolean boxed,
-                               boolean viewLevel,char *name, char *title, char *label,
+                               boolean parentLevel,char *name, char *title, char *label,
                                char *scoreName, boolean isFloat)
 /* Shows a score filter control with minimum value and optional range */
 {
 char *setting = trackDbSetting(tdb, scoreName);
 if(setting)
     {
     if(*opened == FALSE)
         {
         boxed = cfgBeginBoxAndTitle(tdb, boxed, title);
         puts("<TABLE>");
         *opened = TRUE;
         }
     printf("<TR><TD align='right'><B>%s:</B><TD align='left'>",label);
     char varName[256];
     char altLabel[256];
     safef(varName, sizeof(varName), "%s%s", scoreName, _BY_RANGE);
     boolean filterByRange = trackDbSettingClosestToHomeOn(tdb, varName);
     // NOTE: could determine isFloat = (strchr(setting,'.') != NULL);  However, historical trackDb settings of pValueFilter did not always contain '.'
     if (isFloat)
         {
         double minLimit=NO_VALUE,maxLimit=NO_VALUE;
         double minVal=minLimit,maxVal=maxLimit;
         colonPairToDoubles(setting,&minVal,&maxVal);
-        getScoreFloatRangeFromCart(cart,tdb,viewLevel,scoreName,&minLimit,&maxLimit,&minVal,&maxVal);
+        getScoreFloatRangeFromCart(cart,tdb,parentLevel,scoreName,&minLimit,&maxLimit,&minVal,&maxVal);
         safef(varName, sizeof(varName), "%s.%s%s", name, scoreName, _MIN);
         safef(altLabel, sizeof(altLabel), "%s%s", (filterByRange?"Minimum ":""), htmlEncodeText(htmlTextStripTags(label),FALSE));
         cgiMakeDoubleVarWithLimits(varName,minVal, altLabel, 0,minLimit, maxLimit);
         if(filterByRange)
             {
             printf("<TD align='left'>to<TD align='left'>");
             safef(varName, sizeof(varName), "%s.%s%s", name, scoreName, _MAX);
             safef(altLabel, sizeof(altLabel), "%s%s", (filterByRange?"Maximum ":""), label);
             cgiMakeDoubleVarWithLimits(varName,maxVal, altLabel, 0,minLimit, maxLimit);
             }
         safef(altLabel, sizeof(altLabel), "%s", (filterByRange?"": "colspan=3"));
         if(minLimit != NO_VALUE && maxLimit != NO_VALUE)
             printf("<TD align='left'%s> (%g to %g)",altLabel,minLimit, maxLimit);
         else if(minLimit != NO_VALUE)
             printf("<TD align='left'%s> (minimum %g)",altLabel,minLimit);
         else if(maxLimit != NO_VALUE)
             printf("<TD align='left'%s> (maximum %g)",altLabel,maxLimit);
         else
             printf("<TD align='left'%s",altLabel);
         }
     else
         {
         int minLimit=NO_VALUE,maxLimit=NO_VALUE;
         int minVal=minLimit,maxVal=maxLimit;
         colonPairToInts(setting,&minVal,&maxVal);
-        getScoreIntRangeFromCart(cart,tdb,viewLevel,scoreName,&minLimit,&maxLimit,&minVal,&maxVal);
+        getScoreIntRangeFromCart(cart,tdb,parentLevel,scoreName,&minLimit,&maxLimit,&minVal,&maxVal);
         safef(varName, sizeof(varName), "%s.%s%s", name, scoreName, filterByRange ? _MIN:"");
         safef(altLabel, sizeof(altLabel), "%s%s", (filterByRange?"Minimum ":""), label);
         cgiMakeIntVarWithLimits(varName,minVal, altLabel, 0,minLimit, maxLimit);
         if(filterByRange)
             {
             printf("<TD align='left'>to<TD align='left'>");
             safef(varName, sizeof(varName), "%s.%s%s", name, scoreName, _MAX);
             safef(altLabel, sizeof(altLabel), "%s%s", (filterByRange?"Maximum ":""), label);
             cgiMakeIntVarWithLimits(varName,maxVal, altLabel, 0,minLimit, maxLimit);
             }
         safef(altLabel, sizeof(altLabel), "%s", (filterByRange?"": "colspan=3"));
         if(minLimit != NO_VALUE && maxLimit != NO_VALUE)
             printf("<TD align='left'%s> (%d to %d)",altLabel,minLimit, maxLimit);
         else if(minLimit != NO_VALUE)
             printf("<TD align='left'%s> (minimum %d)",altLabel,minLimit);
         else if(maxLimit != NO_VALUE)
             printf("<TD align='left'%s> (maximum %d)",altLabel,maxLimit);
         else
             printf("<TD align='left'%s",altLabel);
         }
     puts("</TR>");
     return TRUE;
     }
 return FALSE;
 }
 
 
 static int numericFiltersShowAll(char *db, struct cart *cart, struct trackDb *tdb, boolean *opened, boolean boxed,
-                               boolean viewLevel,char *name, char *title)
+                               boolean parentLevel,char *name, char *title)
 // Shows all *Filter style filters.  Note that these are in random order and have no graceful title
 {
 int count = 0;
 struct slName *filterSettings = trackDbSettingsWildMatch(tdb, "*Filter");
 if (filterSettings)
     {
     puts("<BR>");
     struct slName *filter = NULL;
 #ifdef EXTRA_FIELDS_SUPPORT
     struct extraField *extras = extraFieldsGet(db,tdb);
 #else///ifndef EXTRA_FIELDS_SUPPORT
     struct sqlConnection *conn = hAllocConnTrack(db, tdb);
     struct asObject *as = asForTdb(conn, tdb);
     hFreeConn(&conn);
 #endif///ndef EXTRA_FIELDS_SUPPORT
@@ -5000,31 +5000,31 @@
                 }
         #else///ifndef EXTRA_FIELDS_SUPPORT
             if (as != NULL)
                 {
                 struct asColumn *asCol = asColumnFind(as, field);
                 if (asCol != NULL)
                     { // Found label so replace field
                     field = asCol->comment;
                     if (!isFloat)
                         isFloat = asTypesIsFloating(asCol->lowType->type);
                     }
                 }
         #endif///ndef EXTRA_FIELDS_SUPPORT
             char label[128];
             safef(label,sizeof(label),"Minimum %s",field);
-            showScoreFilter(cart,tdb,opened,boxed,viewLevel,name,title,label,scoreName,isFloat);
+            showScoreFilter(cart,tdb,opened,boxed,parentLevel,name,title,label,scoreName,isFloat);
             freeMem(scoreName);
             count++;
             }
         slNameFree(&filter);
         }
 #ifdef EXTRA_FIELDS_SUPPORT
     if (extras != NULL)
         extraFieldsFree(&extras);
 #else///ifndef EXTRA_FIELDS_SUPPORT
     if (as != NULL)
         asObjectFree(&as);
 #endif///ndef EXTRA_FIELDS_SUPPORT
     }
 if (count > 0)
     puts("</TABLE>");
@@ -5062,39 +5062,39 @@
     slNameFreeList(&filterSettings);
     if (one)
         return TRUE;
     }
 if (!blocked)  // scoreFilter is implicit unless NO_SCORE_FILTER
     return TRUE;
 
 return FALSE;
 }
 
 
 void scoreCfgUi(char *db, struct cart *cart, struct trackDb *tdb, char *name, char *title,  int maxScore, boolean boxed)
 /* Put up UI for filtering bed track based on a score */
 {
 char option[256];
-boolean viewLevel = isNameAtCompositeLevel(tdb,name);
+boolean parentLevel = isNameAtParentLevel(tdb,name);
 boolean skipScoreFilter = FALSE;
 boolean bigBed = startsWith("bigBed",tdb->type);
 
 if (!bigBed)  // bigBed filters are limited!
     {
     // Numeric filters are first
     boolean isBoxOpened = FALSE;
-    if (numericFiltersShowAll(db, cart, tdb, &isBoxOpened, boxed, viewLevel, name, title) > 0)
+    if (numericFiltersShowAll(db, cart, tdb, &isBoxOpened, boxed, parentLevel, name, title) > 0)
         skipScoreFilter = TRUE;
 
     // Add any multi-selects next
     filterBy_t *filterBySet = filterBySetGet(tdb,cart,name);
     if(filterBySet != NULL)
         {
         if(!tdbIsComposite(tdb) && cartOptionalString(cart, "ajax") == NULL)
             jsIncludeFile("hui.js",NULL);
 
         if (!isBoxOpened)   // Note filterBy boxes are not double "boxed", if there are no other filters
             printf("<BR>");
         filterBySetCfgUi(cart,tdb,filterBySet,TRUE);
         filterBySetFree(&filterBySet);
         skipScoreFilter = TRUE;
         }
@@ -5107,31 +5107,31 @@
             cfgEndBox(boxed);
 
         return; // Cannot have both '*filter' and 'scoreFilter'
         }
     }
 
 boolean scoreFilterOk = (trackDbSettingClosestToHome(tdb, NO_SCORE_FILTER) == NULL);
 boolean glvlScoreMin = (trackDbSettingClosestToHome(tdb, GRAY_LEVEL_SCORE_MIN) != NULL);
 if (! (scoreFilterOk || glvlScoreMin))
     return;
 boxed = cfgBeginBoxAndTitle(tdb, boxed, title);
 
 if (scoreFilterOk)
     {
     int minLimit=0,maxLimit=maxScore,minVal=0,maxVal=maxScore;
-    getScoreIntRangeFromCart(cart,tdb,viewLevel,SCORE_FILTER,&minLimit,&maxLimit,&minVal,&maxVal);
+    getScoreIntRangeFromCart(cart,tdb,parentLevel,SCORE_FILTER,&minLimit,&maxLimit,&minVal,&maxVal);
 
     boolean filterByRange = trackDbSettingClosestToHomeOn(tdb, SCORE_FILTER _BY_RANGE);
     if (!bigBed && filterByRange)
         {
         puts("<B>Filter score range:  min:</B>");
         snprintf(option, sizeof(option), "%s.%s", name,SCORE_FILTER _MIN);
         cgiMakeIntVarWithLimits(option, minVal, "Minimum score",0, minLimit,maxLimit);
         puts("<B>max:</B>");
         snprintf(option, sizeof(option), "%s.%s", name,SCORE_FILTER _MAX);
         cgiMakeIntVarWithLimits(option, maxVal, "Maximum score",0,minLimit,maxLimit);
         printf("(%d to %d)\n",minLimit,maxLimit);
         }
     else
         {
         printf("<b>Show only items with score at or above:</b> ");
@@ -5149,40 +5149,40 @@
     scoreGrayLevelCfgUi(cart, tdb, name, maxScore);
 
 if (!bigBed)
     {
     /* filter top-scoring N items in track */
     char *scoreCtString = trackDbSettingClosestToHome(tdb, "filterTopScorers");
     if (scoreCtString != NULL)
         {
         /* show only top-scoring items. This option only displayed if trackDb
         * setting exists.  Format:  filterTopScorers <on|off> <count> <table> */
         char *words[2];
         char *scoreFilterCt = NULL;
         chopLine(cloneString(scoreCtString), words);
         safef(option, sizeof(option), "%s.filterTopScorersOn", name);
         bool doScoreCtFilter =
-            cartUsualBooleanClosestToHome(cart, tdb, viewLevel, "filterTopScorersOn", sameString(words[0], "on"));
+            cartUsualBooleanClosestToHome(cart, tdb, parentLevel, "filterTopScorersOn", sameString(words[0], "on"));
         puts("<P>");
         cgiMakeCheckBox(option, doScoreCtFilter);
         safef(option, sizeof(option), "%s.filterTopScorersCt", name);
-        scoreFilterCt = cartUsualStringClosestToHome(cart, tdb, viewLevel, "filterTopScorersCt", words[1]);
+        scoreFilterCt = cartUsualStringClosestToHome(cart, tdb, parentLevel, "filterTopScorersCt", words[1]);
 
         puts("&nbsp; <B> Show only items in top-scoring </B>");
         cgiMakeIntVarWithLimits(option,atoi(scoreFilterCt),"Top-scoring count",0,1,100000);
         /* Only check size of table if track does not have subtracks */
-        if ( !viewLevel && hTableExists(db, tdb->table))
+        if ( !parentLevel && hTableExists(db, tdb->table))
             printf("&nbsp; (range: 1 to 100,000 total items: %d)\n",getTableSize(db, tdb->table));
         else
             printf("&nbsp; (range: 1 to 100,000)\n");
         }
     }
 cfgEndBox(boxed);
 }
 
 // Moved from hgTrackUi for consistency
 static void filterByChromCfgUi(struct cart *cart, struct trackDb *tdb)
 {
 char *filterSetting;
 char filterVar[256];
 char *filterVal = "";
 
@@ -5222,94 +5222,94 @@
 char *words[8];
 int wordCount = wordCount = chopLine(typeLine, words);
 if (wordCount == 3 && sameWord(words[1], "xeno"))
     crossSpeciesCfgUi(cart,tdb);
 baseColorDropLists(cart, tdb, name);
 indelShowOptionsWithName(cart, tdb, name);
 cfgEndBox(boxed);
 }
 
 
 void netAlignCfgUi(char *db, struct cart *cart, struct trackDb *tdb, char *prefix, char *title, boolean boxed)
 /* Put up UI for net tracks */
 {
 boxed = cfgBeginBoxAndTitle(tdb, boxed, title);
 
-boolean viewLevel = isNameAtCompositeLevel(tdb,prefix);
+boolean parentLevel = isNameAtParentLevel(tdb,prefix);
 
-enum netColorEnum netColor = netFetchColorOption(cart, tdb, viewLevel);
+enum netColorEnum netColor = netFetchColorOption(cart, tdb, parentLevel);
 
 char optString[256];	/*	our option strings here	*/
 safef(optString, ArraySize(optString), "%s.%s", prefix, NET_COLOR );
 printf("<p><b>Color nets by:&nbsp;</b>");
 netColorDropDown(optString, netColorEnumToString(netColor));
 
 #ifdef NOT_YET
-enum netLevelEnum netLevel = netFetchLevelOption(cart, tdb, viewLevel);
+enum netLevelEnum netLevel = netFetchLevelOption(cart, tdb, parentLevel);
 
 safef( optString, ArraySize(optString), "%s.%s", prefix, NET_LEVEL );
 printf("<p><b>Limit display of nets to:&nbsp;</b>");
 netLevelDropDown(optString, netLevelEnumToString(netLevel));
 #endif
 
 cfgEndBox(boxed);
 }
 
 void chainCfgUi(char *db, struct cart *cart, struct trackDb *tdb, char *prefix, char *title, boolean boxed, char *chromosome)
 /* Put up UI for chain tracks */
 {
 boxed = cfgBeginBoxAndTitle(tdb, boxed, title);
 
-boolean viewLevel = isNameAtCompositeLevel(tdb,prefix);
+boolean parentLevel = isNameAtParentLevel(tdb,prefix);
 
 enum chainColorEnum chainColor =
-	chainFetchColorOption(cart, tdb, viewLevel);
+	chainFetchColorOption(cart, tdb, parentLevel);
 
 /* check if we have normalized scores available */
 boolean normScoreAvailable = chainDbNormScoreAvailable(tdb);
 
 char optString[256];
 if (normScoreAvailable)
     {
     safef(optString, ArraySize(optString), "%s.%s", prefix, OPT_CHROM_COLORS );
     printf("<p><b>Color chains by:&nbsp;</b>");
     chainColorDropDown(optString, chainColorEnumToString(chainColor));
     }
 else
     {
     printf("<p><b>Color track based on chromosome:</b>&nbsp;");
 
     char optString[256];
     /* initial value of chromosome coloring option is "on", unless
      * overridden by the colorChromDefault setting in the track */
     char *binaryColorDefault =
 	    trackDbSettingClosestToHomeOrDefault(tdb, "colorChromDefault", "on");
     /* allow cart to override trackDb setting */
     safef(optString, sizeof(optString), "%s.color", prefix);
     char * colorSetting = cartUsualStringClosestToHome(cart, tdb,
-	viewLevel, "color", binaryColorDefault);
+	parentLevel, "color", binaryColorDefault);
     cgiMakeRadioButton(optString, "on", sameString(colorSetting, "on"));
     printf(" on ");
     cgiMakeRadioButton(optString, "off", sameString(colorSetting, "off"));
     printf(" off ");
     printf("<br>\n");
     }
 
 printf("<p><b>Filter by chromosome (e.g. chr10):</b> ");
 safef(optString, ArraySize(optString), "%s.%s", prefix, OPT_CHROM_FILTER);
 cgiMakeTextVar(optString,
-    cartUsualStringClosestToHome(cart, tdb, viewLevel,
+    cartUsualStringClosestToHome(cart, tdb, parentLevel,
 	OPT_CHROM_FILTER, ""), 15);
 
 if (normScoreAvailable)
     scoreCfgUi(db, cart,tdb,prefix,NULL,CHAIN_SCORE_MAXIMUM,FALSE);
 
 cfgEndBox(boxed);
 }
 
 struct dyString *dyAddFilterAsInt(struct cart *cart, struct trackDb *tdb,
        struct dyString *extraWhere,char *filter,char *defaultLimits, char*field, boolean *and)
 /* creates the where clause condition to support numeric int filter range.
    Filters are expected to follow
         {fiterName}: trackDb min or min:max - default value(s);
         {filterName}Min or {filterName}: min (user supplied) cart variable;
         {filterName}Max: max (user supplied) cart variable;
@@ -5523,49 +5523,49 @@
 ||  sameWord("gappedPeak",tdb->type))
     {
     return (trackDbSettingClosestToHome(tdb, SCORE_FILTER )
         ||  trackDbSettingClosestToHome(tdb, SIGNAL_FILTER)
         ||  trackDbSettingClosestToHome(tdb, PVALUE_FILTER)
         ||  trackDbSettingClosestToHome(tdb, QVALUE_FILTER)
         ||  trackDbSettingClosestToHome(tdb, SCORE_FILTER ));
     }
     return FALSE;
 }
 
 
 void encodePeakCfgUi(struct cart *cart, struct trackDb *tdb, char *name, char *title, boolean boxed)
 /* Put up UI for filtering wgEnocde peaks based on score, Pval and Qval */
 {
-boolean viewLevel = isNameAtCompositeLevel(tdb,name);
+boolean parentLevel = isNameAtParentLevel(tdb,name);
 boolean opened = FALSE;
-showScoreFilter(cart,tdb,&opened,boxed,viewLevel,name,title,"Minimum Signal value",     SIGNAL_FILTER,TRUE);
-showScoreFilter(cart,tdb,&opened,boxed,viewLevel,name,title,"Minimum P-Value (<code>-log<sub>10</sub></code>)",PVALUE_FILTER,TRUE);
-showScoreFilter(cart,tdb,&opened,boxed,viewLevel,name,title,"Minimum Q-Value (<code>-log<sub>10</sub></code>)",QVALUE_FILTER,TRUE);
+showScoreFilter(cart,tdb,&opened,boxed,parentLevel,name,title,"Minimum Signal value",     SIGNAL_FILTER,TRUE);
+showScoreFilter(cart,tdb,&opened,boxed,parentLevel,name,title,"Minimum P-Value (<code>-log<sub>10</sub></code>)",PVALUE_FILTER,TRUE);
+showScoreFilter(cart,tdb,&opened,boxed,parentLevel,name,title,"Minimum Q-Value (<code>-log<sub>10</sub></code>)",QVALUE_FILTER,TRUE);
 
 char *setting = trackDbSettingClosestToHomeOrDefault(tdb, SCORE_FILTER,NULL);//"0:1000");
 if(setting)
     {
     if(!opened)
         {
         boxed = cfgBeginBoxAndTitle(tdb, boxed, title);
         puts("<TABLE>");
         opened = TRUE;
         }
     char varName[256];
     int minLimit=0,maxLimit=1000,minVal=0,maxVal=NO_VALUE;
     colonPairToInts(setting,&minVal,&maxVal);
-    getScoreIntRangeFromCart(cart,tdb,viewLevel,SCORE_FILTER,&minLimit,&maxLimit,&minVal,&maxVal);
+    getScoreIntRangeFromCart(cart,tdb,parentLevel,SCORE_FILTER,&minLimit,&maxLimit,&minVal,&maxVal);
     if(maxVal != NO_VALUE)
         puts("<TR><TD align='right'><B>Score range: min:</B><TD align='left'>");
     else
         puts("<TR><TD align='right'><B>Minimum score:</B><TD align='left'>");
     safef(varName, sizeof(varName), "%s%s", SCORE_FILTER, _BY_RANGE);
     boolean filterByRange = trackDbSettingClosestToHomeOn(tdb, varName);
     safef(varName, sizeof(varName), "%s.%s%s", name, SCORE_FILTER, (filterByRange?_MIN:""));
     cgiMakeIntVarWithLimits(varName, minVal, "Minimum score", 0, minLimit, maxLimit);
     if(filterByRange)
         {
         if(maxVal == NO_VALUE)
             maxVal = maxLimit;
         puts("<TD align='right'>to<TD align='left'>");
         safef(varName, sizeof(varName), "%s.%s%s", name, SCORE_FILTER,_MAX);
         cgiMakeIntVarWithLimits(varName, maxVal, "Maximum score", 0, minLimit, maxLimit);
@@ -5577,37 +5577,37 @@
         scoreGrayLevelCfgUi(cart, tdb, name, 1000);
         puts("</TR>");
         }
     }
 if(opened)
     {
     puts("</TABLE>");
     cfgEndBox(boxed);
     }
 }
 
 void genePredCfgUi(struct cart *cart, struct trackDb *tdb, char *name, char *title, boolean boxed)
 /* Put up gencode-specific controls */
 {
 char varName[64];
-boolean viewLevel = isNameAtCompositeLevel(tdb,name);
-char *geneLabel = cartUsualStringClosestToHome(cart, tdb,viewLevel, "label", "gene");
+boolean parentLevel = isNameAtParentLevel(tdb,name);
+char *geneLabel = cartUsualStringClosestToHome(cart, tdb,parentLevel, "label", "gene");
 boxed = cfgBeginBoxAndTitle(tdb, boxed, title);
 
 if (sameString(name, "acembly"))
     {
-    char *acemblyClass = cartUsualStringClosestToHome(cart,tdb,viewLevel,"type", acemblyEnumToString(0));
+    char *acemblyClass = cartUsualStringClosestToHome(cart,tdb,parentLevel,"type", acemblyEnumToString(0));
     printf("<p><b>Gene Class: </b>");
     acemblyDropDown("acembly.type", acemblyClass);
     printf("  ");
     }
 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));
@@ -5632,40 +5632,40 @@
 
 filterBy_t *filterBySet = filterBySetGet(tdb,cart,name);
 if(filterBySet != NULL)
     {
     printf("<BR>");
     filterBySetCfgUi(cart,tdb,filterBySet,FALSE);
     filterBySetFree(&filterBySet);
     }
 
 cfgEndBox(boxed);
 }
 
 static boolean isSpeciesOn(struct cart *cart, struct trackDb *tdb, char *species, char *option, int optionSize, boolean defaultState)
 /* check the cart to see if species is turned off or on (default is defaultState) */
 {
-boolean viewLevel = isNameAtCompositeLevel(tdb,option);
+boolean parentLevel = isNameAtParentLevel(tdb,option);
 if (*option == '\0')
     safef(option, optionSize, "%s.%s", tdb->track, species);
 else
     {
     char *suffix = option + strlen(option);
     int suffixSize = optionSize - strlen(option);
     safef(suffix,suffixSize,".%s",species);
     }
-return cartUsualBooleanClosestToHome(cart,tdb, viewLevel, species,defaultState);
+return cartUsualBooleanClosestToHome(cart,tdb, parentLevel, species,defaultState);
 }
 
 char **wigMafGetSpecies(struct cart *cart, struct trackDb *tdb, char *prefix, char *db, struct wigMafSpecies **list, int *groupCt)
 {
 int speciesCt = 0;
 char *speciesGroup   = trackDbSetting(tdb, SPECIES_GROUP_VAR);
 char *speciesUseFile = trackDbSetting(tdb, SPECIES_USE_FILE);
 char *speciesOrder   = trackDbSetting(tdb, SPECIES_ORDER_VAR);
 char sGroup[24];
 //Ochar *groups[20];
 struct wigMafSpecies *wmSpecies, *wmSpeciesList = NULL;
 int group;
 int i;
 #define MAX_SP_SIZE 2000
 #define MAX_GROUPS 20
@@ -5714,31 +5714,31 @@
 slReverse(&wmSpeciesList);
 *list = wmSpeciesList;
 
 return groups;
 }
 
 
 struct wigMafSpecies * wigMafSpeciesTable(struct cart *cart,
     struct trackDb *tdb, char *name, char *db)
 {
 int groupCt;
 #define MAX_SP_SIZE 2000
 char option[MAX_SP_SIZE];
 int group, prevGroup;
 int i,j;
-boolean viewLevel = isNameAtCompositeLevel(tdb,name);
+boolean parentLevel = isNameAtParentLevel(tdb,name);
 
 bool lowerFirstChar = TRUE;
 
 struct wigMafSpecies *wmSpeciesList;
 char **groups = wigMafGetSpecies(cart, tdb, name, db, &wmSpeciesList, &groupCt);
 struct wigMafSpecies *wmSpecies = wmSpeciesList;
 struct slName *speciesList = NULL;
 
 for(; wmSpecies; wmSpecies = wmSpecies->next)
     {
     struct slName *newName = slNameNew(wmSpecies->name);
     slAddHead(&speciesList, newName);
     //printf("%s<BR>\n",speciesList->name);
     }
 slReverse(&speciesList);
@@ -5885,31 +5885,31 @@
         if (chp != NULL)
             {
             *chp = '\0';
             safef(query, sizeof(query),
             "select id from %sMsa where id = 'ss.%s'", trackName, label);
 
             conn = hAllocConn(db);
             sr = sqlGetResult(conn, query);
             row = sqlNextRow(sr);
 
             /* offer it only if the entry is found in current maf data set */
             if (row != NULL)
                 {
                 puts("<TD>");
                cgiMakeCheckBoxWithId(option,cartUsualBooleanClosestToHome(
-                                     cart, tdb, viewLevel,wmSpecies->name, checked),id);
+                                     cart, tdb, parentLevel,wmSpecies->name, checked),id);
                 printf ("%s", label);
                 puts("</TD>");
                 fflush(stdout);
                 lineBreakJustPrinted = FALSE;
                 j++;
                 }
             sqlFreeResult(&sr);
             hFreeConn(&conn);
             }
         }
     else
     	{
     	puts("<TD>");
 	boolean defaultState = TRUE;
 	if (offHash != NULL)
@@ -5927,118 +5927,118 @@
         lineBreakJustPrinted = FALSE;
         j++;
         }
     }
 puts("</TR></TABLE><BR>\n");
 return wmSpeciesList;
 }
 
 void wigMafCfgUi(struct cart *cart, struct trackDb *tdb,char *name, char *title, boolean boxed, char *db)
 /* UI for maf/wiggle track
  * NOTE: calls wigCfgUi */
 {
 bool lowerFirstChar = TRUE;
 int i;
 char option[MAX_SP_SIZE];
-boolean viewLevel = isNameAtCompositeLevel(tdb,name);
+boolean parentLevel = isNameAtParentLevel(tdb,name);
 
 boxed = cfgBeginBoxAndTitle(tdb, boxed, title);
 
 char *defaultCodonSpecies = trackDbSetting(tdb, SPECIES_CODON_DEFAULT);
 char *framesTable = trackDbSetting(tdb, "frames");
 char *firstCase = trackDbSetting(tdb, ITEM_FIRST_CHAR_CASE);
 if (firstCase != NULL)
     {
     if (sameWord(firstCase, "noChange")) lowerFirstChar = FALSE;
     }
 char *treeImage = NULL;
 struct consWiggle *consWig, *consWiggles = wigMafWiggles(db, tdb);
 
 
 boolean isWigMafProt = FALSE;
 
 if (strstr(tdb->type, "wigMafProt")) isWigMafProt = TRUE;
 
 puts("<TABLE><TR><TD VALIGN=\"TOP\">");
 
 if (consWiggles && consWiggles->next)
     {
     /* check for alternate conservation wiggles -- create checkboxes */
     puts("<P STYLE=\"margin-top:10;\"><B>Conservation:</B>" );
     boolean first = TRUE;
     for (consWig = consWiggles; consWig != NULL; consWig = consWig->next)
         {
         char *wigVarSuffix = NULL;
         char *wigVar = wigMafWiggleVar(name, consWig, &wigVarSuffix);
         cgiMakeCheckBox(wigVar,
-                        cartUsualBooleanClosestToHome(cart, tdb, viewLevel, wigVarSuffix, first));
+                        cartUsualBooleanClosestToHome(cart, tdb, parentLevel, wigVarSuffix, first));
         freeMem(wigVar);
         first = FALSE;
         subChar(consWig->uiLabel, '_', ' ');
         printf ("%s&nbsp;", consWig->uiLabel);
         }
     }
 
 struct wigMafSpecies *wmSpeciesList = wigMafSpeciesTable(cart, tdb, name, db);
 struct wigMafSpecies *wmSpecies;
 
 if (isWigMafProt)
     puts("<B>Multiple alignment amino acid-level:</B><BR>" );
 else
     puts("<B>Multiple alignment base-level:</B><BR>" );
 
 safef(option, sizeof option, "%s.%s", name, MAF_DOT_VAR);
-cgiMakeCheckBox(option, cartUsualBooleanClosestToHome(cart, tdb, viewLevel,MAF_DOT_VAR, FALSE));
+cgiMakeCheckBox(option, cartUsualBooleanClosestToHome(cart, tdb, parentLevel,MAF_DOT_VAR, FALSE));
 
 if (isWigMafProt)
     puts("Display amino acids identical to reference as dots<BR>" );
 else
     puts("Display bases identical to reference as dots<BR>" );
 
 safef(option, sizeof option, "%s.%s", name, MAF_CHAIN_VAR);
-cgiMakeCheckBox(option, cartUsualBooleanClosestToHome(cart, tdb, viewLevel, MAF_CHAIN_VAR, TRUE));
+cgiMakeCheckBox(option, cartUsualBooleanClosestToHome(cart, tdb, parentLevel, MAF_CHAIN_VAR, TRUE));
 
 char *irowStr = trackDbSetting(tdb, "irows");
 boolean doIrows = (irowStr == NULL) || !sameString(irowStr, "off");
 if (isCustomTrack(tdb->track) || doIrows)
     puts("Display chains between alignments<BR>");
 else
     {
     if (isWigMafProt)
 	puts("Display unaligned amino acids with spanning chain as 'o's<BR>");
     else
 	puts("Display unaligned bases with spanning chain as 'o's<BR>");
     }
 
 safef(option, sizeof option, "%s.%s", name, "codons");
 if (framesTable)
     {
     char *nodeNames[512];
     char buffer[128];
 
     printf("<BR><B>Codon Translation:</B><BR>");
     printf("Default species to establish reading frame: ");
     nodeNames[0] = db;
     for (wmSpecies = wmSpeciesList, i = 1; wmSpecies != NULL;
 			wmSpecies = wmSpecies->next, i++)
 	{
 	nodeNames[i] = wmSpecies->name;
 	}
     cgiMakeDropList(SPECIES_CODON_DEFAULT, nodeNames, i,
 	cartUsualString(cart, SPECIES_CODON_DEFAULT, defaultCodonSpecies)); // tdb independent var
     puts("<br>");
-    char *cartVal = cartUsualStringClosestToHome(cart, tdb, viewLevel, "codons","codonDefault");
+    char *cartVal = cartUsualStringClosestToHome(cart, tdb, parentLevel, "codons","codonDefault");
     safef(buffer, sizeof(buffer), "%s.codons",name);
     cgiMakeRadioButton(buffer,"codonNone",     sameWord(cartVal,"codonNone"));
     printf("No codon translation<BR>");
     cgiMakeRadioButton(buffer,"codonDefault",  sameWord(cartVal,"codonDefault"));
     printf("Use default species reading frames for translation<BR>");
     cgiMakeRadioButton(buffer,"codonFrameNone",sameWord(cartVal,"codonFrameNone"));
     printf("Use reading frames for species if available, otherwise no translation<BR>");
     cgiMakeRadioButton(buffer,"codonFrameDef", sameWord(cartVal,"codonFrameDef"));
     printf("Use reading frames for species if available, otherwise use default species<BR>");
     }
 else
     {
     /* Codon highlighting does not apply to wigMafProt type */
     if (!strstr(tdb->type, "wigMafProt"))
 	{
@@ -7503,33 +7503,33 @@
     else
         name = cloneString(rootName);
     }
 else
     name = cloneString(tdb->track);
 return name;
 }
 
 void compositeViewControlNameFree(char **name)
 /* frees a string allocated by compositeViewControlNameFromTdb */
 {
 if(name && *name)
     freez(name);
 }
 
-boolean isNameAtCompositeLevel(struct trackDb *tdb,char *name)
-/* cfgUi controls are passed a prefix name that may be at the composite or at the subtrack level
-   returns TRUE for composite level name */
+boolean isNameAtParentLevel(struct trackDb *tdb,char *name)
+// cfgUi controls are passed a prefix name that may be at the composite, view or subtrack level
+// returns TRUE if name at view or composite level
 {
 struct trackDb *parent;
 for (parent = tdb->parent; parent != NULL; parent = parent->parent)
     if (startsWithWordByDelimiter(parent->track, '.', name))
         return TRUE;
 return FALSE;
 }
 
 boolean chainDbNormScoreAvailable(struct trackDb *tdb)
 /*	check if normScore column is specified in trackDb as available */
 {
 boolean normScoreAvailable = FALSE;
 char * normScoreTest =
      trackDbSettingClosestToHomeOrDefault(tdb, "chainNormScoreAvailable", "no");
 if (differentWord(normScoreTest, "no"))