Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It is not clear if node_at_vector_offset/node_vector_offset are supposed to be 0-based, 1-based, or a mix. #41

Open
adamnovak opened this issue Jan 7, 2020 · 2 comments

Comments

@adamnovak
Copy link
Member

The vg Sampler samples from the sequence using a 1-based offset:

https://github.com/vgteam/vg/blob/e558c3cc27984415ba3de7c3d941827c39f17376/src/sampler.cpp#L59-L62

However, this isn't documented in the VectorizableHandleGraph interface, so it is likely that implementers will produce and expect 0-based offsets.

It looks like the VectorizableOverlay from libbdsg produces 0-based offsets, but expects 1-based offsets, which is just wild:

https://github.com/vgteam/libbdsg/blob/e073c2aee77e73ec41310bf3191af322fe8faa7e/src/vectorizable_overlays.cpp#L88-L96

We should choose all 0-based or all 1-based (probably all 0-based), document it, and change all the clients and implementations.

@adamnovak
Copy link
Member Author

adamnovak commented Jan 7, 2020

Similarly, our vg Packer code expects edge_index to never return 0 for an edge that exists but this isn't guaranteed by the interface.

adamnovak added a commit to vgteam/xg that referenced this issue Jan 7, 2020
@glennhickey
Copy link
Contributor

glennhickey commented Jan 7, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants