SHORE API
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
mummer.hpp
Go to the documentation of this file.
1 
2 /*
3  * Copyright 2008,2009,2010,2011,2012 Stephan Ossowski, Korbinian Schneeberger,
4  * Felix Ott, Joerg Hagmann, Alf Scotland, Sebastian Bender
5  *
6  * This file is part of SHORE.
7  *
8  * SHORE is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * SHORE is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with SHORE. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
25 
26 #ifndef SHORE_IO_MUMMER_HPP__
27 #define SHORE_IO_MUMMER_HPP__
28 
29 #include <map>
30 #include <string>
31 #include <vector>
32 
34 #include "shore/stream/streams.hpp"
35 #include "shore/fmtio/text.hpp"
36 
37 namespace shore {
38 
41 {
42  private:
43 
44  shore::line_reader m_lr;
45  std::string m_splitbuf[7];
46 
47  shore::delta_record m_current;
48  bool m_hasdata;
49 
50  void init();
51 
52  public:
53 
55 
56  delta_reader(const std::string& fn);
57  delta_reader(std::istream*const in);
58 
59  const shore::delta_record& current() const;
60  bool has_data() const;
61  void next();
62 };
63 
66 
67 class wga_parser
68 {
69  public:
70 
71  private:
72 
73  std::map<std::string,shore::sequence_record> m_ref;
74  std::map<std::string,shore::sequence_record> m_qry;
75 
76  shore::wga_record m_current;
77  bool m_hasdata;
78 
79  std::string m_mmbuf_ref;
80  std::string m_mmbuf_qry;
81 
82  std::vector<int> m_deltabuf;
83 
84  public:
85 
86  typedef shore::delta_record append_type;
87  typedef shore::wga_record current_type;
88 
89  wga_parser(const std::string& seqfn1,const std::string& seqfn2);
90 
91  const shore::wga_record& current() const;
92  bool has_data() const;
93  void next();
94 
95  void append(const shore::delta_record& d);
96  void flush();
97 };
98 
99 } // namespace
100 
101 #endif // SHORE_IO_MUMMER_HPP__
102