-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixes #3267 by adding proper constraints to the char conversion table. * Fixes Question regarding the usage of `seqan3::fm_index_cursor` using `seqan3::bitpacked_sequence`. #3264 Further constraints the conversion constructors of the nucleotide and aminoacid base alphabet types to only consider conversion if all requirements are fulfilled. This is now represented by the specific concept `convertable_to_through_char_representation`. Through this proxy types will not be converted through their char representation but will be implicitly converted to their underling base alphabet type, e.g. dna4, and then copied/moved using the copy/move constructor of the underlying base alphabet type. * [MISC] automatic linting * Adds missing copyright text in test file * Removes superfluous vector include in test file. --------- Co-authored-by: seqan-actions[bot] <[email protected]>
- Loading branch information
1 parent
4cc708d
commit 69284e8
Showing
7 changed files
with
64 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
test/unit/search/fm_index_cursor/extend_bitpacked_query_sequence_test.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// SPDX-FileCopyrightText: 2006-2024 Knut Reinert & Freie Universität Berlin | ||
// SPDX-FileCopyrightText: 2016-2024 Knut Reinert & MPI für molekulare Genetik | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
|
||
#include <gtest/gtest.h> | ||
|
||
#include <vector> | ||
|
||
#include <seqan3/alphabet/container/bitpacked_sequence.hpp> | ||
#include <seqan3/alphabet/nucleotide/dna4.hpp> | ||
#include <seqan3/search/fm_index/fm_index.hpp> | ||
#include <seqan3/utility/views/slice.hpp> | ||
|
||
#include "../helper.hpp" | ||
|
||
TEST(fm_index_cursor_test, extend_right_with_bitpacked_sequence) | ||
{ | ||
using namespace seqan3::literals; | ||
using result_t = std::vector<std::pair<uint64_t, uint64_t>>; | ||
|
||
seqan3::bitpacked_sequence<seqan3::dna4> seq{"ACGGTCAGGTTC"_dna4}; | ||
seqan3::fm_index index{seq}; | ||
|
||
auto bitpacked_query = seqan3::views::slice(seq, 1, 4); | ||
|
||
auto it = index.cursor(); | ||
it.extend_right(bitpacked_query); // this line caused the compile time error | ||
EXPECT_EQ(seqan3::uniquify(it.locate()), (result_t{{0, 1}})); | ||
} |