Example Program
Nested Modifiers
How to combine modifiers.
File "modifier_nested.cpp"
A tutorial showing how to nest modifiers.

1 | #include <iostream>
2 | #include <seqan/file.h>
3 | #include <seqan/modifier.h>
4 |
5 | using namespace seqan;
6 |
7 | int 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 | replace(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$
See
ModView, ModifiedString, ModReverse, String
SeqAn - Sequence Analysis Library - www.seqan.de

Page built @2014/10/13 16:12:57