Skip to content

Commit 041de2b

Browse files
linting
1 parent 4153529 commit 041de2b

File tree

6 files changed

+31
-21
lines changed

6 files changed

+31
-21
lines changed

src/bound_pop.cpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
*
44
* Authors: Timothy Daley and Andrew Smith
55
*
6-
* This program is free software: you can redistribute it and/or
7-
* modify it under the terms of the GNU General Public License as
8-
* published by the Free Software Foundation, either version 3 of the
9-
* License, or (at your option) any later version.
6+
* This program is free software: you can redistribute it and/or modify it
7+
* under the terms of the GNU General Public License as published by the Free
8+
* Software Foundation, either version 3 of the License, or (at your option)
9+
* any later version.
1010
*
11-
* This program is distributed in the hope that it will be useful, but
12-
* WITHOUT ANY WARRANTY; without even the implied warranty of
13-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14-
* General Public License for more details.
11+
* This program is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14+
* more details.
1515
*
16-
* You should have received a copy of the GNU General Public License
17-
* along with this program. If not, see
18-
* <http://www.gnu.org/licenses/>.
16+
* You should have received a copy of the GNU General Public License along
17+
* with this program. If not, see <http://www.gnu.org/licenses/>.
1918
*/
2019

2120
#include "bound_pop.hpp"
@@ -34,6 +33,7 @@
3433
#include <cstdlib>
3534
#include <exception>
3635
#include <fstream>
36+
#include <functional>
3737
#include <iostream>
3838
#include <iterator>
3939
#include <memory> // IWYU pragma: keep
@@ -73,7 +73,9 @@ bound_pop::main(int argc, char *argv[]) -> int { // NOLINT (*-avoid-c-arrays)
7373
std::uint32_t seed = 408;
7474
// NOLINTEND(*-avoid-magic-numbers)
7575

76+
#ifdef HAVE_HTSLIB
7677
std::uint32_t n_threads{1};
78+
#endif
7779

7880
CLI::App app{rlstrip(about_msg)};
7981
argv = app.ensure_utf8(argv);
@@ -95,8 +97,7 @@ bound_pop::main(int argc, char *argv[]) -> int { // NOLINT (*-avoid-c-arrays)
9597
app.add_option("-c,--ci-level", c_level, "level for confidence intervals");
9698
app.add_option("-r,--seed", seed, "seed for random number generator");
9799
app.add_flag("-p,--paired-end", paired_end, "input is paired end read file");
98-
app.add_flag("-Q,--quick", quick_mode,
99-
"quick mode, estimate without bootstrapping");
100+
app.add_flag("-q,--quick", quick_mode, "no bootstraps when making estimates");
100101
app.add_flag("-v,--verbose", verbose, "print moments and boostraps with output");
101102
// clang-format on
102103

src/c_curve.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ c_curve::main(int argc, char *argv[]) -> int { // NOLINT(*-avoid-c-arrays)
5151
bool verbose = false;
5252
bool paired_end = false;
5353

54+
#ifdef HAVE_HTSLIB
5455
std::uint32_t n_threads{1};
56+
#endif
57+
5558
CLI::App app{rlstrip(about_msg)};
5659
argv = app.ensure_utf8(argv);
5760
app.usage("\nUsage: preseq c_curve [OPTIONS]");

src/gc_extrap.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,12 @@ gc_extrap::main(int argc, char *argv[]) -> int { // NOLINT(*-avoid-c-arrays)
107107
std::uint32_t n_bootstraps = 100;
108108
std::uint32_t seed = 408;
109109
double c_level = 0.95;
110-
std::uint32_t n_threads{1};
111110
// NOLINTEND(*-avoid-magic-numbers)
112111

112+
#ifdef HAVE_HTSLIB
113+
std::uint32_t n_threads{1};
114+
#endif
115+
113116
bool allow_defects{false};
114117
bool verbose{false};
115118
bool single_estimate{false};
@@ -141,8 +144,7 @@ gc_extrap::main(int argc, char *argv[]) -> int { // NOLINT(*-avoid-c-arrays)
141144
app.add_option("-c,--cval", c_level, "level for confidence intervals");
142145
app.add_option("-x,--terms", orig_max_terms, "maximum number of terms");
143146
app.add_option("-r,--seed", seed, "seed for random number generator");
144-
app.add_flag("-Q,--quick", single_estimate,
145-
"quick mode: run gc_extrap without bootstrapping for confidence intervals");
147+
app.add_flag("-q,--quick", single_estimate, "no bootstraps for confidence intervals");
146148
app.add_flag("-D,--defects", allow_defects,
147149
"defects mode to extrapolate without testing for defects");
148150
app.add_flag("-v,--verbose", verbose, "print more info");

src/lc_extrap.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ lc_extrap::main(int argc, char *argv[]) -> int { // NOLINT(*-avoid-c-arrays)
6666
bool single_estimate{false};
6767
bool allow_defects{false};
6868

69+
#ifdef HAVE_HTSLIB
6970
std::uint32_t n_threads{1};
71+
#endif
72+
7073
CLI::App app{rlstrip(about_msg)};
7174
argv = app.ensure_utf8(argv);
7275
app.formatter(std::make_shared<preseq_formatter>());
@@ -93,8 +96,7 @@ lc_extrap::main(int argc, char *argv[]) -> int { // NOLINT(*-avoid-c-arrays)
9396
app.add_option("-x,--terms", orig_max_terms, "maximum terms in estimator");
9497
app.add_option("-r,--seed", seed, "seed for random number generator");
9598
app.add_flag("-p,--paired-end", paired_end, "input is paired end read file");
96-
app.add_flag("-Q,--quick", single_estimate,
97-
"do not use bootstraps for confidence intervals");
99+
app.add_flag("-q,--quick", single_estimate, "no bootstraps for confidence intervals");
98100
app.add_flag("-D,--defects", allow_defects, "no testing for defects");
99101
app.add_flag("-v,--verbose", verbose, "print more info");
100102
// clang-format on

src/load_data_for_complexity.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ is_sam_or_bam_format(const std::string &filename) -> bool {
8282

8383
[[nodiscard]] auto
8484
get_input_format_type(const std::string &filename) -> input_format_type {
85-
if (is_sam_or_bam_format(filename))
85+
if (is_sam_or_bam_format( // cppcheck-suppress[knownConditionTrueFalse]
86+
filename))
8687
return input_format_type::bam;
8788

8889
std::ifstream in(filename);

src/pop_size.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ pop_size::main(int argc, char *argv[]) -> int { // NOLINT(*-avoid-c-arrays)
6565
bool single_estimate{false};
6666
bool allow_defects{false};
6767

68+
#ifdef HAVE_HTSLIB
6869
std::uint32_t n_threads{1};
70+
#endif
6971

7072
CLI::App app{rlstrip(pop_size::about_msg)};
7173
argv = app.ensure_utf8(argv);
@@ -87,8 +89,7 @@ pop_size::main(int argc, char *argv[]) -> int { // NOLINT(*-avoid-c-arrays)
8789
app.add_option("-x,--terms", orig_max_terms, "maximum terms in estimator");
8890
app.add_option("-r,--seed", seed, "seed for random number generator");
8991
app.add_flag("-p,--paired-end", paired_end, "input is paired end read file");
90-
app.add_flag("-Q,--quick", single_estimate,
91-
"quick mode (no bootstraps) for confidence intervals");
92+
app.add_flag("-q,--quick", single_estimate, "no bootstraps for confidence intervals");
9293
app.add_flag("-D,--defects", allow_defects, "no testing for defects");
9394
app.add_flag("-v,--verbose", verbose, "print more info");
9495
// clang-format on

0 commit comments

Comments
 (0)