Skip to content

Commit

Permalink
Merge pull request #3215 from vgteam/handle-stuff
Browse files Browse the repository at this point in the history
Error out before writing invalid rGFA tags
  • Loading branch information
glennhickey authored Mar 1, 2021
2 parents 292717e + 719aa5d commit 08faee0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/gfa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <gfakluge.hpp>
#include "utility.hpp"
#include "path.hpp"
#include <sstream>

namespace vg {

Expand Down Expand Up @@ -30,6 +31,12 @@ void graph_to_gfa(const PathHandleGraph* graph, ostream& out, const set<string>&
graph->for_each_step_in_path(path_handle, [&](step_handle_t step_handle) {
handle_t handle = graph->get_handle_of_step(step_handle);
nid_t node_id = graph->get_id(handle);
if (graph->get_is_reverse(handle)) {
stringstream ss;
ss << "error [gfa]: unable to write rGFA tags for path " << path_name << " because node "
<< node_id << " is traversed on its reverse strand. rGFA only supports the forward strand." << endl;
throw runtime_error(ss.str());
}
if (node_offsets.count(node_id)) {
cerr << "warning [gfa]: multiple selected rgfa paths found on node " << node_id << ": keeping tags for "
<< graph->get_path_name(node_offsets[node_id].first) << " and ignoring those for " << path_name << endl;
Expand Down

2 comments on commit 08faee0

@adamnovak
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vg CI tests complete for merge to master. View the full report here.

16 tests passed, 0 tests failed and 0 tests skipped in 12414 seconds

@adamnovak
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vg CI tests complete for branch v1.31.0. View the full report here.

16 tests passed, 0 tests failed and 0 tests skipped in 12610 seconds

Please sign in to comment.