| Example Program Nested Modifiers How to combine modifiers. File "modifier_nested.cpp"
1 | #include <iostream>
2 | #include <seqan/file.h>
3 | #include <seqan/modifier.h>
4 |
5 | using namespace std;
6 | using namespace seqan;
7 |
8 | int main ()
9 | {
10 | String<Dna> myString = "attacgg";
11 |
12 | typedef ModifiedString<String<Dna>, ModComplementDna> TMyComplement;
13 | typedef ModifiedString<TMyComplement, ModReverse> TMyReverseComplement;
14 |
15 | TMyReverseComplement myReverseComplement(myString);
16 |
17 | cout << myString << endl;
18 | cout << myReverseComplement << endl;
19 |
20 | infix(myString, 1, 1) = "cgt";
21 |
22 | cout << myString << endl;
23 | cout << myReverseComplement << endl;
24 |
25 | cout << DnaStringReverseComplement(myString) << endl;
26 |
27 | return 0;
28 | }
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$ See ModifiedString, ModReverse, ModView, String SeqAn - Sequence Analysis Library - www.seqan.de