lh3 / minigraph

Sequence-to-graph mapper and graph generator
https://lh3.github.io/minigraph
MIT License
417 stars 38 forks source link

segmentation fault #1

Open samlipworth opened 5 years ago

samlipworth commented 5 years ago

Hi,

When mapping sequences (from nanopore reads) to a graph (~ 5.2M) I get no output an segmentation fault. Works OK when I run the test - is there a limit on the size of graph/do I need to re-compile with different settings?

lh3 commented 5 years ago

Minigraph works for human graph. Nonetheless, it has only been evaluated on graphs it generated. I guess you are using an assembly graph. Probably I have overlooked aspects special to such graphs.

Could you run:

make clean && make asan=1 # this requires a relatively recent gcc
./minigraph -t1 --no-kalloc --dbg-qname graph.gfa reads.fa > /dev/null 2> run.log

You then send me the log file first? Thanks!

lh3 commented 5 years ago

Forgot to ask: does you graph contain overlaps between segments? Minigraph doesn’t work with such graphs.

lh3 commented 5 years ago

Thank you for the log file. Really helpful. Your assembly graph contains overlapping segments. Minigraph doesn't work with such graphs for the moment. I have just added a change and asked minigraph to throw an error in this case. Segfault is always bad.

I will leave this issue open. I plan to support graphs with overlapping segments, but it won't happen soon.

samlipworth commented 5 years ago

OK great thanks for looking into it

ekg commented 4 years ago

You can reduce the GFA assembly graph with overlaps to a GFA without overlaps using gimbricate and seqwish:

gimbricate -g h.gfa -n -p h.paf -f h.fasta >h.gimbry.gfa
seqwish -s h.fasta -p h.paf -g h.seqwish.gfa

See https://github.com/ekg/gimbricate

I don't know if the output will work with minigraph, but in principle it should work as long as variation resulting from the reduction (mismatches and indels in overlaps) isn't too dense.

It should be fine with GraphAligner and vg.