94ab45bc69a304d7f68851812e96de7af8943f6d
angie
Wed Mar 9 13:12:36 2016 -0800
Libified hgVai's code to find the latest snpNNN table so that other spots in the code could use it instead of hardcoding version numbers. Thx Matt for pointing out the hardcoding.
refs #16777
diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c
index 5764325..ab54b3a 100644
--- src/hg/hgc/hgc.c
+++ src/hg/hgc/hgc.c
@@ -10524,42 +10524,42 @@
dbSnpId = cloneString("-");
printf("
\n");
sqlSafef(query, sizeof(query),
"select dbSnpId from omimAvRepl where avId='%s'", avId);
sr = sqlMustGetResult(conn, query);
row = sqlNextRow(sr);
if (row != NULL)
{
dbSnpId = cloneString(row[0]);
}
sqlFreeResult(&sr);
if (!sameWord(dbSnpId, "-"))
{
- printf("dbSNP: \n");
- if (sameWord(database, "hg18"))
- {
- printf("",
- "../cgi-bin/hgc?g=snp130&i=", dbSnpId);
- }
+ char *snpTable = hFindLatestSnpTable(database, NULL);
+ if (snpTable != NULL)
+ // NOTE: dbSnpId is not guaranteed to be found in snpTable and it might be
+ // a better idea to always link directly to dbSNP.
+ printf("dbSNP: \n"
+ "%s",
+ cartSessionId(cart), snpTable, dbSnpId, dbSnpId);
else
{
- printf("",
- "../cgi-bin/hgc?g=snp144&i=", dbSnpId);
+ puts("dbSNP: ");
+ printDbSnpRsUrl(dbSnpId, "%s", dbSnpId);
}
- printf("%s", dbSnpId);
}
}
printf("