Created
May 16, 2015 15:51
-
-
Save estebistec/a363b9105f50af30b17f to your computer and use it in GitHub Desktop.
find complement strand
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(export) { | |
var symbolComplements = { | |
"A": "T", | |
"T": "A", | |
"C": "G", | |
"G": "C" | |
}; | |
export.DNA = { | |
complementStrand: function(strand) { | |
var complement = ''; | |
if(strand) { | |
for(index in strand) { | |
var symbol = strand[index]; | |
complement += symbolComplements[symbol]; | |
} | |
} | |
return complement; | |
} | |
}; | |
})(window); | |
console.log(DNA.complementStrand("ATTGC")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment