src/hg/instinct/inc/hgHeatmapCustomDb.h 1.1

1.1 2009/05/05 22:43:59 sbenz
Adding autosql for the custom clinical db
Index: src/hg/instinct/inc/hgHeatmapCustomDb.h
===================================================================
RCS file: src/hg/instinct/inc/hgHeatmapCustomDb.h
diff -N src/hg/instinct/inc/hgHeatmapCustomDb.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/hg/instinct/inc/hgHeatmapCustomDb.h	5 May 2009 22:43:59 -0000	1.1
@@ -0,0 +1,247 @@
+/* hgHeatmapCustomDb.h was originally generated by the autoSql program, which also 
+ * generated hgHeatmapCustomDb.c and hgHeatmapCustomDb.sql.  This header links the database and
+ * the RAM representation of objects. */
+
+#ifndef HGHEATMAPCUSTOMDB_H
+#define HGHEATMAPCUSTOMDB_H
+
+#include "jksql.h"
+#define FEATURES_NUM_COLS 7
+
+struct features
+/* All Features */
+    {
+    struct features *next;  /* Next in singly linked list. */
+    unsigned id;	/* Unique Id */
+    char *name;	/* Feature Name */
+    char *shortLabel;	/* Short Label */
+    char *longLabel;	/* Long Label */
+    char *filterType;	/* Filter Type */
+    double priority;	/* Priority */
+    char *visibility;	/* Visibility */
+    };
+
+void featuresStaticLoad(char **row, struct features *ret);
+/* Load a row from features table into ret.  The contents of ret will
+ * be replaced at the next call to this function. */
+
+struct features *featuresLoad(char **row);
+/* Load a features from row fetched with select * from features
+ * from database.  Dispose of this with featuresFree(). */
+
+struct features *featuresLoadAll(char *fileName);
+/* Load all features from whitespace-separated file.
+ * Dispose of this with featuresFreeList(). */
+
+struct features *featuresLoadAllByChar(char *fileName, char chopper);
+/* Load all features from chopper separated file.
+ * Dispose of this with featuresFreeList(). */
+
+#define featuresLoadAllByTab(a) featuresLoadAllByChar(a, '\t');
+/* Load all features from tab separated file.
+ * Dispose of this with featuresFreeList(). */
+
+struct features *featuresLoadByQuery(struct sqlConnection *conn, char *query);
+/* Load all features 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 featuresFreeList(). */
+
+void featuresSaveToDb(struct sqlConnection *conn, struct features *el, char *tableName, int updateSize);
+/* Save features 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 featuresSaveToDbEscaped() */
+
+void featuresSaveToDbEscaped(struct sqlConnection *conn, struct features *el, char *tableName, int updateSize);
+/* Save features 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 featuresSaveToDb().
+ * For example automatically copies and converts: 
+ * "autosql's features include" --> "autosql\'s features include" 
+ * before inserting into database. */ 
+
+struct features *featuresCommaIn(char **pS, struct features *ret);
+/* Create a features out of a comma separated string. 
+ * This will fill in ret if non-null, otherwise will
+ * return a new features */
+
+void featuresFree(struct features **pEl);
+/* Free a single dynamically allocated features such as created
+ * with featuresLoad(). */
+
+void featuresFreeList(struct features **pList);
+/* Free a list of dynamically allocated features's */
+
+void featuresOutput(struct features *el, FILE *f, char sep, char lastSep);
+/* Print out features.  Separate fields with sep. Follow last field with lastSep. */
+
+#define featuresTabOut(el,f) featuresOutput(el,f,'\t','\n');
+/* Print out features as a line in a tab-separated file. */
+
+#define featuresCommaOut(el,f) featuresOutput(el,f,',',',');
+/* Print out features as a comma separated list including final comma. */
+
+#define CLINICALDATA_NUM_COLS 4
+
+struct clinicalData
+/* All clinical data */
+    {
+    struct clinicalData *next;  /* Next in singly linked list. */
+    char *patientId;	/* Patient Id */
+    unsigned feature_id;	/* Feature Id */
+    double val;	/* Value */
+    char *code;	/* Coded Value */
+    };
+
+void clinicalDataStaticLoad(char **row, struct clinicalData *ret);
+/* Load a row from clinicalData table into ret.  The contents of ret will
+ * be replaced at the next call to this function. */
+
+struct clinicalData *clinicalDataLoad(char **row);
+/* Load a clinicalData from row fetched with select * from clinicalData
+ * from database.  Dispose of this with clinicalDataFree(). */
+
+struct clinicalData *clinicalDataLoadAll(char *fileName);
+/* Load all clinicalData from whitespace-separated file.
+ * Dispose of this with clinicalDataFreeList(). */
+
+struct clinicalData *clinicalDataLoadAllByChar(char *fileName, char chopper);
+/* Load all clinicalData from chopper separated file.
+ * Dispose of this with clinicalDataFreeList(). */
+
+#define clinicalDataLoadAllByTab(a) clinicalDataLoadAllByChar(a, '\t');
+/* Load all clinicalData from tab separated file.
+ * Dispose of this with clinicalDataFreeList(). */
+
+struct clinicalData *clinicalDataLoadByQuery(struct sqlConnection *conn, char *query);
+/* Load all clinicalData 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 clinicalDataFreeList(). */
+
+void clinicalDataSaveToDb(struct sqlConnection *conn, struct clinicalData *el, char *tableName, int updateSize);
+/* Save clinicalData 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 clinicalDataSaveToDbEscaped() */
+
+void clinicalDataSaveToDbEscaped(struct sqlConnection *conn, struct clinicalData *el, char *tableName, int updateSize);
+/* Save clinicalData 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 clinicalDataSaveToDb().
+ * For example automatically copies and converts: 
+ * "autosql's features include" --> "autosql\'s features include" 
+ * before inserting into database. */ 
+
+struct clinicalData *clinicalDataCommaIn(char **pS, struct clinicalData *ret);
+/* Create a clinicalData out of a comma separated string. 
+ * This will fill in ret if non-null, otherwise will
+ * return a new clinicalData */
+
+void clinicalDataFree(struct clinicalData **pEl);
+/* Free a single dynamically allocated clinicalData such as created
+ * with clinicalDataLoad(). */
+
+void clinicalDataFreeList(struct clinicalData **pList);
+/* Free a list of dynamically allocated clinicalData's */
+
+void clinicalDataOutput(struct clinicalData *el, FILE *f, char sep, char lastSep);
+/* Print out clinicalData.  Separate fields with sep. Follow last field with lastSep. */
+
+#define clinicalDataTabOut(el,f) clinicalDataOutput(el,f,'\t','\n');
+/* Print out clinicalData as a line in a tab-separated file. */
+
+#define clinicalDataCommaOut(el,f) clinicalDataOutput(el,f,',',',');
+/* Print out clinicalData as a comma separated list including final comma. */
+
+#define LABTRACK_NUM_COLS 2
+
+struct labTrack
+/* Sample Conversion */
+    {
+    struct labTrack *next;  /* Next in singly linked list. */
+    char *patientId;	/* Patient Id */
+    char *trackId;	/* Track Id */
+    };
+
+void labTrackStaticLoad(char **row, struct labTrack *ret);
+/* Load a row from labTrack table into ret.  The contents of ret will
+ * be replaced at the next call to this function. */
+
+struct labTrack *labTrackLoad(char **row);
+/* Load a labTrack from row fetched with select * from labTrack
+ * from database.  Dispose of this with labTrackFree(). */
+
+struct labTrack *labTrackLoadAll(char *fileName);
+/* Load all labTrack from whitespace-separated file.
+ * Dispose of this with labTrackFreeList(). */
+
+struct labTrack *labTrackLoadAllByChar(char *fileName, char chopper);
+/* Load all labTrack from chopper separated file.
+ * Dispose of this with labTrackFreeList(). */
+
+#define labTrackLoadAllByTab(a) labTrackLoadAllByChar(a, '\t');
+/* Load all labTrack from tab separated file.
+ * Dispose of this with labTrackFreeList(). */
+
+struct labTrack *labTrackLoadByQuery(struct sqlConnection *conn, char *query);
+/* Load all labTrack 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 labTrackFreeList(). */
+
+void labTrackSaveToDb(struct sqlConnection *conn, struct labTrack *el, char *tableName, int updateSize);
+/* Save labTrack 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 labTrackSaveToDbEscaped() */
+
+void labTrackSaveToDbEscaped(struct sqlConnection *conn, struct labTrack *el, char *tableName, int updateSize);
+/* Save labTrack 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 labTrackSaveToDb().
+ * For example automatically copies and converts: 
+ * "autosql's features include" --> "autosql\'s features include" 
+ * before inserting into database. */ 
+
+struct labTrack *labTrackCommaIn(char **pS, struct labTrack *ret);
+/* Create a labTrack out of a comma separated string. 
+ * This will fill in ret if non-null, otherwise will
+ * return a new labTrack */
+
+void labTrackFree(struct labTrack **pEl);
+/* Free a single dynamically allocated labTrack such as created
+ * with labTrackLoad(). */
+
+void labTrackFreeList(struct labTrack **pList);
+/* Free a list of dynamically allocated labTrack's */
+
+void labTrackOutput(struct labTrack *el, FILE *f, char sep, char lastSep);
+/* Print out labTrack.  Separate fields with sep. Follow last field with lastSep. */
+
+#define labTrackTabOut(el,f) labTrackOutput(el,f,'\t','\n');
+/* Print out labTrack as a line in a tab-separated file. */
+
+#define labTrackCommaOut(el,f) labTrackOutput(el,f,',',',');
+/* Print out labTrack as a comma separated list including final comma. */
+
+/* -------------------------------- End autoSql Generated Code -------------------------------- */
+
+#endif /* HGHEATMAPCUSTOMDB_H */
+