Sha256: b065ee3c2949640d2eebf4ff03fcf924487fe749753b0ec8dd9c31a9cfadf1a3

Contents?: true

Size: 438 Bytes

Versions: 311

Compression:

Stored size: 438 Bytes

Contents

# Given a DNA strand, its transcribed RNA strand is formed by replacing each nucleotide with its complement:
# G -> C, C -> G, T -> A, A -> U
function to_rna(dna::AbstractString)
    typeof(match(r"^[GCTA]+$", dna)) == Void && error("Invalid RNA strand")
    # Define character associations
    a_nucleotides = Dict('G'=>'C', 'C'=>'G', 'T'=>'A', 'A'=>'U')
    # Replace characters using dictionary
    map((x)->a_nucleotides[x], dna)
end

Version data entries

311 entries across 311 versions & 1 rubygems

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