drptranslator
Version:
A DNA-RNA-Protein translator library
60 lines (59 loc) • 2.21 kB
TypeScript
import { RNA } from "./rna";
/**
* A class that represents a codon object
* a codon must have 3 bases to be able to be converted into an aminoacid
* @see https://en.wikipedia.org/wiki/Genetic_code#RNA_codon_table
*/
export declare class Codon {
/**
* Returns a string made with the matches of a @see Codon array
* @static
* @return { string } the string with the codon translation
* @example
* ```JavaScript
* var cod1 = new Codon(RNA.A,RNA.U,RNA.G);
* var cod2 = new Codon(RNA.U,RNA.G,RNA.A);
* var arr = [cod1,cod2];
* var aaSeq = Codon.getCodonChain(arr);
* console.log(aaSeq); // Met-STOP
* ```
* @throws {TypeError}
*/
static getCodonChain(codons: Codon[]): string;
/**
* Matches a [[Codon]] object with a string that represents
* the matching AminoAcid based on the Central Dogma of Molecular Biology
* @see https://en.wikipedia.org/wiki/Genetic_code#RNA_codon_table
* @static
* @return {string | undefined}
* ```JavaScript
* var cod = new Codon(RNA.A,RNA.U,RNA.G);
* console.log(Codon.matchCodon(cod)); // Met
* ```
*/
static matchCodon(codon: Codon): string | undefined;
fp: RNA | "A" | "U" | "C" | "G";
sp: RNA | "A" | "U" | "C" | "G";
tp: RNA | "A" | "U" | "C" | "G";
/**
* Codon constructor can optionaly accept it's RNA bases.
*
* @param fp First base of the codon
* @param sp Second base of the codon
* @param tp Third base of the codon
* ```JavaScript
* var cod = new Codon(RNA.A, RNA.U, RNA.G);
* // OR
* var cod = new Codon();
* ```
*/
constructor(fp?: RNA | "A" | "U" | "C" | "G", sp?: RNA | "A" | "U" | "C" | "G", tp?: RNA | "A" | "U" | "C" | "G");
/**
* Sets a new codon with the suplemented parameters
* @param {RNA | "A" | "U" | "C"| "G"} fp Base
* @param {RNA | "A" | "U" | "C"| "G"} sp Base
* @param {RNA | "A" | "U" | "C"| "G"} tp Base
*/
setCodon(fp: RNA | "A" | "U" | "C" | "G", sp: RNA | "A" | "U" | "C" | "G", tp: RNA | "A" | "U" | "C" | "G"): void;
toString(): string;
}