Running sequence alignment with alphabets with more than 256 characters

Open
#3,341 3 comments 0 reactions 0 assignees View on GitHub

@eseiler is already working on this.

Since Feb 20, 2025.

  • #3342 by @eseiler — open

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp

Research direction

Start at seqan3/include/seqan3/alphabet/composite/alphabet_variant.hpp and the align_pairwise example, then inspect linked pull request #3342. Determine whether alphabets using char16_t with size 1333 are supported without the static assertion; done means a documented workaround or confirmed support with a reproducible build.

Written by the indexing model from the issue text.

Description

question

Platform

  • SeqAn version: 3.4.0
  • Operating system: Linux
  • Compiler: g++ (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0

Question

Hi,
Is it possible to compute sequence alignments suing alphabets larger than 256 characters?

For instance I tried running one of the examples from the tutorials using an alphabet with more than 256 characters I defined like this:

class example_alphabet : public seqan3::alphabet_base<example_alphabet, 1333, char16_t>
{
.
.
.
};

and when building this code:

    // Invoke the pairwise alignment which returns a lazy range over alignment results.
    auto results_example = seqan3::align_pairwise(std::tie(example_alphabet_vector_1, example_alphabet_vector_2), config);
    auto & res_example = *results_example.begin();
    seqan3::debug_stream << "Score: " << res_example.score() << '\n';
    return 0;

I get these kind of errors:

/home/eclypsium/Workspace/v2d/seqan3/tutorial/seqan3/include/seqan3/alphabet/composite/alphabet_variant.hpp:134:25: error: static assertion failed: The alphabet_variant is currently only tested for alphabets with char_type char. Contact us on GitHub if you have a different use case: https://github.com/seqan/seqan3 .
  134 |     static_assert((std::is_same_v<alphabet_char_t<alternative_types>, char> && ...),
      | 

Looking at the code it seems that char as is hardcoded in many places as char_type.
Is there any way to circumvent this?

Best regards,
Andrés Tiraboschi

Dominant language
C++
Stars
463
Forks
90
Avg merge
1h 11m
Merged PRs (30d)
3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from seqan/seqan3

All issues in seqan/seqan3

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.