libsequence  1.9.5
Comparisons.hpp
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 2003-2009 Kevin Thornton, krthornt[]@[]uci.edu
4 
5 Remove the brackets to email me.
6 
7 This file is part of libsequence.
8 
9 libsequence is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 libsequence is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 long with libsequence. If not, see <http://www.gnu.org/licenses/>.
21 
22 */
23 
24 #ifndef COMPARISONS_H
25 #define COMPARISONS_H
26 
37 #include <string>
38 #include <algorithm>
39 #include <type_traits>
40 #include <Sequence/SeqEnums.hpp>
41 
42 namespace Sequence
43 {
44  Mutations TsTv(const char & i, const char & j);
45  Mutations TsTv(const int & i,const int & j);
46  bool Different (const std::string & seq1,
47  const std::string & seq2,
48  const bool & skip_missing = true,
49  const bool & nucleic_acid = true);
50 
51  int NumDiffs(const std::string & seq1,
52  const std::string & seq2,
53  const bool & skip_missing = true ,
54  const bool & nucleic_acid = true);
55 
56  bool Gapped(const std::string &s);
57 
58  template<typename Iterator> bool Gapped(Iterator beg,Iterator end,
59  const char & gapchar = '-')
66  {
67  Iterator itr = std::find(beg,end,gapchar);
68  return (itr!=end);
69  }
70 
71  bool NotAGap(const char &c);
72 }
73 #endif
Mutations TsTv(const char &i, const char &j)
Definition: Comparisons.cc:35
The namespace in which this library resides.
int NumDiffs(const std::string &seq1, const std::string &seq2, const bool &skip_missing=true, const bool &nucleic_acid=true)
Definition: Comparisons.cc:141
bool Different(const std::string &seq1, const std::string &seq2, const bool &skip_missing=true, const bool &nucleic_acid=true)
Definition: Comparisons.cc:98
bool NotAGap(const char &c)
Definition: Comparisons.cc:196
bool Gapped(const std::string &s)
Definition: Comparisons.cc:184
Definition of enumeration types.