src/hg/hgc/hgc.c 1.1522
1.1522 2009/03/26 17:33:59 fanhsu
Updated omimGene section, to go after knownCanonical KG and get description from gbCdnaInfo instead of refLink for RefSeq entries.
Index: src/hg/hgc/hgc.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgc/hgc.c,v
retrieving revision 1.1521
retrieving revision 1.1522
diff -b -B -U 4 -r1.1521 -r1.1522
--- src/hg/hgc/hgc.c 17 Mar 2009 19:54:55 -0000 1.1521
+++ src/hg/hgc/hgc.c 26 Mar 2009 17:33:59 -0000 1.1522
@@ -8562,12 +8562,25 @@
printGadDetails(tdb, item, FALSE);
printTrackHtml(tdb);
}
+char *gbCdnaGetDescription(struct sqlConnection *conn, char *acc)
+/* return mrna description, or NULL if not available. freeMem result */
+{
+char query[128];
+safef(query, sizeof(query),
+ "select description.name from gbCdnaInfo,description where (acc = '%s') and (gbCdnaInfo.description = description.id)", acc);
+char *desc = sqlQuickString(conn, query);
+if ((desc == NULL) || sameString(desc, "n/a") || (strlen(desc) == 0))
+ freez(&desc);
+return desc;
+}
+
void printOmimGeneDetails(struct trackDb *tdb, char *itemName, boolean encode)
/* Print details of an OMIM Gene entry. */
{
struct sqlConnection *conn = hAllocConn(database);
+struct sqlConnection *conn2 = hAllocConn(database);
char query[256];
struct sqlResult *sr;
char **row;
char *url = tdb->url;
@@ -8575,8 +8588,10 @@
char *title1 = NULL;
char *title2 = NULL;
char *geneSymbols = NULL;
char *chrom, *chromStart, *chromEnd;
+char *kgDescription = NULL;
+char *refSeq;
chrom = cartOptionalString(cart, "c");
chromStart = cartOptionalString(cart, "o");
chromEnd = cartOptionalString(cart, "t");
@@ -8595,9 +8610,9 @@
sqlFreeResult(&sr);
/* get corresponding KG ID */
safef(query, sizeof(query),
- "select k.name from kgXref x, knownGene k where k.chrom='%s' and k.txStart=%s and k.txEnd=%s and k.name=x.kgId ",
+ "select k.transcript from knownCanonical k where k.chrom='%s' and k.chromStart=%s and k.chromEnd=%s",
chrom, chromStart, chromEnd);
sr = sqlMustGetResult(conn, query);
row = sqlNextRow(sr);
if (row != NULL)
@@ -8668,8 +8683,21 @@
printf("<A HREF=\"%s%s&hgg_chrom=none\" target=_blank>",
"../cgi-bin/hgGene?hgg_gene=", kgId);
printf("%s</A></B>: ", kgId);
+ safef(query, sizeof(query), "select refseq from kgXref where kgId='%s';", kgId);
+ sr = sqlMustGetResult(conn, query);
+ row = sqlNextRow(sr);
+ if (row != NULL)
+ {
+ refSeq = strdup(row[0]);
+ kgDescription = gbCdnaGetDescription(conn2, refSeq);
+ }
+ sqlFreeResult(&sr);
+ hFreeConn(&conn2);
+
+ if (kgDescription == NULL)
+ {
safef(query, sizeof(query), "select description from kgXref where kgId='%s';", kgId);
sr = sqlMustGetResult(conn, query);
row = sqlNextRow(sr);
if (row != NULL)
@@ -8677,8 +8705,14 @@
printf("%s", row[0]);
}
sqlFreeResult(&sr);
+ }
+ else
+ {
+ printf("%s", kgDescription);
+ }
+
printf("<BR>\n");
}
}
@@ -9047,20 +9081,8 @@
}
return ver;
}
-char *gbCdnaGetDescription(struct sqlConnection *conn, char *acc)
-/* return mrna description, or NULL if not available. freeMem result */
-{
-char query[128];
-safef(query, sizeof(query),
- "select description.name from gbCdnaInfo,description where (acc = '%s') and (gbCdnaInfo.description = description.id)", acc);
-char *desc = sqlQuickString(conn, query);
-if ((desc == NULL) || sameString(desc, "n/a") || (strlen(desc) == 0))
- freez(&desc);
-return desc;
-}
-
void prRefGeneInfo(struct sqlConnection *conn, char *rnaName,
char *sqlRnaName, struct refLink *rl, boolean isXeno)
/* print basic details information and links for a RefGene */
{