src/hg/regulate/regBedStats/regBedStats.c 1.2
1.2 2010/03/10 19:45:19 kent
Moving doubleBoxWhiskerCalc to library.
Index: src/hg/regulate/regBedStats/regBedStats.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/regulate/regBedStats/regBedStats.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -b -B -U 4 -r1.1 -r1.2
--- src/hg/regulate/regBedStats/regBedStats.c 10 Mar 2010 19:41:55 -0000 1.1
+++ src/hg/regulate/regBedStats/regBedStats.c 10 Mar 2010 19:45:19 -0000 1.2
@@ -34,43 +34,8 @@
{"scoreColIx", OPTION_INT},
{NULL, 0},
};
-void doubleBoxWhiskerCalc(int count, double *array, double *retMin,
- double *retQ1, double *retMedian, double *retQ3, double *retMax)
-/* Calculate what you need to draw a box and whiskers plot from an array of doubles. */
-{
-double median;
-doubleSort(count, array);
-*retMin = array[0];
-*retQ1 = array[(count+2)/4];
-int halfCount = count>>1;
-if ((count&1) == 1)
- *retMedian = array[halfCount];
-else
- {
- *retMedian = (array[halfCount] + array[halfCount-1]) * 0.5;
- }
-*retQ3 = array[(3*count+2)/4];
-*retMax = array[count-1];
-}
-
-void slDoubleBoxWhiskerCalc(struct slDouble *list, double *retMin,
- double *retQ1, double *retMedian, double *retQ3, double *retMax)
-/* Calculate what you need to draw a box and whiskers plot from a list of slDoubles. */
-{
-int i,count = slCount(list);
-struct slDouble *el;
-double *array, minVal, q1, median, q3, maxVal;
-if (count == 0)
- errAbort("Can't take do slDoubleBoxWhiskerCalc of empty list");
-AllocArray(array,count);
-for (i=0, el=list; i<count; ++i, el=el->next)
- array[i] = el->val;
-doubleBoxWhiskerCalc(count, array, retMin, retQ1, retMedian, retQ3, retMax);
-freeMem(array);
-}
-
void printStats(FILE *f, struct slDouble *list)
/* Print out stats on list: ave +-std min 1/4 median 3/4 max */
{
int count = 0;