src/hg/hgc/hgc.c 1.1590
1.1590 2010/01/20 00:29:53 angie
For snp125+, if there is a gwasCatalog table that also contains the SNP, make a link to open the track in hgTracks (like we do for HapMap).
Index: src/hg/hgc/hgc.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgc/hgc.c,v
retrieving revision 1.1589
retrieving revision 1.1590
diff -b -B -U 4 -r1.1589 -r1.1590
--- src/hg/hgc/hgc.c 19 Jan 2010 23:13:17 -0000 1.1589
+++ src/hg/hgc/hgc.c 20 Jan 2010 00:29:53 -0000 1.1590
@@ -15365,8 +15365,33 @@
printf("\"> HapMap SNP</A> </B><BR>\n");
}
}
+static void checkForGwasCatalog(struct sqlConnection *conn, struct trackDb *tdb, char *item)
+/* If item is in gwasCatalog, add link to make the track visible. */
+{
+char *gcTable = "gwasCatalog";
+if (sqlTableExists(conn, gcTable))
+ {
+ char query[512];
+ safef(query, sizeof(query), "select count(*) from %s where name = '%s'", gcTable, item);
+ if (sqlQuickNum(conn, query) > 0)
+ {
+ struct trackDb *gcTdb = hashFindVal(trackHash, gcTable);
+ if (gcTdb != NULL)
+ {
+ printf("<B><A HREF=\"%s", hgTracksPathAndSettings());
+ // If gcTable is hidden, make it dense; otherwise, leave it alone.
+ if (sameString("hide",
+ cartUsualString(cart, gcTable,
+ trackDbSettingOrDefault(gcTdb, "visibility", "hide"))))
+ printf("&%s=dense", gcTable);
+ printf("\">%s SNP</A> </B><BR>\n", gcTdb->shortLabel);
+ }
+ }
+ }
+}
+
static void printLsSnpPdb(struct sqlConnection *conn, char *pdbId, char *snpId)
/* generate LS-SNP and chimera links for a PDB id */
{
char *lsSnpUrl = lsSnpPdbGetUrlPdbSnp(pdbId, snpId);
@@ -15476,8 +15501,9 @@
printf("<BR>");
}
}
sqlFreeResult(&sr);
+checkForGwasCatalog(conn, tdb, itemName);
checkForHgdpGeo(conn, tdb, itemName, start);
checkForHapmap(conn, tdb, itemName);
checkForLsSnpMappings(conn, itemName);
printSnpAlignment(tdb, snpAlign);