pangenome / odgi

Optimized Dynamic Genome/Graph Implementation: understanding pangenome graphs
https://doi.org/10.1093/bioinformatics/btac308
MIT License
196 stars 40 forks source link

`odgi flip`: avoid introducing useless edges and losing edges from the original graph #485

Closed AndreaGuarracino closed 1 year ago

AndreaGuarracino commented 1 year ago

This PR introduces a different way to construct the flipped graph:

In the first tests, this avoids introducing edges that are not used in the flipped paths and avoids losing edges that are present in the input graph.

anshumanmohan commented 1 year ago

Thanks for this, @AndreaGuarracino! I can recreate the fact that it now (correctly) does nothing for the graph LPA.gfa. However, it now does the same fishy thing for note5.gfa.

When I run flip on note5, the only meaningful change is that L 3 - 4 + 0M becomes L 4 - 3 + 0M. The paths, segments, and other links remain the same.

If I understand flip correctly, the correct behavior for this graph is to do nothing.