src/hg/hgTables/intersect.c 1.48

1.48 2009/03/17 04:28:39 kent
Adding parameter to getHti, and creating a hti object for bigBed tables out of the associated .as information.
Index: src/hg/hgTables/intersect.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/hgTables/intersect.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -b -B -U 4 -r1.47 -r1.48
--- src/hg/hgTables/intersect.c	13 Mar 2009 23:04:52 -0000	1.47
+++ src/hg/hgTables/intersect.c	17 Mar 2009 04:28:39 -0000	1.48
@@ -128,9 +128,9 @@
 char *op, *setting;
 boolean wigOptions = (isWiggle(database, curTable) || isBedGraph(curTable));
 // Note - bigWig is purposely left out of wigOptions.   It supports more intersection options
 // than wig does.
-struct hTableInfo *hti1 = maybeGetHti(database, curTable), *hti2 = NULL;
+struct hTableInfo *hti1 = maybeGetHti(database, curTable, conn), *hti2 = NULL;
 htmlOpen("Intersect with %s", name);
 
 hPrintf("<FORM ACTION=\"%s\" NAME=\"mainForm\" METHOD=GET>\n", getScriptName());
 cartSaveSession(cart);
@@ -143,9 +143,9 @@
 iName = iTrack->shortLabel;
 
 hPrintf("<TR><TD>\n");
 iTable = showTableField(iTrack, hgtaNextIntersectTable, FALSE);
-hti2 = maybeGetHti(database, iTable);
+hti2 = maybeGetHti(database, iTable, conn);
 hPrintf("</TD></TR>\n");
 hPrintf("</TABLE>\n");
 
 if (!wigOptions)
@@ -486,9 +486,9 @@
  * Consult CGI vars to figure out what table it is. */
 {
 boolean invTable2 = cartCgiUsualBoolean(cart, hgtaInvertTable2, FALSE);
 char *table2 = cartString(cart, hgtaIntersectTable);
-struct hTableInfo *hti2 = getHti(database, table2);
+struct hTableInfo *hti2 = getHti(database, table2, conn);
 struct lm *lm2 = lmInit(64*1024);
 Bits *bits2 = bitAlloc(chromSize+8);
 struct bed *bedList2 = getFilteredBeds(conn, table2, region, lm2, NULL);
 if (!isBpWise)
@@ -539,9 +539,9 @@
 int chromSize = hChromSize(database, region->chrom);
 boolean isBpWise = (sameString("and", op) || sameString("or", op));
 Bits *bits2 = bitsForIntersectingTable(conn, region, chromSize, isBpWise);
 /* Set up some other local vars. */
-struct hTableInfo *hti1 = getHti(database, table1);
+struct hTableInfo *hti1 = getHti(database, table1, conn);
 struct bed *intersectedBedList = NULL;
 
 /* Produce intersectedBedList. */
 if (isBpWise)
@@ -613,9 +613,9 @@
 if (! anySubtrackMerge(db, table))
     return getRegionAsBed(db, table, region, filter, idHash, lm, retFieldCount);
 else
     {
-    struct hTableInfo *hti = getHti(database, table);
+    struct hTableInfo *hti = getHtiOnDb(database, table);
     int chromSize = hChromSize(database, region->chrom);
     Bits *bits1 = NULL;
     Bits *bits2 = NULL;
     struct bed *bedMerged = NULL;
@@ -666,9 +666,9 @@
 	if (! sameString(curTable, subtrack->tableName) &&
 	    isSubtrackMerged(subtrack->tableName) &&
 	    sameString(subtrack->type, primaryType))
 	    {
-	    struct hTableInfo *hti2 = getHti(database, subtrack->tableName);
+	    struct hTableInfo *hti2 = getHtiOnDb(database, subtrack->tableName);
 	    struct lm *lm2 = lmInit(64*1024);
 	    struct bed *bedList2 =
 		getRegionAsBed(db, subtrack->tableName, region, NULL, idHash,
 			       lm2, NULL);