Created
May 20, 2017 04:45
-
-
Save echiesse/b46edc9763bbd3ce4fec1bbc4f78cd9c to your computer and use it in GitHub Desktop.
DNA strand reverse
This file contains 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 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