ekg / seqwish

alignment to variation graph inducer
MIT License
143 stars 18 forks source link

Assertion `seen_bp == accumulated_bp' failed. #24

Closed ChriKub closed 4 years ago

ChriKub commented 5 years ago

Hi, I'm building a graph from two small, very similar sequences. The sequences were manually constructed to contain some repeats and a few SNPs. The Sequences share an identical sequence stretch in the beginning and should share an identical sequence in the back. Without the identical end piece in both sequences (present in just one) seqwish finishes without error. If it is present in both sequences seqwish fails.

seqwish: seqwish/src/gfa.cpp:125: void seqwish::emit_gfa(std::ostream&, size_t, const string&, mmmulti::map<long unsigned int, long unsigned int>&, mmmulti::map<long unsigned int, long unsigned int>&, mmmulti::map<long unsigned int, long unsigned int>&, const sdsl::sd_vector<>&, const rank_1_type&, const select_1_type&, seqwish::seqindex_t&): Assertion `seen_bp == accumulated_bp' failed.
Aborted

These are the commands I run:

minimap2 SeqsSeqwish.fasta SeqsSeqwish.fasta -c -X > SeqsSeqwish.paf
seqwish -s SeqsSeqwish.fasta -p SeqsSeqwish.paf -b SeqsSeqwish.graph -g SeqsSeqwish.gfa

The two example fasta files can be downloaded here: SeqWish.tar.gz SeqsSeqwish.fasta throws the error, the other file does not.

Thanks, Chris

ekg commented 5 years ago

Thanks for the test case! I'll see what's causing it.

ekg commented 5 years ago

I'm not able to reproduce this as of the current master 3e94aa828990b4c6c2a5d13f32e2b1d354cd40c5.

Here's what I did:

minimap2 SeqsSeqwish.fasta SeqsSeqwish.fasta -c -X > SeqsSeqwish.paf
seqwish -s SeqsSeqwish.fasta -p SeqsSeqwish.paf -b SeqsSeqwish.graph -g SeqsSeqwish.gfa
odgi build -g SeqsSeqwish.gfa -s -o - | odgi viz -i - -o SeqsSeqwish.png -y 200 -x 1000

image

Here's the one without the end:

minimap2 SeqsSeqwishwoEnd.fasta SeqsSeqwishwoEnd.fasta -c -X > SeqsSeqwishwoEnd.paf
seqwish -s SeqsSeqwishwoEnd.fasta -p SeqsSeqwishwoEnd.paf -b SeqsSeqwishwoEnd.work -g SeqsSeqwishwoEnd.gfa
odgi build -g SeqsSeqwishwoEnd.gfa -s -o - | odgi viz -i - -o SeqsSeqwishwoEnd.png -y 200 -x 1000

image

So it's apparently working for me. Any idea what might be causing the error for you?

ChriKub commented 4 years ago

Apparently I used a slightly out of date version. Updating seqwish fixed the problem.