Open JappyPing opened 1 year ago
Hi Jappy0
Thank you for your report. There is indeed a design flaw in the align_pairwise
method. It is not possible for it to report sequence ids. Instead it is reporting the index of the alignment-pair.
We are discussing a solution.
For you to continue working, you need to create a list which does the same mapping as seqan3::views::pairwise_combine(vec)
for indices and then convert it to the real sequence ids.
Here a detailed adjustment of your final for loop:
// Create a mapping, that maps from alignment-pair-ids → sequence-ids
auto pair_indices = seqan3::views::pairwise_combine(std::views::iota(0ul, vec.size()));
for (auto const & result : alignment_results | filter_v) {
seqan3::debug_stream << result << '\n';
// The sequence1_id is reporting the index of the alignment-pair, not the ids of the pairs them self
auto alignment_id = result.sequence1_id(); // result.sequence1_id() == result.sequence2_id()
auto [sid1, sid2] = pair_indices[alignment_id]; // alignment-pair-id -> sequence-id
seqan3::debug_stream << "sid1: " << sid1 << "; sid2: " << sid2 << "\n"; // the real sequence ids
}
I will keep this issue open, until we have some kind of proper solution in seqan
Here's a godbolt link showing both versions: https://godbolt.org/z/q6dMYajef
Here a detailed adjustment of your final for loop:
Hi Simon,
I see, thanks so much for the quick solution.
Here's a godbolt link showing both versions: https://godbolt.org/z/q6dMYajef
Hi Enrico, Thanks so much for the examples.
Hi there,
Thanks so much for this excellent C++ library for bioinformatics. I had a question when I was using it; please have a look at the following,
Platform
Question
I used the following configurations to get pairwise alignment from a vector. I found the output pairwise sequence id-1 and id-2 are the same. Is this problem a bug?
Thanks for your time.
Best regards,
Jappy