transcribe(s::AbstractString) = replace(s, 'T'=>'U')
function main()
if length(ARGS) < 2
println("Usage: julia $(Base.PROGRAM_FILE) <fineIN> <fileOUT>")
exit(1)
end
= read(ARGS[1], String)
s
open(ARGS[2], "w") do file
println(file, transcribe(s))
end
exit(0)
end
main()
Transcribing DNA into RNA
Problem definition
Write a program
Given: A DNA string \(t\) having length at most 1000 nucleotides
Return: The transcribed RNA string of \(t\).
Sample data
GATGGAACTTGACTACGTAAATT
Sample output
GAUGGAACUUGACUACGUAAAUU
Solution
transcription.jl
We use the in-built function replace
which takes in a collection and for each pair old=>new
returns a copy of the collection where all occurances of old
are replaced by new
.