Open anshumanmohan opened 1 year ago
Interesting! Can I ask some follow-up questions to ensure that I'm understanding what's interesting about these examples?
odgi flip
's contract may say, "if you give me a valid GFA, I will do X," but if that premise is falsified, then all bets are off and it can do anything it likes. From that perspective, commands' behavior on invalid graphs may not matter much?odgi flip
adds links to cover any steps in flipped paths that were not previously covered by old links?Thanks for this, Adrian!
tl;dr: I think leaving it as-is would be fine, I just worry about downstream reliances on this "fixing" behavior.
odgi
command makevalid
that backfills any missing links.odgi flip
adds links to cover any steps in all paths that were not previously covered by old links. In this illustration, this happens to mean that it just needed to add links to cover steps in those paths that it just flipped. That is why it collapses into your summary just above, and why I call it the good case.
I think
flip
is adding new links too eagerly.Minimal
Here's a minimal example:
Clearly the path does not require a flip. More subtly, though, the graph is not well-formed: it will fail
validate
. Runningflip
and thenview
has an interesting effect:Now this graph is valid! Interesting, but IMO not
flip
's job!Why this exists
I'll create a valid graph that is in need of a flip:
And now
flip
and thenview
shows a reasonable output: a path was flipped, and two links were added in support of the new path.Fix
The paths that have just been generated need to be siloed off, and only links that are needed by those paths should be added.
Something else is also going on
I do still think that
flip
is doing something else that's a bit fishy. See note5.gfa from your test suite. I don't think that fixing the above would fixflip
's behavior when run against note5. See my comment here: https://github.com/pangenome/odgi/pull/485#issuecomment-1496693803