Class: CodonTables

CodonTables

Holder for CodonTables. This class will be populated with each CodonTable as it's required.

Examples:

// Initially this class will have no
const codonTables = new CodonTables();
codonTables.tables;
// => {}

Tables are accessed via byID
codonTables.byID(1)
// => CodonTable {name: 'Standard', ...}

// This will also add the table to tables:
codonTables.tables;
// => { 1: {name: 'Standard', ...} }

new CodonTables()

Create an empty container to lazy load codon tables as needed

Members

tables

Return the current tables

Methods

Return the table for provided code

Name Type Description
id Number | String

ID of the Codon Table (e.g. 1, '1')

Returns object with table codes as the keys and the values as the table names

codonTables.names()
// => {1: 'Standard', 2: 'Vertebrate Mitochondrial', ...}

translate(seq, geneticCodeID, startCodon)

Translate a sequence

Name Type Default Description
seq String

The sequence to translate

geneticCodeID Number

The genetic code ID (e.g. 1)

startCodon Number 1

Position (bp) of the first codon