Example Program
Nested Modifiers
How to combine modifiers.
A tutorial showing how to nest modifiers.
1#include <iostream>
2#include <seqan/file.h>
3#include <seqan/modifier.h>
4
5using namespace seqan;
6
7int main ()
8{
9    String<Dna> myString = "attacgg";
A nested modifier.
10    typedef ModifiedString<String<Dna>, ModComplementDna>   TMyComplement;
11    typedef ModifiedString<TMyComplement, ModReverse>       TMyReverseComplement;
12
A reverse complemented string.
13    TMyReverseComplement myReverseComplement(myString);
14    ::std::cout << myString << ::std::endl;
15    ::std::cout << myReverseComplement << ::std::endl;
16    infix(myString, 1, 1) = "cgt";
17    ::std::cout << myString << ::std::endl;
18    ::std::cout << myReverseComplement << ::std::endl;
19    ::std::cout << DnaStringReverseComplement(myString) << ::std::endl;
20    return 0;
21}
Output
weese@tanne:~/seqan$ cd demos
weese@tanne:~/seqan/demos$ make modifier_nested
weese@tanne:~/seqan/demos$ ./modifier_nested
ATTACGG
CCGTAAT
ACGTTTACGG
CCGTAAACGT
CCGTAAACGT
weese@tanne:~/seqan/demos$
SeqAn - Sequence Analysis Library - www.seqan.de