ajcod.c


Section: Codon Constructors

All constructors return a new object by pointer. It is the responsibility of the user to first destroy any previous object. The target pointer does not need to be initialised to NULL, but it is good programming practice to do so anyway.

Functions:
ajCodNewDefault constructor for empty AJAX codon objects.
ajCodNewCodenumDefault constructor for empty AJAX codon usage objects, with the amino acid assignments taken from a standard genetic code.
ajCodNewCodDuplicate a codon object


Function ajCodNew

Default constructor for empty AJAX codon objects.

Prototype

AjPCod ajCodNew (
      void
);

TypeNameRead/WriteDescription
AjPCod RETURNPointer to an codon object

From EMBOSS 1.0.0


Function ajCodNewCodenum

Default constructor for empty AJAX codon usage objects, with the amino acid assignments taken from a standard genetic code.

Prototype

AjPCod ajCodNewCodenum (
      ajint code
);

TypeNameRead/WriteDescription
ajintcodeInputGenetic code number
AjPCod RETURNPointer to an codon object

From EMBOSS 6.2.0


Function ajCodNewCod

Duplicate a codon object

Prototype

AjPCod ajCodNewCod (
      const AjPCod thys
);

TypeNameRead/WriteDescription
const AjPCodthysInputCodon to duplicate
AjPCod RETURNPointer to an codon object

From EMBOSS 6.2.0


Section: Codon Destructors

Destructor(s) for AjPCod objects

Functions:
ajCodDelDefault destructor for AJAX codon objects.


Function ajCodDel

Default destructor for AJAX codon objects.

Prototype

void ajCodDel (
      AjPCod* pthys
);

TypeNameRead/WriteDescription
AjPCod*pthysOutputcodon usage structure
void RETURN

From EMBOSS 1.0.0


Section: Codon Functions

Function(s) for AjPCod objects

Functions:
ajCodBacktranslateBack translate a string
ajCodBacktranslateAmbigBack translate a string to a fully ambiguous nucleotide sequence as a string
ajCodBaseReturn one codon value given a possibly ambiguous base
ajCodClearZero all entries
ajCodClearDataZero the name, number count and fraction codon entries
ajCodSetTripletsSLoad the num array of a codon structure
ajCodIndexReturn a codon index given a three character codon
ajCodIndexCReturn a codon index given a three character codon
ajCodReadRead a codon index from a filename using a specified format.
ajCodSetBacktranslateFill the codon usage object "back" element with the most commonly used triplet index for the amino acids
ajCodTripletConvert triplet index to triple
ajCodWriteOutWrite codon structure to output file
ajCodWriteWrite codon structure to output file
ajCodCompCalculate sequence composition
ajCodCalcCaiCodCalculate codon adaptive index using overall codon usage data only.
ajCodCalcCaiSeqCalculate codon adaptive index for a coding sequence
ajCodCalcGribskovCalculate Gribskov statistic (count per thousand) in AjPCod internals
ajCodCalcNcCalculate effective number of codons Wright, F. (1990) Gene 87:23-29
ajCodCalcUsageCalculate fractional and thousand elements of a codon object Used for creating a codon usage table
ajCodGetNameReturns the name of a codon table
ajCodGetNameCReturns the name of a codon table
ajCodGetDescReturns the description of a codon table
ajCodGetDescCReturns the description of a codon table
ajCodGetSpeciesReturns the species of a codon table
ajCodGetSpeciesCReturns the species of a codon table
ajCodGetDivisionReturns the division of a codon table
ajCodGetDivisionCReturns the division of a codon table
ajCodGetReleaseReturns the release of a codon table
ajCodGetReleaseCReturns the release of a codon table
ajCodGetNumcodonReturns the number of codons in a codon table
ajCodGetNumcdsReturns the numbers of CDSs in a codon table
ajCodGetCodeReturns the genetic code of a codon table
ajCodSetCodenumAssigns the genetic code in a codon table
ajCodSetDescCAssigns the description of a codon table
ajCodSetDescSAssigns the description of a codon table
ajCodSetDivisionCAssigns the division of a codon table
ajCodSetDivisionSAssigns the division of a codon table
ajCodSetNameCAssigns the name of a codon table
ajCodSetNameSAssigns the name of a codon table
ajCodSetNumcdsAssigns the number of CDSs in a codon table
ajCodSetNumcodonsAssigns the number of codons in a codon table
ajCodSetReleaseCAssigns the of a codon table
ajCodSetReleaseSAssigns the release of a codon table
ajCodSetSpeciesCAssigns the species of a codon table
ajCodSetSpeciesSAssigns the species of a codon table
ajCodoutformatFindTests the output format for an outcodon ACD type
ajCodPrintFormatReports the internal data structures
ajCodGetCodonlistWrites codon triplets to a string list
ajCodExitCleans up codon usage processing internal memory


Function ajCodBacktranslate

Back translate a string

Prototype

void ajCodBacktranslate (
      AjPStr* b,
      const AjPStr a,
      const AjPCod thys
);

TypeNameRead/WriteDescription
AjPStr*bOutputback translated sequence
const AjPStraInputsequence
const AjPCodthysInputcodon usage object
void RETURN

From EMBOSS 1.0.0


Function ajCodBacktranslateAmbig

Back translate a string to a fully ambiguous nucleotide sequence as a string

Prototype

void ajCodBacktranslateAmbig (
      AjPStr* b,
      const AjPStr a,
      const AjPCod thys
);

TypeNameRead/WriteDescription
AjPStr*bOutputback translated sequence
const AjPStraInputsequence
const AjPCodthysInputcodon usage object
void RETURN

From EMBOSS 4.0.0


Function ajCodBase

Return one codon value given a possibly ambiguous base

Prototype

ajint ajCodBase (
      ajint c
);
ajintcInputbase ajint RETURNsingle base value

From EMBOSS 1.0.0


Function ajCodClear

Zero all entries

Prototype

void ajCodClear (
      AjPCod thys
);

TypeNameRead/WriteDescription
AjPCodthysOutputcodon usage structure
void RETURN

From EMBOSS 1.0.0


Function ajCodClearData

Zero the name, number count and fraction codon entries

Prototype

void ajCodClearData (
      AjPCod thys
);

TypeNameRead/WriteDescription
AjPCodthysOutputcodon usage structure
void RETURN

From EMBOSS 3.0.0


Function ajCodSetTripletsS

Load the num array of a codon structure

Prototype

void ajCodSetTripletsS (
      AjPCod thys,
      const AjPStr s,
      ajint* c
);

TypeNameRead/WriteDescription
AjPCodthysOutputCodon object
const AjPStrsInputdna sequence
ajint*cOutputtriplet count
void RETURN

From EMBOSS 6.2.0


Function ajCodIndex

Return a codon index given a three character codon

Prototype

ajint ajCodIndex (
      const AjPStr s
);

TypeNameRead/WriteDescription
const AjPStrsInputCodon
ajint RETURNCodon index AAA=0 TTT=3f

From EMBOSS 1.0.0


Function ajCodIndexC

Return a codon index given a three character codon

Prototype

ajint ajCodIndexC (
      const char* codon
);

TypeNameRead/WriteDescription
const char*codonInputCodon pointer
ajint RETURNcodon index AAA=0 TTT=3f

From EMBOSS 1.0.0


Function ajCodRead

Read a codon index from a filename using a specified format.

Prototype

AjBool ajCodRead (
      AjPCod thys,
      const AjPStr fn,
      const AjPStr format
);

TypeNameRead/WriteDescription
AjPCodthysOutputCodon object
const AjPStrfnInputfilename
const AjPStrformatInputformat
AjBool RETURNajTrue on success

From EMBOSS 1.0.0


Function ajCodSetBacktranslate

Fill the codon usage object "back" element with the most commonly used triplet index for the amino acids

Prototype

void ajCodSetBacktranslate (
      AjPCod thys
);

TypeNameRead/WriteDescription
AjPCodthysModifycodon usage structure
void RETURN

From EMBOSS 1.0.0


Function ajCodTriplet

Convert triplet index to triple

Prototype

char* ajCodTriplet (
      ajint idx
);

TypeNameRead/WriteDescription
ajintidxInputtriplet index
char* RETURNTriplet

From EMBOSS 1.0.0


Function ajCodWriteOut

Write codon structure to output file

Prototype

void ajCodWriteOut (
      const AjPCod thys,
      AjPOutfile outf
);

TypeNameRead/WriteDescription
const AjPCodthysInputcodon usage
AjPOutfileoutfModifyoutput file
void RETURN

From EMBOSS 3.0.0


Function ajCodWrite

Write codon structure to output file

Prototype

void ajCodWrite (
      AjPCod thys,
      AjPFile outf
);

TypeNameRead/WriteDescription
AjPCodthysModifycodon usage
AjPFileoutfModifyoutput file
void RETURN

From EMBOSS 1.0.0


Function ajCodComp

Calculate sequence composition

Prototype

void ajCodComp (
      ajint* NA,
      ajint* NC,
      ajint* NG,
      ajint* NT,
      const char* str
);

TypeNameRead/WriteDescription
ajint*NAOutputnumber of A's
ajint*NCOutputnumber of C's
ajint*NGOutputnumber of G's
ajint*NTOutputnumber of T'
const char*strInputsequence
void RETURN

From EMBOSS 1.0.0


Function ajCodCalcCaiCod

Calculate codon adaptive index using overall codon usage data only.

Prototype

double ajCodCalcCaiCod (
      const AjPCod thys
);

TypeNameRead/WriteDescription
const AjPCodthysInputcodon usage
double RETURNCAI

From EMBOSS 6.2.0


Function ajCodCalcCaiSeq

Calculate codon adaptive index for a coding sequence

Prototype

double ajCodCalcCaiSeq (
      const AjPCod thys,
      const AjPStr str
);

TypeNameRead/WriteDescription
const AjPCodthysInputcodon usage
const AjPStrstrInputsequence
double RETURNCAI

From EMBOSS 6.2.0


Function ajCodCalcGribskov

Calculate Gribskov statistic (count per thousand) in AjPCod internals

Prototype

void ajCodCalcGribskov (
      AjPCod thys,
      const AjPStr s
);

TypeNameRead/WriteDescription
AjPCodthysModifycodon usage for sequence
const AjPStrsInputsequence
void RETURN

From EMBOSS 1.0.0


Function ajCodCalcNc

Calculate effective number of codons Wright, F. (1990) Gene 87:23-29

Prototype

double ajCodCalcNc (
      const AjPCod thys
);

TypeNameRead/WriteDescription
const AjPCodthysInputcodon usage
double RETURNNc

From EMBOSS 1.0.0


Function ajCodCalcUsage

Calculate fractional and thousand elements of a codon object Used for creating a codon usage table

Prototype

void ajCodCalcUsage (
      AjPCod thys,
      ajint c
);

TypeNameRead/WriteDescription
AjPCodthysModifyCodon object
ajintcInputtriplet count
void RETURN

From EMBOSS 6.2.0


Function ajCodGetName

Returns the name of a codon table

Prototype

const AjPStr ajCodGetName (
      const AjPCod thys
);

TypeNameRead/WriteDescription
const AjPCodthysInputCodon usage object
const AjPStr RETURNOriginal filename

From EMBOSS 2.9.0


Function ajCodGetNameC

Returns the name of a codon table

Prototype

const char* ajCodGetNameC (
      const AjPCod thys
);

TypeNameRead/WriteDescription
const AjPCodthysInputCodon usage object
const char* RETURNOriginal filename

From EMBOSS 2.9.0


Function ajCodGetDesc

Returns the description of a codon table

Prototype

const AjPStr ajCodGetDesc (
      const AjPCod thys
);

TypeNameRead/WriteDescription
const AjPCodthysInputCodon usage object
const AjPStr RETURNOriginal filename

From EMBOSS 2.9.0


Function ajCodGetDescC

Returns the description of a codon table

Prototype

const char* ajCodGetDescC (
      const AjPCod thys
);

TypeNameRead/WriteDescription
const AjPCodthysInputCodon usage object
const char* RETURNOriginal filename

From EMBOSS 2.9.0


Function ajCodGetSpecies

Returns the species of a codon table

Prototype

const AjPStr ajCodGetSpecies (
      const AjPCod thys
);

TypeNameRead/WriteDescription
const AjPCodthysInputCodon usage object
const AjPStr RETURNSpecies

From EMBOSS 3.0.0


Function ajCodGetSpeciesC

Returns the species of a codon table

Prototype

const char* ajCodGetSpeciesC (
      const AjPCod thys
);

TypeNameRead/WriteDescription
const AjPCodthysInputCodon usage object
const char* RETURNSpecies

From EMBOSS 3.0.0


Function ajCodGetDivision

Returns the division of a codon table

Prototype

const AjPStr ajCodGetDivision (
      const AjPCod thys
);

TypeNameRead/WriteDescription
const AjPCodthysInputCodon usage object
const AjPStr RETURNDivision

From EMBOSS 3.0.0


Function ajCodGetDivisionC

Returns the division of a codon table

Prototype

const char* ajCodGetDivisionC (
      const AjPCod thys
);

TypeNameRead/WriteDescription
const AjPCodthysInputCodon usage object
const char* RETURNDivision

From EMBOSS 3.0.0


Function ajCodGetRelease

Returns the release of a codon table

Prototype

const AjPStr ajCodGetRelease (
      const AjPCod thys
);

TypeNameRead/WriteDescription
const AjPCodthysInputCodon usage object
const AjPStr RETURNRelease

From EMBOSS 3.0.0


Function ajCodGetReleaseC

Returns the release of a codon table

Prototype

const char* ajCodGetReleaseC (
      const AjPCod thys
);

TypeNameRead/WriteDescription
const AjPCodthysInputCodon usage object
const char* RETURNRelease

From EMBOSS 3.0.0


Function ajCodGetNumcodon

Returns the number of codons in a codon table

Prototype

ajint ajCodGetNumcodon (
      const AjPCod thys
);

TypeNameRead/WriteDescription
const AjPCodthysInputCodon usage object
ajint RETURNNumber of codons

From EMBOSS 3.0.0


Function ajCodGetNumcds

Returns the numbers of CDSs in a codon table

Prototype

ajint ajCodGetNumcds (
      const AjPCod thys
);

TypeNameRead/WriteDescription
const AjPCodthysInputCodon usage object
ajint RETURNNumber of CDSs

From EMBOSS 3.0.0


Function ajCodGetCode

Returns the genetic code of a codon table

Prototype

ajint ajCodGetCode (
      const AjPCod thys
);

TypeNameRead/WriteDescription
const AjPCodthysInputCodon usage object
ajint RETURNNumber of CDSs

From EMBOSS 3.0.0


Function ajCodSetCodenum

Assigns the genetic code in a codon table

Prototype

void ajCodSetCodenum (
      AjPCod thys,
      ajint geneticcode
);

TypeNameRead/WriteDescription
AjPCodthysModifyCodon usage object
ajintgeneticcodeInputGenetic code
void RETURN

From EMBOSS 6.2.0


Function ajCodSetDescC

Assigns the description of a codon table

Prototype

void ajCodSetDescC (
      AjPCod thys,
      const char* desc
);

TypeNameRead/WriteDescription
AjPCodthysModifyCodon usage object
const char*descInputDescription
void RETURN

From EMBOSS 6.2.0


Function ajCodSetDescS

Assigns the description of a codon table

Prototype

void ajCodSetDescS (
      AjPCod thys,
      const AjPStr desc
);

TypeNameRead/WriteDescription
AjPCodthysModifyCodon usage object
const AjPStrdescInputDescription
void RETURN

From EMBOSS 6.2.0


Function ajCodSetDivisionC

Assigns the division of a codon table

Prototype

void ajCodSetDivisionC (
      AjPCod thys,
      const char* division
);

TypeNameRead/WriteDescription
AjPCodthysModifyCodon usage object
const char*divisionInputDivision
void RETURN

From EMBOSS 6.2.0


Function ajCodSetDivisionS

Assigns the division of a codon table

Prototype

void ajCodSetDivisionS (
      AjPCod thys,
      const AjPStr division
);

TypeNameRead/WriteDescription
AjPCodthysModifyCodon usage object
const AjPStrdivisionInputDivision
void RETURN

From EMBOSS 6.2.0


Function ajCodSetNameC

Assigns the name of a codon table

Prototype

void ajCodSetNameC (
      AjPCod thys,
      const char* name
);

TypeNameRead/WriteDescription
AjPCodthysModifyCodon usage object
const char*nameInputName
void RETURN

From EMBOSS 6.2.0


Function ajCodSetNameS

Assigns the name of a codon table

Prototype

void ajCodSetNameS (
      AjPCod thys,
      const AjPStr name
);

TypeNameRead/WriteDescription
AjPCodthysModifyCodon usage object
const AjPStrnameInputName
void RETURN

From EMBOSS 6.2.0


Function ajCodSetNumcds

Assigns the number of CDSs in a codon table

Prototype

void ajCodSetNumcds (
      AjPCod thys,
      ajint numcds
);

TypeNameRead/WriteDescription
AjPCodthysModifyCodon usage object
ajintnumcdsInputNumber of codons
void RETURN

From EMBOSS 6.2.0


Function ajCodSetNumcodons

Assigns the number of codons in a codon table

Prototype

void ajCodSetNumcodons (
      AjPCod thys,
      ajint numcodon
);

TypeNameRead/WriteDescription
AjPCodthysModifyCodon usage object
ajintnumcodonInputNumber of codons
void RETURN

From EMBOSS 6.2.0


Function ajCodSetReleaseC

Assigns the of a codon table

Prototype

void ajCodSetReleaseC (
      AjPCod thys,
      const char* release
);

TypeNameRead/WriteDescription
AjPCodthysModifyCodon usage object
const char*releaseInputRelease
void RETURN

From EMBOSS 6.2.0


Function ajCodSetReleaseS

Assigns the release of a codon table

Prototype

void ajCodSetReleaseS (
      AjPCod thys,
      const AjPStr release
);

TypeNameRead/WriteDescription
AjPCodthysModifyCodon usage object
const AjPStrreleaseInputRelease
void RETURN

From EMBOSS 6.2.0


Function ajCodSetSpeciesC

Assigns the species of a codon table

Prototype

void ajCodSetSpeciesC (
      AjPCod thys,
      const char* species
);

TypeNameRead/WriteDescription
AjPCodthysModifyCodon usage object
const char*speciesInputSpecies
void RETURN

From EMBOSS 6.2.0


Function ajCodSetSpeciesS

Assigns the species of a codon table

Prototype

void ajCodSetSpeciesS (
      AjPCod thys,
      const AjPStr species
);

TypeNameRead/WriteDescription
AjPCodthysModifyCodon usage object
const AjPStrspeciesInputSpecies
void RETURN

From EMBOSS 6.2.0


Function ajCodoutformatFind

Tests the output format for an outcodon ACD type

Prototype

AjBool ajCodoutformatFind (
      const AjPStr name,
      ajint* iformat
);

TypeNameRead/WriteDescription
const AjPStrnameInputFormat name
ajint*iformatOutputInternal format index
AjBool RETURNTrue on success

From EMBOSS 6.4.0


Function ajCodPrintFormat

Reports the internal data structures

Prototype

void ajCodPrintFormat (
      AjPFile outf,
      AjBool full
);

TypeNameRead/WriteDescription
AjPFileoutfModifyOutput file
AjBoolfullInputFull report, currently no extra details printed
void RETURN

From EMBOSS 3.0.0


Function ajCodGetCodonlist

Writes codon triplets to a string list

Prototype

void ajCodGetCodonlist (
      const AjPCod cod,
      AjPList list
);

TypeNameRead/WriteDescription
const AjPCodcodInputCusp file
AjPListlistOutputList with character distributions
void RETURN

From EMBOSS 4.0.0


Function ajCodExit

Cleans up codon usage processing internal memory

Prototype

void ajCodExit (
      void
);

TypeNameRead/WriteDescription
void RETURN

From EMBOSS 4.0.0