00001 /***************************************************************************** 00002 * Copyright (C) 2000 Jim Kent. This source code may be freely used * 00003 * for personal, academic, and non-profit purposes. Commercial use * 00004 * permitted only by explicit agreement with Jim Kent (jim_kent@pacbell.net) * 00005 *****************************************************************************/ 00006 #ifndef MADBREP_H 00007 #define MADBREP_H 00008 00009 /* maDbRep.h was originally generated by the autoSql program, which also 00010 * generated maDbRep.c and maDbRep.sql. This header links the database and the RAM 00011 * representation of objects. */ 00012 00013 struct mrnaAli 00014 /* An mRNA/genomic alignment */ 00015 { 00016 struct mrnaAli *next; /* Next in singly linked list. */ 00017 unsigned id; /* Unique ID */ 00018 signed char readDir; /* Read direction of mRNA +1 or -1 */ 00019 signed char orientation; /* Orientation relative to first BAC */ 00020 unsigned char hasIntrons; /* True if alignment has introns */ 00021 unsigned char isEst; /* True if an EST. */ 00022 int score; /* Score in something like log-odds form */ 00023 char qAcc[13]; /* GenBank Accession for mRNA sequence */ 00024 unsigned qId; /* Database ID of mRNA sequence */ 00025 unsigned qTotalSize; /* Total bases (not just aligned) in mRNA */ 00026 unsigned qStart; /* Start in mRNA sequence */ 00027 unsigned qEnd; /* End in mRNA sequence */ 00028 unsigned tStartBac; /* ID of first genomic BAC in alignment */ 00029 unsigned tStartPos; /* Start position within first BAC */ 00030 unsigned tEndBac; /* ID of last genomic BAC in alignment */ 00031 unsigned tEndPos; /* End position within last BAC */ 00032 unsigned blockCount; /* Number of aligned blocks */ 00033 unsigned *blockSizes; /* Size of each block */ 00034 unsigned *qBlockStarts; /* Start of each block in mRNA */ 00035 unsigned *tBlockBacs; /* BAC each block starts in */ 00036 unsigned *tBlockStarts; /* Position within BAC of each block start */ 00037 unsigned short *startGoods; /* Number of perfect bases at start of block */ 00038 unsigned short *endGoods; /* Number of perfect bases at end of block */ 00039 }; 00040 00041 struct mrnaAli *mrnaAliLoad(char **row); 00042 /* Load a mrnaAli from row fetched with select * from mrnaAli 00043 * from database. Dispose of this with mrnaAliFree(). */ 00044 00045 void mrnaAliFree(struct mrnaAli **pEl); 00046 /* Free a single dynamically allocated mrnaAli such as created 00047 * with mrnaAliLoad(). */ 00048 00049 void mrnaAliFreeList(struct mrnaAli **pList); 00050 /* Free a list of dynamically allocated mrnaAli's */ 00051 00052 void mrnaAliOutput(struct mrnaAli *el, FILE *f, char sep, char lastSep); 00053 /* Print out mrnaAli. Separate fields with sep. Follow last field with lastSep. */ 00054 00055 #define mrnaAliTabOut(el,f) mrnaAliOutput(el,f,'\t','\n'); 00056 /* Print out mrnaAli as a line in a tab-separated file. */ 00057 00058 #define mrnaAliCommaOut(el,f) mrnaAliOutput(el,f,',',','); 00059 /* Print out mrnaAli as a comma separated list including final comma. */ 00060 00061 #endif /* MADBREP_H */ 00062
1.5.2