Skip to content

Commit

Permalink
Merge pull request #569 from pangenome/non-ref-nodes-Ns
Browse files Browse the repository at this point in the history
add uncalled bases to non-ref-nodes
  • Loading branch information
AndreaGuarracino authored Mar 23, 2024
2 parents d02d26d + 4d03cb7 commit 824a168
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/subcommand/paths_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ int main_paths(int argc, char** argv) {
}

// Emit non-reference nodes
std::cout << "#node.id\tnode.len\tpaths" << std::endl;
std::cout << "#node.id\tnode.len\tnum.uncalled.bases\tpaths" << std::endl;
for (auto x : non_reference_nodes) {
const handle_t handle = graph.get_handle(x + shift);

Expand All @@ -433,7 +433,14 @@ int main_paths(int argc, char** argv) {
result += graph.get_path_name(path);
}

std::cout << graph.get_id(handle) << "\t" << graph.get_length(handle) << "\t" << result << std::endl;
uint64_t n_count = 0;
for (auto c : graph.get_sequence(handle)) {
if (c == 'N' || c == 'n') { // Increment n_count if character is 'N' or 'n'
++n_count;
}
}

std::cout << graph.get_id(handle) << "\t" << graph.get_length(handle) << "\t" << n_count << "\t" << result << std::endl;
}
} else {
// Emit non-reference ranges
Expand Down

0 comments on commit 824a168

Please sign in to comment.