src/utils/bedToBigBed/bedToBigBed.c 1.3
1.3 2009/03/15 18:03:03 kent
Adding -as option.
Index: src/utils/bedToBigBed/bedToBigBed.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/utils/bedToBigBed/bedToBigBed.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -B -U 1000000 -r1.2 -r1.3
--- src/utils/bedToBigBed/bedToBigBed.c 10 Feb 2009 22:11:00 -0000 1.2
+++ src/utils/bedToBigBed/bedToBigBed.c 15 Mar 2009 18:03:03 -0000 1.3
@@ -1,57 +1,62 @@
/* bedToBigBed - Convert bed file to bigBed.. */
#include "common.h"
#include "linefile.h"
#include "hash.h"
#include "options.h"
#include "bigBed.h"
static char const rcsid[] = "$Id$";
int blockSize = 1024;
int itemsPerSlot = 64;
int bedFields = 0;
+char *as = NULL;
void usage()
/* Explain usage and exit. */
{
errAbort(
"bedToBigBed - Convert bed file to bigBed.\n"
"usage:\n"
" bedToBigBed in.bed chrom.sizes out.bb\n"
"Where in.bed is in one of the ascii bed formats, but not including track lines\n"
"and chrom.sizes is two column: <chromosome name> <size in bases>\n"
"and out.bb is the output indexed big bed file.\n"
"options:\n"
" -blockSize=N - Number of items to bundle in r-tree. Default %d\n"
" -itemsPerSlot=N - Number of data points bundled at lowest level. Default %d\n"
" -bedFields=N - Number of fields that fit standard bed definition. If undefined\n"
" assumes all fields in bed are defined.\n"
+ " -as=fields.as - If have non-standard fields, it's great to put a definition of\n"
+ " each field in a row in AutoSql format here.\n"
, blockSize, itemsPerSlot
);
}
static struct optionSpec options[] = {
{"blockSize", OPTION_INT},
{"itemsPerSlot", OPTION_INT},
{"bedFields", OPTION_INT},
+ {"as", OPTION_STRING},
{NULL, 0},
};
void bedToBigBed(char *inName, char *chromSizes, char *outName)
/* bedToBigBed - Convert bed file to bigBed.. */
{
-bigBedFileCreate(inName, chromSizes, blockSize, itemsPerSlot, bedFields, outName);
+bigBedFileCreate(inName, chromSizes, blockSize, itemsPerSlot, bedFields, as, outName);
}
int main(int argc, char *argv[])
/* Process command line. */
{
optionInit(&argc, argv, options);
blockSize = optionInt("blockSize", blockSize);
itemsPerSlot = optionInt("itemsPerSlot", itemsPerSlot);
bedFields = optionInt("bedFields", bedFields);
+as = optionVal("as", as);
if (argc != 4)
usage();
bedToBigBed(argv[1], argv[2], argv[3]);
return 0;
}