src/hg/instinct/bioInt2/bioIntDriver.h 1.3
1.3 2009/03/29 01:40:43 jsanborn
added to UI code
Index: src/hg/instinct/bioInt2/bioIntDriver.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/instinct/bioInt2/bioIntDriver.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -B -U 1000000 -r1.2 -r1.3
--- src/hg/instinct/bioInt2/bioIntDriver.h 24 Mar 2009 05:21:54 -0000 1.2
+++ src/hg/instinct/bioInt2/bioIntDriver.h 29 Mar 2009 01:40:43 -0000 1.3
@@ -1,169 +1,170 @@
/* bioIntDriver.h
* All rights reserved -- J. Zachary Sanborn
*/
#ifndef BIOINTDRIVER_H
#define BIOINTDRIVER_H
#include "common.h"
#include "bioIntDb.h"
#define DBL_NULL -9999.98 /* fairly unique number... TODO: better way? */
#define DEBUG 0
#define AN_TABLE "analyses"
#define AF_TABLE "analysisFeatures"
#define AM_TABLE "analysisModules"
#define AP_TABLE "analysisParams"
#define CD_TABLE "clinicalData"
#define CO_TABLE "cohorts"
+#define CC_TABLE "cohortCorr"
#define DA_TABLE "datasets"
#define DC_TABLE "datasetCohort"
#define DT_TABLE "dataTypes"
#define FE_TABLE "features"
#define GL_TABLE "geneLookup"
#define PA_TABLE "pathways"
#define PG_TABLE "pathwayGenes"
#define PI_TABLE "pathwayInfo"
#define SA_TABLE "samples"
#define TI_TABLE "tissues"
struct biQuery {
struct biQuery *next;
char *db;
char *dataset;
boolean getAllProbes;
struct slName *pathwayList;
struct slName *probeList;
struct slName *geneList;
struct slName *sampleList;
struct slName *featureValList;
struct slName *featureCodeList;
/* Methods */
int (*addPathways)(struct biQuery *bq, char *str, char sep);
int (*addProbes)(struct biQuery *bq, char *str, char sep);
int (*addGenes)(struct biQuery *bq, char *str, char sep);
int (*addSamples)(struct biQuery *bq, char *str, char sep);
int (*addFeatureVals)(struct biQuery *bq, char *str, char sep);
int (*addFeatureCodes)(struct biQuery *bq, char *str, char sep);
};
struct biData {
struct biData *next;
char *name;
char *type;
struct slDouble *data;
struct hash *hash;
};
struct biOmics {
struct biOmics *next;
char *db;
char *name;
char *type; // data type (cnv, expression, etc.)
struct hash *sampleIndices;
struct hash *geneAliases;
struct hash *datasetProbes;
struct datasets *dataset;
struct samples *samples;
struct hash *samplesHash;
struct probeInfo *probeInfo;
struct hash *probeInfoHash;
/* Probe data */
struct slPair *probes;
struct hash *probesHash;
/* Methods */
int (*populate)(struct biOmics *bi, struct biQuery *bq);
int (*populateAll)(struct biOmics *bi, struct biQuery *bq);
int (*populateRandom)(struct biOmics *bi, struct biQuery *bq, int numProbes);
void (*loadData)(struct sqlConnection *conn, struct biOmics *bi, boolean allData);
void (*freeData)(struct slPair **pList);
struct slName *(*allSamples)(struct biOmics *bi);
struct slName *(*allProbes)(struct biOmics *bi);
struct slName *(*probesForGene)(struct biOmics *bi, char *gene);
struct biData *(*dataForProbe)(struct biOmics *bi, char *probe);
struct biData *(*dataForSample)(struct biOmics *bi, char *sample);
double (*dataForProbeSample)(struct biOmics *bi, char *probe, char *sample);
void (*toZscores)(struct biOmics *bi);
void (*toLogP)(struct biOmics *bi);
};
struct biResults {
struct biOmics *datasets;
/* Methods */
struct slName *(*allDatasets)(struct biResults *br);
struct slName *(*allProbes)(struct biResults *br);
struct slName *(*allProbesInDataset)(struct biResults *br, char *dataset);
struct slName *(*allSamples)(struct biResults *br);
struct slName *(*allSamplesInCommon)(struct biResults *br);
struct slName *(*allSamplesInDataset)(struct biResults *br, char *dataset);
struct slName *(*probesForGene)(struct biResults *br, char *gene);
struct slName *(*probesForGeneInDataset)(struct biResults *br, char *gene, char *dataset);
struct biData *(*dataForProbe)(struct biResults *br, char *probe);
struct biData *(*dataForProbeInDataset)(struct biResults *br, char *probe, char *dataset);
struct biData *(*dataForSample)(struct biResults *br, char *sample);
struct biData *(*dataForSampleInDataset)(struct biResults *br, char *sample, char *dataset);
struct biData *(*dataForProbeSample)(struct biResults *br, char *probe, char *sample);
double (*dataForProbeSampleInDataset)(struct biResults *br, char *probe, char *sample, char *dataset);
void (*toZscores)(struct biResults *br);
void (*toLogP)(struct biResults *br);
};
void slPairSampleValFreeList(struct slPair **pList);
void slPairValsFreeList(struct slPair **pList);
struct biOmics *newBiOmics(char *db, char *dataset);
void biOmicsFree(struct biOmics **ptr);
struct biQuery *biQueryNew(char *db, char *dataset);
void biQueryAppend(struct biQuery **list, struct biQuery *bq);
void biQueryFree(struct biQuery **pEl);
void biQueryFreeList(struct biQuery **pList);
struct biResults *biQueryResults(struct biQuery *bqList);
struct biResults *biQueryResultsRandomize(struct biQuery *bqList, int numProbes);
void biResultsFree(struct biResults **pEl);
void biDataAppendName(struct biData *bd, char *name);
struct biData *biDataNew(char *name);
void biDataFree(struct biData **pEl);
void biDataFreeList(struct biData **pList);
struct biData *biDataFind(struct biData *bdList, char *name);
#endif /* BIOINTDRIVER_H */