src/hg/inc/pgSnp.h 1.4
1.4 2010/03/08 17:52:10 giardine
Adding phenotype tables for pgSnp track hgc clicks
Index: src/hg/inc/pgSnp.h
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/inc/pgSnp.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -b -B -U 1000000 -r1.3 -r1.4
--- src/hg/inc/pgSnp.h 3 Sep 2008 19:19:12 -0000 1.3
+++ src/hg/inc/pgSnp.h 8 Mar 2010 17:52:10 -0000 1.4
@@ -1,115 +1,119 @@
/* pgSnp.h was originally generated by the autoSql program, which also
* generated pgSnp.c and pgSnp.sql. This header links the database and
* the RAM representation of objects. */
#ifndef PGSNP_H
#define PGSNP_H
#include "jksql.h"
+#include "trackDb.h"
#define PGSNP_NUM_COLS 8
#ifndef BED_H
#include "bed.h"
#endif
struct pgSnp
/* personal genome SNP */
{
struct pgSnp *next; /* Next in singly linked list. */
char *chrom; /* Chromosome */
unsigned chromStart; /* Start position in chrom */
unsigned chromEnd; /* End position in chrom */
char *name; /* alleles */
int alleleCount; /* number of alleles */
char *alleleFreq; /* comma separated list of frequency of each allele */
char *alleleScores; /* comma separated list of quality scores */
unsigned short bin; /* A field to speed indexing */
};
void pgSnpStaticLoad(char **row, struct pgSnp *ret);
/* Load a row from pgSnp table into ret. The contents of ret will
* be replaced at the next call to this function. */
struct pgSnp *pgSnpLoad(char **row);
/* Load a pgSnp from row fetched with select * from pgSnp
* from database. Dispose of this with pgSnpFree(). */
struct pgSnp *pgSnpLoadAll(char *fileName);
/* Load all pgSnp from whitespace-separated file.
* Dispose of this with pgSnpFreeList(). */
struct pgSnp *pgSnpLoadAllByChar(char *fileName, char chopper);
/* Load all pgSnp from chopper separated file.
* Dispose of this with pgSnpFreeList(). */
#define pgSnpLoadAllByTab(a) pgSnpLoadAllByChar(a, '\t');
/* Load all pgSnp from tab separated file.
* Dispose of this with pgSnpFreeList(). */
struct pgSnp *pgSnpLoadByQuery(struct sqlConnection *conn, char *query);
/* Load all pgSnp 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 pgSnpFreeList(). */
void pgSnpSaveToDb(struct sqlConnection *conn, struct pgSnp *el, char *tableName, int updateSize);
/* Save pgSnp 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 pgSnpSaveToDbEscaped() */
void pgSnpSaveToDbEscaped(struct sqlConnection *conn, struct pgSnp *el, char *tableName, int updateSize);
/* Save pgSnp 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 pgSnpSaveToDb().
* For example automatically copies and converts:
* "autosql's features include" --> "autosql\'s features include"
* before inserting into database. */
struct pgSnp *pgSnpCommaIn(char **pS, struct pgSnp *ret);
/* Create a pgSnp out of a comma separated string.
* This will fill in ret if non-null, otherwise will
* return a new pgSnp */
void pgSnpFree(struct pgSnp **pEl);
/* Free a single dynamically allocated pgSnp such as created
* with pgSnpLoad(). */
void pgSnpFreeList(struct pgSnp **pList);
/* Free a list of dynamically allocated pgSnp's */
void pgSnpOutput(struct pgSnp *el, FILE *f, char sep, char lastSep);
/* Print out pgSnp. Separate fields with sep. Follow last field with lastSep. */
#define pgSnpTabOut(el,f) pgSnpOutput(el,f,'\t','\n');
/* Print out pgSnp as a line in a tab-separated file. */
#define pgSnpCommaOut(el,f) pgSnpOutput(el,f,',',',');
/* Print out pgSnp as a comma separated list including final comma. */
/* -------------------------------- End autoSql Generated Code -------------------------------- */
struct pgCodon
/* codons covering region */
{
char *seq;
int cdStart;
int cdEnd;
int firstCodon;
int regStart; /* in coding sequence positions */
int regEnd;
};
struct pgCodon *fetchCodons (char *db, struct bed *gene, unsigned chrStart, unsigned chrEnd);
/* get codon sequence to compute aa changes */
void printSeqCodDisplay (char *db, struct pgSnp *item);
/* print the display of sequence changes for a coding variant */
+void printPgDbLink(char *db, struct trackDb *tdb, struct pgSnp *item);
+/* print the links to phenotype and other databases for pgSnps */
+
#endif /* PGSNP_H */