-
-
Save srkama/ed8be9c03168594b3a22 to your computer and use it in GitHub Desktop.
https://repl.it/Biuj/0 created by [email protected]
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
pairs = [["A", "T"],["C","G"]] | |
function pair(str) { | |
tempArray = []; | |
for (j=0;j<str.length;j++){ | |
for (i=0;i<pairs.length;i++) { | |
indexValue = pairs[i].indexOf(str.charAt(j)); | |
if(indexValue==0) { | |
tempArray.push(pairs[i].slice()); | |
} else if (indexValue == 1) { | |
pairs[i].reverse(); | |
tempArray.push(pairs[i].slice()); | |
} | |
} | |
} | |
return tempArray; | |
} |
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
Native Browser JavaScript | |
>>> => [ [ 'A', 'T' ], [ 'C', 'G' ] ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this is DNA mapping