vgteam / libhandlegraph

Library for the Handle Graph abstraction
MIT License
20 stars 3 forks source link

for_each_step_on_handle will give you step_handle_t values for which get_handle_of_step will return the reverse of the handle_t you started with #37

Open adamnovak opened 4 years ago

adamnovak commented 4 years ago

As far as I can tell, step_handle_t doesn't track an orientation. There's no flip for it; it always is in the orientation of the path it is part of.

But then when you loop through the steps on a handle, you'll get all the steps that visit the handle's node in both direction, but each step you get will be in the path's forward orientation. So if you want to do something like see what paths leave a handle to the left, you need to do a bunch of orientation tracking and call get_next_step or get_previous_step depending on how the path went through the handle you started with.

And if the path went through your starting handle backward, get_handle_of_step will return the reverse of the handle you started with.

None of these caveats seem to be documented in the PathHandleGraph interface. At the very least we should point them out.

I kind of want to give orientations to step handles, so that you can have a handle to the reverse orientation of a path where next is previous and visa versa, and a way to get and flip that orientation flag. That would make navigating along paths much harder to mess up when you find them from handles, but it would also ask more of our implementations.