21 inline bool compatibleWithVersion(
const std::string& version)
23 double myVersion, inVersion;
25 std::stringstream ss, ss2;
30 return (
int)myVersion == (int)inVersion;
34 std::vector<std::string>
chopString(
const std::string& inString,
35 const std::string& separator);
44 case 'A' :
return 'T';
45 case 'a' :
return 't';
46 case 'C' :
return 'G';
47 case 'c' :
return 'g';
48 case 'G' :
return 'C';
49 case 'g' :
return 'c';
50 case 'T' :
return 'A';
51 case 't' :
return 'a';
82 inline bool isTransition(
char c1,
char c2)
85 char x = std::toupper((
char)c1);
86 char y = std::toupper((
char)c2);
89 case 'A' :
return y ==
'G';
90 case 'C' :
return y ==
'T';
91 case 'G' :
return y ==
'A';
92 case 'T' :
return y ==
'C';
98 inline bool isSubstitution(
char c1,
char c2)
100 return std::toupper(c1) != std::toupper(c2);
103 inline bool isTransversion(
char c1,
char c2)
105 char x = std::toupper((
char)c1);
106 char y = std::toupper((
char)c2);
107 return (x != y && x !=
'N' && y !=
'N' && !isTransition(c1, c2));
110 inline bool isMissingData(
char c)
112 return c ==
'n' || c ==
'N';
115 inline bool isMasked(
char c)
117 return c == std::tolower(c);
123 char x1 = std::toupper((
char)c1);
124 char x2 = std::toupper((
char)c2);
125 if (x2 ==
'T' || x2 ==
'G')
127 return x1 ==
'C' || x1 ==
'G';
131 return x1 ==
'A' || x1 ==
'C' || x1 ==
'G' || x1 ==
'T';
139 assert(s1.length() == s2.length());
141 for (
size_t i = 0; i < s1.length(); ++i)
143 if (isSubstitution(s1[i], s2[i]) ==
true)
151 const Genome* getLowestCommonAncestor(
const std::set<const Genome*>& inputSet);
155 void getGenomesInSpanningTree(
const std::set<const Genome*>& inputSet,
156 std::set<const Genome*>& outputSet);
160 void getGenomesInSubTree(
const Genome* root,
161 std::set<const Genome*>& outputSet);
std::vector< std::string > chopString(const std::string &inString, const std::string &separator)
hal_size_t hammingDistance(const std::string &s1, const std::string &s2)
Definition: halCommon.h:137
bool isNucleotide(char c)
Definition: halCommon.h:61
bool isFourfoldDegenerate(char c1, char c2)
Definition: halCommon.h:121
char reverseComplement(char c)
Definition: halCommon.h:40