Skip to content

Commit

Permalink
Hackily add 1 to edge indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
adamnovak committed Jan 7, 2020
1 parent 660708b commit ae67271
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/xg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1582,8 +1582,11 @@ size_t XG::edge_index(const edge_t& edge) const {
throw std::runtime_error("Cound not find index of edge connecting " +
std::to_string(get_id(edge.first)) + " and " + std::to_string(get_id(edge.second)));
} else {
// We found it and we have the correct index
return idx;
// We found it and we have the correct index.
// TODO: it is 0-based, and vg pack demands 1-based indexes. So we will
// add 1. See
// https://github.com/vgteam/libhandlegraph/issues/41#issuecomment-571386849
return idx + 1;
}
}

Expand Down

0 comments on commit ae67271

Please sign in to comment.