Rosalind刷题-DNA反向互补序列

原题:Complementing a Strand of DNA

数据:Julia_for_Rosalind/rosalind_revc.txt at main · sajesi/Julia_for_Rosalind · GitHub

#Given: A DNA string s of length at most 1000 bp.
#Return: The reverse complement sc of s.

using Chain

function revc(DNAseq::AbstractString)
    @chain DNAseq begin
        collect
        replace('A' => 'T','C' => 'G','T' => 'A','G' => 'C')
        join
        reverse    
    end
end

seq = readchomp("data/rosalind_revc.txt")

revc(seq)

备案号:京ICP备17009874号-2