00001 /* gfPcrLib - Routines to help do in silico PCR. 00002 * Copyright 2004 Jim Kent. All rights reserved. */ 00003 00004 #ifndef GFPCRLIB_H 00005 #define GFPCRLIB_H 00006 00007 struct gfPcrInput 00008 /* Info for input to one PCR experiment. */ 00009 { 00010 struct gfPcrInput *next; /* Next in singly linked list. */ 00011 char *name; /* Name of experiment */ 00012 char *fPrimer; /* Forward primer - 15-30 bases */ 00013 char *rPrimer; /* Reverse primer - after fPrimer and on opposite strand */ 00014 }; 00015 00016 void gfPcrInputStaticLoad(char **row, struct gfPcrInput *ret); 00017 /* Load a row from gfPcrInput table into ret. The contents of ret will 00018 * be replaced at the next call to this function. */ 00019 00020 struct gfPcrInput *gfPcrInputLoad(char **row); 00021 /* Load a gfPcrInput from row fetched with select * from gfPcrInput 00022 * from database. Dispose of this with gfPcrInputFree(). */ 00023 00024 struct gfPcrInput *gfPcrInputLoadAll(char *fileName); 00025 /* Load all gfPcrInput from a whitespace-separated file. 00026 * Dispose of this with gfPcrInputFreeList(). */ 00027 00028 void gfPcrInputFree(struct gfPcrInput **pEl); 00029 /* Free a single dynamically allocated gfPcrInput such as created 00030 * with gfPcrInputLoad(). */ 00031 00032 void gfPcrInputFreeList(struct gfPcrInput **pList); 00033 /* Free a list of dynamically allocated gfPcrInput's */ 00034 00035 struct gfPcrOutput 00036 /* Output of PCR experiment. */ 00037 { 00038 struct gfPcrOutput *next; /* Next in list */ 00039 char *name; /* Name of experiment. */ 00040 char *fPrimer; /* Forward primer - 15-30 bases */ 00041 char *rPrimer; /* Reverse primer - after fPrimer and on opposite strand */ 00042 char *seqName; /* Name of sequence (chromosome maybe) that gets amplified. */ 00043 int seqSize; /* Size of sequence (chromosome maybe) */ 00044 int fPos; /* Position of forward primer in seq. */ 00045 int rPos; /* Position of reverse primer in seq. */ 00046 char strand; /* Strand of amplified sequence. */ 00047 char *dna; /* Fragment of sequence that gets amplified. 00048 * Note in some senses you'll want to replace 00049 * start and ends of this with fPrimer/rPrimer to 00050 * be strictly accurate. */ 00051 }; 00052 00053 void gfPcrOutputFree(struct gfPcrOutput **pOut); 00054 /* Free up a gfPcrOutput structure. */ 00055 00056 void gfPcrOutputFreeList(struct gfPcrOutput **pList); 00057 /* Free up a list of gfPcrOutputs. */ 00058 00059 00060 00061 00062 void gfPcrLocal(char *pcrName, 00063 struct dnaSeq *seq, int seqOffset, char *seqName, int seqSize, 00064 int maxSize, char *fPrimer, int fPrimerSize, char *rPrimer, int rPrimerSize, 00065 int minPerfect, int minGood, char strand, struct gfPcrOutput **pOutList); 00066 /* Do detailed PCR scan on DNA already loaded into memory and put results 00067 * (in reverse order) on *pOutList. */ 00068 00069 struct gfRange *gfPcrGetRanges(char *host, char *port, char *fPrimer, char *rPrimer, 00070 int maxSize); 00071 /* Query gfServer with primers and convert response to a list of gfRanges. */ 00072 00073 struct gfPcrOutput *gfPcrViaNet(char *host, char *port, char *seqDir, 00074 struct gfPcrInput *inList, 00075 int maxSize, int minPerfect, int minGood); 00076 /* Do PCRs using gfServer index, returning list of results. */ 00077 00078 void gfPcrOutputWriteList(struct gfPcrOutput *outList, char *outType, 00079 char *url, FILE *f); 00080 /* Write list of outputs in specified format (either "fa" or "bed") 00081 * to file. If url is non-null it should be a printf formatted 00082 * string that takes %s, %d, %d for chromosome, start, end. */ 00083 00084 void gfPcrOutputWriteAll(struct gfPcrOutput *outList, 00085 char *outType, char *url, char *fileName); 00086 /* Create file of outputs in specified format (either "fa" or "bed") 00087 * to file. If url is non-null it should be a printf formatted 00088 * string that takes %s, %d, %d for chromosome, start, end. */ 00089 00090 char *gfPcrMakePrimer(char *s); 00091 /* Make primer (lowercased DNA) out of text. Complain if 00092 * it is too short or too long. */ 00093 00094 #endif /* GFPCRLIB_H */
1.5.2