rosalind/rna.rb
Code:
# Rosalind Problem RNA: Transcribing DNA into RNA
# https://rosalind.info/problems/rna/
require_relative './helpers.rb'
dataset = get_dataset(problem: 'RNA')[0]
def solve(dataset)
dataset.gsub('T', 'U')
end
puts solve('GATGGAACTTGACTACGTAAATT')
puts solve(dataset)
Output:
GAUGGAACUUGACUACGUAAAUU
CACGUAAGGCGUCUCCCUUCGGACUUCGCUUUCGUGUGAGCUAACAUUGGCGUGCCGGCGUGCUUUCAGUAUUGUCAACUAACACAAUCUCAUGACUCCGAACUUUAUGGACAAGGGUUCUAACUUUCGCGUAGUUGUCGAUCAGGAACUGGGACUUAGGCCAAUGGUUCUUGGUAUCCAUACGUAUAAUUUCCGUAUAAGAUCCGCCCACGAGAGACGAGUAUGUUUAAUAUUCAAGAAGAGUGCGCCACACCCGAAUCUGGCGUCAGGUAUUUUCAGCGUCUUUAGUGGGGUUGAUAGAACCCCUACUUAGGUUAAUCCUUCGUUAUAGAAUCCACUUGAGAUUCGCUAUAGGUGGCUUACAAGGACUGUGAGAAGAAGGAUCCUUAGACGAUGACCGAAAAAUUUGGUGGUCGCGCGGCGUUUUUAACCGCGUGAUAUCUUCGGACUGCUCGCCGUCUAUGCUCGCCGUGGUACGCCAGGUAGUGCCGUCCUCUAAGCUGCAUGAGUGAAAGUAAAGAACGUGGCGCCCAAAAGAGAGGAGGCGGUAUUUCACAACGGAGACUGGAAGAUCUAGUUAGCAGAGAAGCGCGGGAGUUCCGCCAAAGUCUCCAAUUGUAGGAUGUUCCGGUACUGCGGAAAAAAAGGAAAUAAAAGCCCAUAGUAGCUGUUACUCACUGCUCUCAAUCUUUCGACUCAUAUUCCAGCCCAGGCAUGGACUGUGAGUCUAAAUAGUCGGCCGAAAUUCAUGUUAGUCUCUUCCGCGUUGAAACCUCGUAGACGAAUUACGCAGCUGCUAAUGUCGAGGCAAUCGGUGUCGAUAGACAACCGGGCGUCGGCGACUAAUUGUCGUGGGGACGAAUGAGACGCUUUUAAUGACAGUGUCUGGGCAACAAUCGGCGGGCAAAUAUGUAGCAUUUGCCGGCCAACGUCUCUAUCUGUAUCGAACAGGACUCGUUAGUAAUCCCAUUUAAUCAGUUACCACUUU