/* bwtMake - Create a bwt transformed version of a file. */ #include "common.h" #include "linefile.h" #include "hash.h" #include "options.h" #include "obscure.h" void usage() /* Explain usage and exit. */ { errAbort( "bwtMake - Create a bwt transformed version of dna sequence\n" "usage:\n" " bwtMake in.txt out.bwt\n" "The out.bwt will be mostly text, but will have a zero in it.\n" " -suffix=file Output suffix tree to file.\n" ); } static struct optionSpec options[] = { {"suffix", OPTION_STRING}, {NULL, 0}, }; char *inBuf; int cmpInBufAtOffset(const void *va, const void *vb) { int a = *((const int *)va), b = *((const int *)vb); return strcmp(inBuf+a, inBuf+b); } void writeUpTo(FILE *f, char *s, int maxSize) /* Write string to file, up to either end of string of maxSize chars */ { int i; for (i=0; i= (1LL << 32LL)) errAbort("In is too big, can only handle up to 4 Gig"); bits32 *offsets; bits32 i, size=inSize+1; AllocArray(offsets, size); for (i=0; i