src/hg/hgTracks/hgTracks.c 1.1562
1.1562 2009/03/19 22:21:06 angie
Refactoring for performance issue raised by David: moved all baseColor work that was done at load-time to draw-time, and removed the freeing-by-default of original genePred and psl structs converted to lf. Now, when there are so many items in the window that limitVisibility kicks it down to dense mode, we don't waste time on baseColor stuff that won't be used. Also some refactoring for tidiness in cds.c: got rid of a couple unused function args.
Index: src/hg/hgTracks/hgTracks.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/hgTracks.c,v
retrieving revision 1.1561
retrieving revision 1.1562
diff -b -B -U 4 -r1.1561 -r1.1562
--- src/hg/hgTracks/hgTracks.c 13 Mar 2009 23:30:13 -0000 1.1561
+++ src/hg/hgTracks/hgTracks.c 19 Mar 2009 22:21:06 -0000 1.1562
@@ -593,8 +593,9 @@
struct targetDb *target;
if (! pcrResultParseCart(database, cart, &pslFileName, &primerFileName, &target))
return;
+/* Don't free psl -- used in drawing phase by baseColor code. */
struct psl *pslList = pslLoadAll(pslFileName), *psl;
struct linkedFeatures *itemList = NULL;
if (target != NULL)
{
@@ -638,11 +639,9 @@
safef(extraInfo, sizeof(extraInfo), "%s|%d|%d",
(itemName ? itemName : ""), tpsl->tStart, tpsl->tEnd);
lf->extra = cloneString(extraInfo);
slAddHead(&itemList, lf);
- pslFree(&trimmed);
}
- pslFree(&gpsl);
}
}
hFreeConn(&conn);
}
@@ -656,9 +655,8 @@
safecpy(lf->name, sizeof(lf->name), "");
lf->extra = cloneString("");
slAddHead(&itemList, lf);
}
-pslFreeList(&pslList);
slSort(&itemList, linkedFeaturesCmp);
tg->items = itemList;
}
@@ -739,9 +737,9 @@
return fileExists(pslFileName) && fileExists(faFileName);
}
void loadUserPsl(struct track *tg)
-/* Load up rnas from table into track items. */
+/* Load up hgBlat results from table into track items. */
{
char *ss = userSeqString;
char buf2[3*512];
char *faFileName, *pslFileName;
@@ -749,13 +747,8 @@
struct psl *psl;
struct linkedFeatures *lfList = NULL, *lf;
enum gfType qt, tt;
int sizeMul = 1;
-enum baseColorDrawOpt drawOpt = baseColorGetDrawOpt(tg);
-boolean indelShowDoubleInsert, indelShowQueryInsert, indelShowPolyA;
-
-indelEnabled(cart, (tg ? tg->tdb : NULL), basesPerPixel,
- &indelShowDoubleInsert, &indelShowQueryInsert, &indelShowPolyA);
parseSs(ss, &pslFileName, &faFileName);
pslxFileOpen(pslFileName, &qt, &tt, &f);
if (qt == gftProt)
@@ -772,13 +765,9 @@
lf = lfFromPslx(psl, sizeMul, TRUE, FALSE, tg);
sprintf(buf2, "%s %s", ss, psl->qName);
lf->extra = cloneString(buf2);
slAddHead(&lfList, lf);
- if (drawOpt > baseColorDrawOff ||
- indelShowQueryInsert || indelShowPolyA)
- lf->original = psl;
- else
- pslFree(&psl);
+ /* Don't free psl -- used in drawing phase by baseColor code. */
}
else
pslFree(&psl);
}