Skip to content

Instantly share code, notes, and snippets.

@cossio
Created August 2, 2018 12:41
Show Gist options
  • Save cossio/f10ef1e9fa26f24334cd6bf185d07877 to your computer and use it in GitHub Desktop.
Save cossio/f10ef1e9fa26f24334cd6bf185d07877 to your computer and use it in GitHub Desktop.
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