src/hg/near/hgNear/expRatio.c 1.42
1.42 2009/03/03 23:29:02 aamp
Changed the expRatio column type so that it doesn't need to have a knownTo* table, rather a "null" indicates that the microarray table uses knownGene identifiers.
Index: src/hg/near/hgNear/expRatio.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/near/hgNear/expRatio.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -b -B -U 4 -r1.41 -r1.42
--- src/hg/near/hgNear/expRatio.c 29 Jan 2009 09:06:25 -0000 1.41
+++ src/hg/near/hgNear/expRatio.c 3 Mar 2009 23:29:02 -0000 1.42
@@ -64,9 +64,9 @@
static boolean expRatioExists(struct column *col, struct sqlConnection *conn)
/* This returns true if relevant tables exist. */
{
-boolean tableOk = sqlTableExists(conn, col->table);
+boolean tableOk = sameWord(col->table, "null") || sqlTableExists(conn, col->table);
boolean posTableOk = sqlTableExists(conn, col->posTable);
boolean expTableOk = sqlTableExists(conn, col->experimentTable);
return tableOk && posTableOk && expTableOk;
}
@@ -255,10 +255,10 @@
{
if (expAdvFilterUsed(col, subName))
{
struct hash *expHash = expValHash(dataConn, dataTable);
- struct hash *nameExpHash = getNameExpHash(lookupConn, lookupTable,
- "name", "value", expHash);
+ struct hash *nameExpHash = sameWord(lookupTable,"null") ? expHash :
+ getNameExpHash(lookupConn, lookupTable, "name", "value", expHash);
boolean orLogic = advFilterOrLogic(col, "logic", FALSE);
int isMax;
int repIx;
char *varValString;
@@ -722,16 +722,18 @@
{
char query[256];
char expName[64];
float maxVal = -10000;
-
-safef(query, sizeof(query), "select value from %s where name = '%s'",
+boolean noLookup = sameWord(col->table, "null");
+if (!noLookup)
+ safef(query, sizeof(query), "select value from %s where name = '%s'",
col->table, gp->name);
-if (sqlQuickQuery(conn, query, expName, sizeof(expName)) != NULL)
+if (noLookup ||
+ (sqlQuickQuery(conn, query, expName, sizeof(expName)) != NULL))
{
char *commaString = NULL;
safef(query, sizeof(query), "select expScores from %s where name = '%s'",
- col->posTable, expName);
+ col->posTable, (noLookup) ? gp->name : expName);
if ((commaString = sqlQuickString(fConn, query)) != NULL)
{
float *vals = NULL;
int valCount, i;