src/hg/instinct/lib/hgStatsLib.c 1.13

1.13 2009/04/27 16:58:35 jsanborn
fixed bug with fishers meta
Index: src/hg/instinct/lib/hgStatsLib.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/instinct/lib/hgStatsLib.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -b -B -U 4 -r1.12 -r1.13
--- src/hg/instinct/lib/hgStatsLib.c	17 Mar 2009 22:50:58 -0000	1.12
+++ src/hg/instinct/lib/hgStatsLib.c	27 Apr 2009 16:58:35 -0000	1.13
@@ -479,9 +479,9 @@
 {
 if (data == NULL)
     return 0;
 
-float logSum = 0;
+float logSum = 0.0;
 float sign = 0.0;
 int logSumCount = 0;
 struct slDouble *currVal = data;
 while(currVal)
@@ -496,8 +496,11 @@
 		logSumCount++; // only count the ones we can actually use
 		}
 	currVal = currVal->next;
 	}
+if (logSumCount == 0 || logSum == 0)
+    return 0;
+
 sign = 1.0;
 if (logSum > 0.0)
     sign = -1.0;
 logSum = 2.0*fabs(logSum);