| Example Program T-Coffee T-Coffee code example File "graph_align_msa.cpp" This code example illustrates a consistency-based multiple sequence alignment using an amino acid alphabet
1 | #include <seqan/graph_msa.h>
2 | #include <iostream>
3 |
4 | using namespace seqan;
5 |
6 |
7 | int main() {
8 | typedef String<AminoAcid> TString;
9 | typedef StringSet<TString, Dependent<> > TStringSet;
10 | typedef Graph<Alignment<TStringSet, unsigned int, Default> > TGraph;
Alignments are carried out on a StringSet that holds the sequences
11 | TString str1 = "GARFIELDTHELASTFATCAT";
12 | TString str2 = "GARFIELDTHEFASTCAT";
13 | TString str3 = "GARFIELDTHEVERYFASTCAT";
14 | TString str4 = "THEFATCAT";
15 | TStringSet strSet;
16 | assignValueById(strSet, str1);
17 | assignValueById(strSet, str2);
18 | assignValueById(strSet, str3);
19 | assignValueById(strSet, str4);
Out-parameter: An alignment graph of multiple sequences
20 | Graph<Alignment<TStringSet, void, WithoutEdgeId> > gOut(strSet);
Consistency-based multiple sequence alignment
21 | globalAlignment(strSet, gOut, MSA_Protein() );
Console output
22 | std::cout << gOut << std::endl;
23 | return 0;
24 | }
See Graph SeqAn - Sequence Analysis Library - www.seqan.de