c2c65344c6ae672dbc05e7920049803c3fe29874
tdreszer
  Thu Sep 16 12:29:34 2010 -0700
Fixed tdbVisLimitedByAncestry which caused supertrack contained and visibble tracks to appear hidden in findTracks.  Added composite/view vis reshaping based upon subtrack specific vis.
diff --git src/hg/lib/trackDbCustom.c src/hg/lib/trackDbCustom.c
index 5b6833c..25688ed 100644
--- src/hg/lib/trackDbCustom.c
+++ src/hg/lib/trackDbCustom.c
@@ -694,8 +694,39 @@
 return tdb;
 }
 
+#ifdef OMIT
+// NOTE: This may not be needed.
+struct trackDb *tdbFillInAncestry(char *db,struct trackDb *tdbChild)
+/* Finds parents and fills them in.  Does not find siblings, however! */
+{
+assert(tdbChild != NULL);
+struct trackDb *tdb = tdbChild;
+struct sqlConnection *conn = NULL;
+for (;tdb->parent != NULL;tdb = tdb->parent)
+    ; // advance to highest parent already known
+
+// If track with no tdbParent has a parent setting then fill it in.
+for (;tdb->parent == NULL; tdb = tdb->parent)
+    {
+    char *parentTrack = trackDbLocalSetting(tdb,"parent");
+    if (parentTrack == NULL)
+        break;
+
+    if (conn == NULL)
+        conn = hAllocConn(db);
+    tdb->parent = hMaybeTrackInfo(conn, parentTrack); // Now there are 2 versions of this child!  And what to do about views?
+    printf("tdbFillInAncestry(%s): has %d children.",parentTrack,slCount(tdb->parent->subtracks));
+    //tdb->parent = tdbFindOrCreate(db,tdb,parentTrack); // Now there are 2 versions of this child!  And what to do about views?
+    }
+if (conn != NULL)
+    hFreeConn(&conn);
+
+return tdb;
+}
+#endif///def OMIT
+
 void tdbExtrasAddOrUpdate(struct trackDb *tdb,char *name,void *value)
-/* Adds some "extra" nformation to the extras hash.  Creates hash if necessary. */
+/* Adds some "extra" information to the extras hash.  Creates hash if necessary. */
 {
 if(tdb->extras == NULL)
     {
@@ -708,6 +739,13 @@
     }
 }
 
+void tdbExtrasRemove(struct trackDb *tdb,char *name)
+/* Removes a value from the extras hash. */
+{
+if(tdb->extras != NULL)
+    hashMayRemove(tdb->extras, name);
+}
+
 void *tdbExtrasGetOrDefault(struct trackDb *tdb,char *name,void *defaultVal)
 /* Returns a value if it is found in the extras hash. */
 {