You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JavaScript object that translates a DNA input sequence into a protein sequence.
It uses the "Combination Constructor/Prototype Pattern" as described in the book "Professional JavaScript For Web Developers"
by Nicholas Zakas.
The code is described in link "http://www.javascript-spreadsheet-programming.com/2012/12/object-oriented-javascript-example.html".
The scientific background is given in "http://www.javascript-spreadsheet-programming.com/2012/11/using-github-for-javascript-and-vba.html"
USE:
Useful if you wish to translate a DNA sequence that contains IUPAC ambiguity codes.
To use (Executed by Node.js): Append the three code lines below to the code file and execute from the command line with:
node TranslateDna.js
var seq = 'CCTKAGATCACTCTTTGGCAACGACCCCTCGTCACAATAAAGATAGGGGGGCAACTAAAGGAAGCTCTATTAGATACAGGAGCAGATGATACAGTATTAGAAGAAATGAATTTGCCAGGAAGATGGAAACCAAAAATGATAGGGGGAATTGGAGGTTTTATCAAAGTAAGACAGTATGATCAGATACTCATAGAAATCTGTGGACATAAAGCTATAGGTACAGTATTAATAGGACCTACACCTGTCAACATAATTGGAAGAAATCTGTTGACTCAGCTTGGTTGCACTTTAAATTTT';
var trans = new TranslateDna(seq);
console.log(trans.getAminoAcids());
Passes JSLint without error when using the default settings.