static void linkToDetailsCellPrint(struct column *col, struct genePos *gp, struct sqlConnection *conn) /* Print a link to known genes details page. */ { char *s = col->cellVal(col, gp, conn); fillInKnownPos(gp, conn); hPrintf("<TD>"); hPrintf("<A HREF=\"../cgi-bin/hgGene?%s&%s=%s&%s=%s&%s=%s&%s=%d&%s=%d\">", cartSidUrlString(cart), "db", database, "hgg_gene", gp->name, "hgg_chrom", gp->chrom, "hgg_start", gp->start, "hgg_end", gp->end); if (s == NULL) { hPrintf("n/a"); } else { hPrintEncodedNonBreak(s); freeMem(s); } hPrintf("</A></TD>"); }
static void associationCellPrint(struct column *col, struct genePos *gp, struct sqlConnection *conn) /* Print cell in association table. */ { char query[1024]; struct sqlResult *sr; char **row; boolean gotOne = FALSE; char *key = (col->protKey ? (kgVersion == KG_III ? lookupProtein(conn, gp->name) : gp->protein) : gp->name); struct hash *uniqHash = NULL; if (col->weedDupes) uniqHash = newHash(8); hPrintf("<TD>"); safef(query, sizeof(query), col->queryOne, key); sr = sqlGetResult(conn, query); while ((row = sqlNextRow(sr)) != NULL) { char *s = row[0]; boolean needQuote; if (uniqHash != NULL) { if (hashLookup(uniqHash, s)) continue; else hashAdd(uniqHash, s, NULL); } needQuote = hasWhiteSpace(s); if (!gotOne) gotOne = TRUE; else hPrintf(" "); if (needQuote) hPrintf("'"); if (col->itemUrl) { hPrintf("<A HREF=\""); hPrintf(col->itemUrl, row[1]); hPrintf("\" TARGET=_blank>"); } hPrintEncodedNonBreak(s); if (col->itemUrl) { hPrintf("</A>"); } if (needQuote) hPrintf("'"); } sqlFreeResult(&sr); if (!gotOne) { hPrintf("n/a"); } hPrintf("</TD>"); freeHash(&uniqHash); }
static void flyBdgpCellPrint(struct column *col, struct genePos *gp, struct sqlConnection *conn) /* Print trancript name and link to fruitfly.org. */ { char *geneName = flyTxToGene(gp->name); hPrintf("<TD><A HREF=\""); hPrintf(col->itemUrl, geneName); hPrintf("\" TARGET=_blank>"); hPrintEncodedNonBreak(gp->name); hPrintf("</A></TD>"); }
static void xyzCellPrint(struct column *col, struct genePos *gp, struct sqlConnection *conn) /* Print cell in xyz table. */ { char *string = xyzCellVal(col, gp, conn); hPrintf("<TD>"); if (string == NULL) { hPrintf("n/a"); } else if (col->xyzItalics) { hPrintf("<I>"); hPrintEncodedNonBreak(string); hPrintf("</I>"); } else hPrintEncodedNonBreak(string); hPrintf("</TD>"); freeMem(string); }