void motifLogoAndMatrix(struct dnaSeq **seqs, int count, struct dnaMotif *motif) /* Print out motif sequence logo and text (possibly with multiple occurences) */ { // Detect inconsistent motif/pwm tables and suppress confusing display if (motif != NULL) { if (seqs != NULL && motif->columnCount != seqs[0]->size) { warn("Motif seq length doesn't match PWM\n"); return; } } #define MOTIF_HELP_PAGE "../goldenPath/help/hgRegMotifHelp.html" printf("<PRE>\n"); printf("<table>\n"); if (motif != NULL) { struct tempName pngTn; dnaMotifMakeProbabalistic(motif); makeTempName(&pngTn, "logo", ".png"); dnaMotifToLogoPng(motif, 47, 140, NULL, "../trash", pngTn.forCgi); printf("<tr><td></td><td colspan='%d'align=right><a href=\"%s\" target=_blank>Motif display help</a></td></tr>", motif->columnCount, MOTIF_HELP_PAGE); printf("<tr><td></td><td colspan='%d'>", motif->columnCount); printf("<IMG SRC=\"%s\" BORDER=1>", pngTn.forHtml); printf("</td><td></td></tr>\n"); } if (count > 0) { int i; for (i = 0; i < count; i++) { struct dnaSeq *seq = seqs[i]; printf("<tr><td></td>"); touppers(seq->dna); printDnaCells(seq->dna, seq->size); if (count == 1) printf("<td>this occurrence</td></tr>\n"); else // is there a library routine to get 1st, 2nd ...? printf("<td>occurrence #%d</td></tr>\n", i + 1); } } if (motif != NULL) { printf("<tr><td></td>"); printConsensus(motif); printf("<td>motif consensus</td></tr>\n"); dnaMotifPrintProbTable(motif, stdout); } printf("</table>\n"); printf("</PRE>"); }
static void transRegCodeMotifPrint(struct section *section, struct sqlConnection *conn, char *geneId) /* Print out transcription regulatory code info. */ { struct dnaMotif *motif = transRegMotif(conn, geneId); if (motif != NULL) { struct tempName pngTn; dnaMotifMakeProbabalistic(motif); makeTempName(&pngTn, "logo", ".png"); dnaMotifToLogoPng(motif, 47, 140, NULL, "../trash", pngTn.forCgi); hPrintf(" "); hPrintf("<IMG SRC=\"%s\" BORDER=1>", pngTn.forHtml); hPrintf("\n"); hPrintf("<PRE>"); dnaMotifPrintProb(motif, stdout); hPrintf("</PRE><BR>\n"); hPrintf("This data is from "); hPrintf("<A HREF=\"%s\" TARGET=_blank>", "http://www.nature.com/cgi-taf/DynaPage.taf?file=/nature/journal/v431/n7004/abs/nature02800_fs.html"); hPrintf("Transcriptional regulatory code of a eukaryotic genome</A> "); hPrintf("by Harbison, Gordon, et al."); } }