0c4c7028a43e7434f9e01bca2c8794ecd8e5c6ae chinhli Wed Jul 3 12:14:41 2013 -0700 RM To Do 10993 path for the files necessary to compute the links has changed. diff --git src/hg/hgc/hgc.c src/hg/hgc/hgc.c index 6f53033..d55851b 100644 --- src/hg/hgc/hgc.c +++ src/hg/hgc/hgc.c @@ -227,30 +227,31 @@ #include "itemConf.h" #include "chromInfo.h" #include "gbWarn.h" #include "lsSnpPdbChimera.h" #include "mammalPsg.h" #include "net.h" #include "jsHelper.h" #include "virusClick.h" #include "gwasCatalog.h" #include "parClick.h" #include "mdb.h" #include "yaleGencodeAssoc.h" #include "itemDetailsHtml.h" #include "trackVersion.h" #include "numtsClick.h" +#include "geneReviewsClick.h" static char *rootDir = "hgcData"; #define LINESIZE 70 /* size of lines in comp seq feature */ struct cart *cart; /* User's settings. */ char *seqName; /* Name of sequence we're working on. */ int winStart, winEnd; /* Bounds of sequence. */ char *database; /* Name of mySQL database. */ char *organism; /* Colloquial name of organism. */ char *genome; /* common name, e.g. Mouse, Human */ char *scientificName; /* Scientific name of organism. */ struct hash *trackHash; /* A hash of all tracks - trackDb valued */ @@ -23899,132 +23900,30 @@ bedDetailFree(&r); hFreeConn(&conn); } struct trackDb *tdbForTableArg() /* get trackDb for track passed in table arg */ { char *table = cartString(cart, "table"); struct trackDb *tdb = hashFindVal(trackHash, table); if (tdb == NULL) errAbort("no trackDb entry for %s", table); return tdb; } -void doGeneReviews(struct trackDb *tdb, char *itemName) -/* generate the detail page for geneReviews */ -{ -struct sqlConnection *conn = hAllocConn(database); -//char *table = tdb->table; -int start = cartInt(cart, "o"); -int num = 4; - - genericHeader(tdb, itemName); - genericBedClick(conn, tdb, itemName, start, num); - prGeneReviews(conn, itemName); - printf("
"); - printTrackHtml(tdb); - hFreeConn(&conn); -} - -void prGeneReviews(struct sqlConnection *conn, char *itemName) -/* print GeneReviews associated to this item - Note: this print function has been replaced by addGeneReviewToBed.pl - which print the same information to the field 5 of bigBed file -*/ -{ -struct sqlResult *sr; -char **row; -char query[512]; -int i; -char *clickMsg = "Click link(s) below to search GeneReviews and GeneTests"; -boolean firstTime = TRUE; - -if (!sqlTableExists(conn, "geneReviewsRefGene")) return; - -sqlSafef(query, sizeof(query), "select grShort, diseaseID, diseaseName from geneReviewsRefGene where geneSymbol='%s'", itemName); -sr = sqlGetResult(conn, query); -while ((row = sqlNextRow(sr)) != NULL) - { - char *grShort = *row++; - char *diseaseID = *row++; - char *diseaseName = *row++; - - - if (firstTime) - { - printf("
GeneReview(s) available for %s: (%s)
",itemName,clickMsg); - firstTime = FALSE; - printf("
");
-              // #123456789-123456789-123456789-123456789-123456789-123456789-
-          printf("Short name    Disease ID     GeneTests disease name
"); - printf("------------------------------------------------------------"); - printf("--------------------
"); - } - printf("%s", grShort, grShort); - if (strlen(grShort) <= 15) { - for (i = 0; i < 15-strlen(grShort); i ++ ) - { - printf("%s", " " ); - } - } - printf("%-10s ", diseaseID); - printf("%s
", diseaseName, diseaseName); - - } /* end while */ - printf("
"); - sqlFreeResult(&sr); -} /* end of prGeneReviews */ - -void prGRShortRefGene(char *itemName) -/* print GeneReviews short label associated to this refGene item */ -{ -struct sqlConnection *conn = hAllocConn(database); -struct sqlResult *sr; -char **row; -char query[512]; -boolean firstTime = TRUE; - -if (!sqlTableExists(conn, "geneReviewsRefGene")) return; - -sqlSafef(query, sizeof(query), "select grShort, diseaseName from geneReviewsRefGene where geneSymbol='%s'", itemName); -sr = sqlGetResult(conn, query); -while ((row = sqlNextRow(sr)) != NULL) - { - char *grShort = *row++; - char *diseaseName = *row++; - if (firstTime) - { - printf("Related GeneReview(s) and GeneTests disease(s): "); - firstTime = FALSE; - printf("%s", grShort, grShort); - printf(" ("); - printf("%s", diseaseName, diseaseName); - printf(")"); - } else { - printf(", "); - printf("%s", grShort, grShort); - printf(" ("); - printf("%s", diseaseName, diseaseName); - printf(")"); - } - } - printf("
"); - sqlFreeResult(&sr); -} /* end of prGRShortRefGene */ - void doQPCRPrimers(struct trackDb *tdb, char *itemName) /* Put up page for QPCRPrimers. */ { genericHeader(tdb, itemName); doBedDetail(tdb, NULL, itemName); } /* end of doQPCRPrimers */ void doSnakeClick(struct trackDb *tdb, char *itemName) /* Put up page for snakes. */ { genericHeader(tdb, itemName); char *otherSpecies = trackHubSkipHubName(tdb->table) + strlen("snake"); char *hubName = cloneString(database); char *ptr = strchr(hubName + 4, '_'); *ptr = 0;