44 char(std::toupper(i)) ) );
47 std::string message(
"Sequence::TsTv error: ");
49 message +=
" is not A,G,C, nor T.";
50 throw std::runtime_error(message.c_str());
55 char(std::toupper(j)) ) );
58 std::string message(
"Sequence::TsTv error: ");
60 message +=
" is not A,G,C, nor T.";
61 throw std::runtime_error(message.c_str());
65 return (Mutations::Tv);
67 return (Mutations::Ts);
68 return (Mutations::Unknown);
80 std::toupper(i))) < 4 );
84 std::toupper(j))) < 4 );
88 return (Mutations::Tv);
92 return (Mutations::Ts);
95 return (Mutations::Unknown);
99 const std::string & seq2,
100 const bool & skip_missing,
101 const bool & nucleic_acid)
113 if(! (seq1.length () == seq2.length ()))
120 for (
unsigned i = 0 ; i < seq1.length() ; ++i)
122 const char _ch1 = char(std::toupper(seq1[i])),
123 _ch2 = char(std::toupper(seq2[i]));
124 if( (_ch1 != MISSING && _ch2 != MISSING) &&
131 for (
unsigned i = 0 ; i < seq1.length() ; ++i)
133 if (
char(std::toupper(seq1[i])) != char(std::toupper(seq2[i])) )
142 const std::string & seq2,
143 const bool & skip_missing,
144 const bool & nucleic_acid)
156 size_t len = seq1.length();
157 if (seq1.length() != seq2.length())
164 for (
unsigned i = 0; i < len; ++i)
166 const char _ch1 = char(std::toupper(seq1[i])),
167 _ch2 = char(std::toupper(seq2[i]));
168 if(skip_missing ==
true)
170 if( (_ch1 != MISSING &&
193 return (s.find(
'-') != std::string::npos);
Mutations TsTv(const char &i, const char &j)
The namespace in which this library resides.
const alphabet_t dna_alphabet
Alphabet for DNA sequences Valid DNA characters. Upper-case only. Only - is accepted as gap character...
int NumDiffs(const std::string &seq1, const std::string &seq2, const bool &skip_missing=true, const bool &nucleic_acid=true)
bool Different(const std::string &seq1, const std::string &seq2, const bool &skip_missing=true, const bool &nucleic_acid=true)
bool NotAGap(const char &c)
bool Gapped(const std::string &s)
Definition of enumeration types.