Skip to content

Instantly share code, notes, and snippets.

@echiesse echiesse/dnaRev.lua
Created May 20, 2017

Embed
What would you like to do?
DNA strand reverse
function strandComplRev(s)
local complements =
{
A = "T",
T = "A",
C = "G",
G = "C",
}
local s2 = ""
for c in string.gmatch(s, ".") do
s2 = complements[c] .. s2
end
return s2
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.