src/hg/hgTracks/switchGear.c 1.7
1.7 2010/05/11 01:43:28 kent
Refactoring to split the trackDb.tableName field into separate track and table fields. Similarly track.mapName field goes to the same track and table fields.
Index: src/hg/hgTracks/switchGear.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTracks/switchGear.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -b -B -U 1000000 -r1.6 -r1.7
--- src/hg/hgTracks/switchGear.c 21 Dec 2009 22:43:35 -0000 1.6
+++ src/hg/hgTracks/switchGear.c 11 May 2010 01:43:28 -0000 1.7
@@ -1,76 +1,76 @@
/* Module for SwitchGear Genomics tracks. */
#include "common.h"
#include "hgTracks.h"
#include "switchGear.h"
struct slList *switchDbTssLoadConduit(char **row)
{
return (struct slList *)switchDbTssLoad(row);
}
boolean switchDbTssFilterPseudo(struct slList *slItem)
/* "Include pseudogenes" checkbox filter. */
{
struct switchDbTss *item = (struct switchDbTss *)slItem;
boolean includePseudo = cartUsualBoolean(cart, "switchDbTss.pseudo", FALSE);
if (item == NULL)
return FALSE;
if (!includePseudo && (item->isPseudo == 1))
return FALSE;
return TRUE;
}
struct linkedFeatures *lfFromSwitchDbTss(struct slList *item)
/* Translate a switchDbTss thing into a linkedFeatures. */
{
struct switchDbTss *tss = (struct switchDbTss *)item;
struct linkedFeatures *lf;
struct simpleFeature *sf;
AllocVar(lf);
lf->start = tss->chromStart;
lf->end = tss->chromEnd;
lf->tallStart = tss->chromStart;
lf->tallEnd = tss->chromEnd;
lf->filterColor = -1;
lf->orientation = orientFromChar(tss->strand[0]);
lf->grayIx = grayInRange((int)tss->confScore, 0, 100);
lf->name = cloneString(tss->name);
AllocVar(sf);
sf->start = tss->chromStart;
sf->end = tss->chromEnd;
sf->grayIx = lf->grayIx;
lf->components = sf;
lf->codons = CloneVar(sf);
return lf;
}
void loadItemsSwitchDbTss(struct track *tg)
/* Load switchDbTss items into a linkedFeatures list. */
{
char optionScoreStr[128]; /* Option - score filter */
safef(optionScoreStr, sizeof(optionScoreStr), "%s.scoreFilter",
- tg->tdb->tableName);
+ tg->tdb->track);
if (!cartVarExists(cart, optionScoreStr))
cartSetInt(cart, optionScoreStr, SWITCHDBTSS_FILTER);
loadLinkedFeaturesWithLoaders(tg, switchDbTssLoadConduit, lfFromSwitchDbTss,
"confScore", NULL, switchDbTssFilterPseudo);
}
Color switchDbTssItemColor(struct track *tg, void *item, struct hvGfx *hvg)
/* Return color to switchDbTss item */
{
struct linkedFeatures *thisItem = item;
int grayIx = thisItem->grayIx;
if (grayIx == 1)
grayIx++;
return shadesOfBrown[grayIx];
}
void switchDbTssMethods(struct track *tg)
/* Methods for switchDbTss track uses mostly linkedFeatures stuff. */
{
linkedFeaturesMethods(tg);
tg->loadItems = loadItemsSwitchDbTss;
tg->itemColor = switchDbTssItemColor;
}