Sha256: 9aa5e323e8a1d43beed536d6e318b34332a9cdd505c4e3a424d7185f26c7ded2

Contents?: true

Size: 607 Bytes

Versions: 396

Compression:

Stored size: 607 Bytes

Contents

#include "rna_transcription.h"
#include <algorithm>
#include <iterator>

using namespace std;

namespace transcription
{

char to_rna(const char nucleotide)
{
    const string dna_nucleotides("CGAT");
    const string rna_nucleotides("GCUA");
    const auto pos = dna_nucleotides.find(nucleotide);
    if (pos != string::npos) {
        return rna_nucleotides[pos];
    }
    return 0;
}

string to_rna(string const& sequence)
{
    string transcription;
    transform(sequence.begin(), sequence.end(), back_inserter(transcription),
        [](char c) { return to_rna(c); });
    return transcription;
}

}

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/cpp/exercises/rna-transcription/example.cpp
trackler-2.2.1.179 tracks/cpp/exercises/rna-transcription/example.cpp
trackler-2.2.1.178 tracks/cpp/exercises/rna-transcription/example.cpp
trackler-2.2.1.177 tracks/cpp/exercises/rna-transcription/example.cpp
trackler-2.2.1.176 tracks/cpp/exercises/rna-transcription/example.cpp
trackler-2.2.1.175 tracks/cpp/exercises/rna-transcription/example.cpp
trackler-2.2.1.174 tracks/cpp/exercises/rna-transcription/example.cpp
trackler-2.2.1.173 tracks/cpp/exercises/rna-transcription/example.cpp
trackler-2.2.1.172 tracks/cpp/exercises/rna-transcription/example.cpp
trackler-2.2.1.171 tracks/cpp/exercises/rna-transcription/example.cpp
trackler-2.2.1.170 tracks/cpp/exercises/rna-transcription/example.cpp
trackler-2.2.1.169 tracks/cpp/exercises/rna-transcription/example.cpp
trackler-2.2.1.167 tracks/cpp/exercises/rna-transcription/example.cpp
trackler-2.2.1.166 tracks/cpp/exercises/rna-transcription/example.cpp
trackler-2.2.1.165 tracks/cpp/exercises/rna-transcription/example.cpp
trackler-2.2.1.164 tracks/cpp/exercises/rna-transcription/example.cpp
trackler-2.2.1.163 tracks/cpp/exercises/rna-transcription/example.cpp
trackler-2.2.1.162 tracks/cpp/exercises/rna-transcription/example.cpp
trackler-2.2.1.161 tracks/cpp/exercises/rna-transcription/example.cpp
trackler-2.2.1.160 tracks/cpp/exercises/rna-transcription/example.cpp