src/hg/hgc/hgc.c 1.1523

1.1523 2009/03/30 22:06:21 fanhsu
Updated details page logic for omimGene.
Index: src/hg/hgc/hgc.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgc/hgc.c,v
retrieving revision 1.1522
retrieving revision 1.1523
diff -b -B -U 4 -r1.1522 -r1.1523
--- src/hg/hgc/hgc.c	26 Mar 2009 17:33:59 -0000	1.1522
+++ src/hg/hgc/hgc.c	30 Mar 2009 22:06:21 -0000	1.1523
@@ -8638,21 +8638,33 @@
     	sqlFreeResult(&sr);
 	}
     else
     	{
-	/* get gene symbol from kgXref if the entry is not in morbidmap */
+	/* display gene symbol(s) from omimGenemap  */
+    	safef(query, sizeof(query), "select geneSymbol from omimGeneMap where omimId=%s;", itemName);
+    	sr = sqlMustGetResult(conn, query);
+    	row = sqlNextRow(sr);
+        if (row != NULL)
+    	    {
+ 	    printf("<B>OMIM Gene Symbol:</B> %s", row[0]);
+	    printf("<BR>\n");
+    	    sqlFreeResult(&sr);
+	    }
+	else
+    	    {
+	    /* get gene symbol from kgXref if the entry is not in morbidmap and omim genemap */
     	safef(query, sizeof(query), "select geneSymbol from kgXref where kgId='%s';", kgId);
 
         sr = sqlMustGetResult(conn, query);
     	row = sqlNextRow(sr);
     	if (row != NULL)
     	    {
- 	    printf("<B>Gene Symbol:</B> %s", row[0]);
+ 	    	printf("<B>UCSC Gene Symbol:</B> %s", row[0]);
 	    printf("<BR>\n");
 	    }
     	sqlFreeResult(&sr);
     	}
-
+	}
     printf("<B>OMIM Database ");fflush(stdout);
     printf("<A HREF=\"%s%s\" target=_blank>", url, itemName);
     printf("%s</A></B>", itemName);
 
@@ -8678,9 +8690,9 @@
     printf("<BR>\n");
 
     if (kgId != NULL)
     	{
-    	printf("<B>UCSC Gene ");
+    	printf("<B>UCSC Canonical Gene ");
     	printf("<A HREF=\"%s%s&hgg_chrom=none\" target=_blank>",
 	       "../cgi-bin/hgGene?hgg_gene=", kgId);
     	printf("%s</A></B>: ", kgId);
     	
@@ -8710,9 +8722,30 @@
 	else
     	    {
 	    printf("%s", kgDescription);
 	    }
+        printf("<BR>\n");
 
+	safef(query, sizeof(query),
+	      "select i.transcript from knownIsoforms i, knownCanonical c where c.transcript='%s' and i.clusterId=c.clusterId and i.transcript <>'%s'", 
+	      kgId, kgId);
+    	sr = sqlMustGetResult(conn, query);
+	if (sr != NULL)
+	    {
+	    int printedCnt;
+	    printedCnt = 0;
+	    while ((row = sqlNextRow(sr)) != NULL)
+	    	{
+	        if (printedCnt < 1) 
+		    printf("<B>Other UCSC Gene(s) in the same cluster: </B>");
+		else
+		    printf(", ");
+    	    	printf("<A HREF=\"%s%s&hgg_chrom=none\" target=_blank>", "../cgi-bin/hgGene?hgg_gene=", row[0]);
+    	    	printf("%s</A></B>", row[0]);
+	    	printedCnt++;
+		}
+	    }
+	sqlFreeResult(&sr);
         printf("<BR>\n");
 	}
     }