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

The ODGI graph does not pass the handle graph tests ported over from VG #19

Open
jeizenga opened this issue Aug 24, 2019 · 9 comments
Open

Comments

@jeizenga
Copy link
Contributor

jeizenga commented Aug 24, 2019

I haven't looked into this deeply yet, but we should figure out whether this is the fault of the tests or the implementation, or perhaps a disagreement over the generality of our formalism.

Currently, I've commented out ODGI in these tests so that they would still run for the other graphs.

@ekg
Copy link
Member

ekg commented Aug 24, 2019 via email

@jeizenga
Copy link
Contributor Author

Okay, I think I at least have a clue what's happening. It relates to this line in the orginal node.cpp:
https://github.com/vgteam/odgi/blob/master/src/node.cpp#L36

I think I wrote to you about this on slack a while back. The issue is that the assert statement was never actually executing because of this line in the CMakeLists, which removes all asserts
https://github.com/vgteam/odgi/blob/master/CMakeLists.txt#L235

I had to edit the line to have edge_count() instead of edge_count in order to compile. However, this assert statement has probably never actually run in the tests in the odgi repository because of that cmake flag. According to the slack messages I left you, you should be able to reproduce this from the vg view GFA from tiny.vg.

@ekg
Copy link
Member

ekg commented Aug 26, 2019 via email

@jeizenga
Copy link
Contributor Author

Another update: if I comment out that assert everything passes. Is that assert statement correct?

@ekg
Copy link
Member

ekg commented Aug 26, 2019 via email

@jeizenga
Copy link
Contributor Author

Oh yeah, sorry I posted without refreshing the page. I've started activating more tests and found some differences in how we've implemented circular paths that are causing ODGI to fail some more of the tests I wrote.

The tests are written with the assumption that circular paths "loop around" when calling get_next/previous_step or has_next/previous_step. I've tried modifying your implementation to have this behavior, but it seems that has_next/previous_step are used pretty substantially in internal routines. Other things seem to break, but I'm not totally sure why yet.

@jeizenga
Copy link
Contributor Author

jeizenga commented Aug 27, 2019

@ekg I think I might need your help resolving this. I tried to add the "looping around" behavior for circular paths like this:

bool ODGI::has_next_step(const step_handle_t& step_handle) const {
    const node_t& node = node_v.at(number_bool_packing::unpack_number(get_handle_of_step(step_handle)));
    return (node.get_path_step(as_integers(step_handle)[1]).next_id() != path_end_marker ||
            get_is_circular(as_path_handle(node.get_path_step(as_integers(step_handle)[1]).path_id())));
}

It looks right to me, but it seems to completely blow up the destroy_step method, which uses has_next and has_previous. However, strangely the problem seems to occur on a non-circular path, where I would expect to function the same as previously. Perhaps the graph entered an invalid state before this?

@ekg
Copy link
Member

ekg commented Aug 27, 2019 via email

@jeizenga
Copy link
Contributor Author

Probably the easiest way is with the easy install repo: https://github.com/vgteam/libbdsg-easy
Clone it, checkout b942cc96c8 in the libbdsg submodule, and then use the make in the root directory. It should automatically execute the tests.

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