Hi,
The program I'm trying to make is to transcribe DNA to RNA and separate into codons.
So far I was able to transcribe DNA to RNA and store it in string variable.
Next part is to separate RNA strand into groups of 3 (codon) and store each group in vector.
Below is part of my code.
void GeneLoader::setCodon ()
{
string s = rna.getRnaStrand ();
for (int i=0; i < s.length() - 2; i+3)
{
temp = s[i] + s[i+1] + s[i+2];
s.push_back (temp);
}
}
The string s has the RNA sequence stored inside. I'm trying to concatenate s + s[i+1] + s[i+2] into a one string and store into the vector.
For example, if s == 'a', s[i+1] == 'c', s[i+2] == 'g' then s + s[i+1] + s[i+2] would equal to "acg". The "acg" would be stored into the vector and so forth.
Any advice on how to tackle this problem?