src/hg/hgTracks/simpleTracks.c 1.114
1.114 2009/12/01 05:49:36 kent
Moving a few bigBed-specific functions from bedTrack.c to new modulc bigBedTrack.c Making bigBeds in dense mode do drawing by querying summary rather than going through itemList. Making it so that it only loads maxItems+1 (251 by default) items before flipping to dense. Making it draw density plot in grayscale if denseCoverage is set. Net result should be reduced bigBed i/o when zoomed out.
Index: src/hg/hgTracks/simpleTracks.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/simpleTracks.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -b -B -U 4 -r1.113 -r1.114
--- src/hg/hgTracks/simpleTracks.c 17 Nov 2009 20:47:49 -0000 1.113
+++ src/hg/hgTracks/simpleTracks.c 1 Dec 2009 05:49:36 -0000 1.114
@@ -319,16 +319,19 @@
{
return tg->lineHeight;
}
+int maximumTrackItems(struct track *tg)
+/* Return the maximum number of items allowed in track. */
+{
+return trackDbFloatSettingOrDefault(tg->tdb, "maxItems", maxItemsInFullTrack);
+}
+
int maximumTrackHeight(struct track *tg)
/* Return the maximum track height allowed in pixels. */
{
-int maxItems = maxItemsInFullTrack;
-char *maxItemsString = trackDbSetting(tg->tdb, "maxItems");
-if (maxItemsString != NULL)
- maxItems = sqlUnsigned(maxItemsString);
-return maxItems * tl.fontHeight; //tg->lineHeight; ?
+int maxItems = maximumTrackItems(tg);
+return maxItems * tl.fontHeight;
}
static int maxItemsToOverflow(struct track *tg)
/* Return the maximum number of items to allow overflow indication. */
@@ -3050,12 +3053,17 @@
MgFont *font, Color color, enum trackVisibility vis)
/* Draw linked features items. */
{
clearColorBin();
-if (vis == tvDense && tg->colorShades)
+if (vis == tvDense && tg->isBigBed)
+ bigBedDrawDense(tg, seqStart, seqEnd, hvg, xOff, yOff, width, font, color);
+else
+ {
+ if (vis == tvDense && tg->colorShades)
slSort(&tg->items, cmpLfWhiteToBlack);
-genericDrawItems(tg, seqStart, seqEnd, hvg, xOff, yOff, width,
+ genericDrawItems(tg, seqStart, seqEnd, hvg, xOff, yOff, width,
font, color, vis);
+ }
}
void incRange(UBYTE *start, int size)
/* Add one to range of bytes, taking care to not overflow. */
@@ -8923,10 +8931,9 @@
{
struct track *subtrack;
int subCnt = subtrackCount(tg->subtracks);
maxHeight = maxHeight * max(subCnt,1);
- for (subtrack = tg->subtracks; subtrack != NULL;
- subtrack = subtrack->next)
+ for (subtrack = tg->subtracks; subtrack != NULL; subtrack = subtrack->next)
limitVisibility(subtrack);
}
while((h = tg->totalHeight(tg, vis)) > maxHeight && vis != tvDense)
{
@@ -10590,9 +10597,9 @@
track->itemColor = genePredItemClassColor;
}
else if (sameWord(type, "bigBed"))
{
- complexBedMethods(track, tdb, TRUE, wordCount, words);
+ bigBedMethods(track, tdb, wordCount, words);
}
else if (sameWord(type, "bedGraph"))
{
bedGraphMethods(track, tdb, wordCount, words);