a9a29995abe1e134d84bb80bdae1c0318060feff kate Wed Aug 6 00:41:21 2014 -0700 Tool to load GTEx (NIH Common Fund Gene Tissue Expression). Quite similar to microarray table organization. diff --git src/hg/inc/gtexData.h src/hg/inc/gtexData.h new file mode 100644 index 0000000..ee4ce75 --- /dev/null +++ src/hg/inc/gtexData.h @@ -0,0 +1,64 @@ +/* gtexData.h was originally generated by the autoSql program, which also + * generated gtexData.c and gtexData.sql. This header links the database and + * the RAM representation of objects. */ + +#ifndef GTEXDATA_H +#define GTEXDATA_H + +#define GTEXDATA_NUM_COLS 3 + +extern char *gtexDataCommaSepFieldNames; + +struct gtexData +/* GTEX Expression data (RPKM levels, unmapped) */ + { + struct gtexData *next; /* Next in singly linked list. */ + char *geneId; /* Gene identifier (ensembl) */ + unsigned sampleCount; /* Number of samples */ + float *sampleLevels; /* RPKM expression levels */ + }; + +struct gtexData *gtexDataLoad(char **row); +/* Load a gtexData from row fetched with select * from gtexData + * from database. Dispose of this with gtexDataFree(). */ + +struct gtexData *gtexDataLoadAll(char *fileName); +/* Load all gtexData from whitespace-separated file. + * Dispose of this with gtexDataFreeList(). */ + +struct gtexData *gtexDataLoadAllByChar(char *fileName, char chopper); +/* Load all gtexData from chopper separated file. + * Dispose of this with gtexDataFreeList(). */ + +#define gtexDataLoadAllByTab(a) gtexDataLoadAllByChar(a, '\t'); +/* Load all gtexData from tab separated file. + * Dispose of this with gtexDataFreeList(). */ + +struct gtexData *gtexDataCommaIn(char **pS, struct gtexData *ret); +/* Create a gtexData out of a comma separated string. + * This will fill in ret if non-null, otherwise will + * return a new gtexData */ + +void gtexDataFree(struct gtexData **pEl); +/* Free a single dynamically allocated gtexData such as created + * with gtexDataLoad(). */ + +void gtexDataFreeList(struct gtexData **pList); +/* Free a list of dynamically allocated gtexData's */ + +void gtexDataOutput(struct gtexData *el, FILE *f, char sep, char lastSep); +/* Print out gtexData. Separate fields with sep. Follow last field with lastSep. */ + +#define gtexDataTabOut(el,f) gtexDataOutput(el,f,'\t','\n'); +/* Print out gtexData as a line in a tab-separated file. */ + +#define gtexDataCommaOut(el,f) gtexDataOutput(el,f,',',','); +/* Print out gtexData as a comma separated list including final comma. */ + +/* -------------------------------- End autoSql Generated Code -------------------------------- */ + +void gtexDataCreateTable(struct sqlConnection *conn, char *table); +/* Create table with given name. */ + +#endif /* GTEXDATA_H */ +