Created
August 2, 2018 12:41
-
-
Save cossio/f10ef1e9fa26f24334cd6bf185d07877 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function dnacompl(nt::Char) | |
@assert nt ∈ ('A', 'T', 'C', 'G', 'N', '*') | |
if nt == 'A' | |
return 'T' | |
elseif nt == 'T' | |
return 'A' | |
elseif nt == 'G' | |
return 'C' | |
elseif nt == 'C' | |
return 'G' | |
elseif nt == 'N' || nt == '*' | |
return nt | |
end | |
end; | |
function dnacompl(seq::AbstractString) | |
return join(dnacompl.(collect(seq))) | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment