src/hg/instinct/bioInt2/bioIntDb.h 1.7
1.7 2009/04/30 19:54:28 jsanborn
added factor graph pipeline and code
Index: src/hg/instinct/bioInt2/bioIntDb.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/instinct/bioInt2/bioIntDb.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -b -B -U 4 -r1.6 -r1.7
--- src/hg/instinct/bioInt2/bioIntDb.h 27 Apr 2009 06:15:48 -0000 1.6
+++ src/hg/instinct/bioInt2/bioIntDb.h 30 Apr 2009 19:54:28 -0000 1.7
@@ -1393,8 +1393,87 @@
#define analysisValsCommaOut(el,f) analysisValsOutput(el,f,',',',');
/* Print out analysisVals as a comma separated list including final comma. */
+#define PATHWAYVALS_NUM_COLS 5
+
+struct pathwayVals
+/* All pathway vals */
+ {
+ struct pathwayVals *next; /* Next in singly linked list. */
+ unsigned pathway_id; /* Pathway Id */
+ unsigned sample_id; /* Sample Id */
+ unsigned feature_id; /* Analysis Feature Id */
+ float val; /* Val */
+ float conf; /* Confidence */
+ };
+
+void pathwayValsStaticLoad(char **row, struct pathwayVals *ret);
+/* Load a row from pathwayVals table into ret. The contents of ret will
+ * be replaced at the next call to this function. */
+
+struct pathwayVals *pathwayValsLoad(char **row);
+/* Load a pathwayVals from row fetched with select * from pathwayVals
+ * from database. Dispose of this with pathwayValsFree(). */
+
+struct pathwayVals *pathwayValsLoadAll(char *fileName);
+/* Load all pathwayVals from whitespace-separated file.
+ * Dispose of this with pathwayValsFreeList(). */
+
+struct pathwayVals *pathwayValsLoadAllByChar(char *fileName, char chopper);
+/* Load all pathwayVals from chopper separated file.
+ * Dispose of this with pathwayValsFreeList(). */
+
+#define pathwayValsLoadAllByTab(a) pathwayValsLoadAllByChar(a, '\t');
+/* Load all pathwayVals from tab separated file.
+ * Dispose of this with pathwayValsFreeList(). */
+
+struct pathwayVals *pathwayValsLoadByQuery(struct sqlConnection *conn, char *query);
+/* Load all pathwayVals from table that satisfy the query given.
+ * Where query is of the form 'select * from example where something=something'
+ * or 'select example.* from example, anotherTable where example.something =
+ * anotherTable.something'.
+ * Dispose of this with pathwayValsFreeList(). */
+
+void pathwayValsSaveToDb(struct sqlConnection *conn, struct pathwayVals *el, char *tableName, int updateSize);
+/* Save pathwayVals as a row to the table specified by tableName.
+ * As blob fields may be arbitrary size updateSize specifies the approx size
+ * of a string that would contain the entire query. Arrays of native types are
+ * converted to comma separated strings and loaded as such, User defined types are
+ * inserted as NULL. Note that strings must be escaped to allow insertion into the database.
+ * For example "autosql's features include" --> "autosql\'s features include"
+ * If worried about this use pathwayValsSaveToDbEscaped() */
+
+void pathwayValsSaveToDbEscaped(struct sqlConnection *conn, struct pathwayVals *el, char *tableName, int updateSize);
+/* Save pathwayVals as a row to the table specified by tableName.
+ * As blob fields may be arbitrary size updateSize specifies the approx size.
+ * of a string that would contain the entire query. Automatically
+ * escapes all simple strings (not arrays of string) but may be slower than pathwayValsSaveToDb().
+ * For example automatically copies and converts:
+ * "autosql's features include" --> "autosql\'s features include"
+ * before inserting into database. */
+
+struct pathwayVals *pathwayValsCommaIn(char **pS, struct pathwayVals *ret);
+/* Create a pathwayVals out of a comma separated string.
+ * This will fill in ret if non-null, otherwise will
+ * return a new pathwayVals */
+
+void pathwayValsFree(struct pathwayVals **pEl);
+/* Free a single dynamically allocated pathwayVals such as created
+ * with pathwayValsLoad(). */
+
+void pathwayValsFreeList(struct pathwayVals **pList);
+/* Free a list of dynamically allocated pathwayVals's */
+
+void pathwayValsOutput(struct pathwayVals *el, FILE *f, char sep, char lastSep);
+/* Print out pathwayVals. Separate fields with sep. Follow last field with lastSep. */
+
+#define pathwayValsTabOut(el,f) pathwayValsOutput(el,f,'\t','\n');
+/* Print out pathwayVals as a line in a tab-separated file. */
+
+#define pathwayValsCommaOut(el,f) pathwayValsOutput(el,f,',',',');
+/* Print out pathwayVals as a comma separated list including final comma. */
+
#define COHORTCORR_NUM_COLS 2
struct cohortCorr
/* Cohort Correlation tables */