Origenes
Nucleotide sequences manipulation tools.
Getting Started
Install the module with: npm install origenes
var Sequence = Sequence; // Create some sequence instances var simple_seq = 'ACTG'; /* { SEQ: 'ACTG', LEN: 4, TYPE: 'DNA' } */ var oligonucleotide = "GTTGACCGTAGCGAGTCCG"; /* { SEQ: 'GTTGACCGTAGCGAGTCCG', LEN: 19, TYPE: 'DNA', TM: 62, TA: 57 } */ var rna = "AUGGAACUGACUGAAGAUUGA"; /* { SEQ: 'AUGGAACUGACUGAAGAUUGA', LEN: 21, TYPE: 'RNA' } */ var degenerate_seq = 'AN-RCTYGK'; /* { SEQ: 'AN-RCTYGK', LEN: 9, TYPE: 'DNA' } */ // Sequence instances are immutable, their properties are constants simple_seqSEQ = "ATATATATATA"; simple_seqaNewProperty = "something": simple_seq; /* { SEQ: 'ACTG', LEN: 4, TYPE: 'DNA' } */ // Melting and annealing temperatures are calculated for DNA oligonucleotides [18..25nt] oligonucleotideTM; // 62 as 4*(G+C) + 2*(A+T) in °C oligonucleotideTA; // 57 as (TM - 5) in °C // Tm, Ta are not defined for sequences shorter than 18nt or longer than 25nt simple_seqTM; // undefined simple_seqTA; // undefined // Sequence instance methods return new Sequence instances simple_seq; /* { SEQ: 'ACUG', LEN: 4, TYPE: 'RNA' } */ rna; /* 'Error: can't transcribe RNA.' */ simple_seq; /* { SEQ: 'GTCA', LEN: 4, TYPE: 'DNA' } */ simple_seq; /* { SEQ: 'TGAC', LEN: 4, TYPE: 'DNA' } */ degenerate_seq; /* { SEQ: 'TN-YGARCN', LEN: 9, TYPE: 'DNA' } */ rna; /* { SEQ: 'UACCUUGACUGACUUCUAACU', LEN: 21, TYPE: 'RNA' } */ // Instance methods are chainable simple_seq; /* { SEQ: 'CAGT', LEN: 4, TYPE: 'DNA' } */ simple_seqSEQ == simple_seqSEQ; // true simple_seqSEQ == simple_seqSEQ; // true // Translate a RNA Sequence object into a new Sequence instance of type PROT rna; /* { SEQ: 'MELTED*', LEN: 7, TYPE: 'PROT' } */ // translate a DNA Sequence object into new Sequence instance of type PROT// with automatic/under the hood transcription() long_oligo; /* { SEQ: 'VDRSES', LEN: 6, TYPE: 'PROT' } */
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.
Lint and test your code using Grunt.
License
Copyright (c) 2013 tripitakit
Licensed under the MIT license.