File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 *
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 {
You can’t perform that action at this time.
0 commit comments