Skip to content

Commit 0da7c89

Browse files
src/analysis/nanopore.cpp: allowing for no modifications within a read when checking if modifications are valid
1 parent 6f11fa1 commit 0da7c89

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/analysis/nanopore.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -942,14 +942,16 @@ valid_modification_types(const std::string &infile,
942942
// ADS: or bam_parse_basemod2(aln.b, m, HTS_MOD_REPORT_UNCHECKED)
943943
int n_types{};
944944
const auto types = bam_mods_recorded(m.get(), &n_types);
945-
valid_types = (n_types == 1 && types[0] == 'C') ||
946-
(n_types >= 2 && types[0] == 'h' && types[1] == 'm');
945+
// clang-format off
946+
valid_types = ((n_types == 0) ||
947+
(n_types == 1 && types[0] == 'C') ||
948+
(n_types >= 2 && types[0] == 'h' && types[1] == 'm'));
949+
// clang-format on
947950
if (!valid_types) {
948951
message = "n_types: " + std::to_string(n_types) + "\n";
949-
for (auto i = 0; i < n_types; ++i) {
952+
for (auto i = 0; i < n_types; ++i)
950953
message += "type[" + std::to_string(i) +
951954
"]=" + std::to_string(static_cast<char>(types[i])) + "\n";
952-
}
953955
}
954956
}
955957
return std::make_pair(valid_types, message);

0 commit comments

Comments
 (0)