yat  0.11.3pre
Aligner.h
1 #ifndef _theplu_yat_utility_aligner_
2 #define _theplu_yat_utility_aligner_
3 
4 // $Id: Aligner.h 3114 2013-11-10 23:51:47Z peter $
5 
6 /*
7  Copyright (C) 2012 Peter Johansson
8  Copyright (C) 2013 Jari Häkkinen, Peter Johansson
9 
10  This file is part of the yat library, http://dev.thep.lu.se/yat
11 
12  The yat library is free software; you can redistribute it and/or
13  modify it under the terms of the GNU General Public License as
14  published by the Free Software Foundation; either version 3 of the
15  License, or (at your option) any later version.
16 
17  The yat library is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with yat. If not, see <http://www.gnu.org/licenses/>.
24 */
25 
26 #include <cstddef>
27 #include <vector>
28 
29 namespace theplu {
30 namespace yat {
31 namespace utility {
32 
33  class Matrix;
34 
49  class Aligner
50  {
51  public:
57  enum direction { none, right, down, diagonal };
58 
64  Aligner(double gap=0, double open_gap=0);
65 
81  Aligner(double vertical_gap, double open_vertical_gap,
82  double horizon_gap, double open_horizon_gap);
83 
92  double needleman_wunsch(const Matrix& d);
93 
100  double smith_waterman(const Matrix& d);
101 
114  void operator()(const Matrix& dot, Matrix& score);
115 
122  const direction& alignment(size_t i, size_t j) const;
123 
124  private:
125  direction& cigar(size_t i, size_t j);
126 
127  size_t columns_;
128  double vertical_gap_;
129  double open_vertical_gap_;
130  double horizon_gap_;
131  double open_horizon_gap_;
132  std::vector<direction> alignment_;
133  };
134 
135 }}} // of namespace utility, yat, and theplu
136 
137 #endif

Generated on Sat May 24 2014 03:33:05 for yat by  doxygen 1.8.2