Skip to content

Commit 2382b71

Browse files
src/analysis/nanopore.cpp: truncated size 256 lookup array to 96 for ACGT and change c array to std::array
1 parent d7a8421 commit 2382b71

1 file changed

Lines changed: 4 additions & 16 deletions

File tree

src/analysis/nanopore.cpp

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,13 @@
5454
// NOLINTBEGIN(*-narrowing-conversions)
5555

5656
// clang-format off
57-
static constexpr std::array<std::uint8_t, 256> encoding = {
57+
static constexpr std::array<std::uint8_t, 96> encoding = {
5858
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 16
5959
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 32
6060
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 48
6161
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 64
6262
4, 0, 4, 1, 4, 4, 4, 2, 4, 4, 4, 4, 4, 4, 4, 4, // 80
6363
4, 4, 4, 4, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 96
64-
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 112
65-
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 128
66-
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 144
67-
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 160
68-
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 176
69-
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 192
70-
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 208
71-
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 224
72-
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 240
73-
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 // 256
7464
};
7565
// clang-format on
7666

@@ -150,8 +140,8 @@ get_basecall_model(const bamxx::bam_header &hdr) {
150140
return {};
151141
}
152142

153-
// ADS: here the std::uint16_t allows for up to 256 reads, each contributing up
154-
// to 256 "counts" in the probability encoding.
143+
// ADS: here the std::uint16_t allows for up to 256 reads, each contributing
144+
// up to 256 "counts" in the probability encoding.
155145
typedef std::uint16_t count_type;
156146

157147
[[nodiscard]] static inline bool
@@ -268,15 +258,13 @@ enum class missing_code : std::uint8_t {
268258
unknown = 1,
269259
};
270260

271-
// NOLINTBEGIN(*-avoid-c-arrays)
272-
static const char *const tag_values[] = {
261+
static constexpr auto tag_values = std::array<const char *, 5>{
273262
"CpG", // 0
274263
"CHH", // 1
275264
"CXG", // 2
276265
"CCG", // 3
277266
"N", // 4
278267
};
279-
// NOLINTEND(*-avoid-c-arrays)
280268

281269
struct mod_prob_buffer {
282270
static constexpr auto init_capacity{128 * 1024};

0 commit comments

Comments
 (0)