/* sageCounts.h was originally generated by the autoSql program, which also 
 * generated sageCounts.c and sageCounts.sql.  This header links the database and
 * the RAM representation of objects. */

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

#ifndef SAGECOUNTS_H
#define SAGECOUNTS_H

struct sageCounts
/* Counts for each tag from each experiment */
    {
    struct sageCounts *next;  /* Next in singly linked list. */
    char tag[11];	/* Tag sequence */
    int numExps;	/* Number of experiments. */
    int *expCounts;	/* Counts from each experiment */
    };

struct sageCounts *sageCountsLoad(char **row);
/* Load a sageCounts from row fetched with select * from sageCounts
 * from database.  Dispose of this with sageCountsFree(). */

struct sageCounts *sageCountsLoadAll(char *fileName);
/* Load all sageCounts from a tab-separated file.
 * Dispose of this with sageCountsFreeList(). */

struct sageCounts *sageCountsCommaIn(char **pS, struct sageCounts *ret);
/* Create a sageCounts out of a comma separated string. 
 * This will fill in ret if non-null, otherwise will
 * return a new sageCounts */

void sageCountsFree(struct sageCounts **pEl);
/* Free a single dynamically allocated sageCounts such as created
 * with sageCountsLoad(). */

void sageCountsFreeList(struct sageCounts **pList);
/* Free a list of dynamically allocated sageCounts's */

void sageCountsOutput(struct sageCounts *el, FILE *f, char sep, char lastSep);
/* Print out sageCounts.  Separate fields with sep. Follow last field with lastSep. */

#define sageCountsTabOut(el,f) sageCountsOutput(el,f,'\t','\n');
/* Print out sageCounts as a line in a tab-separated file. */

#define sageCountsCommaOut(el,f) sageCountsOutput(el,f,',',',');
/* Print out sageCounts as a comma separated list including final comma. */

#endif /* SAGECOUNTS_H */

