8e43853bd76653bea4566bf16baa3603732d862b
braney
  Tue Feb 1 10:33:17 2011 -0800
change interaction track (eg. ChiaPet) to use score to color, rather than chrom color
diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c
index 2bb354b..5a595a3 100644
--- src/hg/hgTracks/simpleTracks.c
+++ src/hg/hgTracks/simpleTracks.c
@@ -7721,37 +7721,41 @@
 /* Return color of chromosome/scaffold/contig/numeric string. */
 {
 return getSeqColorDefault(seqName, hvg, chromColor[0]);
 }
 
 Color lfChromColor(struct track *tg, void *item, struct hvGfx *hvg)
 /* Return color of chromosome for linked feature type items
  * where the chromosome is listed somewhere in the lf->name. */
 {
 struct linkedFeatures *lf = item;
 return getSeqColorDefault(lf->name, hvg, tg->ixColor);
 }
 
 Color interactionColor(struct track *tg, void *item, struct hvGfx *hvg)
 {
+struct linkedFeatures *lf = item;
+return  tg->colorShades[lf->grayIx];
+
+#ifdef NOTNOW  // leaving this in the code in case we want chrom color again
+
 char *name = tg->itemName(tg, item);
 struct linkedFeatures *lf = item;
 if (slCount(lf->components) == 2)
     return MG_BLACK;
-//errAbort("name %s\n", name);
-//errAbort("name %s chrom %s\n", b->name, b->chrom);
 return getSeqColorDefault(name, hvg, tg->ixColor);
+#endif
 }
 
 void interactionLeftLabels(struct track *tg, int seqStart, int seqEnd,
 	struct hvGfx *hvg, int xOff, int yOff, int width, int height,
 	boolean withCenterLabels, MgFont *font, Color color,
 	enum trackVisibility vis)
 {
 /*
 struct linkedFeatures *lf, *lfList = track->items;
 for (lf = lfList; lf != NULL; lf = lf->next)
     {
     if (tg->itemLabelColor != NULL)
 	color = tg->itemLabelColor(track, lf, hvg);
     int itemHeight = tg->itemHeight(track, lf);
     hvGfxTextRight(hvg, xOff, y, width - 1,
@@ -7776,54 +7780,48 @@
 char *ptr;
 
 if (startsWith(chromName, buffer))
     {
     name = strchr(buffer,'-');
     name++;
     ptr = strchr(name,':');
     *ptr = 0;
     }
 else
     {
     ptr = strchr(buffer,':');
     *ptr = 0;
     }
 
-//return linkedFeaturesName(tg, item);
 return cloneString(name);
 }
 
 void interactionMethods(struct track *tg)
 {
 tg->freeItems = linkedFeaturesFreeItems;
 tg->drawItems = linkedFeaturesDraw;
 tg->drawItemAt = linkedFeaturesDrawAt;
 tg->mapItemName = linkedFeaturesName;
 tg->totalHeight = tgFixedTotalHeightNoOverflow;
-//tg->totalHeight = linkedFeaturesHeight;
 tg->itemHeight = tgFixedItemHeight;
-//tg->itemHeight = linkedFeaturesItemHeight;
 tg->itemStart = linkedFeaturesItemStart;
 tg->itemEnd = linkedFeaturesItemEnd;
 tg->itemNameColor = linkedFeaturesNameColor;
 tg->nextPrevExon = linkedFeaturesNextPrevItem;
 tg->nextPrevItem = linkedFeaturesLabelNextPrevItem;
 tg->loadItems = interactionLoad;
-//tg->itemName = cactusName;
 tg->itemName = interactionName;
-//tg->itemName = linkedFeaturesName;
-//tg->mapItemName = refGeneMapName;
 tg->itemColor = interactionColor;
 tg->itemNameColor = linkedFeaturesNameColor;
 //tg->drawLeftLabels = interactionLeftLabels;
 tg->canPack = TRUE;
 }
 
 #ifndef GBROWSE
 void loadRnaGene(struct track *tg)
 /* Load up rnaGene from database table to track items. */
 {
 bedLoadItem(tg, "rnaGene", (ItemLoader)rnaGeneLoad);
 }
 
 void freeRnaGene(struct track *tg)
 /* Free up rnaGene items. */