Closed iqbal-lab closed 6 years ago
So looks like in the forward search we are not adding to sites object properly.
In commit 318a43b5656560fa65fdcc538a7ea5f7ea8f318b I've added a similar check in an earlier unit test (2SNPs) and that also fails:
[ RUN ] BackwardSearchTest.TwoSNPs ./test/unittest_bidir_search_bwd_fwd.cpp:229: Failure Value of: 1 Expected: sites.front().back().second.size() Which is: 3 [ FAILED ] BackwardSearchTest.TwoSNPs (476 ms)
I notice we clear empty_allele differently in fwd and bwd
No longer relevant.
In test Long_site_and_repeated_snp_on_edge_of_site at commit 2a41ce162e87b7d69c89eb079343705551be5803
We have
prg = gacatagacacacagt5gtcgcctcgtcggctttgagt6gtcgctgctccacacagagact5ggtgctagac7c8a7ccagctgctccacacagaga
andFirst the unit test does a bidir backward search and all the unti test assertions pass
` EXPECT_EQ(true,first_del); EXPECT_EQ(1,sa_intervals.size()); EXPECT_EQ(no_occ,1);
If we print the sites variable we see this
Then we clear variables:
sa_intervals.clear(); sa_intervals_rev.clear(); sites.clear();
and search with the bidir forwards search. Now as soon as we finish the forward search, we print sites and see this:
p sites $3 = std::list = {[0] = std::vector of length 4, capacity 4 = {{first = 5, second =std::vector of length 3, capacity 3 = {1, 2, 1}}, {first = 5, second = std::vector of length 4, capacity 4 = {1, 2, 1, 2}}, {first = 7, second = std::vector of length 4, capacity 4 = {1, 2, 1, 2}}, {first = 7, second = std::vector of length 5, capacity 5 = {1, 2, 1, 2, 1}}}}
That doesnt look right to me at all, and when we get to the assertions we have this code
EXPECT_EQ(sites.front().front().first, 5); EXPECT_EQ(sites.front().front().second.front(), 1); EXPECT_EQ(sites.front().front().second.size(), 1); EXPECT_EQ(sites.front().back().first, 7); EXPECT_EQ(sites.front().back().second.front(), 1); EXPECT_EQ(sites.front().back().second.size(), 1);
and this output `./test/unittest_bidir_search_bwd_fwd.cpp:586: Failure Value of: 1 Expected: sites.front().front().second.size() Which is: 3
./test/unittest_bidir_search_bwd_fwd.cpp:589: Failure Value of: 1 Expected: sites.front().back().second.size() Which is: 5 `