Skip to content

Commit

Permalink
[WIP] work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Irallia committed Apr 8, 2020
1 parent a478547 commit a04799c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 43 deletions.
2 changes: 0 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ Note that 3.1.0 will be the first API stable release and interfaces in this rele

* Added `seqan3::interleaved_bloom_filter`, a data structure that efficiently answers set-membership queries for
multiple bins ([\#920](https://github.com/seqan/seqan3/pull/920)).
* The `extend_right()` function can now also handle `char const *`.
([\#1588](https://github.com/seqan/seqan3/pull/1588)).

## API changes

Expand Down
2 changes: 0 additions & 2 deletions test/unit/search/fm_index/bi_fm_index_aa27_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#include "fm_index_collection_test_template.hpp"
#include "fm_index_test_template.hpp"

#include <seqan3/alphabet/aminoacid/aa27.hpp>

using t1 = std::pair<seqan3::bi_fm_index<seqan3::aa27, seqan3::text_layout::single>,
seqan3::aa27_vector>;
INSTANTIATE_TYPED_TEST_SUITE_P(aa27, fm_index_test, t1, );
Expand Down
2 changes: 0 additions & 2 deletions test/unit/search/fm_index/bi_fm_index_char_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#include "fm_index_collection_test_template.hpp"
#include "fm_index_test_template.hpp"

#include <seqan3/alphabet/adaptation/uint.hpp>

using t1 = std::pair<seqan3::bi_fm_index<unsigned char, seqan3::text_layout::single>,
std::vector<unsigned char>>;
INSTANTIATE_TYPED_TEST_SUITE_P(char, fm_index_test, t1, );
Expand Down
2 changes: 0 additions & 2 deletions test/unit/search/fm_index/bi_fm_index_dna4_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
#include "fm_index_collection_test_template.hpp"
#include "fm_index_test_template.hpp"

#include <seqan3/alphabet/nucleotide/dna4.hpp>

using t1 = std::pair<seqan3::bi_fm_index<seqan3::dna4, seqan3::text_layout::single>,
seqan3::dna4_vector>;
INSTANTIATE_TYPED_TEST_SUITE_P(dna4, fm_index_test, t1, );
Expand Down
3 changes: 0 additions & 3 deletions test/unit/search/fm_index/fm_index_dna4_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
#include "fm_index_collection_test_template.hpp"
#include "fm_index_test_template.hpp"

#include <seqan3/alphabet/nucleotide/dna4.hpp>
#include <seqan3/alphabet/nucleotide/dna5.hpp>

using t1 = std::pair<seqan3::fm_index<seqan3::dna4, seqan3::text_layout::single>, seqan3::dna4_vector>;
INSTANTIATE_TYPED_TEST_SUITE_P(dna4, fm_index_test, t1, );
using t2 = std::pair<seqan3::fm_index<seqan3::dna4, seqan3::text_layout::collection>, std::vector<seqan3::dna4_vector>>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,40 +323,35 @@ TYPED_TEST_P(fm_index_cursor_collection_test, lazy_locate)

TYPED_TEST_P(fm_index_cursor_collection_test, locate_char_string)
{
// test case for https://github.com/seqan/seqan3/issues/1473
std::string text = "How much wood would a woodchuck chuck?";
char const * wood = "wood";

// extend_right()
{
seqan3::fm_index index{text};
auto it1 = index.cursor();
auto it2 = index.cursor();

it1.extend_right("wood");
it2.extend_right(wood);

EXPECT_TRUE(std::ranges::equal(it1.locate(), it2.locate())); // [22,9] == [22,9]

seqan3::bi_fm_index b_index{text};
auto it3 = b_index.cursor();
auto it4 = b_index.cursor();

it3.extend_right("wood");
it4.extend_right(wood);
using alphabet_type = typename TestFixture::alphabet_type;

EXPECT_TRUE(std::ranges::equal(it3.locate(), it4.locate())); // [22,9] == [22,9]
}
// extend_left()
// test case for https://github.com/seqan/seqan3/issues/1473
if (std::is_same<alphabet_type, char>::value)
{
seqan3::bi_fm_index b_index{text};
auto it3 = b_index.cursor();
auto it4 = b_index.cursor();

it3.extend_left("wood");
it4.extend_left(wood);

EXPECT_TRUE(std::ranges::equal(it3.locate(), it4.locate())); // [22,9] == [22,9]
char const * cg = "CG";

// extend_right()
{
typename TypeParam::index_type fm{this->text_col1}; // {"ACGACG", "ACGACG"}
TypeParam it1 = TypeParam(fm);
TypeParam it2 = TypeParam(fm);

it1.extend_right(cg);
it2.extend_right(seqan3::views::slice(this->text1, 1, 3)); // "CG"

// EXPECT_TRUE(std::ranges::equal(it1.locate(), it2.locate())); // [(0,1),(0,4),(1,4),(1,1)]
}
// // extend_left()
// {
// seqan3::bi_fm_index b_index{this->text_col1}; // {"ACGACG", "ACGACG"}
// auto it3 = b_index.cursor();
// auto it4 = b_index.cursor();

// it3.extend_left("AC");
// it4.extend_right(seqan3::views::slice(this->text1, 1, 3)); // "CG"

// EXPECT_TRUE(std::ranges::equal(it3.locate(), it4.locate())); // [(0,1),(0,4),(1,4),(1,1)]
// }
}
}

Expand Down

0 comments on commit a04799c

Please sign in to comment.