3b6b332ae9f729a5cbc146116f56b9840dbe2af8
jcasper
Fri Mar 11 10:59:51 2016 -0800
Updated OMIM display, more linkouts, resolving merge conflict, refs #16796
diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c
index 196c95b..0766f49 100644
--- src/hg/hgc/hgc.c
+++ src/hg/hgc/hgc.c
@@ -295,30 +295,32 @@
/* 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 *ncbiGeneFormat = "http://www.ncbi.nlm.nih.gov/gene/%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: */
char *unistsnameScript = "http://www.ncbi.nlm.nih.gov:80/entrez/query.fcgi?db=unists";
char *unistsScript = "http://www.ncbi.nlm.nih.gov/genome/sts/sts.cgi?uid=";
char *gdbScript = "http://www.gdb.org/gdb-bin/genera/accno?accessionNum=";
char *cloneDbScript = "http://www.ncbi.nlm.nih.gov/clone?term=";
char *traceScript = "http://www.ncbi.nlm.nih.gov/Traces/trace.cgi?cmd=retrieve&val=";
char *genMapDbScript = "http://genomics.med.upenn.edu/perl/genmapdb/byclonesearch.pl?clone=";
char *uniprotFormat = "http://www.uniprot.org/uniprot/%s";
+char *dbSnpFormat = "http://www.ncbi.nlm.nih.gov/SNP/snp_ref.cgi?type=rs&rs=%s";
+char *clinVarFormat = "http://www.ncbi.nlm.nih.gov/clinvar/?term=%s[clv_acc]";
/* variables for gv tables */
char *gvPrevCat = NULL;
char *gvPrevType = NULL;
/* initialized by getCtList() if necessary: */
struct customTrack *theCtList = NULL;
/* getDNA stuff actually works when the database doesn't exist! */
boolean dbIsFound = FALSE;
/* forwards */
char *getPredMRnaProtSeq(struct genePred *gp);
void doAltGraphXDetails(struct trackDb *tdb, char *item);
@@ -10489,81 +10491,82 @@
printf("
OMIM: ");
printf("", url, itemName);
printf("%s", itemName);
if (title1 != NULL) printf(": %s", title1);
if (title2 != NULL) printf(" %s ", title2);
// disable NCBI link until they work it out with OMIM
/*
printf("
\n");
printf("OMIM page at NCBI: ");
printf("", ncbiOmimUrl, itemName);
printf("%s
", itemName);
*/
sqlSafef(query, sizeof(query),
- "select replStr from omimAvRepl where avId=%s;", avId);
+ "select repl2 from omimAv where avId=%s;", avId);
sr = sqlMustGetResult(conn, query);
row = sqlNextRow(sr);
if (row != NULL)
{
if (row[0] != NULL)
- {
- char *replStr;
- char *chp;
- replStr= cloneString(row[0]);
-
- // just take the first AA replacement if there are multiple
- chp = strstr(replStr, ",");
- if (chp != NULL) *chp = '\0';
-
- printf("
Amino Acid Replacement: %s\n", replStr);
- }
+ printf("
Amino Acid Replacement: %s\n", row[0]);
}
sqlFreeResult(&sr);
- dbSnpId = cloneString("-");
printf("
\n");
- sqlSafef(query, sizeof(query),
- "select dbSnpId from omimAvRepl where avId='%s'", avId);
+ sqlSafef(query, sizeof(query),
+ "select dbSnpId from omimAv where avId='%s'", avId);
sr = sqlMustGetResult(conn, query);
row = sqlNextRow(sr);
+ dbSnpId = cloneString("-");
if (row != NULL)
- {
dbSnpId = cloneString(row[0]);
- }
sqlFreeResult(&sr);
if (!sameWord(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
+ struct slName *snpIdList, *thisSnpId;
+
+ printf("dbSNP/ClinVar: \n");
+
+ /* for each variant, print name and build a link for it if possible */
+ snpIdList = slNameListFromComma(dbSnpId);
+ while ((thisSnpId = slPopHead(&snpIdList)) != NULL)
{
- puts("dbSNP: ");
- printDbSnpRsUrl(dbSnpId, "%s", dbSnpId);
+ if (strncmp(thisSnpId->name, "rs", 2) == 0) /* dbSnp ID */
+ printDbSnpRsUrl (thisSnpId->name, "%s", thisSnpId->name);
+ else if (strncmp(thisSnpId->name, "SCV", 3) == 0) /* ClinVar ID */
+ {
+ char clinVarUrl[2048];
+ safef (clinVarUrl, sizeof(clinVarUrl), clinVarFormat, thisSnpId->name);
+ printf ("%s", clinVarUrl, thisSnpId->name);
}
+ else
+ printf ("%s", thisSnpId->name);
+
+ slNameFree(&thisSnpId);
+
+ if (snpIdList != NULL)
+ printf (",");
+ }
+ printf("
\n");
}
}
-printf("