5b7c7f2a08d4eb035063f24655507b6e72931e42 braney Tue Feb 1 14:28:57 2011 -0800 if you add exonArrows to broadPeak trackDb, draw the arrows on full size track #2189 diff --git src/hg/hgTracks/encode.c src/hg/hgTracks/encode.c index d89f88d..f01e413 100644 --- src/hg/hgTracks/encode.c +++ src/hg/hgTracks/encode.c @@ -1,27 +1,29 @@ /* encode.c - hgTracks routines that are specific to the ENCODE project */ #include "common.h" #include "hCommon.h" #include "hdb.h" #include "hui.h" #include "hgTracks.h" #include "customTrack.h" #include "encode.h" #include "encode/encodeRna.h" #include "encode/encodePeak.h" +extern struct trackLayout tl; + static char const rcsid[] = "$Id: encode.c,v 1.24 2010/05/11 01:43:27 kent Exp $"; #define SMALLBUF 128 char *encodeErgeName(struct track *tg, void *item) /* return the actual data name, in form xx/yyyy cut off xx/ return yyyy */ { char *name; struct linkedFeatures *lf = item; name = strstr(lf->name, "/"); if (name != NULL) name ++; if (name != NULL) return name; return "unknown"; @@ -224,39 +226,62 @@ { struct customTrack *ct = tg->customPt; encodePeakLoadItemsBoth(tg, ct); } static void encodePeakDrawAt(struct track *tg, void *item, struct hvGfx *hvg, int xOff, int y, double scale, MgFont *font, Color color, enum trackVisibility vis) /* Draw the peak from the linkedFeature. Currently this doesn't draw any */ /* sorta shading based on the signalValue/pValue. */ { struct linkedFeatures *lf = item; int heightPer = tg->heightPer; int shortOff = heightPer/4; int shortHeight = heightPer - 2*shortOff; +char *exonArrows = trackDbSettingClosestToHomeOrDefault(tg->tdb, "exonArrows", "off"); +boolean drawArrows = FALSE; +if ((exonArrows != NULL) && sameString(exonArrows, "on")) + drawArrows = TRUE; Color rangeColor = shadesOfGray[lf->grayIx]; -Color peakColor = (tg->ixColor != blackIndex()) ? tg->ixColor : getOrangeColor();; +Color peakColor = (tg->ixColor != blackIndex()) ? tg->ixColor : getOrangeColor(); +if (drawArrows) + { + shortOff = 0; + shortHeight = heightPer; + } if (lf->components) { struct simpleFeature *sf; drawScaledBox(hvg, lf->start, lf->end, scale, xOff, y+(heightPer/2), 1, rangeColor); for (sf = lf->components; sf != NULL; sf = sf->next) + { drawScaledBox(hvg, sf->start, sf->end, scale, xOff, y+shortOff, shortHeight, rangeColor); + if (drawArrows) + { + int x1 = round((double)(sf->start-winStart)*scale) + xOff; + int x2 = round((double)(sf->end-winStart)*scale) + xOff; + int w = x2-x1; + if (w < 1) + w = 1; + + clippedBarbs(hvg, x1, y + heightPer/2, w, + tl.barbHeight, tl.barbSpacing, lf->orientation, + MG_WHITE, FALSE); + } + } } else drawScaledBox(hvg, lf->start, lf->end, scale, xOff, y+shortOff, shortHeight, rangeColor); if ((lf->tallEnd > 0) && (lf->tallStart < lf->end)) drawScaledBox(hvg, lf->tallStart, lf->tallEnd, scale, xOff, y, heightPer, peakColor); } char *encodePeakItemName(struct track *tg, void *item) /* Get rid of the '.' names */ { struct linkedFeatures *lf = item; if (lf->name && sameString(lf->name, ".")) return "";