82aa485d4cd6ee3a840eefa0bd78a54885fb0fa0 Merge parents a8aa20a 38589dd kate Fri Aug 9 14:44:34 2013 -0700 Enable conditional code and merge diff --cc src/hg/hgc/peakClusters.c index 3e4de89,b2aa75f..e1eb459 --- src/hg/hgc/peakClusters.c +++ src/hg/hgc/peakClusters.c @@@ -12,33 -13,32 +13,34 @@@ #include "common.h" #include "hash.h" #include "jksql.h" #include "obscure.h" #include "hCommon.h" #include "hdb.h" #include "web.h" #include "cart.h" #include "trackDb.h" #include "hui.h" #include "hgc.h" #include "encode/encodePeak.h" #include "expRecord.h" #include "bed6FloatScore.h" #include "ra.h" + #include "factorSource.h" ++// TODO: needed for conditional def/hard-coded table name (remove when this is fixed) +#include "txCluster.h" - static void printClusterTableHeader(struct slName *otherCols, boolean withAbbreviation, boolean withDescription, boolean withSignal) /* Print out header fields table of tracks in cluster */ { webPrintLabelCell("#"); if (withSignal) webPrintLabelCell("signal"); if (withAbbreviation) webPrintLabelCell("abr"); struct slName *col; for (col = otherCols; col != NULL; col = col->next) webPrintLabelCell(col->name); if (withDescription) webPrintLabelCell("description"); webPrintLabelCell("more info"); @@@ -337,50 -347,49 +349,50 @@@ else errAbort("Missing required trackDb setting %s for track %s", "inputTableFieldDisplay", tdb->track); webPrintLinkTableEnd(); } printf("", hgcPathAndSettings(), tdb->track); printf("List all items assayed"); printf("
\n"); webNewSection("Track Description"); printTrackHtml(tdb); hFreeConn(&conn); } void doFactorSource(struct sqlConnection *conn, struct trackDb *tdb, char *item, int start) - /* Display detailed info about a cluster of peaks from other tracks. */ + /* Display detailed info about a cluster of TFBS peaks from other tracks. */ { int rowOffset = hOffsetPastBin(database, seqName, tdb->table); char **row; struct sqlResult *sr; char query[256]; char *motifTable = NULL; -#ifdef TXCLUSTER_MOTIFS_TABLE +// TODO: deal with hard-coded table names +//#ifdef TXCLUSTER_MOTIFS_TABLE motifTable = TXCLUSTER_MOTIFS_TABLE; -#endif +//#endif sqlSafef(query, sizeof(query), "select * from %s where name = '%s' and chrom = '%s' and chromStart = %d", tdb->table, item, seqName, start); sr = sqlGetResult(conn, query); row = sqlNextRow(sr); - struct bed *cluster = NULL; + struct factorSource *cluster = NULL; if (row != NULL) - cluster = bedLoadN(row + rowOffset, 15); + cluster = factorSourceLoad(row + rowOffset); sqlFreeResult(&sr); if (cluster != NULL) { char *sourceTable = trackDbRequiredSetting(tdb, "sourceTable"); struct dnaMotif *motif = NULL; struct dnaSeq **seqs = NULL; struct bed6FloatScore *hits = NULL; if(motifTable != NULL && sqlTableExists(conn, motifTable)) { struct sqlResult *sr; int rowOffset; char where[256];