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

segmentation fault on branch walks #150

Closed
dirkjanvw opened this issue Feb 17, 2024 · 8 comments · Fixed by #153
Closed

segmentation fault on branch walks #150

dirkjanvw opened this issue Feb 17, 2024 · 8 comments · Fixed by #153

Comments

@dirkjanvw
Copy link

As mentioned in #149 I get a segmentation fault on branch walks, which I don't get on branch dev with my Macbook Pro. Example GFA file I obtained from the Minigraph-Cactus pipeline can be found here: mc-pangenome.gfa.gz. Let me know if there is anything else I can provide to figure out why this happens.

@asl
Copy link
Owner

asl commented Feb 18, 2024

Ok, so the problem is that W line appear before L. As we are doing stream parsing we build graph on-fly. Therefore at the time of W record processing there are no edges between segments / nodes. I will fix, so the proper message / exception will be thrown.

@asl
Copy link
Owner

asl commented Feb 18, 2024

We do not segfault after a6adcc3

However, the producer of this GFA should be fixed. Per GFA spec – "A valid walk must exist in the graph". We treat this quite strict as otherwise we will need essentially to save the copy of entire GFA before processing.

@dirkjanvw
Copy link
Author

Thank you for the quick fix! I now "sorted" the graph by putting all W-lines at the end of the file, I think that should solve the processing issue? However, it doesn't complete parsing. I let BandageNG info mc-pangenome.sorted.gfa run for an hour before I killed the process. Were you able to parse this GFA file in reasonable time?

@asl
Copy link
Owner

asl commented Feb 19, 2024

Can you attach the new file, so I can check?

@dirkjanvw
Copy link
Author

Of course: mc-pangenome.sorted.gfa.gz I had to gzip the file, wheareas I ran BandageNG info with the uncompressed version, assuming this has no effect.

@asl
Copy link
Owner

asl commented Apr 2, 2024

Of course: mc-pangenome.sorted.gfa.gz I had to gzip the file, wheareas I ran BandageNG info with the uncompressed version, assuming this has no effect.

Sorry, somehow I forgot to respond. Looks like it was me reading GFA spec improperly. Need to push the fix

@asl
Copy link
Owner

asl commented Apr 2, 2024

Should be fixed in 24907eb

@dirkjanvw
Copy link
Author

Thanks a lot, it works for me now!

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

Successfully merging a pull request may close this issue.

2 participants