0b7628a3c2f9451cd82cbea128c71b986b32b7d6 chinhli Mon Aug 15 08:47:45 2011 -0700 hgGene, hgc, section.ra change for phase 2 of geneReviews track diff --git src/hg/hgGene/geneReviews.c src/hg/hgGene/geneReviews.c new file mode 100644 index 0000000..06d0acb --- /dev/null +++ src/hg/hgGene/geneReviews.c @@ -0,0 +1,53 @@ +/* GeneReviews - print out GeneReviews for this gene. */ + +#include "common.h" +#include "hash.h" +#include "hdb.h" +#include "linefile.h" +#include "dystring.h" +#include "hgGene.h" + +static void geneReviewsPrint(struct section *section, + struct sqlConnection *conn, char *itemName) +/* print GeneReviews short label associated to this refGene item */ +{ +if (sqlTablesExist(conn, "geneReviews")) + { + hPrintf("Printing geneReviews for %s
", itemName ); + } else { + hPrintf("geneReviews table not found
" ); + } +/******************************************************************* +struct sqlResult *sr; +char **row; +char query[512]; +boolean firstTime = TRUE; + +safef(query, sizeof(query), "select grShort from geneReviewsRefGene where geneSymbol='%s'", itemName); +sr = sqlGetResult(conn, query); +while ((row = sqlNextRow(sr)) != NULL) + { + char *grShort = *row++; + if (firstTime) + { + printf(" GeneReview: "); + firstTime = FALSE; + printf("%s", grShort, grShort); + } else { + printf(", "); + printf("%s", grShort, grShort); + } + } + printf("
"); +**********************************************************/ +} + + +struct section *geneReviewsSection(struct sqlConnection *conn, + struct hash *sectionRa) +/* Create geneReviews (aka Other Names) section. */ +{ +struct section *section = sectionNew(sectionRa, "geneReviews"); +section->print = geneReviewsPrint; +return section; +}