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

Unexpected behaviour: the reverse of a link can be added to the graph #35

Open
vepain opened this issue Jan 8, 2025 · 0 comments
Open

Comments

@vepain
Copy link

vepain commented Jan 8, 2025

As it is not possible to add twice the same link line in the graph, one should expect to not be able to add the reversed link to the graph.

import gfapy

graph = gfapy.Gfa.from_file("graph.gfa")

for seg in graph.segments:
    for r_link_line in seg.dovetails_R:
        print(r_link_line)
        rev_r_link_line = f"L\t{r_link_line.to_segment.name}\t{gfapy.invert(r_link_line.to_orient)}\t{r_link_line.from_segment.name}\t{gfapy.invert(r_link_line.from_orient)}\t{r_link_line.overlap}"
        print(rev_r_link_line)
        graph.add_line(rev_r_link_line)  # should raise gfapy.RuntimeError exception
        # graph.add_line(r_link_line)   # this raises gfapy.RuntimeError exception
        print()

I suspect the same unexpected behaviour for edges in gfav2

@vepain vepain changed the title Unexpected behaviour: the reverse of link can be added to the graph Unexpected behaviour: the reverse of a link can be added to the graph Jan 8, 2025
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

1 participant