03d79bf4ff976c1c0f7327d91e8b9d9adc70cefd markd Tue Jan 23 21:55:36 2018 -0800 do a better job converting NCBI [CDJV]_gene_segment GFF3 annotations. This avoids split into genePreds. Another evening wasted with bioinformatics file formats diff --git src/inc/gff3.h src/inc/gff3.h index d6d66a7..a6e3675 100644 --- src/inc/gff3.h +++ src/inc/gff3.h @@ -211,32 +211,36 @@ /* commonly used features names */ extern char *gff3FeatGene; extern char *gff3FeatPseudogene; extern char *gff3FeatMRna; extern char *gff3FeatNCRna; extern char *gff3FeatRRna; extern char *gff3FeatTRna; extern char *gff3FeatExon; extern char *gff3FeatCDS; extern char *gff3FeatThreePrimeUTR; extern char *gff3FeatFivePrimeUTR; extern char *gff3FeatStartCodon; extern char *gff3FeatStopCodon; extern char *gff3FeatTranscript; extern char *gff3FeatPrimaryTranscript; +extern char *gff3FeatCGeneSegment; +extern char *gff3FeatDGeneSegment; +extern char *gff3FeatJGeneSegment; extern char *gff3FeatVGeneSegment; + struct gff3File *gff3FileOpen(char *fileName, int maxErr, FILE *errFh); /* Parse a GFF3 file into a gff3File object. If maxErr not zero, then * continue to parse until this number of error have been reached. A maxErr * less than zero does not stop reports all errors. Write errors to errFh, * if NULL, use stderr. */ void gff3FileFree(struct gff3File **g3fPtr); /* Free a gff3File object */ struct gff3Ann *gff3FileFindAnn(struct gff3File *g3f, char *id); /* find an annotation record by id, or NULL if not found. */ struct gff3Attr *gff3AnnFindAttr(struct gff3Ann *g3a, char *tag); /* find a user attribute, or NULL */ @@ -248,30 +252,38 @@ /* write contents of an GFF3File object to a file */ INLINE struct gff3AnnRef *gff3AnnRefNew(struct gff3Ann *g3a) /* Allocate a gff3AnnRef object from the heap. Not used by the parsing code, as * all data is contained in localMem objects */ { struct gff3AnnRef *ref; AllocVar(ref); ref->ann = g3a; return ref; } int gff3AnnRefLocCmp(const void *va, const void *vb); /* sort compare function for location of two gff3AnnRef objects */ +void gff3UnlinkChild(struct gff3Ann *g3a, + struct gff3Ann *child); +/* unlink the child from it's parent (do not free) */ + +void gff3LinkChild(struct gff3Ann *g2a, + struct gff3Ann *child); +/* Add a child to a parent */ + INLINE int gff3PhaseToFrame(int phase) /* convert a phase to a frame */ { switch (phase) { case 0: return 0; case 1: return 2; case 2: return 1; } return -1; }