Skip to content

Commit ec041ae

Browse files
guessprotocol: adding an include for std::array; left out as some compilers seem to have it through another header
1 parent 26319e2 commit ec041ae

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/utils/guessprotocol.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* guessprotocol: a program for guessing whether a wgbs protocol is
2-
* original, pbat or random pbat
2+
* wgbs, pbat or random pbat
33
*
4-
* Copyright (C) 2019-2023
4+
* Copyright (C) 2019-2023 Andrew D. Smith
55
*
66
* Authors: Andrew D. Smith
77
*
@@ -27,6 +27,7 @@
2727
#include <stdexcept>
2828
#include <string>
2929
#include <vector>
30+
#include <array>
3031

3132
#include "OptionParser.hpp"
3233
#include "numerical_utils.hpp"
@@ -83,9 +84,11 @@ struct nucleotide_model {
8384
}
8485

8586
double operator()(const string &s) const {
86-
return accumulate(
87-
cbegin(s), cend(s), 0.0,
88-
[&](const double x, const char c) { return x + lpr[nuc_to_idx[c]]; });
87+
return accumulate(cbegin(s), cend(s), 0.0,
88+
[&](const double x, const char c) {
89+
const auto i = nuc_to_idx[c];
90+
return i == 4 ? x : x + lpr[i];
91+
});
8992
};
9093

9194
string tostring() const {

0 commit comments

Comments
 (0)