9784213b1d0017a834b3c74ef6e0c78f1f856ef0
fanhsu
  Mon Sep 12 16:03:47 2011 -0700
Updated query to decide DECIPHER entry color.
diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c
index 2f52093..aa9cbe8 100644
--- src/hg/hgTracks/simpleTracks.c
+++ src/hg/hgTracks/simpleTracks.c
@@ -5090,31 +5090,33 @@
 char **row;
 char query[256];
 char cond_str[256];
 char *decipherId = NULL;
 
 /* color scheme:
 	RED:	If the entry is a deletion (mean ratio < 0)
 	BLUE:	If the entry is a duplication (mean ratio > 0)
 */
 safef(cond_str, sizeof(cond_str),"name='%s' ", bed->name);
 decipherId = sqlGetField(database, "decipher", "name", cond_str);
 if (decipherId != NULL)
     {
     if (hTableExists(database, "decipherRaw"))
     	{
-    	safef(query, sizeof(query), "select mean_ratio > 0 from decipherRaw where id = '%s'", decipherId);
+    	safef(query, sizeof(query), 
+	      "select mean_ratio > 0 from decipherRaw where id = '%s' and start=%d and end=%d", 
+	      decipherId, bed->chromStart+1, bed->chromEnd);
     	sr = sqlGetResult(conn, query);
     	if ((row = sqlNextRow(sr)) != NULL)
             {
 	    if (sameWord(row[0], "1"))
 	    	{
 	    	col = MG_BLUE;
 	    	}
 	    else
 		{
 	    	col = MG_RED;
 		}
 	    }
 	sqlFreeResult(&sr);
     	/* add more logic here to check for mean_ratio = 0
 	   (which is a problem to be fixed by DECIPHER */