Antkeeper  0.0.1
Classes | Functions
genetics::codon Namespace Reference

Functions and structures related to triplets of IUPAC base symbols. More...

Classes

struct  table
 Table for translating codons to amino acids. More...
 

Functions

char translate (char base1, char base2, char base3, const char *aas)
 Translates a codon into an amino acid. More...
 
bool is_start (char base1, char base2, char base3, const char *starts)
 Returns true if a codon is a start codon. More...
 
bool is_stop (char base1, char base2, char base3, const char *aas)
 Returns true if a codon is a stop codon. More...
 

Detailed Description

Functions and structures related to triplets of IUPAC base symbols.

Function Documentation

◆ is_start()

bool genetics::codon::is_start ( char  base1,
char  base2,
char  base3,
const char *  starts 
)

Returns true if a codon is a start codon.

Parameters
base1IUPAC base code of first nucleobase, either U, T, C, A, or G.
base2IUPAC base code of second nucleobase, either U, T, C, A, or G.
base3IUPAC base code of third nucleobase, either U, T, C, A, or G.
startsString of 64 IUPAC amino acid codes, in TCAG order.
Returns
true if the codon is a start codon, false otherwise.

Definition at line 73 of file codon.cpp.

◆ is_stop()

bool genetics::codon::is_stop ( char  base1,
char  base2,
char  base3,
const char *  aas 
)

Returns true if a codon is a stop codon.

Parameters
base1IUPAC base code of first nucleobase, either U, T, C, A, or G.
base2IUPAC base code of second nucleobase, either U, T, C, A, or G.
base3IUPAC base code of third nucleobase, either U, T, C, A, or G.
aasString of 64 IUPAC amino acid codes, in TCAG order.
Returns
true if the codon is a stop codon, false otherwise.

Definition at line 79 of file codon.cpp.

◆ translate()

char genetics::codon::translate ( char  base1,
char  base2,
char  base3,
const char *  aas 
)
inline

Translates a codon into an amino acid.

Parameters
base1IUPAC base code of first nucleobase, either U, T, C, A, or G.
base2IUPAC base code of second nucleobase, either U, T, C, A, or G.
base3IUPAC base code of third nucleobase, either U, T, C, A, or G.
aasString of 64 IUPAC amino acid codes, in TCAG order.
Returns
IUPAC amino acid code of corresponding amino acid, or - if an invalid codon was supplied.

Definition at line 65 of file codon.cpp.