283ecb763785bc0f76edd211f95c091863962348
fanhsu
Tue Feb 22 17:10:18 2011 -0800
Fine tuned details page for OMIM new tracks.
diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c
index de2cc51..a74814d 100644
--- src/hg/hgc/hgc.c
+++ src/hg/hgc/hgc.c
@@ -257,30 +257,31 @@
/* JavaScript to automatically submit the form when certain values are
* changed. */
char *onChangeAssemblyText = "onchange=\"document.orgForm.submit();\"";
#define NUMTRACKS 9
int prevColor[NUMTRACKS]; /* used to optimize color change html commands */
int currentColor[NUMTRACKS]; /* used to optimize color change html commands */
int maxShade = 9; /* Highest shade in a color gradient. */
Color shadesOfGray[10+1]; /* 10 shades of gray from white to black */
Color shadesOfRed[16];
boolean exprBedColorsMade = FALSE; /* Have the shades of red been made? */
int maxRGBShade = 16;
struct bed *sageExpList = NULL;
+char ncbiOmimUrl[255] = {"http://www.ncbi.nlm.nih.gov/omim/"};
struct palInfo
{
char *chrom;
int left;
int right;
char *rnaName;
};
/* See this NCBI web doc for more info about entrezFormat:
* http://www.ncbi.nlm.nih.gov/entrez/query/static/linking.html */
char *entrezFormat = "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Search&db=%s&term=%s&doptcmdl=%s&tool=genome.ucsc.edu";
char *entrezPureSearchFormat = "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=PureSearch&db=%s&details_term=%s[%s] ";
char *entrezUidFormat = "http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=%s&list_uids=%d&dopt=%s&tool=genome.ucsc.edu";
/* db=unists is not mentioned in NCBI's doc... so stick with this usage: */
@@ -9397,30 +9398,33 @@
{
if (row[0] != NULL)
{
title1 = cloneString(row[0]);
printf(" %s", title1);
}
if (row[1] != NULL)
{
title2 = cloneString(row[1]);
printf(" %s ", title2);
}
}
sqlFreeResult(&sr);
printf("
\n");
+ printf("OMIM page at NCBI: ");
+ printf("", ncbiOmimUrl, itemName);
+ printf("%s
", itemName);
safef(query, sizeof(query),
"select geneSymbol from omimGeneMap where omimId=%s;", itemName);
sr = sqlMustGetResult(conn, query);
row = sqlNextRow(sr);
if (row != NULL)
{
geneSymbol = cloneString(row[0]);
}
sqlFreeResult(&sr);
/* get corresponding KG ID */
safef(query, sizeof(query),
"select k.transcript from knownCanonical k where k.chrom='%s' and k.chromStart=%s and k.chromEnd=%s",
chrom, chromStart, chromEnd);
@@ -9597,30 +9601,33 @@
{
if (row[0] != NULL)
{
title1 = cloneString(row[0]);
printf(": %s", title1);
}
if (row[1] != NULL)
{
title2 = cloneString(row[1]);
printf(" %s ", title2);
}
}
sqlFreeResult(&sr);
printf("
\n");
+ printf("OMIM page at NCBI: ");
+ printf("", ncbiOmimUrl, itemName);
+ printf("%s
", itemName);
printf("Location: ");
safef(query, sizeof(query),
"select location from omimGeneMap where omimId=%s;", itemName);
sr = sqlMustGetResult(conn, query);
row = sqlNextRow(sr);
if (row != NULL)
{
if (row[0] != NULL)
{
char *locStr;
locStr= cloneString(row[0]);
printf("%s\n", locStr);
}
}
@@ -9778,71 +9785,79 @@
{
struct sqlConnection *conn = hAllocConn(database);
char query[256];
struct sqlResult *sr;
char **row;
char *url = tdb->url;
char *title1 = NULL;
char *title2 = NULL;
char *chrom, *chromStart, *chromEnd;
char *omimId;
char *avId;
char *dbSnpId;
char *chp;
char *seqId = NULL;
char avString[255];
+char *avDesc = NULL;
chrom = cartOptionalString(cart, "c");
chromStart = cartOptionalString(cart, "o");
chromEnd = cartOptionalString(cart, "t");
avId = strdup(itemName);
-chp = strstr(itemName, "#");
+chp = strstr(itemName, ".");
*chp = '\0';
omimId = strdup(itemName);
if (url != NULL && url[0] != 0)
{
printf("OMIM Entry ");fflush(stdout);
printf("", url, itemName);
printf("%s", itemName);
safef(query, sizeof(query),
- "select title1, title2, format(seqNo/10000,4) from omimGeneMap m, omimAv v where m.omimId=%s and m.omimId=v.omimId and v.avId='%s';", itemName, avId);
+ "select title1, title2, format(seqNo/10000,4), v.description from omimGeneMap m, omimAv v where m.omimId=%s and m.omimId=v.omimId and v.avId='%s';", itemName, avId);
sr = sqlMustGetResult(conn, query);
row = sqlNextRow(sr);
if (row != NULL)
{
seqId = strdup(row[2]);
safef(avString, sizeof(avString), "%s#%s", omimId, seqId+2L);
if (row[0] != NULL)
{
title1 = cloneString(row[0]);
printf(": %s", title1);
}
if (row[1] != NULL)
{
title2 = cloneString(row[1]);
printf(" %s ", title2);
}
+ avDesc = row[3];
}
sqlFreeResult(&sr);
- printf("
Allelic Variant: ");fflush(stdout);
+ printf("
\n");
+ printf("OMIM page at NCBI: ");
+ printf("", ncbiOmimUrl, itemName);
+ printf("%s
", itemName);
+
+ printf("Allelic Variant: ");fflush(stdout);
printf("", url, avString);
- printf("%s", avString);
+ printf("%s", avId);
+ printf(" %s", avDesc);
safef(query, sizeof(query),
"select replStr from omimAvRepl where avId=%s;", avId);
sr = sqlMustGetResult(conn, query);
row = sqlNextRow(sr);
if (row != NULL)
{
if (row[0] != NULL)
{
char *replStr;
replStr= cloneString(row[0]);
printf("
Amino Acid Replacement: %s\n", replStr);
}
}
sqlFreeResult(&sr);