31 char Universal (
const char codon[4],
38 std::ptrdiff_t ngaps = (std::count(&codon[0],&codon[0]+3,gapchar));
43 else if (ngaps > 0 && ngaps < 3)
224 std::string::const_iterator end,
226 const char & gapchar)
231 return std::string();
233 std::string translation;
238 codon[0] = char(std::toupper(*beg));
239 codon[1] = char(std::toupper(*(beg+1)));
240 codon[2] = char(std::toupper(*(beg+2)));
241 switch (genetic_code)
243 case GeneticCodes::UNIVERSAL:
244 translation += Universal (codon,gapchar);
247 throw std::runtime_error (
"Translate.cc: Translate(), invalid genetic code passed");
std::string Translate(std::string::const_iterator beg, std::string::const_iterator end, Sequence::GeneticCodes genetic_code=GeneticCodes::UNIVERSAL, const char &gapchar='-')
The namespace in which this library resides.
declares Sequence::Translate,a function to translate CDS sequences into peptide sequences ...