src/utils/bigWigInfo/bigWigInfo.c 1.3
1.3 2009/11/05 19:48:21 kent
Making listing of chromosomes just an option. Adding info from totalSummary, which some day may be used to set min/max values of bigBed/bigWig wiggle ranges.
Index: src/utils/bigWigInfo/bigWigInfo.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/utils/bigWigInfo/bigWigInfo.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -B -U 4 -r1.2 -r1.3
--- src/utils/bigWigInfo/bigWigInfo.c 8 Sep 2009 19:50:24 -0000 1.2
+++ src/utils/bigWigInfo/bigWigInfo.c 5 Nov 2009 19:48:21 -0000 1.3
@@ -5,8 +5,9 @@
#include "options.h"
#include "localmem.h"
#include "udc.h"
#include "bigWig.h"
+#include "hmmstats.h"
static char const rcsid[] = "$Id$";
@@ -18,13 +19,15 @@
"usage:\n"
" bigWigInfo file.bw\n"
"options:\n"
" -udcDir=/dir/to/cache - place to put cache for remote bigBed/bigWigs\n"
+ " -chroms - list all chromosomes and their sizes\n"
);
}
static struct optionSpec options[] = {
{"udcDir", OPTION_STRING},
+ {"chroms", OPTION_BOOLEAN},
{NULL, 0},
};
void bigWigInfo(char *fileName)
@@ -38,10 +41,17 @@
for (zoom = bwf->levelList; zoom != NULL; zoom = zoom->next)
printf("\t%d\n", zoom->reductionLevel);
struct bbiChromInfo *chrom, *chromList = bbiChromList(bwf);
printf("chromCount: %d\n", slCount(chromList));
-for (chrom=chromList; chrom != NULL; chrom = chrom->next)
+if (optionExists("chroms"))
+ for (chrom=chromList; chrom != NULL; chrom = chrom->next)
printf("\t%s %d %d\n", chrom->name, chrom->id, chrom->size);
+struct bbiSummaryElement sum = bbiTotalSummary(bwf);
+printf("basesCovered: %lld\n", sum.validCount);
+printf("mean: %f\n", sum.sumData/sum.validCount);
+printf("min: %f\n", sum.minVal);
+printf("max: %f\n", sum.maxVal);
+printf("std: %f\n", calcStdFromSums(sum.sumData, sum.sumSquares, sum.validCount));
}
int main(int argc, char *argv[])
/* Process command line. */