ajbase.c

Datatypes: none


Datatype: none

Base

Sections: character conversion Complement binary conversion query retrieval Doublet names exit


Section: character conversion

Functions converting binary forms of base codes

Functions: ajBaseAlphaCompare ajBaseAlphaToBin


Function ajBaseAlphaCompare

Returns an element of the base match probability array

Synopsis

Prototype
float ajBaseAlphaCompare (
      ajint base,
      ajint base2
);

TypeNameRead/WriteDescription
ajintbaseInputFirst base offset
ajintbase2InputSecond base offset
float RETURNBase probability value

Input
base:(Input)First base offset
base2:(Input)Second base offset
Returns
float:Base probability value

Description

Returns an element of the base match probability array

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBaseAlphaToBin

Returns a binary OR'd representation of an IUB base where A=1, C=2, G=4 and T=8 Uses the base table set up by daseInit

Synopsis

Prototype
ajint ajBaseAlphaToBin (
      ajint base
);

TypeNameRead/WriteDescription
ajintbaseInputcharacter to convert
ajint RETURNBinary OR'd representation

Input
base:(Input)character to convert
Returns
ajint:Binary OR'd representation

Description

Returns a binary OR'd representation of an IUB base where A=1, C=2, G=4 and T=8 Uses the base table set up by daseInit

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBaseAlphacharCompare

Check ambiguity codes (IUB) to estimate the distance score.

Synopsis

Prototype
float ajBaseAlphacharCompare (
      char c,
      char c2
);

TypeNameRead/WriteDescription
charcInputFirst base to compare
charc2InputSecond base to compare
float RETURNestimated match

Input
c:(Input)First base to compare
c2:(Input)Second base to compare
Returns
float:estimated match

Description

Check ambiguity codes (IUB) to estimate the distance score.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBaseAlphacharToBin

Returns a binary OR'd representation of an IUB base where A=1, C=2, G=4 and T=8 Uses the base table set up by baseInit

Synopsis

Prototype
char ajBaseAlphacharToBin (
      char c
);

TypeNameRead/WriteDescription
charcInputcharacter to convert
char RETURNBinary OR'd representation

Input
c:(Input)character to convert
Returns
char:Binary OR'd representation

Description

Returns a binary OR'd representation of an IUB base where A=1, C=2, G=4 and T=8 Uses the base table set up by baseInit

See Also

See other functions in this section

Availability

In release 6.4.0

Section: Complement

Functions complementing nucleotide base codes

Functions: ajBaseAlphacharComp


Function ajBaseAlphacharComp

Complements a nucleotide base.

Synopsis

Prototype
char ajBaseAlphacharComp (
      char c
);

TypeNameRead/WriteDescription
charcInputBase character.
char RETURNComplementary base.

Input
c:(Input)Base character.
Returns
char:Complementary base.

Description

Complements a nucleotide base.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: binary conversion

Functions converting binary forms of base codes

Functions: ajBaseBinToAlpha


Function ajBaseBinToAlpha

Converts a binary OR'd representation of an IUB base where A=1, C=2, G=4 and T=8 into an ambiguous DNA base code (uses T rather than U).

Uses the base table set up by baseInit

Synopsis

Prototype
char ajBaseBinToAlpha (
      ajint c
);

TypeNameRead/WriteDescription
ajintcInputcharacter to convert
char RETURNAmbiguous DNA base code

Input
c:(Input)character to convert
Returns
char:Ambiguous DNA base code

Description

Converts a binary OR'd representation of an IUB base where A=1, C=2, G=4 and T=8 into an ambiguous DNA base code (uses T rather than U).

Uses the base table set up by baseInit

See Also

See other functions in this section

Availability

In release 6.4.0

Section: query

Functions

Functions: ajBaseExistsBin ajBaseExistsChar


Function ajBaseExistsBin

Tests whether a base code exists

Synopsis

Prototype
AjBool ajBaseExistsBin (
      ajint base
);

TypeNameRead/WriteDescription
ajintbaseInputBase code in range 0 to 31
AjBool RETURNTrue if base code is known

Input
base:(Input)Base code in range 0 to 31
Returns
AjBool:True if base code is known

Description

Tests whether a base code exists

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBaseExistsChar

Tests whether a base code exists

Synopsis

Prototype
AjBool ajBaseExistsChar (
      char c
);

TypeNameRead/WriteDescription
charcInputBase character
AjBool RETURNTrue if base code is known

Input
c:(Input)Base character
Returns
AjBool:True if base code is known

Description

Tests whether a base code exists

See Also

See other functions in this section

Availability

In release 6.4.0

Section: retrieval

Functions

Functions: ajBaseGetCodes ajBaseGetMnemonic


Function ajBaseGetCodes

Returns a string of matching base codes

Synopsis

Prototype
const AjPStr ajBaseGetCodes (
      ajint base
);

TypeNameRead/WriteDescription
ajintbaseInputOriginal base code
const AjPStr RETURNBase codes

Input
base:(Input)Original base code
Returns
const AjPStr:Base codes

Description

Returns a string of matching base codes

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBaseGetMnemonic

Returns a string of matching base codes

Synopsis

Prototype
const AjPStr ajBaseGetMnemonic (
      ajint base
);

TypeNameRead/WriteDescription
ajintbaseInputOriginal base code
const AjPStr RETURNBase codes

Input
base:(Input)Original base code
Returns
const AjPStr:Base codes

Description

Returns a string of matching base codes

See Also

See other functions in this section

Availability

In release 6.4.0

Section: Doublet names

Functions exchanging residue codes with PDB two letter codes

Functions: ajBaseFromDoublet


Function ajBaseFromDoublet

Takes a 2 character PDB base code and writes a char with the corresponding single letter code.

Synopsis

Prototype
AjBool ajBaseFromDoublet (
      const AjPStr nuc2,
      char* Pc
);

TypeNameRead/WriteDescription
const AjPStrnuc2InputAjPStr object (2 letter code)
char*PcOutputResulting residue code
AjBool RETURNTrue on success, false if doublet is not recognised

Input
nuc2:(Input)AjPStr object (2 letter code)
Output
Pc:(Output)Resulting residue code
Returns
AjBool:True on success, false if doublet is not recognised

Description

Takes a 2 character PDB base code and writes a char with the corresponding single letter code.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: exit

Functions called on exit from the program by ajExit to do any necessary cleanup and to report internal statistics to the debug file

Functions: ajBaseExit


Function ajBaseExit

Cleans up sequence base and residue processing internal memory

Synopsis

Prototype
void ajBaseExit (
      void
);

TypeNameRead/WriteDescription
void RETURN

Returns
void:No return value

Description

Cleans up sequence base and residue processing internal memory

See Also

See other functions in this section

Availability

In release 6.4.0

Section: character conversion

Functions converting binary forms of amino acid residue codes

Functions: ajResidueAlphaToBin


Function ajResidueAlphaToBin

Returns a binary OR'd representation of an IUB residue where A=1, C=2, Uses the base table set up by residueInit

Synopsis

Prototype
ajint ajResidueAlphaToBin (
      ajint base
);

TypeNameRead/WriteDescription
ajintbaseInputcharacter to convert
ajint RETURNBinary OR'd representation

Input
base:(Input)character to convert
Returns
ajint:Binary OR'd representation

Description

Returns a binary OR'd representation of an IUB residue where A=1, C=2, Uses the base table set up by residueInit

See Also

See other functions in this section

Availability

In release 6.4.0

Section: binary conversion

Functions converting binary forms of base codes

Functions: ajResidueBinToAlpha


Function ajResidueBinToAlpha

Converts a binary OR'd representation of an IUB residue where A=1, C=2, etc into an ambiguous protein code

Uses the base table set up by residueInit

Synopsis

Prototype
char ajResidueBinToAlpha (
      ajint c
);

TypeNameRead/WriteDescription
ajintcInputcharacter to convert
char RETURNAmbiguous residue code

Input
c:(Input)character to convert
Returns
char:Ambiguous residue code

Description

Converts a binary OR'd representation of an IUB residue where A=1, C=2, etc into an ambiguous protein code

Uses the base table set up by residueInit

See Also

See other functions in this section

Availability

In release 6.4.0

Section: query

Functions

Functions: ajResidueExistsBin ajResidueExistsChar


Function ajResidueExistsBin

Tests whether a residue code exists

Synopsis

Prototype
AjBool ajResidueExistsBin (
      ajint base
);

TypeNameRead/WriteDescription
ajintbaseInputBase code in range 0 to 31
AjBool RETURNTrue if base code is known

Input
base:(Input)Base code in range 0 to 31
Returns
AjBool:True if base code is known

Description

Tests whether a residue code exists

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajResidueExistsChar

Tests whether a residue code exists

Synopsis

Prototype
AjBool ajResidueExistsChar (
      char c
);

TypeNameRead/WriteDescription
charcInputBase character
AjBool RETURNTrue if base code is known

Input
c:(Input)Base character
Returns
AjBool:True if base code is known

Description

Tests whether a residue code exists

See Also

See other functions in this section

Availability

In release 6.4.0

Section: retrieval

Functions

Functions: ajResidueGetCodes ajResidueGetMnemonic


Function ajResidueGetCodes

Returns a string of matching amino acid residue codes

Synopsis

Prototype
const AjPStr ajResidueGetCodes (
      ajint base
);

TypeNameRead/WriteDescription
ajintbaseInputOriginal base code
const AjPStr RETURNBase codes

Input
base:(Input)Original base code
Returns
const AjPStr:Base codes

Description

Returns a string of matching amino acid residue codes

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajResidueGetMnemonic

Returns a string of matching amino acid residue codes

Synopsis

Prototype
const AjPStr ajResidueGetMnemonic (
      ajint base
);

TypeNameRead/WriteDescription
ajintbaseInputOriginal base code
const AjPStr RETURNBase codes

Input
base:(Input)Original base code
Returns
const AjPStr:Base codes

Description

Returns a string of matching amino acid residue codes

See Also

See other functions in this section

Availability

In release 6.4.0

Section: Triplet names

Functions exchanging residue codes with three letter codes

Functions: ajResidueFromTriplet ajResidueToTriplet


Function ajResidueFromTriplet

Takes a 3 character amino acid code and writes a char with the corresponding single letter code.

Synopsis

Prototype
AjBool ajResidueFromTriplet (
      const AjPStr aa3,
      char* Pc
);

TypeNameRead/WriteDescription
const AjPStraa3InputAjPStr object (3 letter code)
char*PcOutputResulting residue code
AjBool RETURNTrue on success, false if triplet is not recognised

Input
aa3:(Input)AjPStr object (3 letter code)
Output
Pc:(Output)Resulting residue code
Returns
AjBool:True on success, false if triplet is not recognised

Description

Takes a 3 character amino acid code and writes a char with the corresponding single letter code.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajResidueToTriplet

Writes an AjPStr with an amino acid 3 letter code

Synopsis

Prototype
AjBool ajResidueToTriplet (
      char c,
      AjPStr* Paa3
);

TypeNameRead/WriteDescription
charcInputSingle letter identifier of amino acid
AjPStr*Paa3OutputAjPStr object
AjBool RETURNTrue on success

Input
c:(Input)Single letter identifier of amino acid
Output
Paa3:(Output)AjPStr object
Returns
AjBool:True on success

Description

Writes an AjPStr with an amino acid 3 letter code

See Also

See other functions in this section

Availability

In release 6.4.0

Section: Conversion

Functions: ajBasecodeFromInt ajBasecodeToInt


Function ajBasecodeFromInt

Returns 'A' for 0 to 'Z' for 25

Synopsis

Prototype
ajint ajBasecodeFromInt (
      ajint n
);

TypeNameRead/WriteDescription
ajintnInputcharacter to convert
ajint RETURN0 as 'A' up to 25 as 'Z'

Input
n:(Input)character to convert
Returns
ajint:0 as 'A' up to 25 as 'Z'

Description

Returns 'A' for 0 to 'Z' for 25

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBasecodeToInt

Returns A=0 to Z=25 or 27 otherwise

Synopsis

Prototype
ajint ajBasecodeToInt (
      ajint c
);

TypeNameRead/WriteDescription
ajintcInputcharacter to convert
ajint RETURNA=0 to Z=25 or 27 if unknown

Input
c:(Input)character to convert
Returns
ajint:A=0 to Z=25 or 27 if unknown

Description

Returns A=0 to Z=25 or 27 otherwise

See Also

See other functions in this section

Availability

In release 6.4.0