f8929d074fa315ae76bc2430a72ca38f2fc0f36a
kate
  Tue Jan 28 12:08:34 2014 -0800
Add some flexibility to Motif section display. refs #9092
diff --git src/hg/hgc/peakClusters.c src/hg/hgc/peakClusters.c
index 3c5fabf..1904024 100644
--- src/hg/hgc/peakClusters.c
+++ src/hg/hgc/peakClusters.c
@@ -445,31 +445,32 @@
     #ifdef SHOW_MAX_SCORE
     float maxScore = -1;
     sqlSafef(query, sizeof(query), 
         "select max(score) from %s where name = '%s'", motifTable, motifName);
     sr = sqlGetResult(conn, query);
     if ((row = sqlNextRow(sr)) != NULL)
         {
         if(!isEmpty(row[0]))
             {
             maxScore = sqlFloat(row[0]);
             }
         }
     sqlFreeResult(&sr);
     #endif
 
-    puts("<p></p>");
+    //puts("<p></p>");
+    webNewSection("Motif Sequence from Matching Strand");
     for (hit = hits, i = 0; hit != NULL; hit = hit->next, i++)
         {
         struct dnaSeq *seq = hDnaFromSeq(database, 
             seqName, hit->chromStart, hit->chromEnd, dnaLower);
         if(hit->strand[0] == '-')
             reverseComplement(seq->dna, seq->size);
         seqs[i] = seq;
         // TODO: move to hgc.c (with other pos printers)
         safef(posLink, sizeof(posLink),"<a href=\"%s&db=%s&position=%s%%3A%d-%d\">%s:%d-%d</a>",
                 hgTracksPathAndSettings(), database, 
                     cluster->chrom, hit->chromStart+1, hit->chromEnd,
                     cluster->chrom, hit->chromStart+1, hit->chromEnd);
         printf("<b>Motif Name:</b>  %s<br>\n", motifName);
         printf("<b>Motif Score");
         if (hitCount > 1)
@@ -485,31 +486,31 @@
             }
         else
             {
             #ifdef SHOW_MAX_SCORE
             printf(":</b>  %.2f (%s max: %.2f)<br>\n", hit->score, cluster->name, maxScore);
             #else
             printf(":</b>  %.2f<br>\n", hit->score);
             #endif
             printf("<b>Motif Position:</b> %s<br>\n", posLink);
             printf("<b>Motif Strand:</b> %c<br>\n", (int)hit->strand[0]);
             }
         }
     }
 if (seqs != NULL)
     {
-    motifMultipleHitsSection(seqs, hitCount, motif);
+    motifLogoAndMatrix(seqs, hitCount, motif);
     }
 }
 
 void doFactorSource(struct sqlConnection *conn, struct trackDb *tdb, char *item, int start)
 /* Display detailed info about a cluster of TFBS peaks from other tracks. */
 {
 int rowOffset = hOffsetPastBin(database, seqName, tdb->table);
 char **row;
 struct sqlResult *sr;
 char query[256];
 
 sqlSafef(query, sizeof(query),
 	"select * from %s where name = '%s' and chrom = '%s' and chromStart = %d",
 	tdb->table, item, seqName, start);
 sr = sqlGetResult(conn, query);