2b0605543d897a5fb6a6139f6a107742daeb3e67
braney
  Sat May 26 17:01:37 2012 -0700
add ability to highlight linkedFeatures with a colored box around the existing boxes.  Will be used by Mark to highlight Gencode genes that satisfy filtering requirements.
diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c
index 5453233..860fd7e 100644
--- src/hg/hgTracks/simpleTracks.c
+++ src/hg/hgTracks/simpleTracks.c
@@ -2632,73 +2632,107 @@
     // sometimes a bed <8 will get passed off as a bed 8, tsk tsk
     tallStart = lf->start;
     tallEnd   = lf->end;
     }
 x1 = round((double)((int)lf->start-winStart)*scale) + xOff;
 x2 = round((double)((int)lf->end-winStart)*scale) + xOff;
 w = x2-x1;
 if (!hideLine)
     {
     innerLine(hvg, x1, midY, w, color);
     }
 if (!hideArrows)
     {
     if ((intronGap == 0) && (vis == tvFull || vis == tvPack))
 	{
+	if (lf->highlightColor)
+	    clippedBarbs(hvg, x1, midY, w, tl.barbHeight, tl.barbSpacing,
+		     lf->orientation, lf->highlightColor, FALSE);
+	else
 	clippedBarbs(hvg, x1, midY, w, tl.barbHeight, tl.barbSpacing,
 		 lf->orientation, bColor, FALSE);
 	}
     }
 
 components = (lf->codons && zoomedToCdsColorLevel) ?
 	      lf->codons : lf->components;
 for (sf = components; sf != NULL; sf = sf->next)
     {
     s = sf->start; e = sf->end;
 
     /* Draw UTR portion(s) of exon, if any: */
     if (s < tallStart)
 	{
 	e2 = e;
 	if (e2 > tallStart) e2 = tallStart;
+	if (lf->highlightColor)
+	    {
+	    drawScaledBoxSample(hvg, s, e2, scale, xOff, y+shortOff , shortHeight ,
+		lf->highlightColor, lf->score);
+	    drawScaledBoxSample(hvg, s, e2, scale, xOff + 1, y+shortOff + 1, shortHeight - 2,
+		color, lf->score);
+	    }
+	else
+	    {
 	drawScaledBoxSample(hvg, s, e2, scale, xOff, y+shortOff, shortHeight,
             color, lf->score);
+	    }
 	s = e2;
 	}
     if (e > tallEnd)
 	{
 	s2 = s;
 	if (s2 < tallEnd) s2 = tallEnd;
+	if (lf->highlightColor)
+	    {
 	drawScaledBoxSample(hvg, s2, e, scale, xOff, y+shortOff, shortHeight,
+		lf->highlightColor, lf->score);
+	    drawScaledBoxSample(hvg, s2, e, scale, xOff+1, y+shortOff+1, shortHeight-2,
             color, lf->score);
+	    }
+	else
+	    {
+	    drawScaledBoxSample(hvg, s2, e, scale, xOff, y+shortOff, shortHeight,
+		color, lf->score);
+	    }
 	e = s2;
 	}
     /* Draw "tall" portion of exon (or codon) */
     if (e > s)
 	{
         if (drawOpt > baseColorDrawOff &&
             e + 6 >= winStart && s - 6 < winEnd &&
 	    (e-s <= 3 || !baseColorNeedsCodons))
                 baseColorDrawItem(tg, lf, sf->grayIx, hvg, xOff, y,
 				  scale, font, s, e, heightPer,
 				  zoomedToCodonLevel, mrnaSeq, sf, psl,
 				  drawOpt,
 				  MAXPIXELS, winStart, color);
         else
             {
+	    if (lf->highlightColor)
+		{
             drawScaledBoxSample(hvg, s, e, scale, xOff, y, heightPer,
+				    lf->highlightColor, lf->score );
+		drawScaledBoxSample(hvg, s, e, scale, xOff+1, y+1, heightPer-2,
                                 color, lf->score );
+		}
+	    else
+		{
+		drawScaledBoxSample(hvg, s, e, scale, xOff, y, heightPer,
+				    color, lf->score );
+		}
 
             if (exonArrowsAlways || (exonArrows &&
                 /* Display barbs only if no intron is visible on the item.
                    This occurs when the exon completely spans the window,
                    or when it is the first or last intron in the feature and
                    the following/preceding intron isn't visible */
                 (sf->start <= winStart || sf->start == lf->start) &&
                 (sf->end >= winEnd || sf->end == lf->end)))
                     {
                     Color barbColor = hvGfxContrastingColor(hvg, color);
                     x1 = round((double)((int)s-winStart)*scale) + xOff;
                     x2 = round((double)((int)e-winStart)*scale) + xOff;
                     w = x2-x1;
                     clippedBarbs(hvg, x1+1, midY, x2-x1-2,
 		    		tl.barbHeight, tl.barbSpacing, lf->orientation,