a282777be825705145a1945c2800ad193dbb2351
fanhsu
  Fri Oct 15 15:40:18 2010 -0700
Updated pathways.c to support RGD Genes.
diff --git src/hg/hgGene/pathways.c src/hg/hgGene/pathways.c
index f03803f..1a6fd7e 100644
--- src/hg/hgGene/pathways.c
+++ src/hg/hgGene/pathways.c
@@ -158,6 +158,27 @@
     }
 }
 
+static void rgdPathwayLink(struct pathwayLink *pl, struct sqlConnection *conn, 
+	char *geneId)
+/* Print out bioCarta database link. */
+{
+char query[512], **row;
+struct sqlResult *sr;
+char *rgdId = geneId;
+safef(query, sizeof(query),
+    	"select x.pathwayId, description from rgdPathway p, rgdGenePathway x "
+	" where p.pathwayId = x.pathwayId "
+	" and x.geneId = '%s'"
+	, rgdId);
+sr = sqlGetResult(conn, query);
+while ((row = sqlNextRow(sr)) != NULL)
+    {
+    hPrintf("<A HREF=\"http://rgd.mcw.edu/tools/ontology/ont_annot.cgi?ontology=wo&ont_id=%s\" TARGET=_blank>", row[0]);
+    hPrintf("%s</A> - %s<BR>\n", row[0], row[1]);
+    }
+sqlFreeResult(&sr);
+}
+
 static void bioCartaLink(struct pathwayLink *pl, struct sqlConnection *conn, 
 	char *geneId)
 /* Print out bioCarta database link. */
@@ -207,6 +228,16 @@
 return ret;
 }
 
+static int rgdPathwayCount(struct pathwayLink *pl, struct sqlConnection *conn,
+char *geneId)
+/* Count up number of hits. */
+{
+char query[256];
+safef(query, sizeof(query),
+      "select count(*) from rgdGenePathway where geneId ='%s'", geneId);
+return sqlQuickNum(conn, query);
+}
+
 static int reactomeCount(struct pathwayLink *pl, struct sqlConnection *conn, 
 	char *geneId)
 /* Count up number of hits. */
@@ -252,6 +283,9 @@
    { "reactome", "Reactome", "Reactome (by CSHL, EBI, and GO)",
    	"proteome.spReactomeEvent",
 	reactomeCount, reactomeLink},
+   { "rgdPathway", "RGDPathway", "RGD Pathway",
+   	"rgdPathway rgdGenePathway",
+	rgdPathwayCount, rgdPathwayLink},
 };
 
 static boolean pathwayExists(struct pathwayLink *pl,