cd53a755e4e7dfbbfdeeef59b03c8261146d2a82 baertsch Sun May 15 03:16:54 2011 -0700 add ucscRetroOrtho table and code for ucscRetro child table diff --git src/hg/inc/ucscRetroOrtho.h src/hg/inc/ucscRetroOrtho.h new file mode 100644 index 0000000..ef3c654 --- /dev/null +++ src/hg/inc/ucscRetroOrtho.h @@ -0,0 +1,89 @@ +/* ucscRetroOrtho.h was originally generated by the autoSql program, which also + * generated ucscRetroOrtho.c and ucscRetroOrtho.sql. This header links the database and + * the RAM representation of objects. */ + +#ifndef UCSCRETROORTHO_H +#define UCSCRETROORTHO_H + +#include "jksql.h" +#define UCSCRETROORTHO_NUM_COLS 3 + +struct ucscRetroOrtho +/* Orthlogy of retrogenes based on chains/nets with other species. */ + { + struct ucscRetroOrtho *next; /* Next in singly linked list. */ + char *name; /* Unique name of retrogene */ + char *db; /* database of other species */ + int overlap; /* percent of retro that breaks net relative to other species */ + }; + +void ucscRetroOrthoStaticLoad(char **row, struct ucscRetroOrtho *ret); +/* Load a row from ucscRetroOrtho table into ret. The contents of ret will + * be replaced at the next call to this function. */ + +struct ucscRetroOrtho *ucscRetroOrthoLoadByQuery(struct sqlConnection *conn, char *query); +/* Load all ucscRetroOrtho 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 ucscRetroOrthoFreeList(). */ + +void ucscRetroOrthoSaveToDb(struct sqlConnection *conn, struct ucscRetroOrtho *el, char *tableName, int updateSize); +/* Save ucscRetroOrtho 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 ucscRetroOrthoSaveToDbEscaped() */ + +void ucscRetroOrthoSaveToDbEscaped(struct sqlConnection *conn, struct ucscRetroOrtho *el, char *tableName, int updateSize); +/* Save ucscRetroOrtho 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 ucscRetroOrthoSaveToDb(). + * For example automatically copies and converts: + * "autosql's features include" --> "autosql\'s features include" + * before inserting into database. */ + +struct ucscRetroOrtho *ucscRetroOrthoLoad(char **row); +/* Load a ucscRetroOrtho from row fetched with select * from ucscRetroOrtho + * from database. Dispose of this with ucscRetroOrthoFree(). */ + +struct ucscRetroOrtho *ucscRetroOrthoLoadAll(char *fileName); +/* Load all ucscRetroOrtho from whitespace-separated file. + * Dispose of this with ucscRetroOrthoFreeList(). */ + +struct ucscRetroOrtho *ucscRetroOrthoLoadAllByChar(char *fileName, char chopper); +/* Load all ucscRetroOrtho from chopper separated file. + * Dispose of this with ucscRetroOrthoFreeList(). */ + +#define ucscRetroOrthoLoadAllByTab(a) ucscRetroOrthoLoadAllByChar(a, '\t'); +/* Load all ucscRetroOrtho from tab separated file. + * Dispose of this with ucscRetroOrthoFreeList(). */ + +struct ucscRetroOrtho *ucscRetroOrthoCommaIn(char **pS, struct ucscRetroOrtho *ret); +/* Create a ucscRetroOrtho out of a comma separated string. + * This will fill in ret if non-null, otherwise will + * return a new ucscRetroOrtho */ + +void ucscRetroOrthoFree(struct ucscRetroOrtho **pEl); +/* Free a single dynamically allocated ucscRetroOrtho such as created + * with ucscRetroOrthoLoad(). */ + +void ucscRetroOrthoFreeList(struct ucscRetroOrtho **pList); +/* Free a list of dynamically allocated ucscRetroOrtho's */ + +void ucscRetroOrthoOutput(struct ucscRetroOrtho *el, FILE *f, char sep, char lastSep); +/* Print out ucscRetroOrtho. Separate fields with sep. Follow last field with lastSep. */ + +#define ucscRetroOrthoTabOut(el,f) ucscRetroOrthoOutput(el,f,'\t','\n'); +/* Print out ucscRetroOrtho as a line in a tab-separated file. */ + +#define ucscRetroOrthoCommaOut(el,f) ucscRetroOrthoOutput(el,f,',',','); +/* Print out ucscRetroOrtho as a comma separated list including final comma. */ + +/* -------------------------------- End autoSql Generated Code -------------------------------- */ + +#endif /* UCSCRETROORTHO_H */ +