libsequence  1.9.5
translateTest.cc
1 #include <Sequence/Translate.hpp>
2 #include <iostream>
3 #include <string>
4 
5 const char alphabet[4] = {'A','G','C','T'};
6 
7 int main(int argc, char **argv)
8 {
9  std::string codon;
10  codon.resize(3);
11  for (unsigned first = 0 ; first < 4 ; ++first)
12  {
13  for (unsigned second = 0 ; second < 4 ; ++second)
14  {
15  for (unsigned third = 0 ; third < 4 ; ++third)
16  {
17  codon[0] = alphabet[first];
18  codon[1] = alphabet[second];
19  codon[2] = alphabet[third];
20  std::cout << codon
21  << '\t'
22  << Sequence::Translate(codon.begin(),codon.end())
23  << std::endl;
24  }
25  }
26  }
27 }
std::string Translate(std::string::const_iterator beg, std::string::const_iterator end, Sequence::GeneticCodes genetic_code=GeneticCodes::UNIVERSAL, const char &gapchar='-')
Definition: Translate.cc:223
declares Sequence::Translate,a function to translate CDS sequences into peptide sequences ...