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