File: graph_align.cpp

package info (click to toggle)
seqan2 2.4.0%2Bdfsg-16
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 224,180 kB
  • sloc: cpp: 256,886; ansic: 91,672; python: 8,330; sh: 995; xml: 570; makefile: 252; awk: 51; javascript: 21
file content (38 lines) | stat: -rw-r--r-- 1,142 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <iostream>

#include <seqan/basic.h>
#include <seqan/stream.h>
#include <seqan/align.h>
#include <seqan/graph_align.h>

using namespace seqan;

int main()
{
    typedef StringSet<DnaString, Dependent<> > TStringSet;
    typedef Graph<Alignment<TStringSet, void> > TAlignmentGraph;

    // Define scorings scheme.
    //
    // In this case, affine gap costs with match = 0, mismatch = -1,
    // gapextend = -1 and gapopen = -2.
    Score<int> scoringScheme(0, -1, -1, -2);

    // Define the two sequence to be allocated.
    DnaString seq1 = "atcgaatgcgga";
    DnaString seq2 = "actcgttgca";

    // Create StringSet with these two sequences and construct an
    // AlignmentGraph for them.
    TStringSet stringSet;
    appendValue(stringSet, seq1);
    appendValue(stringSet, seq2);
    TAlignmentGraph alignmentGraph(stringSet);

    // Compute global alignment of seq1 and seq1 using Gotoh's algorithm and
    // print score and alignment graph.
    int score = globalAlignment(alignmentGraph, scoringScheme, Gotoh());
    std::cout << "Score = " << score << "\n"
              << alignmentGraph << std::endl;
    return 0;
}