src/hg/hgTracks/hapmapTrack.c 1.48

1.48 2010/05/11 01:43:27 kent
Refactoring to split the trackDb.tableName field into separate track and table fields. Similarly track.mapName field goes to the same track and table fields.
Index: src/hg/hgTracks/hapmapTrack.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/hapmapTrack.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -b -B -U 4 -r1.47 -r1.48
--- src/hg/hgTracks/hapmapTrack.c	9 Mar 2009 21:17:52 -0000	1.47
+++ src/hg/hgTracks/hapmapTrack.c	11 May 2010 01:43:27 -0000	1.48
@@ -201,16 +201,16 @@
 
 char orthoTable[HDB_MAX_TABLE_STRING];
 for (i = 0;  i < HAP_ORTHO_COUNT;  i++)
     {
-    if (endsWith(tg->mapName, "PhaseII"))
+    if (endsWith(tg->table, "PhaseII"))
 	safef(orthoTable, sizeof(orthoTable), "hapmapAlleles%sPhaseII", hapmapOrthoSpecies[i]);
     else
 	safef(orthoTable, sizeof(orthoTable), "hapmapAlleles%s", hapmapOrthoSpecies[i]);
-    if (sameString(tg->mapName, orthoTable))
+    if (sameString(tg->table, orthoTable))
 	{
 	struct hapmapAllelesOrtho *orthoLoadItem, *orthoItemList = NULL;
-	sr = hRangeQuery(conn, tg->mapName, chromName, winStart, winEnd, NULL, &rowOffset);
+	sr = hRangeQuery(conn, tg->table, chromName, winStart, winEnd, NULL, &rowOffset);
 	while ((row = sqlNextRow(sr)) != NULL)
 	    {
 	    orthoLoadItem = hapmapAllelesOrthoLoad(row+rowOffset);
 	    slAddHead(&orthoItemList, orthoLoadItem);
@@ -223,9 +223,9 @@
 	}
     }
 
 struct hapmapSnps *simpleLoadItem, *simpleItemList = NULL;
-sr = hRangeQuery(conn, tg->mapName, chromName, winStart, winEnd, NULL, &rowOffset);
+sr = hRangeQuery(conn, tg->table, chromName, winStart, winEnd, NULL, &rowOffset);
 while ((row = sqlNextRow(sr)) != NULL)
     {
     simpleLoadItem = hapmapSnpsLoad(row+rowOffset);
     slAddHead(&simpleItemList, simpleLoadItem);
@@ -607,17 +607,17 @@
 int i;
 char orthoTable[HDB_MAX_TABLE_STRING];
 for (i = 0;  i < HAP_ORTHO_COUNT;  i++)
     {
-    if (endsWith(tg->mapName, "PhaseII"))
+    if (endsWith(tg->table, "PhaseII"))
 	safef(orthoTable, sizeof(orthoTable), "hapmapAlleles%sPhaseII", hapmapOrthoSpecies[i]);
     else
 	safef(orthoTable, sizeof(orthoTable), "hapmapAlleles%s", hapmapOrthoSpecies[i]);
-    if (sameString(tg->mapName, orthoTable))
+    if (sameString(tg->table, orthoTable))
 	{
 	struct hapmapAllelesOrtho *orthoLoadItem, *orthoItemList = NULL;
 	struct hapmapAllelesOrtho *orthoItemsFiltered = NULL;
-	sr = hRangeQuery(conn, tg->mapName, chromName, winStart, winEnd, NULL, &rowOffset);
+	sr = hRangeQuery(conn, tg->table, chromName, winStart, winEnd, NULL, &rowOffset);
 	while ((row = sqlNextRow(sr)) != NULL)
 	    {
 	    orthoLoadItem = hapmapAllelesOrthoLoad(row+rowOffset);
 	    slAddHead(&orthoItemList, orthoLoadItem);
@@ -631,9 +631,9 @@
 	}
     }
 
 struct hapmapSnps *simpleLoadItem, *simpleItemList = NULL, *simpleItemsFiltered = NULL;
-sr = hRangeQuery(conn, tg->mapName, chromName, winStart, winEnd, NULL, &rowOffset);
+sr = hRangeQuery(conn, tg->table, chromName, winStart, winEnd, NULL, &rowOffset);
 while ((row = sqlNextRow(sr)) != NULL)
     {
     simpleLoadItem = hapmapSnpsLoad(row+rowOffset);
     slAddHead(&simpleItemList, simpleLoadItem);
@@ -733,21 +733,21 @@
 return FALSE;
 }
 
 boolean loadOrthosPhaseIII(struct track *tg, struct sqlConnection *conn, struct hash *summaryHash)
-/* If tg->mapName is a hapmapAlleles table, load & filter into tg->items and return TRUE. */
+/* If tg->table is a hapmapAlleles table, load & filter into tg->items and return TRUE. */
 {
 int i;
 char orthoTable[HDB_MAX_TABLE_STRING];
 for (i = 0;  i < HAP_ORTHO_COUNT;  i++)
     {
     safef(orthoTable, sizeof(orthoTable), "hapmapAlleles%s", hapmapOrthoSpecies[i]);
-    if (sameString(tg->mapName, orthoTable))
+    if (sameString(tg->table, orthoTable))
 	{
 	struct hapmapAllelesOrtho *item, *itemList = NULL;
 	struct hapmapPhaseIIISummary *summary;
 	int rowOffset;
-	struct sqlResult *sr = hRangeQuery(conn, tg->mapName,
+	struct sqlResult *sr = hRangeQuery(conn, tg->table,
 					   chromName, winStart, winEnd, NULL, &rowOffset);
 	char **row;
 	while ((row = sqlNextRow(sr)) != NULL)
 	    {
@@ -777,9 +777,9 @@
     return;
 
 struct hapmapSnps *item, *itemList = NULL;
 struct hapmapPhaseIIISummary *summary;
-struct sqlResult *sr = hRangeQuery(conn, tg->mapName, chromName, winStart, winEnd, NULL, &rowOffset);
+struct sqlResult *sr = hRangeQuery(conn, tg->table, chromName, winStart, winEnd, NULL, &rowOffset);
 while ((row = sqlNextRow(sr)) != NULL)
     {
     item = hapmapSnpsLoad(row+rowOffset);
     summary = (struct hapmapPhaseIIISummary *)hashMustFindVal(summaryHash, item->name);
@@ -830,13 +830,13 @@
 int i;
 char orthoTable[HDB_MAX_TABLE_STRING];
 for (i = 0;  i < HAP_ORTHO_COUNT;  i++)
     {
-    if (endsWith(tg->mapName, "PhaseII"))
+    if (endsWith(tg->table, "PhaseII"))
 	safef(orthoTable, sizeof(orthoTable), "hapmapAlleles%sPhaseII", hapmapOrthoSpecies[i]);
     else
 	safef(orthoTable, sizeof(orthoTable), "hapmapAlleles%s", hapmapOrthoSpecies[i]);
-    if (sameString(tg->mapName, orthoTable))
+    if (sameString(tg->table, orthoTable))
 	{
 	struct hapmapAllelesOrtho *thisItem = item;
 	chromStart = thisItem->chromStart;
 	chromEnd = thisItem->chromEnd;
@@ -896,13 +896,13 @@
 int i;
 char orthoTable[HDB_MAX_TABLE_STRING];
 for (i = 0;  i < HAP_ORTHO_COUNT;  i++)
     {
-    if (endsWith(tg->mapName, "PhaseII"))
+    if (endsWith(tg->table, "PhaseII"))
 	safef(orthoTable, sizeof(orthoTable), "hapmapAlleles%sPhaseII", hapmapOrthoSpecies[i]);
     else
 	safef(orthoTable, sizeof(orthoTable), "hapmapAlleles%s", hapmapOrthoSpecies[i]);
-    if (sameString(tg->mapName, orthoTable))
+    if (sameString(tg->table, orthoTable))
 	{
 	struct hapmapAllelesOrtho *thisItem = item;
 	gradient = grayInRange(thisItem->score, 0, 100);
 	col = shadesOfBrown[gradient];