Skip to content

Commit eaea59b

Browse files
Ensuring the VERSION is available for the PG lines in the SAM output. This is coming from the config.h file in the repo root, and might cause inconveniences for compiling and testing the tools without building the entire package
1 parent 7d094c2 commit eaea59b

2 files changed

Lines changed: 5 additions & 14 deletions

File tree

src/utils/duplicate-remover.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* on identical mapping location and possibly also using the read
44
* sequence if requested.
55
*
6-
* Copyright (C) 2013-2021 University of Southern California and
6+
* Copyright (C) 2013-2023 University of Southern California and
77
* Andrew D. Smith
88
*
99
* Authors: Andrew D. Smith, Ben Decato, Song Qiang, Guilherme Sena
@@ -26,6 +26,8 @@
2626
#include <unordered_set>
2727
#include <stdexcept>
2828

29+
#include <config.h>
30+
2931
#include "OptionParser.hpp"
3032
#include "smithlab_utils.hpp"
3133
#include "smithlab_os.hpp"
@@ -374,11 +376,8 @@ main_duplicate_remover(int argc, const char **argv) {
374376
if (!out)
375377
throw runtime_error("failed to open output file: " + outfile);
376378

377-
// GS TODO: the empty argument below is the program version, it
378-
// should be an extern string to the dnmtools version when we
379-
// set prefix command calls
380379
std::ostringstream oss;
381-
write_pg_line(argc, argv, "DUPLICATE_REMOVER", "", oss);
380+
write_pg_line(argc, argv, "DUPLICATE_REMOVER", VERSION, oss);
382381
const string pg_line = oss.str();
383382

384383
duplicate_remover(VERBOSE, USE_SEQUENCE, ALL_C, DISABLE_SORT_TEST,
@@ -388,9 +387,5 @@ main_duplicate_remover(int argc, const char **argv) {
388387
cerr << e.what() << endl;
389388
return EXIT_FAILURE;
390389
}
391-
catch (std::bad_alloc &ba) {
392-
cerr << "ERROR: could not allocate memory" << endl;
393-
return EXIT_FAILURE;
394-
}
395390
return EXIT_SUCCESS;
396391
}

src/utils/format-reads.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include <cmath>
3737
#include <sstream>
3838

39-
#include "config.h"
39+
#include <config.h>
4040

4141
#include "OptionParser.hpp"
4242
#include "smithlab_utils.hpp"
@@ -442,9 +442,5 @@ main_format_reads(int argc, const char **argv) {
442442
cerr << e.what() << endl;
443443
return EXIT_FAILURE;
444444
}
445-
catch (std::bad_alloc &ba) {
446-
cerr << "ERROR: could not allocate memory" << endl;
447-
return EXIT_FAILURE;
448-
}
449445
return EXIT_SUCCESS;
450446
}

0 commit comments

Comments
 (0)