Loading...
Searching...
No Matches
Mask
Alphabet

Provides the mask alphabet and functionality for creating masked composites. More...

Collaboration diagram for Mask:

## Classes

class | seqan3::mask
| Implementation of a masked alphabet to be used for tuple composites. More...
struct | seqan3::mask_printer< mask_t >
| The printer used for formatted output of seqan3::mask alphabet. More...
class | seqan3::masked< sequence_alphabet_t >
| Implementation of a masked composite, which extends a given alphabet with a mask. More...

## Detailed Description

Provides the mask alphabet and functionality for creating masked composites.

See also
  alphabet

### Introduction

Masks are useful in cases where an alphabet needs to be augmented with additional information. A common use case is the introduction of don't-care positions (masking) in nucleotide or aminoacid sequences without using 'N' or 'X', respectively. Instead, the original alphabet is combined with seqan3::mask to create a seqan3::masked composite. When printed via the seqan3::debug_stream, masked characters are displayed in lowercase.

// SPDX-FileCopyrightText: 2006-2025 Knut Reinert & Freie Universität Berlin
// SPDX-FileCopyrightText: 2016-2025 Knut Reinert & MPI für molekulare Genetik
// SPDX-License-Identifier: CC0-1.0
#include <seqan3/alphabet/mask/masked.hpp>
#include <seqan3/alphabet/nucleotide/dna4.hpp>
#include <seqan3/core/debug_stream.hpp>
int main()
{
using namespace seqan3::literals;
seqan3::masked<seqan3::dna4> dna4_masked{};
seqan3::masked<seqan3::dna4> dna4_another_masked{'A'_dna4, seqan3::mask::unmasked};
// create a dna4 masked alphabet with an unmasked A
dna4_masked.assign_char('a'); // assigns a masked 'A'_dna4
if (dna4_masked.to_char() != dna4_another_masked.to_char())
{
seqan3::debug_stream << dna4_masked.to_char() << " is not the same as " << dna4_another_masked.to_char()
<< "\n";
}
}
seqan3::mask::unmasked
static mask const unmasked
Member for unmasked.
Definition mask.hpp:65
seqan3::masked
Implementation of a masked composite, which extends a given alphabet with a mask.
Definition masked.hpp:42
seqan3::masked::assign_char
constexpr masked & assign_char(char_type const c) noexcept
Assign from a character.
Definition masked.hpp:86
seqan3::masked::to_char
constexpr char_type to_char() const noexcept
Return a character.
Definition masked.hpp:101
debug_stream.hpp
Provides seqan3::debug_stream and related types.
dna4.hpp
Provides seqan3::dna4, container aliases and string literals.
seqan3::debug_stream
debug_stream_type debug_stream
A global instance of seqan3::debug_stream_type.
Definition debug_stream.hpp:38
masked.hpp
Extends a given alphabet with the mask alphabet.
seqan3::literals
The SeqAn namespace for literals.

### Types of masking

There are two types of masking:

- hard-masking, which converts masked characters to the ambiguous/unknown character ('N' or 'X')
- soft-masking, which uses lowercase for masked characters

### Repeat masking

The use of soft-masking was popularised by RepeatMasker. Interspersed repeats (transposons, retrotransposons and processed pseudogenes) and low complexity sequences are denoted by lowercase characters. Note that larger repeats, such as segmental duplications, large tandem repeats and whole gene duplications are generally not masked.

Hide me