edawson / gfakluge

A C++ library and utilities for manipulating the Graphical Fragment Assembly format.
http://edawson.github.io/gfakluge/
MIT License
51 stars 20 forks source link

path_elem orientations are backward in GFA 0.1 #34

Closed adamnovak closed 6 years ago

adamnovak commented 6 years ago

It looks like path entry orientations are true for forward, and false for backward:

https://github.com/edawson/gfakluge/blob/1a78943536f36e0d08b4d2944ee4f0066fe610a8/src/gfakluge.hpp#L102

But when loading GFA files like this:

H   VN:Z:0.1
S   1   CAAATAAG
S   2   A
S   3   G
P   1   x   1   +   8M
P   3   x   2   +   1M
L   1   +   2   +   0M
L   1   +   3   +   0M

I get path_elem objects that look like this:

P   x   1-,3-   8M,1M

In other words, the orientations flags are backward when reading GFA 0.1 paths.

adamnovak commented 6 years ago

@edawson Could you have a look at this, please? I'm wanting to use this fix in a PR to vg, and to use it it has to be merged in here.

edawson commented 6 years ago

This looks good. It has always been confusing that the walk_elem that Erik drew up used true for is_reversed and the path_elem of GFA1+ used essentially the opposite. I think you fix is fine - I'm merging.