Example Program
Alphabets
Examples for common alphabets.
SeqAn offers some common alphabets like Dna, Iupac, and AminoAcid, which are all simple types.
File "alphabet.cpp"
A tutorial about the use of alphabets.

1 | #include <iostream>
2 | #include <seqan/basic.h>
3 | using namespace seqan;
4 |
5 | int main()
6 | {

The typical alphabet is convertible to char. A conversion of a char back and forth into another alphabet can, however, change the value of the char.

7 | Dna a = 'a';
8 | ::std::cout << a << ::std::endl;
9 |

'f' is not in Dna5 and hence b is set to 'N'.

10 | Dna5 b = 'f';
11 | ::std::cout << b << ::std::endl;
12 |

Many SeqAn alphabet classes can be converted into each other.

13 | b = a;
14 | ::std::cout << b << ::std::endl;
15 |
16 | Iupac c = b;
17 | ::std::cout << c << ::std::endl;
18 |
19 | return 0;
20 | }

See
Dna5, Iupac, Dna, AminoAcid
SeqAn - Sequence Analysis Library - www.seqan.de

Page built @2012/03/14 16:34:45