src/hg/instinct/bioInt2/bioIntDb.h 1.6

1.6 2009/04/27 06:15:48 jsanborn
updated lots of stuff, will break older implementation of database
Index: src/hg/instinct/bioInt2/bioIntDb.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/instinct/bioInt2/bioIntDb.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -b -B -U 4 -r1.5 -r1.6
--- src/hg/instinct/bioInt2/bioIntDb.h	29 Mar 2009 01:40:42 -0000	1.5
+++ src/hg/instinct/bioInt2/bioIntDb.h	27 Apr 2009 06:15:48 -0000	1.6
@@ -5,236 +5,236 @@
 #ifndef BIOINTDB_H
 #define BIOINTDB_H
 
 #include "jksql.h"
-#define PATHWAYS_NUM_COLS 3
+#define GENESETS_NUM_COLS 3
 
-struct pathways
+struct genesets
 /* Pathway List */
     {
-    struct pathways *next;  /* Next in singly linked list. */
+    struct genesets *next;  /* Next in singly linked list. */
     unsigned id;	/* Unique id */
     char *name;	/* Pathway name */
     char *source;	/* Pathway Source, i.e. KEGG, BioCarta */
     };
 
-void pathwaysStaticLoad(char **row, struct pathways *ret);
-/* Load a row from pathways table into ret.  The contents of ret will
+void genesetsStaticLoad(char **row, struct genesets *ret);
+/* Load a row from genesets table into ret.  The contents of ret will
  * be replaced at the next call to this function. */
 
-struct pathways *pathwaysLoad(char **row);
-/* Load a pathways from row fetched with select * from pathways
- * from database.  Dispose of this with pathwaysFree(). */
-
-struct pathways *pathwaysLoadAll(char *fileName);
-/* Load all pathways from whitespace-separated file.
- * Dispose of this with pathwaysFreeList(). */
-
-struct pathways *pathwaysLoadAllByChar(char *fileName, char chopper);
-/* Load all pathways from chopper separated file.
- * Dispose of this with pathwaysFreeList(). */
-
-#define pathwaysLoadAllByTab(a) pathwaysLoadAllByChar(a, '\t');
-/* Load all pathways from tab separated file.
- * Dispose of this with pathwaysFreeList(). */
+struct genesets *genesetsLoad(char **row);
+/* Load a genesets from row fetched with select * from genesets
+ * from database.  Dispose of this with genesetsFree(). */
 
-struct pathways *pathwaysLoadByQuery(struct sqlConnection *conn, char *query);
-/* Load all pathways from table that satisfy the query given.  
+struct genesets *genesetsLoadAll(char *fileName);
+/* Load all genesets from whitespace-separated file.
+ * Dispose of this with genesetsFreeList(). */
+
+struct genesets *genesetsLoadAllByChar(char *fileName, char chopper);
+/* Load all genesets from chopper separated file.
+ * Dispose of this with genesetsFreeList(). */
+
+#define genesetsLoadAllByTab(a) genesetsLoadAllByChar(a, '\t');
+/* Load all genesets from tab separated file.
+ * Dispose of this with genesetsFreeList(). */
+
+struct genesets *genesetsLoadByQuery(struct sqlConnection *conn, char *query);
+/* Load all genesets 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 pathwaysFreeList(). */
+ * Dispose of this with genesetsFreeList(). */
 
-void pathwaysSaveToDb(struct sqlConnection *conn, struct pathways *el, char *tableName, int updateSize);
-/* Save pathways as a row to the table specified by tableName. 
+void genesetsSaveToDb(struct sqlConnection *conn, struct genesets *el, char *tableName, int updateSize);
+/* Save genesets 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 pathwaysSaveToDbEscaped() */
+ * If worried about this use genesetsSaveToDbEscaped() */
 
-void pathwaysSaveToDbEscaped(struct sqlConnection *conn, struct pathways *el, char *tableName, int updateSize);
-/* Save pathways as a row to the table specified by tableName. 
+void genesetsSaveToDbEscaped(struct sqlConnection *conn, struct genesets *el, char *tableName, int updateSize);
+/* Save genesets 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 pathwaysSaveToDb().
+ * escapes all simple strings (not arrays of string) but may be slower than genesetsSaveToDb().
  * For example automatically copies and converts: 
  * "autosql's features include" --> "autosql\'s features include" 
  * before inserting into database. */ 
 
-struct pathways *pathwaysCommaIn(char **pS, struct pathways *ret);
-/* Create a pathways out of a comma separated string. 
+struct genesets *genesetsCommaIn(char **pS, struct genesets *ret);
+/* Create a genesets out of a comma separated string. 
  * This will fill in ret if non-null, otherwise will
- * return a new pathways */
+ * return a new genesets */
 
-void pathwaysFree(struct pathways **pEl);
-/* Free a single dynamically allocated pathways such as created
- * with pathwaysLoad(). */
+void genesetsFree(struct genesets **pEl);
+/* Free a single dynamically allocated genesets such as created
+ * with genesetsLoad(). */
 
-void pathwaysFreeList(struct pathways **pList);
-/* Free a list of dynamically allocated pathways's */
+void genesetsFreeList(struct genesets **pList);
+/* Free a list of dynamically allocated genesets's */
 
-void pathwaysOutput(struct pathways *el, FILE *f, char sep, char lastSep);
-/* Print out pathways.  Separate fields with sep. Follow last field with lastSep. */
+void genesetsOutput(struct genesets *el, FILE *f, char sep, char lastSep);
+/* Print out genesets.  Separate fields with sep. Follow last field with lastSep. */
 
-#define pathwaysTabOut(el,f) pathwaysOutput(el,f,'\t','\n');
-/* Print out pathways as a line in a tab-separated file. */
+#define genesetsTabOut(el,f) genesetsOutput(el,f,'\t','\n');
+/* Print out genesets as a line in a tab-separated file. */
 
-#define pathwaysCommaOut(el,f) pathwaysOutput(el,f,',',',');
-/* Print out pathways as a comma separated list including final comma. */
+#define genesetsCommaOut(el,f) genesetsOutput(el,f,',',',');
+/* Print out genesets as a comma separated list including final comma. */
 
-#define PATHWAYGENES_NUM_COLS 2
+#define GENESETGENES_NUM_COLS 2
 
-struct pathwayGenes
+struct genesetGenes
 /* Pathway Genes */
     {
-    struct pathwayGenes *next;  /* Next in singly linked list. */
+    struct genesetGenes *next;  /* Next in singly linked list. */
     unsigned id;	/* Unique id */
     unsigned gene_id;	/* Gene id */
     };
 
-void pathwayGenesStaticLoad(char **row, struct pathwayGenes *ret);
-/* Load a row from pathwayGenes table into ret.  The contents of ret will
+void genesetGenesStaticLoad(char **row, struct genesetGenes *ret);
+/* Load a row from genesetGenes table into ret.  The contents of ret will
  * be replaced at the next call to this function. */
 
-struct pathwayGenes *pathwayGenesLoad(char **row);
-/* Load a pathwayGenes from row fetched with select * from pathwayGenes
- * from database.  Dispose of this with pathwayGenesFree(). */
-
-struct pathwayGenes *pathwayGenesLoadAll(char *fileName);
-/* Load all pathwayGenes from whitespace-separated file.
- * Dispose of this with pathwayGenesFreeList(). */
-
-struct pathwayGenes *pathwayGenesLoadAllByChar(char *fileName, char chopper);
-/* Load all pathwayGenes from chopper separated file.
- * Dispose of this with pathwayGenesFreeList(). */
-
-#define pathwayGenesLoadAllByTab(a) pathwayGenesLoadAllByChar(a, '\t');
-/* Load all pathwayGenes from tab separated file.
- * Dispose of this with pathwayGenesFreeList(). */
+struct genesetGenes *genesetGenesLoad(char **row);
+/* Load a genesetGenes from row fetched with select * from genesetGenes
+ * from database.  Dispose of this with genesetGenesFree(). */
+
+struct genesetGenes *genesetGenesLoadAll(char *fileName);
+/* Load all genesetGenes from whitespace-separated file.
+ * Dispose of this with genesetGenesFreeList(). */
 
-struct pathwayGenes *pathwayGenesLoadByQuery(struct sqlConnection *conn, char *query);
-/* Load all pathwayGenes from table that satisfy the query given.  
+struct genesetGenes *genesetGenesLoadAllByChar(char *fileName, char chopper);
+/* Load all genesetGenes from chopper separated file.
+ * Dispose of this with genesetGenesFreeList(). */
+
+#define genesetGenesLoadAllByTab(a) genesetGenesLoadAllByChar(a, '\t');
+/* Load all genesetGenes from tab separated file.
+ * Dispose of this with genesetGenesFreeList(). */
+
+struct genesetGenes *genesetGenesLoadByQuery(struct sqlConnection *conn, char *query);
+/* Load all genesetGenes 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 pathwayGenesFreeList(). */
+ * Dispose of this with genesetGenesFreeList(). */
 
-void pathwayGenesSaveToDb(struct sqlConnection *conn, struct pathwayGenes *el, char *tableName, int updateSize);
-/* Save pathwayGenes as a row to the table specified by tableName. 
+void genesetGenesSaveToDb(struct sqlConnection *conn, struct genesetGenes *el, char *tableName, int updateSize);
+/* Save genesetGenes 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 pathwayGenesSaveToDbEscaped() */
+ * If worried about this use genesetGenesSaveToDbEscaped() */
 
-void pathwayGenesSaveToDbEscaped(struct sqlConnection *conn, struct pathwayGenes *el, char *tableName, int updateSize);
-/* Save pathwayGenes as a row to the table specified by tableName. 
+void genesetGenesSaveToDbEscaped(struct sqlConnection *conn, struct genesetGenes *el, char *tableName, int updateSize);
+/* Save genesetGenes 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 pathwayGenesSaveToDb().
+ * escapes all simple strings (not arrays of string) but may be slower than genesetGenesSaveToDb().
  * For example automatically copies and converts: 
  * "autosql's features include" --> "autosql\'s features include" 
  * before inserting into database. */ 
 
-struct pathwayGenes *pathwayGenesCommaIn(char **pS, struct pathwayGenes *ret);
-/* Create a pathwayGenes out of a comma separated string. 
+struct genesetGenes *genesetGenesCommaIn(char **pS, struct genesetGenes *ret);
+/* Create a genesetGenes out of a comma separated string. 
  * This will fill in ret if non-null, otherwise will
- * return a new pathwayGenes */
+ * return a new genesetGenes */
 
-void pathwayGenesFree(struct pathwayGenes **pEl);
-/* Free a single dynamically allocated pathwayGenes such as created
- * with pathwayGenesLoad(). */
+void genesetGenesFree(struct genesetGenes **pEl);
+/* Free a single dynamically allocated genesetGenes such as created
+ * with genesetGenesLoad(). */
 
-void pathwayGenesFreeList(struct pathwayGenes **pList);
-/* Free a list of dynamically allocated pathwayGenes's */
+void genesetGenesFreeList(struct genesetGenes **pList);
+/* Free a list of dynamically allocated genesetGenes's */
 
-void pathwayGenesOutput(struct pathwayGenes *el, FILE *f, char sep, char lastSep);
-/* Print out pathwayGenes.  Separate fields with sep. Follow last field with lastSep. */
+void genesetGenesOutput(struct genesetGenes *el, FILE *f, char sep, char lastSep);
+/* Print out genesetGenes.  Separate fields with sep. Follow last field with lastSep. */
 
-#define pathwayGenesTabOut(el,f) pathwayGenesOutput(el,f,'\t','\n');
-/* Print out pathwayGenes as a line in a tab-separated file. */
+#define genesetGenesTabOut(el,f) genesetGenesOutput(el,f,'\t','\n');
+/* Print out genesetGenes as a line in a tab-separated file. */
 
-#define pathwayGenesCommaOut(el,f) pathwayGenesOutput(el,f,',',',');
-/* Print out pathwayGenes as a comma separated list including final comma. */
+#define genesetGenesCommaOut(el,f) genesetGenesOutput(el,f,',',',');
+/* Print out genesetGenes as a comma separated list including final comma. */
 
-#define PATHWAYINFO_NUM_COLS 2
+#define GENESETINFO_NUM_COLS 2
 
-struct pathwayInfo
+struct genesetInfo
 /* Pathway Information */
     {
-    struct pathwayInfo *next;  /* Next in singly linked list. */
+    struct genesetInfo *next;  /* Next in singly linked list. */
     unsigned id;	/* Unique id */
     char *description;	/* Description of pathway */
     };
 
-void pathwayInfoStaticLoad(char **row, struct pathwayInfo *ret);
-/* Load a row from pathwayInfo table into ret.  The contents of ret will
+void genesetInfoStaticLoad(char **row, struct genesetInfo *ret);
+/* Load a row from genesetInfo table into ret.  The contents of ret will
  * be replaced at the next call to this function. */
 
-struct pathwayInfo *pathwayInfoLoad(char **row);
-/* Load a pathwayInfo from row fetched with select * from pathwayInfo
- * from database.  Dispose of this with pathwayInfoFree(). */
-
-struct pathwayInfo *pathwayInfoLoadAll(char *fileName);
-/* Load all pathwayInfo from whitespace-separated file.
- * Dispose of this with pathwayInfoFreeList(). */
-
-struct pathwayInfo *pathwayInfoLoadAllByChar(char *fileName, char chopper);
-/* Load all pathwayInfo from chopper separated file.
- * Dispose of this with pathwayInfoFreeList(). */
-
-#define pathwayInfoLoadAllByTab(a) pathwayInfoLoadAllByChar(a, '\t');
-/* Load all pathwayInfo from tab separated file.
- * Dispose of this with pathwayInfoFreeList(). */
+struct genesetInfo *genesetInfoLoad(char **row);
+/* Load a genesetInfo from row fetched with select * from genesetInfo
+ * from database.  Dispose of this with genesetInfoFree(). */
+
+struct genesetInfo *genesetInfoLoadAll(char *fileName);
+/* Load all genesetInfo from whitespace-separated file.
+ * Dispose of this with genesetInfoFreeList(). */
 
-struct pathwayInfo *pathwayInfoLoadByQuery(struct sqlConnection *conn, char *query);
-/* Load all pathwayInfo from table that satisfy the query given.  
+struct genesetInfo *genesetInfoLoadAllByChar(char *fileName, char chopper);
+/* Load all genesetInfo from chopper separated file.
+ * Dispose of this with genesetInfoFreeList(). */
+
+#define genesetInfoLoadAllByTab(a) genesetInfoLoadAllByChar(a, '\t');
+/* Load all genesetInfo from tab separated file.
+ * Dispose of this with genesetInfoFreeList(). */
+
+struct genesetInfo *genesetInfoLoadByQuery(struct sqlConnection *conn, char *query);
+/* Load all genesetInfo 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 pathwayInfoFreeList(). */
+ * Dispose of this with genesetInfoFreeList(). */
 
-void pathwayInfoSaveToDb(struct sqlConnection *conn, struct pathwayInfo *el, char *tableName, int updateSize);
-/* Save pathwayInfo as a row to the table specified by tableName. 
+void genesetInfoSaveToDb(struct sqlConnection *conn, struct genesetInfo *el, char *tableName, int updateSize);
+/* Save genesetInfo 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 pathwayInfoSaveToDbEscaped() */
+ * If worried about this use genesetInfoSaveToDbEscaped() */
 
-void pathwayInfoSaveToDbEscaped(struct sqlConnection *conn, struct pathwayInfo *el, char *tableName, int updateSize);
-/* Save pathwayInfo as a row to the table specified by tableName. 
+void genesetInfoSaveToDbEscaped(struct sqlConnection *conn, struct genesetInfo *el, char *tableName, int updateSize);
+/* Save genesetInfo 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 pathwayInfoSaveToDb().
+ * escapes all simple strings (not arrays of string) but may be slower than genesetInfoSaveToDb().
  * For example automatically copies and converts: 
  * "autosql's features include" --> "autosql\'s features include" 
  * before inserting into database. */ 
 
-struct pathwayInfo *pathwayInfoCommaIn(char **pS, struct pathwayInfo *ret);
-/* Create a pathwayInfo out of a comma separated string. 
+struct genesetInfo *genesetInfoCommaIn(char **pS, struct genesetInfo *ret);
+/* Create a genesetInfo out of a comma separated string. 
  * This will fill in ret if non-null, otherwise will
- * return a new pathwayInfo */
+ * return a new genesetInfo */
 
-void pathwayInfoFree(struct pathwayInfo **pEl);
-/* Free a single dynamically allocated pathwayInfo such as created
- * with pathwayInfoLoad(). */
+void genesetInfoFree(struct genesetInfo **pEl);
+/* Free a single dynamically allocated genesetInfo such as created
+ * with genesetInfoLoad(). */
 
-void pathwayInfoFreeList(struct pathwayInfo **pList);
-/* Free a list of dynamically allocated pathwayInfo's */
+void genesetInfoFreeList(struct genesetInfo **pList);
+/* Free a list of dynamically allocated genesetInfo's */
 
-void pathwayInfoOutput(struct pathwayInfo *el, FILE *f, char sep, char lastSep);
-/* Print out pathwayInfo.  Separate fields with sep. Follow last field with lastSep. */
+void genesetInfoOutput(struct genesetInfo *el, FILE *f, char sep, char lastSep);
+/* Print out genesetInfo.  Separate fields with sep. Follow last field with lastSep. */
 
-#define pathwayInfoTabOut(el,f) pathwayInfoOutput(el,f,'\t','\n');
-/* Print out pathwayInfo as a line in a tab-separated file. */
+#define genesetInfoTabOut(el,f) genesetInfoOutput(el,f,'\t','\n');
+/* Print out genesetInfo as a line in a tab-separated file. */
 
-#define pathwayInfoCommaOut(el,f) pathwayInfoOutput(el,f,',',',');
-/* Print out pathwayInfo as a comma separated list including final comma. */
+#define genesetInfoCommaOut(el,f) genesetInfoOutput(el,f,',',',');
+/* Print out genesetInfo as a comma separated list including final comma. */
 
 #define TISSUES_NUM_COLS 2
 
 struct tissues
@@ -387,9 +387,9 @@
 
 #define dataTypesCommaOut(el,f) dataTypesOutput(el,f,',',',');
 /* Print out dataTypes as a comma separated list including final comma. */
 
-#define DATASETS_NUM_COLS 8
+#define DATASETS_NUM_COLS 6
 
 struct datasets
 /* All available datasets */
     {
@@ -399,10 +399,8 @@
     unsigned type_id;	/* Type of genomics data */
     unsigned num_samples;	/* Number of samples in study */
     char *name;	/* Dataset name */
     char *data_table;	/* Array Data tablename */
-    char *probe_table;	/* Probe tablename */
-    char *probe_to_gene_table;	/* Probe to gene tablename */
     };
 
 void datasetsStaticLoad(char **row, struct datasets *ret);
 /* Load a row from datasets table into ret.  The contents of ret will
@@ -621,239 +619,8 @@
 
 #define datasetCohortCommaOut(el,f) datasetCohortOutput(el,f,',',',');
 /* Print out datasetCohort as a comma separated list including final comma. */
 
-#define GENELOOKUP_NUM_COLS 2
-
-struct geneLookup
-/* Lookup table linking knownGene */
-    {
-    struct geneLookup *next;  /* Next in singly linked list. */
-    unsigned id;	/* Unique Id */
-    char *kgId;	/* Known Gene Id */
-    };
-
-void geneLookupStaticLoad(char **row, struct geneLookup *ret);
-/* Load a row from geneLookup table into ret.  The contents of ret will
- * be replaced at the next call to this function. */
-
-struct geneLookup *geneLookupLoad(char **row);
-/* Load a geneLookup from row fetched with select * from geneLookup
- * from database.  Dispose of this with geneLookupFree(). */
-
-struct geneLookup *geneLookupLoadAll(char *fileName);
-/* Load all geneLookup from whitespace-separated file.
- * Dispose of this with geneLookupFreeList(). */
-
-struct geneLookup *geneLookupLoadAllByChar(char *fileName, char chopper);
-/* Load all geneLookup from chopper separated file.
- * Dispose of this with geneLookupFreeList(). */
-
-#define geneLookupLoadAllByTab(a) geneLookupLoadAllByChar(a, '\t');
-/* Load all geneLookup from tab separated file.
- * Dispose of this with geneLookupFreeList(). */
-
-struct geneLookup *geneLookupLoadByQuery(struct sqlConnection *conn, char *query);
-/* Load all geneLookup 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 geneLookupFreeList(). */
-
-void geneLookupSaveToDb(struct sqlConnection *conn, struct geneLookup *el, char *tableName, int updateSize);
-/* Save geneLookup 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 geneLookupSaveToDbEscaped() */
-
-void geneLookupSaveToDbEscaped(struct sqlConnection *conn, struct geneLookup *el, char *tableName, int updateSize);
-/* Save geneLookup 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 geneLookupSaveToDb().
- * For example automatically copies and converts: 
- * "autosql's features include" --> "autosql\'s features include" 
- * before inserting into database. */ 
-
-struct geneLookup *geneLookupCommaIn(char **pS, struct geneLookup *ret);
-/* Create a geneLookup out of a comma separated string. 
- * This will fill in ret if non-null, otherwise will
- * return a new geneLookup */
-
-void geneLookupFree(struct geneLookup **pEl);
-/* Free a single dynamically allocated geneLookup such as created
- * with geneLookupLoad(). */
-
-void geneLookupFreeList(struct geneLookup **pList);
-/* Free a list of dynamically allocated geneLookup's */
-
-void geneLookupOutput(struct geneLookup *el, FILE *f, char sep, char lastSep);
-/* Print out geneLookup.  Separate fields with sep. Follow last field with lastSep. */
-
-#define geneLookupTabOut(el,f) geneLookupOutput(el,f,'\t','\n');
-/* Print out geneLookup as a line in a tab-separated file. */
-
-#define geneLookupCommaOut(el,f) geneLookupOutput(el,f,',',',');
-/* Print out geneLookup as a comma separated list including final comma. */
-
-#define PROBEINFO_NUM_COLS 5
-
-struct probeInfo
-/* Probe Information */
-    {
-    struct probeInfo *next;  /* Next in singly linked list. */
-    unsigned id;	/* Unique Id */
-    char *chrom;	/* Chromosome */
-    unsigned start;	/* Start Base */
-    unsigned stop;	/* Stop Base */
-    char *name;	/* Probe Name */
-    };
-
-void probeInfoStaticLoad(char **row, struct probeInfo *ret);
-/* Load a row from probeInfo table into ret.  The contents of ret will
- * be replaced at the next call to this function. */
-
-struct probeInfo *probeInfoLoad(char **row);
-/* Load a probeInfo from row fetched with select * from probeInfo
- * from database.  Dispose of this with probeInfoFree(). */
-
-struct probeInfo *probeInfoLoadAll(char *fileName);
-/* Load all probeInfo from whitespace-separated file.
- * Dispose of this with probeInfoFreeList(). */
-
-struct probeInfo *probeInfoLoadAllByChar(char *fileName, char chopper);
-/* Load all probeInfo from chopper separated file.
- * Dispose of this with probeInfoFreeList(). */
-
-#define probeInfoLoadAllByTab(a) probeInfoLoadAllByChar(a, '\t');
-/* Load all probeInfo from tab separated file.
- * Dispose of this with probeInfoFreeList(). */
-
-struct probeInfo *probeInfoLoadByQuery(struct sqlConnection *conn, char *query);
-/* Load all probeInfo 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 probeInfoFreeList(). */
-
-void probeInfoSaveToDb(struct sqlConnection *conn, struct probeInfo *el, char *tableName, int updateSize);
-/* Save probeInfo 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 probeInfoSaveToDbEscaped() */
-
-void probeInfoSaveToDbEscaped(struct sqlConnection *conn, struct probeInfo *el, char *tableName, int updateSize);
-/* Save probeInfo 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 probeInfoSaveToDb().
- * For example automatically copies and converts: 
- * "autosql's features include" --> "autosql\'s features include" 
- * before inserting into database. */ 
-
-struct probeInfo *probeInfoCommaIn(char **pS, struct probeInfo *ret);
-/* Create a probeInfo out of a comma separated string. 
- * This will fill in ret if non-null, otherwise will
- * return a new probeInfo */
-
-void probeInfoFree(struct probeInfo **pEl);
-/* Free a single dynamically allocated probeInfo such as created
- * with probeInfoLoad(). */
-
-void probeInfoFreeList(struct probeInfo **pList);
-/* Free a list of dynamically allocated probeInfo's */
-
-void probeInfoOutput(struct probeInfo *el, FILE *f, char sep, char lastSep);
-/* Print out probeInfo.  Separate fields with sep. Follow last field with lastSep. */
-
-#define probeInfoTabOut(el,f) probeInfoOutput(el,f,'\t','\n');
-/* Print out probeInfo as a line in a tab-separated file. */
-
-#define probeInfoCommaOut(el,f) probeInfoOutput(el,f,',',',');
-/* Print out probeInfo as a comma separated list including final comma. */
-
-#define PROBETOGENE_NUM_COLS 2
-
-struct probeToGene
-/* Lookup table linking probe id and gene id */
-    {
-    struct probeToGene *next;  /* Next in singly linked list. */
-    unsigned probe_id;	/* Probe Id */
-    unsigned gene_id;	/* Gene Id */
-    };
-
-void probeToGeneStaticLoad(char **row, struct probeToGene *ret);
-/* Load a row from probeToGene table into ret.  The contents of ret will
- * be replaced at the next call to this function. */
-
-struct probeToGene *probeToGeneLoad(char **row);
-/* Load a probeToGene from row fetched with select * from probeToGene
- * from database.  Dispose of this with probeToGeneFree(). */
-
-struct probeToGene *probeToGeneLoadAll(char *fileName);
-/* Load all probeToGene from whitespace-separated file.
- * Dispose of this with probeToGeneFreeList(). */
-
-struct probeToGene *probeToGeneLoadAllByChar(char *fileName, char chopper);
-/* Load all probeToGene from chopper separated file.
- * Dispose of this with probeToGeneFreeList(). */
-
-#define probeToGeneLoadAllByTab(a) probeToGeneLoadAllByChar(a, '\t');
-/* Load all probeToGene from tab separated file.
- * Dispose of this with probeToGeneFreeList(). */
-
-struct probeToGene *probeToGeneLoadByQuery(struct sqlConnection *conn, char *query);
-/* Load all probeToGene 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 probeToGeneFreeList(). */
-
-void probeToGeneSaveToDb(struct sqlConnection *conn, struct probeToGene *el, char *tableName, int updateSize);
-/* Save probeToGene 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 probeToGeneSaveToDbEscaped() */
-
-void probeToGeneSaveToDbEscaped(struct sqlConnection *conn, struct probeToGene *el, char *tableName, int updateSize);
-/* Save probeToGene 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 probeToGeneSaveToDb().
- * For example automatically copies and converts: 
- * "autosql's features include" --> "autosql\'s features include" 
- * before inserting into database. */ 
-
-struct probeToGene *probeToGeneCommaIn(char **pS, struct probeToGene *ret);
-/* Create a probeToGene out of a comma separated string. 
- * This will fill in ret if non-null, otherwise will
- * return a new probeToGene */
-
-void probeToGeneFree(struct probeToGene **pEl);
-/* Free a single dynamically allocated probeToGene such as created
- * with probeToGeneLoad(). */
-
-void probeToGeneFreeList(struct probeToGene **pList);
-/* Free a list of dynamically allocated probeToGene's */
-
-void probeToGeneOutput(struct probeToGene *el, FILE *f, char sep, char lastSep);
-/* Print out probeToGene.  Separate fields with sep. Follow last field with lastSep. */
-
-#define probeToGeneTabOut(el,f) probeToGeneOutput(el,f,'\t','\n');
-/* Print out probeToGene as a line in a tab-separated file. */
-
-#define probeToGeneCommaOut(el,f) probeToGeneOutput(el,f,',',',');
-/* Print out probeToGene as a comma separated list including final comma. */
-
 #define PROBESAMPLEVAL_NUM_COLS 3
 
 struct probeSampleVal
 /* Probe values for single sample */
@@ -1002,9 +769,9 @@
 
 #define probeValsCommaOut(el,f) probeValsOutput(el,f,',',',');
 /* Print out probeVals as a comma separated list including final comma. */
 
-#define SAMPLES_NUM_COLS 7
+#define SAMPLES_NUM_COLS 6
 
 struct samples
 /* All sample info */
     {
@@ -1013,9 +780,8 @@
     char *name;	/* Sample Name */
     unsigned patient_id;	/* Patient Id */
     char *patient_name;	/* Patient Name */
     unsigned dataset_id;	/* Dataset Id */
-    unsigned exp_id;	/* Index in dataset -- for probeVals format */
     unsigned tissue_id;	/* Tissue Type Id */
     };
 
 void samplesStaticLoad(char **row, struct samples *ret);
@@ -1472,16 +1238,17 @@
 
 #define analysisParamsCommaOut(el,f) analysisParamsOutput(el,f,',',',');
 /* Print out analysisParams as a comma separated list including final comma. */
 
-#define ANALYSISFEATURES_NUM_COLS 2
+#define ANALYSISFEATURES_NUM_COLS 3
 
 struct analysisFeatures
 /* All analysis features */
     {
     struct analysisFeatures *next;  /* Next in singly linked list. */
     unsigned id;	/* Feature Id */
     char *feature_name;	/* Feature Name */
+    char *type;	/* Feature Type */
     };
 
 void analysisFeaturesStaticLoad(char **row, struct analysisFeatures *ret);
 /* Load a row from analysisFeatures table into ret.  The contents of ret will