src/hg/hgTables/intersect.c 1.50
1.50 2009/04/14 14:16:35 angie
anyIntersection() was forgetting to check whether the primary table is positional.
Index: src/hg/hgTables/intersect.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTables/intersect.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -b -B -U 4 -r1.49 -r1.50
--- src/hg/hgTables/intersect.c 10 Apr 2009 20:04:29 -0000 1.49
+++ src/hg/hgTables/intersect.c 14 Apr 2009 14:16:35 -0000 1.50
@@ -36,18 +36,29 @@
/* This is already duplicated in correlate.c and is handy -- should be
* libified, probably in cart.h. */
void removeCartVars(struct cart *cart, char **vars, int varCount);
+static boolean canIntersect(char *db, char *table)
+/* Return true if table exists and is positional. */
+{
+if (isCustomTrack(table) && lookupCt(table) != NULL)
+ return TRUE;
+if (sameWord(table, WIKI_TRACK_TABLE))
+ return TRUE;
+if (hTableOrSplitExists(db, table))
+ return isPositional(db, table);
+return FALSE;
+}
+
boolean anyIntersection()
/* Return TRUE if there's an intersection to do. */
{
boolean specd = (cartVarExists(cart, hgtaIntersectTrack) &&
cartVarExists(cart, hgtaIntersectTable));
-if (specd)
+if (specd && canIntersect(database, curTable))
{
char *table = cartString(cart, hgtaIntersectTable);
- if ((isCustomTrack(table) && lookupCt(table) != NULL) ||
- hTableOrSplitExists(database, table) || sameWord(table, WIKI_TRACK_TABLE))
+ if (canIntersect(database, table))
return TRUE;
else
{
/* If the specified intersect table doesn't exist (e.g. if we