0704feba1b95da51d9bb71b54833196d0954695f kate Wed May 28 13:54:55 2014 -0700 DNase Combined track from ENCODE Analysis, with new data format (BED5Sources). Similar to factorSource, but more general and lighter-weight. refs #13230. diff --git src/hg/inc/bed5Sources.h src/hg/inc/bed5Sources.h new file mode 100644 index 0000000..10e3ed6 --- /dev/null +++ src/hg/inc/bed5Sources.h @@ -0,0 +1,82 @@ +/* bed5Sources.h was originally generated by the autoSql program, which also + * generated bed5Sources.c and bed5Sources.sql. This header links the database and + * the RAM representation of objects. */ + +#ifndef BED5SOURCES_H +#define BED5SOURCES_H + +#include "jksql.h" +#define BED5SOURCES_NUM_COLS 9 + +extern char *bed5SourcesCommaSepFieldNames; + +struct bed5Sources +/* BED5+ with a float data value field and a list of sources for combined data */ + { + struct bed5Sources *next; /* Next in singly linked list. */ + unsigned bin; /* Bin number for browser speedup */ + char *chrom; /* Reference sequence chromosome or scaffold */ + unsigned chromStart; /* Start position in chromosome */ + unsigned chromEnd; /* End position in chromosome */ + char *name; /* Name of item */ + unsigned score; /* Display score (0-1000) */ + float floatScore; /* Data score (signal, p-value, z-score, etc.) */ + unsigned sourceCount; /* Number of sources contributing to this item */ + unsigned *sourceIds; /* Comma separated list of source ids */ + }; + +struct bed5Sources *bed5SourcesLoadByQuery(struct sqlConnection *conn, char *query); +/* Load all bed5Sources 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 bed5SourcesFreeList(). */ + +void bed5SourcesSaveToDb(struct sqlConnection *conn, struct bed5Sources *el, char *tableName, int updateSize); +/* Save bed5Sources 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. This function automatically escapes quoted strings for mysql. */ + +struct bed5Sources *bed5SourcesLoad(char **row); +/* Load a bed5Sources from row fetched with select * from bed5Sources + * from database. Dispose of this with bed5SourcesFree(). */ + +struct bed5Sources *bed5SourcesLoadAll(char *fileName); +/* Load all bed5Sources from whitespace-separated file. + * Dispose of this with bed5SourcesFreeList(). */ + +struct bed5Sources *bed5SourcesLoadAllByChar(char *fileName, char chopper); +/* Load all bed5Sources from chopper separated file. + * Dispose of this with bed5SourcesFreeList(). */ + +#define bed5SourcesLoadAllByTab(a) bed5SourcesLoadAllByChar(a, '\t'); +/* Load all bed5Sources from tab separated file. + * Dispose of this with bed5SourcesFreeList(). */ + +struct bed5Sources *bed5SourcesCommaIn(char **pS, struct bed5Sources *ret); +/* Create a bed5Sources out of a comma separated string. + * This will fill in ret if non-null, otherwise will + * return a new bed5Sources */ + +void bed5SourcesFree(struct bed5Sources **pEl); +/* Free a single dynamically allocated bed5Sources such as created + * with bed5SourcesLoad(). */ + +void bed5SourcesFreeList(struct bed5Sources **pList); +/* Free a list of dynamically allocated bed5Sources's */ + +void bed5SourcesOutput(struct bed5Sources *el, FILE *f, char sep, char lastSep); +/* Print out bed5Sources. Separate fields with sep. Follow last field with lastSep. */ + +#define bed5SourcesTabOut(el,f) bed5SourcesOutput(el,f,'\t','\n'); +/* Print out bed5Sources as a line in a tab-separated file. */ + +#define bed5SourcesCommaOut(el,f) bed5SourcesOutput(el,f,',',','); +/* Print out bed5Sources as a comma separated list including final comma. */ + +/* -------------------------------- End autoSql Generated Code -------------------------------- */ + +#endif /* BED5SOURCES_H */ +