Skip to content

Instantly share code, notes, and snippets.

@srkama
Forked from anonymous/Biuj-0.js
Created February 2, 2016 11:57
Show Gist options
  • Save srkama/ed8be9c03168594b3a22 to your computer and use it in GitHub Desktop.
Save srkama/ed8be9c03168594b3a22 to your computer and use it in GitHub Desktop.
https://repl.it/Biuj/0 created by sri.pgp@gmail.com
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;
}
Native Browser JavaScript
>>> => [ [ 'A', 'T' ], [ 'C', 'G' ] ]
@srkama
Copy link
Author

srkama commented Feb 2, 2016

this is DNA mapping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment