85be21057a058a0bdb12caac2bae553376442f5a
angie
  Mon Apr 15 10:56:28 2013 -0700
Refactoring to remove dependencies on annoGratorQuery from streamers,grators and formatters.  Instead, provide basic assembly info and
explicitly pass streamers(/grators) along with the rows that they
produced into formatters. ref #6152

diff --git src/lib/annoAssembly.c src/lib/annoAssembly.c
new file mode 100644
index 0000000..9bce1d9
--- /dev/null
+++ src/lib/annoAssembly.c
@@ -0,0 +1,33 @@
+/* annoAssembly -- basic metadata about an assembly for the annoGrator framework. */
+
+#include "common.h"
+#include "twoBit.h"
+#include "annoAssembly.h"
+
+struct annoAssembly *annoAssemblyNew(char *name, char *twoBitPath)
+/* Return an annoAssembly with open twoBitFile. */
+{
+struct annoAssembly *aa;
+AllocVar(aa);
+aa->name = cloneString(name);
+aa->tbf = twoBitOpen(twoBitPath);
+return aa;
+}
+
+uint annoAssemblySeqSize(struct annoAssembly *aa, char *seqName)
+/* Return the number of bases in seq which must be in aa's twoBitFile. */
+{
+return (uint)twoBitSeqSize(aa->tbf, seqName);
+}
+
+void annoAssemblyClose(struct annoAssembly **pAa)
+/* Close aa's twoBitFile and free mem. */
+{
+if (*pAa == NULL)
+    return;
+struct annoAssembly *aa = *pAa;
+freeMem(aa->name);
+twoBitClose(&(aa->tbf));
+freez(pAa);
+}
+