Skip to content

Commit

Permalink
check number of paths too
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaGuarracino committed Mar 18, 2024
1 parent ea36234 commit 24c454f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ int main(int argc, char **argv) {

uint64_t block_count;

uint64_t number_of_paths_in_the_original_graph;
{
auto graph = std::make_unique<XG>();

Expand Down Expand Up @@ -441,6 +442,8 @@ int main(int argc, char **argv) {
}
}

number_of_paths_in_the_original_graph = graph->get_path_count();

auto *blockset = new smoothxg::blockset_t();
smoothxg::smoothable_blocks(*graph,
*blockset,
Expand Down Expand Up @@ -792,6 +795,13 @@ int main(int argc, char **argv) {
validate_progress.finish();
}

if (number_of_paths_in_the_original_graph != smoothed->get_path_count()) {
std::cerr << smoothxg_iter << "] error! path count mismatch between input ("
<< number_of_paths_in_the_original_graph << ") and smoothed graph ("
<< smoothed->get_path_count() << ")" << std::endl;
exit(1);
}

if (!consensus_mapping.empty()) {
std::cerr << smoothxg_iter << "::smooth_and_lace] sorting consensus" << std::endl;

Expand Down

0 comments on commit 24c454f

Please sign in to comment.