c7455312e1ba7fb58ed6b9191ee1ff147730066d angie Mon Sep 30 12:02:37 2013 -0700 Make annoAssemblySeqSize cache sequence sizes, because twoBitSeqSizedoes a seek and read, and some annoStreams check sequence size pretty often. diff --git src/inc/annoAssembly.h src/inc/annoAssembly.h index b5e1120..a76caf3 100644 --- src/inc/annoAssembly.h +++ src/inc/annoAssembly.h @@ -1,28 +1,30 @@ /* annoAssembly -- basic metadata about an assembly for the annoGrator framework. */ #ifndef ANNOASSEMBLY_H #define ANNOASSEMBLY_H #include "common.h" +#include "hash.h" struct annoAssembly /* Basic information about a genome assembly. */ { char *name; // UCSC symbolic name for assembly, e.g. "hg19" struct twoBitFile *tbf; // Opened twoBit sequence file for assembly char *twoBitPath; // twoBit file name + struct hash *seqSizes; // cache of sequence names to sizes (twoBitSeqSize does a seek&read) }; struct annoAssembly *annoAssemblyNew(char *name, char *twoBitPath); /* Return an annoAssembly with open twoBitFile. */ struct slName *annoAssemblySeqNames(struct annoAssembly *aa); /* Return a list of sequence names in this assembly. */ uint annoAssemblySeqSize(struct annoAssembly *aa, char *seqName); /* Return the number of bases in seq which must be in aa's twoBitFile. */ void annoAssemblyClose(struct annoAssembly **pAa); /* Close aa's twoBitFile and free mem. */ #endif//ndef ANNOASSEMBLY_H