00001 /* xAli.h was originally generated by the autoSql program, which also 00002 * generated xAli.c and xAli.sql. This header links the database and 00003 * the RAM representation of objects. */ 00004 00005 #ifndef XALI_H 00006 #define XALI_H 00007 00008 struct xAli 00009 /* An alignment - like psl but includes the sequence itself */ 00010 { 00011 struct xAli *next; /* Next in singly linked list. */ 00012 unsigned match; /* Number of bases that match that aren't repeats */ 00013 unsigned misMatch; /* Number of bases that don't match */ 00014 unsigned repMatch; /* Number of bases that match but are part of repeats */ 00015 unsigned nCount; /* Number of 'N' bases */ 00016 unsigned qNumInsert; /* Number of inserts in query */ 00017 int qBaseInsert; /* Number of bases inserted in query */ 00018 unsigned tNumInsert; /* Number of inserts in target */ 00019 int tBaseInsert; /* Number of bases inserted in target */ 00020 char strand[3]; /* + or - for strand. First character query, second target (optional) */ 00021 char *qName; /* Query sequence name */ 00022 unsigned qSize; /* Query sequence size */ 00023 unsigned qStart; /* Alignment start position in query */ 00024 unsigned qEnd; /* Alignment end position in query */ 00025 char *tName; /* Target sequence name */ 00026 unsigned tSize; /* Target sequence size */ 00027 unsigned tStart; /* Alignment start position in target */ 00028 unsigned tEnd; /* Alignment end position in target */ 00029 unsigned blockCount; /* Number of blocks in alignment */ 00030 unsigned *blockSizes; /* Size of each block */ 00031 unsigned *qStarts; /* Start of each block in query. */ 00032 unsigned *tStarts; /* Start of each block in target. */ 00033 char **qSeq; /* Query sequence for each block. */ 00034 char **tSeq; /* Target sequence for each block. */ 00035 }; 00036 00037 struct xAli *xAliLoad(char **row); 00038 /* Load a xAli from row fetched with select * from xAli 00039 * from database. Dispose of this with xAliFree(). */ 00040 00041 struct xAli *xAliLoadAll(char *fileName); 00042 /* Load all xAli from a tab-separated file. 00043 * Dispose of this with xAliFreeList(). */ 00044 00045 struct xAli *xAliCommaIn(char **pS, struct xAli *ret); 00046 /* Create a xAli out of a comma separated string. 00047 * This will fill in ret if non-null, otherwise will 00048 * return a new xAli */ 00049 00050 void xAliFree(struct xAli **pEl); 00051 /* Free a single dynamically allocated xAli such as created 00052 * with xAliLoad(). */ 00053 00054 void xAliFreeList(struct xAli **pList); 00055 /* Free a list of dynamically allocated xAli's */ 00056 00057 void xAliOutput(struct xAli *el, FILE *f, char sep, char lastSep); 00058 /* Print out xAli. Separate fields with sep. Follow last field with lastSep. */ 00059 00060 #define xAliTabOut(el,f) xAliOutput(el,f,'\t','\n'); 00061 /* Print out xAli as a line in a tab-separated file. */ 00062 00063 #define xAliCommaOut(el,f) xAliOutput(el,f,',',','); 00064 /* Print out xAli as a comma separated list including final comma. */ 00065 00066 /* ---------------- Start human generated code. ------------------ */ 00067 00068 struct xAli *xAliNext(struct lineFile *lf); 00069 /* Read next line from file and convert it to xAli. Return 00070 * NULL at eof. */ 00071 00072 #endif /* XALI_H */ 00073
1.5.2