src/utils/bedToBigBed/bedToBigBed.c 1.4
1.4 2009/04/20 23:17:26 mikep
added sort option, also made changes to bigBed.h + bigBed.c
Index: src/utils/bedToBigBed/bedToBigBed.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/utils/bedToBigBed/bedToBigBed.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -b -B -U 4 -r1.3 -r1.4
--- src/utils/bedToBigBed/bedToBigBed.c 15 Mar 2009 18:03:03 -0000 1.3
+++ src/utils/bedToBigBed/bedToBigBed.c 20 Apr 2009 23:17:26 -0000 1.4
@@ -10,8 +10,9 @@
int blockSize = 1024;
int itemsPerSlot = 64;
int bedFields = 0;
char *as = NULL;
+boolean sorted = FALSE;
void usage()
/* Explain usage and exit. */
{
@@ -28,8 +29,9 @@
" -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"
+ " -sorted - Input is already sorted (quicker for very large files)\n"
, blockSize, itemsPerSlot
);
}
@@ -37,15 +39,16 @@
{"blockSize", OPTION_INT},
{"itemsPerSlot", OPTION_INT},
{"bedFields", OPTION_INT},
{"as", OPTION_STRING},
+ {"sorted", OPTION_BOOLEAN},
{NULL, 0},
};
void bedToBigBed(char *inName, char *chromSizes, char *outName)
/* bedToBigBed - Convert bed file to bigBed.. */
{
-bigBedFileCreate(inName, chromSizes, blockSize, itemsPerSlot, bedFields, as, outName);
+bigBedFileCreateDetailed(inName, sorted, chromSizes, blockSize, itemsPerSlot, bedFields, as, outName);
}
int main(int argc, char *argv[])
/* Process command line. */
@@ -53,8 +56,9 @@
optionInit(&argc, argv, options);
blockSize = optionInt("blockSize", blockSize);
itemsPerSlot = optionInt("itemsPerSlot", itemsPerSlot);
bedFields = optionInt("bedFields", bedFields);
+sorted = optionExists("sorted");
as = optionVal("as", as);
if (argc != 4)
usage();
bedToBigBed(argv[1], argv[2], argv[3]);