Permalink
Browse files

*** empty log message ***

  • Loading branch information...
1 parent c582cbd commit ed67f28f017575512ecfecb5a3e18dcc04e02ae9 langmead committed Sep 25, 2009
Showing with 301 additions and 235 deletions.
  1. +1 −1 annot.cpp
  2. +3 −3 bitset.h
  3. +7 −7 blockwise_sa.h
  4. +33 −15 bowtie_inspect.cpp
  5. +1 −1 ebwt.cpp
  6. +27 −27 ebwt.h
  7. +33 −19 ebwt_build.cpp
  8. +58 −49 ebwt_search.cpp
  9. +2 −2 ebwt_search_backtrack.h
  10. +5 −5 filebuf.h
  11. +13 −13 hit.h
  12. +21 −6 map_tool.cpp
  13. +5 −5 maq_convert/bfa.cpp
  14. +20 −11 maq_convert/bowtie_convert.cpp
  15. +3 −3 maq_convert/maqmap.h
  16. +4 −4 maq_convert/read_bfq.h
  17. +4 −4 pat.cpp
  18. +17 −20 pat.h
  19. +2 −2 pool.h
  20. +5 −5 qual.h
  21. +1 −1 range_cache.h
  22. +1 −1 range_source.h
  23. +1 −1 ref_aligner.h
  24. +1 −1 ref_read.cpp
  25. +4 −4 ref_read.h
  26. +9 −9 reference.h
  27. +2 −5 refmap.cpp
  28. +5 −0 sam.cpp
  29. +1 −1 search_1mm_phase1.c
  30. +2 −2 search_23mm_phase1.c
  31. +4 −2 sequence_io.h
  32. +6 −6 shmem.h
View
@@ -17,7 +17,7 @@ void AnnotationMap::parse() {
ifstream in(fname_);
if(!in.good() && in.is_open()) {
cerr << "Could not open annotation file " << fname_ << endl;
- throw std::runtime_error("");
+ throw 1;
}
while(in.peek() != EOF) {
U32Pair pos;
View
@@ -34,7 +34,7 @@ bitsetRealloc(uint32_t& sz, uint32_t* words, const char *errmsg = NULL) {
// Output given error message
std::cerr << errmsg;
}
- throw std::runtime_error("");
+ throw 1;
}
if(oldsz > 0) {
// Move old values into new array
@@ -65,7 +65,7 @@ class SyncBitset {
if(_errmsg != NULL) {
std::cerr << _errmsg;
}
- throw std::runtime_error("");
+ throw 1;
}
assert(_words != NULL);
memset(_words, 0, nwords * 4 /* words to bytes */);
@@ -174,7 +174,7 @@ class Bitset {
if(_errmsg != NULL) {
std::cerr << _errmsg;
}
- throw std::runtime_error("");
+ throw 1;
}
assert(_words != NULL);
memset(_words, 0, nwords * 4);
View
@@ -233,7 +233,7 @@ class SillyBlockwiseDnaSA : public InorderBlockwiseSA<TStr> {
cerr << "Out of memory creating suffix array in "
<< "SillyBlockwiseDnaSA::SillyBlockwiseDnaSA()"
<< " at " << __FILE__ << ":" << __LINE__ << endl;
- std::runtime_error("");
+ throw 1;
}
}
assert_eq(length(this->text())+1, length(_sa));
@@ -482,7 +482,7 @@ void KarkkainenBlockwiseSA<TStr>::buildSamples() {
cerr << "Could not allocate sample suffix container of " << (numSamples * 4) << " bytes." << endl
<< "Please try using a smaller number of blocks by specifying a larger --bmax or" << endl
<< "a smaller --bmaxdivn" << endl;
- std::runtime_error("");
+ throw 1;
}
}
}
@@ -531,7 +531,7 @@ void KarkkainenBlockwiseSA<TStr>::buildSamples() {
cerr << "Could not allocate sizes, representatives (" << ((numBuckets*8)>>10) << " KB) for blocks." << endl
<< "Please try using a smaller number of blocks by specifying a larger --bmax or a" << endl
<< "smaller --bmaxdivn." << endl;
- std::runtime_error("");
+ throw 1;
}
}
// Iterate through every suffix in the text, determine which
@@ -844,7 +844,7 @@ void KarkkainenBlockwiseSA<TStr>::nextBlock() {
cerr << "Could not allocate a master suffix-array block of " << ((len+1) * 4) << " bytes" << endl
<< "Please try using a larger number of blocks by specifying a smaller --bmax or" << endl
<< "a larger --bmaxdivn" << endl;
- std::runtime_error("");
+ throw 1;
}
}
} else {
@@ -860,7 +860,7 @@ void KarkkainenBlockwiseSA<TStr>::nextBlock() {
cerr << "Could not allocate a suffix-array block of " << ((this->bucketSz()+1) * 4) << " bytes" << endl;
cerr << "Please try using a larger number of blocks by specifying a smaller --bmax or" << endl
<< "a larger --bmaxdivn" << endl;
- std::runtime_error("");
+ throw 1;
}
}
// Select upper and lower bounds from _sampleSuffs[] and
@@ -899,7 +899,7 @@ void KarkkainenBlockwiseSA<TStr>::nextBlock() {
cerr << "Could not allocate a z-array of " << (_dcV * 4) << " bytes" << endl;
cerr << "Please try using a larger number of blocks by specifying a smaller --bmax or" << endl
<< "a larger --bmaxdivn" << endl;
- std::runtime_error("");
+ throw 1;
}
}
@@ -942,7 +942,7 @@ void KarkkainenBlockwiseSA<TStr>::nextBlock() {
cerr << "Could not append element to block of " << ((length(bucket)) * 4) << " bytes" << endl;
cerr << "Please try using a larger number of blocks by specifying a smaller --bmax or" << endl
<< "a larger --bmaxdivn" << endl;
- std::runtime_error("");
+ throw 1;
}
}
// Not necessarily true; we allow overflowing buckets
View
@@ -16,13 +16,17 @@ static int verbose = 0; // be talkative
static int names_only = 0; // just print the sequence names in the index
static int across = 60; // number of characters across in FASTA output
-static const char *short_options = "vh?na:";
+static const char *short_options = "vhna:";
-static const int ARG_VERSION = 256;
+enum {
+ ARG_VERSION = 256,
+ ARG_USAGE
+};
static struct option long_options[] = {
{(char*)"verbose", no_argument, 0, 'v'},
{(char*)"version", no_argument, 0, ARG_VERSION},
+ {(char*)"usage", no_argument, 0, ARG_USAGE},
{(char*)"names", no_argument, 0, 'n'},
{(char*)"help", no_argument, 0, 'h'},
{(char*)"across", required_argument, 0, 'a'},
@@ -41,6 +45,7 @@ static void printUsage(ostream& out) {
<< " -n/--names Print reference sequence names only" << endl
<< " -v/--verbose Verbose output (for debugging)" << endl
<< " -h/--help print detailed description of tool and its options" << endl
+ << " --help print this usage message" << endl
;
}
@@ -108,43 +113,46 @@ static int parseInt(int lower, const char *errmsg) {
if (l < lower) {
cerr << errmsg << endl;
printUsage(cerr);
- throw std::runtime_error("");
+ throw 1;
}
return (int32_t)l;
}
cerr << errmsg << endl;
printUsage(cerr);
- throw std::runtime_error("");
+ throw 1;
return -1;
}
/**
* Read command-line arguments
*/
static void parseOptions(int argc, char **argv) {
- int option_index = 0;
+ int option_index = 0;
int next_option;
do {
next_option = getopt_long(argc, argv, short_options, long_options, &option_index);
switch (next_option) {
- case 'h':
- case '?': {
- printLongUsage(cout);
- throw std::runtime_error("");
- break;
- }
- case 'v': verbose = true; break;
- case ARG_VERSION: showVersion = true; break;
+ case ARG_USAGE: {
+ printUsage(cout);
+ throw 0;
+ break;
+ }
+ case 'h': {
+ printLongUsage(cout);
+ throw 0;
+ break;
+ }
+ case 'v': verbose = true; break;
+ case ARG_VERSION: showVersion = true; break;
case 'n': names_only = true; break;
case 'a': across = parseInt(-1, "-a/--across arg must be at least 1"); break;
case -1: break; /* Done with options. */
case 0:
if (long_options[option_index].flag != 0)
break;
default:
- cerr << "Unknown option: " << (char)next_option << endl;
printUsage(cerr);
- throw std::runtime_error("");
+ throw 1;
}
} while(next_option != -1);
}
@@ -322,6 +330,16 @@ int main(int argc, char **argv) {
driver(ebwtFile, query);
return 0;
} catch(std::exception& e) {
+ cerr << "Command: ";
+ for(int i = 0; i < argc; i++) cerr << argv[i] << " ";
+ cerr << endl;
return 1;
+ } catch(int e) {
+ if(e != 0) {
+ cerr << "Command: ";
+ for(int i = 0; i < argc; i++) cerr << argv[i] << " ";
+ cerr << endl;
+ }
+ return e;
}
}
View
@@ -59,7 +59,7 @@ string adjustEbwtBase(const string& cmdline,
}
if(!in.is_open()) {
cerr << "Could not locate a Bowtie index corresponding to basename \"" << ebwtFileBase << "\"" << endl;
- throw std::runtime_error("");
+ throw 1;
}
return str;
}
Oops, something went wrong.

0 comments on commit ed67f28

Please sign in to comment.