817da770acd71c1ad401d9667e69807b6952e755 braney Tue Jun 5 11:39:35 2012 -0700 add another mode for highlighting for Mark and GENCODE diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c index 860fd7e..9269af4 100644 --- src/hg/hgTracks/simpleTracks.c +++ src/hg/hgTracks/simpleTracks.c @@ -2624,104 +2624,116 @@ } if (psl && drawOpt == baseColorDrawCds && !zoomedToCdsColorLevel) baseColorSetCdsBounds(lf, psl, tg); tallStart = lf->tallStart; tallEnd = lf->tallEnd; if ((tallStart == 0 && tallEnd == 0) && !sameWord(tg->table, "jaxQTL3")) { // 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; + +// are we highlighting this feature with background highlighting +if (lf->highlightColor && (lf->highlightMode == highlightBackground)) + { + // draw the background + hvGfxBox(hvg, x1, y, w, heightPer, lf->highlightColor); + + // draw the item slightly smaller + y++; + heightPer -=2; + } + if (!hideLine) { innerLine(hvg, x1, midY, w, color); } if (!hideArrows) { if ((intronGap == 0) && (vis == tvFull || vis == tvPack)) { - if (lf->highlightColor) + if (lf->highlightColor && (lf->highlightMode == highlightOutline)) 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) + if (lf->highlightColor && (lf->highlightMode == highlightOutline)) { 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) + if (lf->highlightColor && (lf->highlightMode == highlightOutline)) { 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) + if (lf->highlightColor && (lf->highlightMode == highlightOutline)) { 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,