iqbal-lab-org / gramtools

Genome inference from a population reference graph
MIT License
92 stars 15 forks source link

Pointing gramtools at current SDSL results in assertion failure in unit tests #26

Closed iqbal-lab closed 7 years ago

iqbal-lab commented 8 years ago

At commit 53598fceaf97b92b017572d298ff3cacc4f932ac

Unit tests pass pointing at Sorina's SDSL work fine:

./unittest_bidir_search_bwd_fwd [==========] Running 7 tests from 1 test case. [----------] Global test environment set-up. [----------] 7 tests from BackwardSearchTest [ RUN ] BackwardSearchTest.OneSNP PRG size: 27 Alphabet size: 5 PRG size: 27 Alphabet size: 5 [ OK ] BackwardSearchTest.OneSNP (1044 ms) [ RUN ] BackwardSearchTest.TwoSNPs PRG size: 34 Alphabet size: 7 PRG size: 34 Alphabet size: 7 [ OK ] BackwardSearchTest.TwoSNPs (722 ms) [ RUN ] BackwardSearchTest.Two_matches_one_variable_one_nonvariable_region PRG size: 39 Alphabet size: 5 PRG size: 39 Alphabet size: 5 [ OK ] BackwardSearchTest.Two_matches_one_variable_one_nonvariable_region (599 ms) [ RUN ] BackwardSearchTest.Two_long_sites PRG size: 86 Alphabet size: 7 PRG size: 86 Alphabet size: 7 [ OK ] BackwardSearchTest.Two_long_sites (483 ms) [ RUN ] BackwardSearchTest.Match_within_long_site_match_outside PRG size: 97 Alphabet size: 7 PRG size: 97 Alphabet size: 7 [ OK ] BackwardSearchTest.Match_within_long_site_match_outside (484 ms) [ RUN ] BackwardSearchTest.Multiple_matches_over_multiple_sites PRG size: 93 Alphabet size: 7 PRG size: 93 Alphabet size: 7 [ OK ] BackwardSearchTest.Multiple_matches_over_multiple_sites (434 ms) [ RUN ] BackwardSearchTest.One_match_many_sites PRG size: 76 Alphabet size: 15 PRG size: 76 Alphabet size: 15 [ OK ] BackwardSearchTest.One_match_many_sites (443 ms) [----------] 7 tests from BackwardSearchTest (4209 ms total)

[----------] Global test environment tear-down [==========] 7 tests from 1 test case ran. (4209 ms total) [ PASSED ] 7 tests.

If I point instead at current tip of SDSL:

then we hit an assert in skip()

Running 7 tests from 1 test case. [----------] Global test environment set-up. [----------] 7 tests from BackwardSearchTest [ RUN ] BackwardSearchTest.OneSNP PRG size: 27 Alphabet size: 5 unittest_bidir_search_bwd_fwd: ./skip.cpp:111: bool skip(sdsl::csa_wtsdsl::wt_int<sdsl::int_vector<1u, sdsl::rank_support_v5<> >, 2u, 16777216u>&, uint64_t&, uint64_t&, uint64_t&, uint64_t&, uint32_t): Assertion `right>left' failed. Aborted

iqbal-lab commented 8 years ago

FFS I can't reproduce it!!

iqbal-lab commented 8 years ago

Ah yes, now I can after make clean. This time used printf right=0 and left=25

iqbal-lab commented 8 years ago

Adding a print to see what each c is (c=*pat_it)

[ RUN ] BackwardSearchTest.OneSNP PRG size: 27 Alphabet size: 5 c is 3 c is 1 c is 3 c is 1 c is 3 c is 1 c is 4 c is 2 c is 1 c is 1 c is 3 oops right is 0and left is 25 unittest_bidir_search_bwd_fwd: ./skip.cpp:116: bool skip(sdsl::csa_wtsdsl::wt_int<sdsl::int_vector<1u, sdsl::rank_support_v5<> >, 2u, 16777216u>&, uint64_t&, uint64_t&, uint64_t&, uint64_t&, uint32_t): Assertion `right>left' failed.

OK, so what does this mean. The read is: ttacacagaactagagag

the prg is: catttacaca5g6t5aactagagagca

So it breaks on the g which is allele 1

For the record the BWM is

$catttacaca5g6t5aactagagagca 5aactagagagca$catttacaca5g6t 5g6t5aactagagagca$catttacaca 6t5aactagagagca$catttacaca5g a$catttacaca5g6t5aactagagagc a5g6t5aactagagagca$catttacac aactagagagca$catttacaca5g6t5 aca5g6t5aactagagagca$catttac acaca5g6t5aactagagagca$cattt actagagagca$catttacaca5g6t5a agagagca$catttacaca5g6t5aact agagca$catttacaca5g6t5aactag agca$catttacaca5g6t5aactagag atttacaca5g6t5aactagagagca$c ca$catttacaca5g6t5aactagagag ca5g6t5aactagagagca$catttaca caca5g6t5aactagagagca$cattta catttacaca5g6t5aactagagagca$ ctagagagca$catttacaca5g6t5aa g6t5aactagagagca$catttacaca5 gagagca$catttacaca5g6t5aacta gagca$catttacaca5g6t5aactaga gca$catttacaca5g6t5aactagaga t5aactagagagca$catttacaca5g6 tacaca5g6t5aactagagagca$catt tagagagca$catttacaca5g6t5aac ttacaca5g6t5aactagagagca$cat <<< index 25 tttacaca5g6t5aactagagagca$ca

sm0179 commented 8 years ago

This BWM is wrong. Why are the rows starting with 5 before the rows starting with a when a is 1 in integer alphabet?

iqbal-lab commented 8 years ago

yes, is wrong, made this when I had a bug in my script for printing BWM. Will fix

iqbal-lab commented 8 years ago

BWM is $214441212153645112413131321 1$21444121215364511241313132 112413131321$214441212153645 1212153645112413131321$21444 12153645112413131321$2144412 12413131321$2144412121536451 13131321$2144412121536451124 131321$214441212153645112413 1321$21444121215364511241313 14441212153645112413131321$2 153645112413131321$214441212 21$2144412121536451124131313 212153645112413131321$214441 214441212153645112413131321$ 2153645112413131321$21444121 2413131321$21444121215364511 3131321$21444121215364511241 31321$2144412121536451124131 321$214441212153645112413131 3645112413131321$21444121215 41212153645112413131321$2144 413131321$214441212153645112 441212153645112413131321$214 4441212153645112413131321$21 45112413131321$2144412121536 5112413131321$21444121215364 53645112413131321$2144412121 645112413131321$214441212153

iqbal-lab commented 7 years ago

Can we close this @rffrancon