e2ec5ef77645a662ba31c7cfbd7499794975275a
angie
  Fri Mar 23 16:44:07 2012 -0700
Feature #6152 (Variant Annotation Tool): Initial work, squashed infrom origin/annoGrator branch.  Superclasses annoColumn, annoFilter,
annoRow, annoStreamer, annoGrator, and annoFormatter define the core
interfaces for passing data and configuration to and from components.
The annoGrator superclass can join annoRows on position and pass
forward all rows of secondary source.  The annoGratorQuery module
orchestrates the passing of annoRows between the primary source,
annoGrator(s) and annoFormatter(s).  The subclasses annoStreamDb and
annoFormatTab, together with hg/lib/tests/annoGratorTester.c, can join
columns of two database tables such as hg19's pgNA12878 and knownGene
into tab-separated output.

diff --git src/lib/annoColumn.c src/lib/annoColumn.c
new file mode 100644
index 0000000..a10cb84
--- /dev/null
+++ src/lib/annoColumn.c
@@ -0,0 +1,41 @@
+/* annoColumn -- def. of column plus flag for inclusion in output of annoGratorQuery framework */
+
+#include "annoColumn.h"
+
+struct annoColumn *annoColumnsFromAsObject(struct asObject *asObj)
+/* Create a list of columns from asObj; by default, all are set to be included in output.
+ * Callers: do not modify any column's def! */
+{
+struct annoColumn *colList = NULL;
+struct asColumn *asCol;
+for (asCol = asObj->columnList;  asCol != NULL;  asCol = asCol->next)
+    {
+    struct annoColumn *col;
+    AllocVar(col);
+    col->def = asCol;
+    col->included = TRUE;
+    slAddHead(&colList, col);
+    }
+slReverse(&colList);
+return colList;
+}
+
+struct annoColumn *annoColumnCloneList(struct annoColumn *list)
+/* Shallow-copy a list of annoColumns.  Callers: do not modify any column's def! */
+{
+struct annoColumn *newList = NULL, *oldC;
+for (oldC = list;  oldC != NULL;  oldC = oldC->next)
+    {
+    struct annoColumn *newC = CloneVar(oldC);
+    slAddHead(&newList, newC);
+    }
+slReverse(&newList);
+return newList;
+}
+
+void annoColumnFreeList(struct annoColumn **pList)
+/* Shallow-free a list of annoColumns.  Does not free any column's def. */
+{
+slFreeList(pList);
+}
+