Index: src/hg/hgTracks/hgTracks.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/hgTracks.c,v
retrieving revision 1.1646
retrieving revision 1.1647
diff -b -B -U 4 -r1.1646 -r1.1647
--- src/hg/hgTracks/hgTracks.c	7 May 2010 05:07:57 -0000	1.1646
+++ src/hg/hgTracks/hgTracks.c	11 May 2010 01:43:27 -0000	1.1647
@@ -119,9 +119,9 @@
 {
 struct track *track;
 for (track = tracks; track != NULL; track = track->next)
     {
-    if (sameString(track->mapName, trackName))
+    if (sameString(track->track, trackName))
         return track;
     else if (track->subtracks != NULL)
         {
         struct track *st = trackFindByName(track->subtracks, trackName);
@@ -203,40 +203,40 @@
         if (changeVis == -1)
                 {
                 if(tdbIsComposite(tdb))
                     {
-                    safef(pname, sizeof(pname),"%s.*",track->mapName); //to remove all settings associated with this composite!
+                    safef(pname, sizeof(pname),"%s.*",track->track); //to remove all settings associated with this composite!
                     cartRemoveLike(cart,pname);
                     struct track *subTrack;
                     for(subTrack = track->subtracks;subTrack != NULL; subTrack = subTrack->next)
                         {
                         subTrack->visibility = tdb->visibility;
-                        cartRemove(cart, subTrack->mapName);
+                        cartRemove(cart, subTrack->track);
                         }
                     }
 
                 /* restore defaults */
                 if (tdbIsSuperTrackChild(tdb) || tdbIsCompositeChild(tdb))
                     {
-                    assert(tdb->parent != NULL && tdb->parent->tableName);
-                    cartRemove(cart, tdb->parent->tableName);
+                    assert(tdb->parent != NULL && tdb->parent->track);
+                    cartRemove(cart, tdb->parent->track);
                     #ifndef IMAGEv2_DRAG_REORDER
                     if (withPriorityOverride)
                         {
-                        safef(pname, sizeof(pname), "%s.priority",tdb->parent->tableName);
+                        safef(pname, sizeof(pname), "%s.priority",tdb->parent->track);
                         cartRemove(cart, pname);
                         }
                     #endif//ndef IMAGEv2_DRAG_REORDER
                     }
 
                 track->visibility = tdb->visibility;
-                cartRemove(cart, track->mapName);
+                cartRemove(cart, track->track);
 
                 /* set the track priority back to the default value */
                 #ifndef IMAGEv2_DRAG_REORDER
                 if (withPriorityOverride)
                     {
-                    safef(pname, sizeof(pname), "%s.priority",track->mapName);
+                    safef(pname, sizeof(pname), "%s.priority",track->track);
                     cartRemove(cart, pname);
                     track->priority = track->defaultPriority;
                     }
                 #endif//ndef IMAGEv2_DRAG_REORDER
@@ -252,22 +252,22 @@
                     if ((changeVis == tvHide && !parentTdb->isShow) ||
                         (changeVis != tvHide && parentTdb->isShow))
                         {
                         /* remove if setting to default vis */
-                        cartRemove(cart, parentTdb->tableName);
+                        cartRemove(cart, parentTdb->track);
                         }
                     else
-                        cartSetString(cart, parentTdb->tableName,
+                        cartSetString(cart, parentTdb->track,
                                     changeVis == tvHide ? "hide" : "show");
                     }
                 else
                     {
                     /* regular track */
                     if (changeVis == tdb->visibility)
                         /* remove if setting to default vis */
-                        cartRemove(cart, track->mapName);
+                        cartRemove(cart, track->track);
                     else
-                        cartSetString(cart, track->mapName,
+                        cartSetString(cart, track->track,
                                                 hStringFromTv(changeVis));
                     track->visibility = changeVis;
                     }
                 }
@@ -340,10 +340,10 @@
     }
 }
 
 char *trackUrl(char *mapName, char *chromName)
-{
 /* Return hgTrackUi url; chromName is optional. */
+{
 char *encodedMapName = cgiEncode(mapName);
 char buf[2048];
 if(chromName == NULL)
     safef(buf, sizeof(buf), "%s?%s=%u&g=%s", hgTrackUiName(), cartSessionVarName(), cartSessionId(cart), encodedMapName);
@@ -468,11 +468,11 @@
 {
 struct track *track;
 for(track = trackList; track != NULL; track = track->next)
     {
-    if(sameString(track->mapName, "cytoBandIdeo"))
+    if(sameString(track->track, "cytoBandIdeo"))
 	{
-	if (hTableExists(database, track->mapName))
+	if (hTableExists(database, track->table))
 	    return track;
 	else
 	    return NULL;
 	}
@@ -848,9 +848,10 @@
 /* Make track of user pasted sequence. */
 {
 struct track *tg = linkedFeaturesTg();
 struct trackDb *tdb;
-tg->mapName = "hgUserPsl";
+tg->track = "hgUserPsl";
+tg->table = tg->track;
 tg->canPack = TRUE;
 tg->visibility = tvPack;
 tg->longLabel = "Your Sequence from Blat Search";
 tg->shortLabel = "Blat Sequence";
@@ -863,9 +864,10 @@
 tg->exonArrows = TRUE;
 
 /* better to create the tdb first, then use trackFromTrackDb */
 AllocVar(tdb);
-tdb->tableName = cloneString(tg->mapName);
+tdb->track = cloneString(tg->track);
+tdb->table = cloneString(tg->table);
 tdb->visibility = tg->visibility;
 tdb->shortLabel = cloneString(tg->shortLabel);
 tdb->longLabel = cloneString(tg->longLabel);
 tdb->grp = cloneString(tg->groupName);
@@ -1005,9 +1007,10 @@
     }
 touppers(medOligo);
 
 bedMethods(tg);
-tg->mapName = "oligoMatch";
+tg->track = "oligoMatch";
+tg->table = tg->track;
 tg->canPack = TRUE;
 tg->visibility = tvHide;
 tg->hasUi = TRUE;
 tg->shortLabel = cloneString(OLIGO_MATCH_TRACK_LABEL);
@@ -1022,9 +1025,10 @@
 tg->groupName = "map";
 tg->defaultGroupName = cloneString(tg->groupName);
 
 AllocVar(tdb);
-tdb->tableName = cloneString(tg->mapName);
+tdb->track = cloneString(tg->track);
+tdb->table = cloneString(tg->table);
 tdb->visibility = tg->visibility;
 tdb->shortLabel = cloneString(tg->shortLabel);
 tdb->longLabel = cloneString(tg->longLabel);
 tdb->grp = cloneString(tg->groupName);
@@ -1075,21 +1079,21 @@
 else
     hvGfxSetClip(hvg, leftLabelX, y, leftLabelWidth, tHeight);
 
 minRange = 0.0;
-safef( o4, sizeof(o4),"%s.min.cutoff", track->mapName);
-safef( o5, sizeof(o5),"%s.max.cutoff", track->mapName);
+safef( o4, sizeof(o4),"%s.min.cutoff", track->track);
+safef( o5, sizeof(o5),"%s.max.cutoff", track->track);
 minRangeCutoff = max( atof(cartUsualString(cart,o4,"0.0"))-0.1,
                                 track->minRange );
 maxRangeCutoff = min( atof(cartUsualString(cart,o5,"1000.0"))+0.1,
                                 track->maxRange);
-if( sameString( track->mapName, "humMusL" ) ||
-    sameString( track->mapName, "musHumL" ) ||
-    sameString( track->mapName, "mm3Rn2L" ) ||
-    sameString( track->mapName, "hg15Mm3L" ) ||
-    sameString( track->mapName, "mm3Hg15L" ) ||
-    sameString( track->mapName, "regpotent" ) ||
-    sameString( track->mapName, "HMRConservation" )  )
+if( sameString( track->table, "humMusL" ) ||
+    sameString( track->table, "musHumL" ) ||
+    sameString( track->table, "mm3Rn2L" ) ||
+    sameString( track->table, "hg15Mm3L" ) ||
+    sameString( track->table, "mm3Hg15L" ) ||
+    sameString( track->table, "regpotent" ) ||
+    sameString( track->table, "HMRConservation" )  )
     {
     int binCount = round(1.0/track->scaleRange);
     minRange = whichSampleBin( minRangeCutoff, track->minRange, track->maxRange, binCount );
     maxRange = whichSampleBin( maxRangeCutoff, track->minRange, track->maxRange ,binCount );
@@ -1171,17 +1175,17 @@
                 prev = item;
 
                 rootName = cloneString( name );
                 beforeFirstPeriod( rootName );
-                if( sameString( track->mapName, "humMusL" ) ||
-                         sameString( track->mapName, "hg15Mm3L" ))
+                if( sameString( track->table, "humMusL" ) ||
+                         sameString( track->table, "hg15Mm3L" ))
                     hvGfxTextRight(hvg, leftLabelX, y, leftLabelWidth - 1,
                              itemHeight, track->ixColor, font, "Mouse Cons");
-                else if( sameString( track->mapName, "musHumL" ) ||
-                         sameString( track->mapName, "mm3Hg15L"))
+                else if( sameString( track->table, "musHumL" ) ||
+                         sameString( track->table, "mm3Hg15L"))
                     hvGfxTextRight(hvg, leftLabelX, y, leftLabelWidth - 1,
                                 itemHeight, track->ixColor, font, "Human Cons");
-                else if( sameString( track->mapName, "mm3Rn2L" ))
+                else if( sameString( track->table, "mm3Rn2L" ))
                     hvGfxTextRight(hvg, leftLabelX, y, leftLabelWidth - 1,
                                 itemHeight, track->ixColor, font, "Rat Cons");
                 else
                     hvGfxTextRight(hvg, leftLabelX, y, leftLabelWidth - 1,
@@ -1258,14 +1262,14 @@
 Color fillColor = lightGrayIndex();
 labelColor = blackIndex();
 hvGfxNextItemButton(hvg, rightButtonX + NEXT_ITEM_ARROW_BUFFER, y, arrowWidth, arrowWidth, labelColor, fillColor, TRUE);
 hvGfxNextItemButton(hvg, insideX + NEXT_ITEM_ARROW_BUFFER, y, arrowWidth, arrowWidth, labelColor, fillColor, FALSE);
-safef(buttonText, ArraySize(buttonText), "hgt.prevItem=%s", track->mapName);
+safef(buttonText, ArraySize(buttonText), "hgt.prevItem=%s", track->track);
 mapBoxReinvoke(hvg, insideX, y + 1, arrowButtonWidth, insideHeight, NULL,
            NULL, 0, 0, (revCmplDisp ? "Next item" : "Prev item"), buttonText);
 mapBoxToggleVis(hvg, insideX + arrowButtonWidth, y + 1, insideWidth - (2 * arrowButtonWidth),
                 insideHeight, (theImgBox ? track : parentTrack));
-safef(buttonText, ArraySize(buttonText), "hgt.nextItem=%s", track->mapName);
+safef(buttonText, ArraySize(buttonText), "hgt.nextItem=%s", track->track);
 mapBoxReinvoke(hvg, insideX + insideWidth - arrowButtonWidth, y + 1, arrowButtonWidth, insideHeight, NULL,
            NULL, 0, 0, (revCmplDisp ? "Prev item" : "Next item"), buttonText);
 }
 
@@ -1357,9 +1361,9 @@
      y += track->lineHeight;
 
 /* override doMapItems for hapmapLd track */
 /* does not scale with subtracks right now, so this is commented out until it can be fixed
-if (startsWith("hapmapLd",track->mapName))
+if (startsWith("hapmapLd",track->table))
     {
     y += round((double)(scaleForPixels(insideWidth)*insideWidth/2));
     return y;
     }
@@ -1550,14 +1554,14 @@
     if (subgroupFind(tdb,"view",&viewName))
 	{
 	struct trackDb *parent = trackDbCompositeParent(tdb);
 	assert(parent != NULL);
-        int len = strlen(parent->tableName) + strlen(viewName) + 10;
+        int len = strlen(parent->track) + strlen(viewName) + 10;
 
 	// Create the view dropdown var name.  This needs to have the view name surrounded by dots
 	// in the middle for the javascript to work.
 	char ddName[len];
-        safef(ddName,len,"%s.%s.vis", parent->tableName,viewName);
+        safef(ddName,len,"%s.%s.vis", parent->track,viewName);
         char * fromParent = cartOptionalString(cart, ddName);
         if(fromParent)
             vis = hTvFromString(fromParent);
         else
@@ -1799,9 +1803,9 @@
 {
 struct track *track;
 for (track = trackList; track != NULL; track = track->next)
     {
-    hashAddUnique(trackHash, track->mapName, track);
+    hashAddUnique(trackHash, track->track, track);
     rAddToTrackHash(trackHash, track->subtracks);
     }
 }
 
@@ -2093,9 +2097,9 @@
             #ifdef FLAT_TRACK_LIST
             int order = flatTrack->order;
             #else//ifndef FLAT_TRACK_LIST
             char var[256];
-            safef(var,sizeof(var),"%s_%s",track->tdb->tableName,IMG_ORDER_VAR);
+            safef(var,sizeof(var),"%s_%s",track->tdb->track,IMG_ORDER_VAR);
             int order = cartUsualInt(cart, var,IMG_ANYORDER);
             #endif//ndef FLAT_TRACK_LIST
             curImgTrack = imgBoxTrackFindOrAdd(theImgBox,track->tdb,NULL,track->limitedVis,isWithCenterLabels(track),order);
             }
@@ -2175,12 +2179,12 @@
                 if(tdbIsCompositeChild(track->tdb))
 		    {
 		    struct trackDb *parent = trackDbCompositeParent(track->tdb);
                     mapBoxTrackUi(hvgSide, trackTabX, yStart, trackTabWidth, (yEnd - yStart - 1),
-		    	parent->tableName, parent->shortLabel, track->mapName);
+		    	parent->track, parent->shortLabel, track->track);
 		    }
                 else
-                    mapBoxTrackUi(hvgSide, trackTabX, yStart, trackTabWidth, h, track->mapName, track->shortLabel, track->mapName);
+                    mapBoxTrackUi(hvgSide, trackTabX, yStart, trackTabWidth, h, track->track, track->shortLabel, track->track);
                 }
             }
         }
     butOff = trackTabX + trackTabWidth;
@@ -2275,9 +2279,9 @@
             sliceHeight      = trackPlusLabelHeight(track, fontHeight);
             sliceOffsetY     = y;
             curImgTrack = imgBoxTrackFind(theImgBox,track->tdb,NULL);
             curSlice    = imgTrackSliceUpdateOrAdd(curImgTrack,stSide,theSideImg,NULL,sliceWidth[stSide],sliceHeight,sliceOffsetX[stSide],sliceOffsetY);
-            curMap      = sliceMapFindOrStart(curSlice,track->tdb->tableName,NULL); // No common linkRoot
+            curMap      = sliceMapFindOrStart(curSlice,track->tdb->track,NULL); // No common linkRoot
             }
 #ifndef FLAT_TRACK_LIST
         if (trackIsCompositeWithSubtracks(track))
             {
@@ -2375,9 +2379,9 @@
             sliceHeight      = fontHeight;
             sliceOffsetY     = y;
             curImgTrack = imgBoxTrackFind(theImgBox,track->tdb,NULL);
             curSlice    = imgTrackSliceUpdateOrAdd(curImgTrack,stCenter,theOneImg,NULL,sliceWidth[stData],sliceHeight,sliceOffsetX[stData],sliceOffsetY);
-            curMap      = sliceMapFindOrStart(curSlice,track->tdb->tableName,NULL); // No common linkRoot
+            curMap      = sliceMapFindOrStart(curSlice,track->tdb->track,NULL); // No common linkRoot
             }
 #ifndef FLAT_TRACK_LIST
         if (trackIsCompositeWithSubtracks(track))  //TODO: Change when tracks->subtracks are always set for composite
             {
@@ -2388,9 +2392,9 @@
                 // Special case: data slice of tracks
                 sliceHeight      = trackPlusLabelHeight(track, fontHeight) - fontHeight;
                 sliceOffsetY     = y;
                 curSlice    = imgTrackSliceUpdateOrAdd(curImgTrack,stData,theOneImg,NULL,sliceWidth[stData],sliceHeight,sliceOffsetX[stData],sliceOffsetY);
-                curMap      = sliceMapFindOrStart(curSlice,track->tdb->tableName,NULL); // No common linkRoot
+                curMap      = sliceMapFindOrStart(curSlice,track->tdb->track,NULL); // No common linkRoot
                 }
             struct track *subtrack;
             for (subtrack = track->subtracks; subtrack != NULL; subtrack = subtrack->next)
                 {
@@ -2438,9 +2442,9 @@
             curImgTrack = imgBoxTrackFind(theImgBox,track->tdb,NULL);
             if(sliceHeight > 0)
                 {
                 curSlice    = imgTrackSliceUpdateOrAdd(curImgTrack,stData,theOneImg,NULL,sliceWidth[stData],sliceHeight,sliceOffsetX[stData],sliceOffsetY);
-                curMap      = sliceMapFindOrStart(curSlice,track->tdb->tableName,NULL); // No common linkRoot
+                curMap      = sliceMapFindOrStart(curSlice,track->tdb->track,NULL); // No common linkRoot
                 }
             }
 #ifndef FLAT_TRACK_LIST
         if (trackIsCompositeWithSubtracks(track))  //TODO: Change when tracks->subtracks are always set for composite
@@ -2490,9 +2494,9 @@
             sliceHeight      = trackPlusLabelHeight(track, fontHeight);
             sliceOffsetY     = y;
             curImgTrack = imgBoxTrackFind(theImgBox,track->tdb,NULL);
             curSlice    = imgTrackSliceUpdateOrAdd(curImgTrack,stSide,theSideImg,NULL,sliceWidth[stSide],sliceHeight,sliceOffsetX[stSide],sliceOffsetY);
-            curMap      = sliceMapFindOrStart(curSlice,track->tdb->tableName,NULL); // No common linkRoot
+            curMap      = sliceMapFindOrStart(curSlice,track->tdb->track,NULL); // No common linkRoot
             }
 #ifndef FLAT_TRACK_LIST
         if (trackIsCompositeWithSubtracks(track))  //TODO: Change when tracks->subtracks are always set for composite
             {
@@ -2663,30 +2667,30 @@
 /* function. */
 for (hel = hels; hel != NULL; hel = hel->next)
     {
     struct trackDb *subtrack;
-    char *table = hel->val;
+    char *subtrackName = hel->val;
     /* check non-subtrack. */
-    if (sameString(track->tdb->tableName, table))
+    if (sameString(track->tdb->track, subtrackName))
 	{
 	track->visibility = tvFull;
 	track->tdb->visibility = tvFull;
-	cartSetString(cart, track->tdb->tableName, "full");
+	cartSetString(cart, track->tdb->track, "full");
 	}
     else if (track->tdb->subtracks != NULL)
 	{
 	struct slRef *tdbRef, *tdbRefList = trackDbListGetRefsToDescendants(track->tdb->subtracks);
 	for (tdbRef = tdbRefList; tdbRef != NULL; tdbRef = tdbRef->next)
 	    {
 	    subtrack = tdbRef->val;
-	    if (sameString(subtrack->tableName, table))
+	    if (sameString(subtrack->track, subtrackName))
 		{
 		char selName[SMALLBUF];
 		track->visibility = tvFull;
-		cartSetString(cart, track->tdb->tableName, "full");
+		cartSetString(cart, track->tdb->track, "full");
 		track->tdb->visibility = tvFull;
 		subtrack->visibility = tvFull;
-		safef(selName, sizeof(selName), "%s_sel", table);
+		safef(selName, sizeof(selName), "%s_sel", subtrackName);
 		cartSetBoolean(cart, selName, TRUE);
 		}
 	    }
 	slFreeList(&tdbRefList);
@@ -2724,9 +2728,9 @@
 tdbSortPrioritiesFromCart(cart, &tdbList);
 for (tdb = tdbList; tdb != NULL; tdb = next)
     {
     next = tdb->next;
-    if(trackNameFilter != NULL && strcmp(trackNameFilter, tdb->tableName))
+    if(trackNameFilter != NULL && strcmp(trackNameFilter, tdb->track))
         // suppress loading & display of all tracks except for the one passed in via trackNameFilter
         continue;
     track = trackFromTrackDb(tdb);
     track->hasUi = TRUE;
@@ -2739,29 +2743,29 @@
 	    makeContainerTrack(track, tdb);
         }
     else
         {
-        handler = lookupTrackHandler(tdb->tableName);
+        handler = lookupTrackHandler(tdb->table);
         if (handler != NULL)
             handler(track);
         }
     if (cgiVarExists("hgGenomeClick"))
 	makeHgGenomeTrackVisible(track);
     if (track->loadItems == NULL)
-        warn("No load handler for %s; possible missing trackDb `type' or `subTrack' attribute", tdb->tableName);
+        warn("No load handler for %s; possible missing trackDb `type' or `subTrack' attribute", tdb->track);
     else if (track->drawItems == NULL)
-        warn("No draw handler for %s", tdb->tableName);
+        warn("No draw handler for %s", tdb->track);
     else
         slAddHead(pTrackList, track);
     }
 }
 
-static int getScoreFilter(char *tableName)
+static int getScoreFilter(char *trackName)
 /* check for score filter configuration setting */
 {
 char optionScoreStr[256];
 
-safef(optionScoreStr, sizeof(optionScoreStr), "%s.scoreFilter", tableName);
+safef(optionScoreStr, sizeof(optionScoreStr), "%s.scoreFilter", trackName);
 return cartUsualInt(cart, optionScoreStr, 0);
 }
 
 void ctLoadSimpleBed(struct track *tg)
@@ -2769,9 +2773,9 @@
  * window... */
 {
 struct customTrack *ct = tg->customPt;
 struct bed *bed, *nextBed, *list = NULL;
-int scoreFilter = getScoreFilter(ct->tdb->tableName);
+int scoreFilter = getScoreFilter(ct->tdb->track);
 
 if (ct->dbTrack)
     {
     int fieldCount = ct->fieldCount;
@@ -2816,9 +2820,9 @@
 struct customTrack *ct = tg->customPt;
 struct bed *bed;
 struct linkedFeatures *lfList = NULL, *lf;
 boolean useItemRgb = FALSE;
-int scoreFilter = getScoreFilter(ct->tdb->tableName);
+int scoreFilter = getScoreFilter(ct->tdb->track);
 
 useItemRgb = bedItemRgb(ct->tdb);
 
 if (ct->dbTrack)
@@ -2877,9 +2881,9 @@
 {
 struct customTrack *ct = tg->customPt;
 struct bed *bed;
 struct linkedFeatures *lfList = NULL, *lf;
-int scoreFilter = getScoreFilter(ct->tdb->tableName);
+int scoreFilter = getScoreFilter(ct->tdb->track);
 
 if (ct->dbTrack)
     {
     int fieldCount = ct->fieldCount;
@@ -2927,9 +2931,9 @@
 struct customTrack *ct = tg->customPt;
 struct bed *bed;
 struct linkedFeatures *lfList = NULL, *lf;
 boolean useItemRgb = FALSE;
-int scoreFilter = getScoreFilter(ct->tdb->tableName);
+int scoreFilter = getScoreFilter(ct->tdb->track);
 
 useItemRgb = bedItemRgb(ct->tdb);
 
 if (ct->dbTrack)
@@ -3299,15 +3303,15 @@
 		    struct track *tg;
 		    boolean toAll = sameWord(s, "all");
 		    for (tg = *pGroupList; tg != NULL; tg = tg->next)
 			{
-			if (toAll || sameString(s, tg->mapName))
+			if (toAll || sameString(s, tg->track))
 			    {
 			    if (hTvFromString(command) == tg->tdb->visibility)
 				/* remove if setting to default vis */
-				cartRemove(cart, tg->mapName);
+				cartRemove(cart, tg->track);
 			    else
-				cartSetString(cart, tg->mapName, command);
+				cartSetString(cart, tg->track, command);
 			    /* hide or show supertrack enclosing this track */
 			    if (tdbIsSuperTrackChild(tg->tdb))
 				{
 				assert(tg->tdb->parentName != NULL);
@@ -3791,9 +3795,9 @@
             }
         else
             {
             /* get group */
-            safef(cartVar, sizeof(cartVar), "%s.group",track->mapName);
+            safef(cartVar, sizeof(cartVar), "%s.group",track->track);
             groupName = cloneString(                                              //1
                     cartUsualString(cart, cartVar, track->defaultGroupName));
             }
         if (vis == -1)
@@ -3802,9 +3806,9 @@
         if (sameString(groupName, track->defaultGroupName))
             cartRemove(cart, cartVar);
 
         /* get priority */
-        safef(cartVar, sizeof(cartVar), "%s.priority",track->mapName);
+        safef(cartVar, sizeof(cartVar), "%s.priority",track->track);
         float priority = (float)cartUsualDouble(cart, cartVar,
                                                     track->defaultPriority);
         /* remove cart variables that are the same as the trackDb settings */
 /*  UGLY - add me back when tdb->priority is no longer pre-clobbered by cart var value
@@ -3874,9 +3878,9 @@
     slAddHead(&newList, ref);
     if (tdbIsSuperTrackChild(track->tdb))
         {
         assert(track->tdb->parentName != NULL);
-        if (hTvFromString(cartUsualString(cart, track->mapName,
+        if (hTvFromString(cartUsualString(cart, track->track,
                         hStringFromTv(track->tdb->visibility))) != tvHide)
             setSuperTrackHasVisibleMembers(track->tdb->parent);
         if (hashLookup(superHash, track->tdb->parentName))
             /* ignore supertrack if it's already been handled */
@@ -3942,9 +3946,9 @@
 {
 if(tdbIsSuperTrackChild(track->tdb))
     {
     assert(track->tdb->parent != NULL);
-    if (sameString("hide", cartUsualString(cart, track->tdb->parent->tableName,
+    if (sameString("hide", cartUsualString(cart, track->tdb->parent->track,
                                     track->tdb->parent->isShow ? "show" : "hide")))
         track->visibility = tvHide;
     }
 }
@@ -3977,15 +3981,15 @@
 
 /* Get visibility values if any from ui. */
 for (track = trackList; track != NULL; track = track->next)
     {
-    char *s = cartOptionalString(cart, track->mapName);
+    char *s = cartOptionalString(cart, track->track);
     if (cgiOptionalString("hideTracks"))
 	{
-	s = cgiOptionalString(track->mapName);
+	s = cgiOptionalString(track->track);
 	if (s != NULL && (hTvFromString(s) != track->tdb->visibility))
 	    {
-	    cartSetString(cart, track->mapName, s);
+	    cartSetString(cart, track->track, s);
 	    }
 	}
     if (s != NULL)
 	track->visibility = hTvFromString(s);
@@ -3993,9 +3997,9 @@
 	{
 	struct trackDb *parent = track->tdb->parent;
 	char *parentShow = NULL;
 	if (parent)
-	    parentShow = cartUsualString(cart, parent->tableName,
+	    parentShow = cartUsualString(cart, parent->track,
 			 parent->isShow ? "show" : "hide");
 	if (!parent || sameString(parentShow, "show"))
 	    compositeTrackVis(track);
 	}
@@ -4092,11 +4096,11 @@
 if (measureTiming)
     uglyTime("Done with trackForm");
 for (track = trackList; track != NULL; track = track->next)
     {
-    char *cartVis = cartOptionalString(cart, track->mapName);
+    char *cartVis = cartOptionalString(cart, track->track);
     if (cartVis != NULL && hTvFromString(cartVis) == track->tdb->visibility)
-    cartRemove(cart, track->mapName);
+    cartRemove(cart, track->track);
     }
 if (measureTiming)
     {
     uglyTime("Pruned redundant vis from cart");
@@ -4177,11 +4181,11 @@
 {
 // add entry for given track to the trackDbJson string
 if(count)
     dyStringAppend(trackDbJson, "\n,");
-dyStringPrintf(trackDbJson, "\t%s: {", track->mapName);
+dyStringPrintf(trackDbJson, "\t%s: {", track->track);
 if(tdbIsSuperTrackChild(track->tdb) || tdbIsCompositeChild(track->tdb))
-    dyStringPrintf(trackDbJson, "\n\t\tparentTrack: '%s',", track->tdb->parent->tableName);
+    dyStringPrintf(trackDbJson, "\n\t\tparentTrack: '%s',", track->tdb->parent->track);
 dyStringPrintf(trackDbJson, "\n\t\tshortLabel: '%s',\n\t\tlongLabel: '%s',\n\t\tcanPack: %d,\n\t\tvisibility: %d\n\t}",
                javaScriptLiteralEncode(track->shortLabel), javaScriptLiteralEncode(track->longLabel), track->canPack, track->limitedVis);
 }
 
@@ -4196,9 +4200,9 @@
 struct track *track;
 for (track = trackList; track != NULL; track = track->next)
     {
     if (startsWithWord("makeItems", track->tdb->type) )
-        hPrintf("setUpMakeItemsDrag(\"%s\");\n", track->mapName);
+        hPrintf("setUpMakeItemsDrag(\"%s\");\n", track->track);
     }
 
 hPrintf( "}\n");
 hPrintf("</script>\n");
@@ -4770,9 +4774,9 @@
 		    continue;
 		myControlGridStartCell(cg, isOpen, group->name);
 		if (track->hasUi)
 		    {
-		    char *url = trackUrl(track->mapName, chromName);
+		    char *url = trackUrl(track->track, chromName);
 		    char *longLabel = replaceChars(track->longLabel, "\"", "&quot;");
 		    if(trackDbSetting(track->tdb, "wgEncode") != NULL)
 			hPrintf("<a title='encode project' href='../ENCODE'><img height='16' width='16' src='../images/encodeThumbnail.jpg'></a>\n");
 		    hPrintf("<A HREF=\"%s\" title=\"%s\">", url, longLabel);
@@ -4793,9 +4797,9 @@
 					    superTrackHasVisibleMembers(track->tdb));
 		    else
 			{
 			/* check for option of limiting visibility to one mode */
-			hTvDropDownClassVisOnly(track->mapName, track->visibility,
+			hTvDropDownClassVisOnly(track->track, track->visibility,
 				    track->canPack, (track->visibility == tvHide) ?
 				    "hiddenText" : "normalText",
 				    trackDbSetting(track->tdb, "onlyVisibility"));
 			}

