/* 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. */

/* Copyright (C) 2013 The Regents of the University of California 
 * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */

#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. Strings are automatically escaped to allow insertion into the 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 */

