7f98bf75bd712a44b8ed9ededdd10e0f387cd35a
angie
  Thu Aug 13 10:31:58 2015 -0700
Moved averaging of wiggle values back from annoFormatTab to annoGrateWig,
so that it can be done properly across multiple regions with data.
A user was trying to get average GC over 1MB regions, but averages of
smaller subregions were returned instead.
refs #15834

diff --git src/inc/annoGrateWig.h src/inc/annoGrateWig.h
index 2131681..9931566 100644
--- src/inc/annoGrateWig.h
+++ src/inc/annoGrateWig.h
@@ -1,14 +1,21 @@
 /* annoGrateWig -- subclass of annoGrator for bigWig or wiggle data */
 
 #ifndef ANNOGRATEWIG_H
 #define ANNOGRATEWIG_H
 
 #include "annoGrator.h"
 
-struct annoGrator *annoGrateWigNew(struct annoStreamer *wigSource);
-/* Create an annoGrator subclass for source with rowType == arWig. */
+enum annoGrateWigMode { agwmAverage, agwmPerBase };
 
-struct annoGrator *annoGrateBigWigNew(char *fileOrUrl, struct annoAssembly *aa);
-/* Create an annoGrator subclass for bigWig file or URL. */
+struct annoGrator *annoGrateWigNew(struct annoStreamer *wigSource, enum annoGrateWigMode mode);
+/* Create an annoGrator subclass for source with wiggle or bigWig data.
+ * If mode is agwmAverage, then this produces at most one annoRow per primary item
+ * with type arWigSingle, containing the average of all overlapping non-NAN values.
+ * If mode is agwmPerBase, then this produces a list of annoRows split by NANs, with type
+ * arWigVec (vector of per-base values). */
+
+struct annoGrator *annoGrateBigWigNew(char *fileOrUrl, struct annoAssembly *aa,
+                                      enum annoGrateWigMode mode);
+/* Create an annoGrator subclass for bigWig file or URL.  See above description of mode. */
 
 #endif//ndef ANNOGRATEWIG_H