vgteam / libhandlegraph

Library for the Handle Graph abstraction
MIT License
21 stars 5 forks source link

rewrite_segment really takes a first and past-last to designate the range to rewrite #38

Open adamnovak opened 4 years ago

adamnovak commented 4 years ago

It looks like #12 and #13 said that rewrite_segment should remove the handle passed as end, and the doc comment seems to suggest so as well. However, in practice, at least for HashGraph and (I think) vg::VG, the end is treated as a past-end. Here's HashGraph not removing the end step:

https://github.com/vgteam/libbdsg/blob/7b913da50dc70bf2b4b301e1226a6586e27892bc/src/hash_graph.cpp#L524-L542

In order to allow for pure insertion operations, the end has to be treated as a past-end, so maybe that's why it is being done this way.

We should make sure all the implementations use a past-end, and update the documentation. Alternately, if what's documented right now is what we really want, I think we need to modify at least HashGraph and vg::VG, and maybe other implementations.