inc/oldGff.h

Go to the documentation of this file.
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 /* oldGff.h - This reads a *special* type of .GFF file.  
00007  * Some of the routines herein expect the gff file to include
00008  * both DNA and gene/intron/exon info.  They expect the
00009  * genes to be named by the group field. */
00010 #ifndef OLDGFF_H
00011 #define OLDGFF_H
00012 
00013 struct gff
00014 /* This is the structure that holds info on a gff file.
00015  */
00016     {
00017     char fileName[256];
00018     FILE *file;
00019     long fileSize;
00020     char buf[256];
00021     int bufSize;
00022     int bytesInBuf;
00023     int readIx;
00024     int lineNumber;
00025     struct lm *memPool;
00026     char *dna;
00027     long dnaSize;
00028     char dnaName[128];
00029     struct gffGene *genes;
00030     };
00031 
00032 /* An intron or exon - just an offset into a DNA array. */
00033 struct gffSegment
00034     {
00035     struct gffSegment *next;    /* This must be first field! */
00036     long start, end;
00037     int frame;
00038     };
00039 typedef struct gffSegment GffIntron;
00040 typedef struct gffSegment GffExon;
00041 
00042 struct gffGene
00043 /* At the end of a GFF file are a number of genes, each of which 
00044  * is a list of exons/introns. */
00045     {
00046     struct gffGene *next;       /* This must be first field! */
00047     long start, end;
00048     int frame;
00049     char strand;        /* + or - */
00050     char name[64];
00051     GffExon *exons;
00052     GffIntron *introns;
00053     DNA *dna;
00054     long dnaSize;
00055     };
00056 
00057 
00058 boolean gffOpen(struct gff *gff, char *fileName);
00059 /* Initialize gff structure and open file for it. */
00060 
00061 boolean gffOpenAndRead(struct gff *gff, char *fileName);
00062 /* Open up gff file and read everything in it. */
00063 
00064 void gffClose(struct gff *gff);
00065 /* Close down gff structure. */
00066 
00067 boolean gffReadDna(struct gff *gff);
00068 /* Read all the DNA in a file. */
00069 
00070 struct gffGene *gffFindGene(struct gff *gff, char *geneName);
00071 /* Find gene with given name.  Case sensitive. */
00072 
00073 struct gffGene *gffFindGeneIgnoreCase(struct gff *gff, char *geneName);
00074 /* Find gene with given name.  Not case sensitive. */
00075 
00076 void gffPrintInfo(struct gff *gff, FILE *out);
00077 /* Print summary info about file. */
00078 
00079 boolean gffReadGenes(struct gff *gff);
00080 /* Read all the gene (as opposed to base) info in file. */
00081 
00082 struct gffGene *gffDupeGene(struct gff *gff, struct gffGene *oldGene);
00083 /* Make a duplicate of gene (with it's own DNA). gffFreeGene it when done. */
00084 
00085 struct gffGene *gffDupeGeneAndSurrounds(struct gff *gff, struct gffGene *oldGene,
00086     int leftExtra, int rightExtra);
00087 /* Make a duplicate of gene with extra DNA around coding region. 
00088  * gffFreeGene it when done. */
00089 
00090 struct gffGene *gffGeneWithOwnDna(struct gff *gff, char *geneName);
00091 /* Find gene with given name.  Case sensitive. */
00092 
00093 void gffFreeGene(struct gffGene **pGene);
00094 /* Free a gene returned with dupeGene or geneWithOwnDna. 
00095  * (You don't want to free the ones returned by findGene,
00096  * they are still owned by the gff.)
00097  */
00098 
00099 struct dnaSeq *gffReadDnaSeq(char *fileName);
00100 /* Open gff file and read DNA sequence from it. */
00101 
00102 #endif /* GFF_H */
00103 

Generated on Tue Dec 25 18:39:29 2007 for blat by  doxygen 1.5.2