760d941586a240c1b4c4e1143f1fd2a3f8ff96c1
braney
  Fri Apr 7 11:26:45 2017 -0700
add the ability to specify a fielded tab-sep file for metadata in a
track hub

diff --git src/hg/lib/trackHub.c src/hg/lib/trackHub.c
index 76927b2..9adacd1 100644
--- src/hg/lib/trackHub.c
+++ src/hg/lib/trackHub.c
@@ -856,42 +856,49 @@
 
     // clear these two pointers which we set in markContainers
     tdb->subtracks = NULL;
     tdb->parent = NULL;
     }
 }
 
 struct trackDb *trackHubTracksForGenome(struct trackHub *hub, struct trackHubGenome *genome)
 /* Get list of tracks associated with genome.  Check that it only is composed of legal
  * types.  Do a few other quick checks to catch errors early. */
 {
 struct lineFile *lf = udcWrapShortLineFile(genome->trackDbFile, NULL, 64*1024*1024);
 struct trackDb *tdbList = trackDbFromOpenRa(lf, NULL);
 lineFileClose(&lf);
 
+char *tabMetaName = hashFindVal(genome->settingsHash, "metaTab");
+char *absTabName  = NULL;
+if (tabMetaName)
+    absTabName  = trackHubRelativeUrl(hub->url, tabMetaName);
+
 char *tagStormName = hashFindVal(genome->settingsHash, "metaDb");
 char *absStormName  = NULL;
 if (tagStormName)
     absStormName  = trackHubRelativeUrl(hub->url, tagStormName);
 
 /* Make bigDataUrls more absolute rather than relative to genome.ra dir */
 struct trackDb *tdb;
 for (tdb = tdbList; tdb != NULL; tdb = tdb->next)
     {
     expandBigDataUrl(hub, genome, tdb);
     if  (absStormName)
         hashReplace(tdb->settingsHash, "metaDb", absStormName);
+    if  (absTabName)
+        hashReplace(tdb->settingsHash, "metaTab", absTabName);
     }
 
 validateTracks(hub, genome, tdbList);
 
 trackDbAddTableField(tdbList);
 if (!isEmpty(hub->name))
     trackHubAddNamePrefix(hub->name, tdbList);
 if (genome->twoBitPath == NULL)
     trackHubAddGroupName(hub->name, tdbList);
 for (tdb = tdbList; tdb != NULL; tdb = tdb->next)
     {
     trackDbFieldsFromSettings(tdb);
     trackDbPolish(tdb);
     }
 return tdbList;