src/hg/instinct/lib/hgHeatmapLib.c 1.61

1.61 2009/08/19 22:08:37 jzhu
fix bug find all overlaping probes not just within probes to draw heatmap, summary view
Index: src/hg/instinct/lib/hgHeatmapLib.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/instinct/lib/hgHeatmapLib.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -b -B -U 4 -r1.60 -r1.61
--- src/hg/instinct/lib/hgHeatmapLib.c	4 Jun 2009 03:45:52 -0000	1.60
+++ src/hg/instinct/lib/hgHeatmapLib.c	19 Aug 2009 22:08:37 -0000	1.61
@@ -984,20 +984,13 @@
 char query[512];
 query[0] = '\0';
 
 safef(query, sizeof(query),
-      "select * from %s where chrom = '%s' and chromStart>%d and chromEnd<%d",
-      tableName, chrom, start, stop); 
+      "select * from %s where chrom = '%s' and chromStart<%d and chromEnd>%d",
+      tableName, chrom, stop,start);
 
 struct sqlConnection *conn = hAllocConnProfile(heatMapDbProfile, database);
 
-if (!sqlExists(conn, query))
-    {  /* found nothing, now check to see if you're inside of a probe. */
-    safef(query, sizeof(query), 
-	  "select * from %s where chrom = '%s' and chromStart<%d and chromEnd>%d",
-	  tableName, chrom, stop, start);
-    }
-
 struct sqlResult *sr = sqlGetResult(conn, query);
 struct bed *tuple = NULL;
 struct bed *tupleList = NULL;
 
@@ -1079,21 +1072,15 @@
 
 char **row = NULL;
 
 char query[256];
+
 safef(query, sizeof(query), 
-      "select * from %s where chrom = '%s' and chromStart>%d and chromEnd<%d",
-      tableName, chrom, start, stop);
+      "select * from %s where chrom = '%s' and chromStart<%d and chromEnd>%d",
+      tableName, chrom, stop,start);
 
 struct sqlConnection *conn = hAllocConnProfile(heatMapDbProfile, database);
 
-if (!sqlExists(conn, query))
-    {  /* found nothing, now check to see if you're inside of a probe. */
-    safef(query, sizeof(query), 
-	  "select * from %s where chrom = '%s' and chromStart<%d and chromEnd>%d",
-	  tableName, chrom, stop, start);
-    }
-
 struct sqlResult *sr = sqlGetResult(conn, query);
 struct bed *tuple = NULL;
 struct bed *tupleList = NULL;