b821b7df6dab3601709da49c089e08d41961e7e8 larrym Wed Jul 14 15:09:07 2010 -0700 add motifMultipleHitsSection diff --git src/hg/hgc/regMotif.c src/hg/hgc/regMotif.c index ddcda99..06d13ec 100644 --- src/hg/hgc/regMotif.c +++ src/hg/hgc/regMotif.c @@ -102,9 +102,10 @@ } -void motifHitSection(struct dnaSeq *seq, struct dnaMotif *motif) -/* Print out section about motif. */ +void motifMultipleHitsSection(struct dnaSeq **seqs, int count, struct dnaMotif *motif) +/* Print out section about motif, possibly with mutliple occurrences. */ { + webNewSection("Motif:"); printf("
\n");
 printf("\n");
@@ -114,16 +115,25 @@
     dnaMotifMakeProbabalistic(motif);
     makeTempName(&pngTn, "logo", ".png");
     dnaMotifToLogoPng(motif, 47, 140, NULL, "../trash", pngTn.forCgi);
-    printf("\n");
     }
-if (seq != NULL)
+if (count > 0)
     {
+    int i;
+    for (i = 0; i < count; i++)
+        {
+        struct dnaSeq *seq = seqs[i];
     printf("");
     touppers(seq->dna);
     printDnaCells(seq->dna, seq->size);
+        if(count == 1)
     printf("\n");
+        else
+            // is there a library routine to get 1st, 2nd ...?
+            printf("\n", i + 1);
+        }
     }
 if (motif != NULL)
     {
@@ -136,6 +146,15 @@
 printf("");
 }
 
+void motifHitSection(struct dnaSeq *seq, struct dnaMotif *motif)
+/* Print out section about motif. */
+{
+if(seq == NULL)
+    motifMultipleHitsSection(NULL, 0, motif);
+else
+    motifMultipleHitsSection(&seq, 1, motif);
+}
+
 void doTriangle(struct trackDb *tdb, char *item, char *motifTable)
 /* Display detailed info on a regulatory triangle item. */
 {
", seq->size); + printf("
", motif->columnCount); printf("", pngTn.forHtml); printf("
this occurrence
occurrence #%d