ajbase.c
Datatypes: none
Base
Sections: character conversion Complement binary conversion query retrieval Doublet names exit
Functions converting binary forms of base codes
Functions: ajBaseAlphaCompare ajBaseAlphaToBin
Returns an element of the base match probability array
Synopsis
Prototype
float ajBaseAlphaCompare (
ajint base,
ajint base2
);
Type | Name | Read/Write | Description |
ajint | base | Input | First base offset |
ajint | base2 | Input | Second base offset |
float | | RETURN | Base 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
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
);
Type | Name | Read/Write | Description |
ajint | base | Input | character to convert |
ajint | | RETURN | Binary 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
Check ambiguity codes (IUB) to estimate the distance score.
Synopsis
Prototype
float ajBaseAlphacharCompare (
char c,
char c2
);
Type | Name | Read/Write | Description |
char | c | Input | First base to compare |
char | c2 | Input | Second base to compare |
float | | RETURN | estimated match |
Input
c: | (Input) | First base to compare |
c2: | (Input) | Second base to compare |
Returns
Description
Check ambiguity codes (IUB) to estimate the distance score.
See Also
See other functions in this section
Availability
In release 6.4.0
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
);
Type | Name | Read/Write | Description |
char | c | Input | character to convert |
char | | RETURN | Binary 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
Functions complementing nucleotide base codes
Functions: ajBaseAlphacharComp
Complements a nucleotide base.
Synopsis
Prototype
char ajBaseAlphacharComp (
char c
);
Type | Name | Read/Write | Description |
char | c | Input | Base character. |
char | | RETURN | Complementary base. |
Input
Returns
Description
Complements a nucleotide base.
See Also
See other functions in this section
Availability
In release 6.4.0
Functions converting binary forms of base codes
Functions: 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
);
Type | Name | Read/Write | Description |
ajint | c | Input | character to convert |
char | | RETURN | Ambiguous 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
Functions
Functions: ajBaseExistsBin ajBaseExistsChar
Tests whether a base code exists
Synopsis
Prototype
AjBool ajBaseExistsBin (
ajint base
);
Type | Name | Read/Write | Description |
ajint | base | Input | Base code in range 0 to 31 |
AjBool | | RETURN | True 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
Tests whether a base code exists
Synopsis
Prototype
AjBool ajBaseExistsChar (
char c
);
Type | Name | Read/Write | Description |
char | c | Input | Base character |
AjBool | | RETURN | True if base code is known |
Input
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
Functions
Functions: ajBaseGetCodes ajBaseGetMnemonic
Returns a string of matching base codes
Synopsis
Prototype
const AjPStr ajBaseGetCodes (
ajint base
);
Type | Name | Read/Write | Description |
ajint | base | Input | Original base code |
const AjPStr | | RETURN | Base codes |
Input
base: | (Input) | Original base code |
Returns
Description
Returns a string of matching base codes
See Also
See other functions in this section
Availability
In release 6.4.0
Returns a string of matching base codes
Synopsis
Prototype
const AjPStr ajBaseGetMnemonic (
ajint base
);
Type | Name | Read/Write | Description |
ajint | base | Input | Original base code |
const AjPStr | | RETURN | Base codes |
Input
base: | (Input) | Original base code |
Returns
Description
Returns a string of matching base codes
See Also
See other functions in this section
Availability
In release 6.4.0
Functions exchanging residue codes with PDB two letter codes
Functions: 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
);
Type | Name | Read/Write | Description |
const AjPStr | nuc2 | Input | AjPStr object (2 letter code) |
char* | Pc | Output | Resulting residue code |
AjBool | | RETURN | True 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
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
Cleans up sequence base and residue processing internal memory
Synopsis
Prototype
void ajBaseExit (
void
);
Type | Name | Read/Write | Description |
void | | RETURN | |
Returns
Description
Cleans up sequence base and residue processing internal memory
See Also
See other functions in this section
Availability
In release 6.4.0
Functions converting binary forms of amino acid residue codes
Functions: 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
);
Type | Name | Read/Write | Description |
ajint | base | Input | character to convert |
ajint | | RETURN | Binary 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
Functions converting binary forms of base codes
Functions: 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
);
Type | Name | Read/Write | Description |
ajint | c | Input | character to convert |
char | | RETURN | Ambiguous 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
Functions
Functions: ajResidueExistsBin ajResidueExistsChar
Tests whether a residue code exists
Synopsis
Prototype
AjBool ajResidueExistsBin (
ajint base
);
Type | Name | Read/Write | Description |
ajint | base | Input | Base code in range 0 to 31 |
AjBool | | RETURN | True 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
Tests whether a residue code exists
Synopsis
Prototype
AjBool ajResidueExistsChar (
char c
);
Type | Name | Read/Write | Description |
char | c | Input | Base character |
AjBool | | RETURN | True if base code is known |
Input
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
Functions
Functions: ajResidueGetCodes ajResidueGetMnemonic
Returns a string of matching amino acid residue codes
Synopsis
Prototype
const AjPStr ajResidueGetCodes (
ajint base
);
Type | Name | Read/Write | Description |
ajint | base | Input | Original base code |
const AjPStr | | RETURN | Base codes |
Input
base: | (Input) | Original base code |
Returns
Description
Returns a string of matching amino acid residue codes
See Also
See other functions in this section
Availability
In release 6.4.0
Returns a string of matching amino acid residue codes
Synopsis
Prototype
const AjPStr ajResidueGetMnemonic (
ajint base
);
Type | Name | Read/Write | Description |
ajint | base | Input | Original base code |
const AjPStr | | RETURN | Base codes |
Input
base: | (Input) | Original base code |
Returns
Description
Returns a string of matching amino acid residue codes
See Also
See other functions in this section
Availability
In release 6.4.0
Functions exchanging residue codes with three letter codes
Functions: ajResidueFromTriplet ajResidueToTriplet
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
);
Type | Name | Read/Write | Description |
const AjPStr | aa3 | Input | AjPStr object (3 letter code) |
char* | Pc | Output | Resulting residue code |
AjBool | | RETURN | True 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
Writes an AjPStr with an amino acid 3 letter code
Synopsis
Prototype
AjBool ajResidueToTriplet (
char c,
AjPStr* Paa3
);
Type | Name | Read/Write | Description |
char | c | Input | Single letter identifier of amino acid |
AjPStr* | Paa3 | Output | AjPStr object |
AjBool | | RETURN | True on success |
Input
c: | (Input) | Single letter identifier of amino acid |
Output
Paa3: | (Output) | AjPStr object |
Returns
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
Functions: ajBasecodeFromInt ajBasecodeToInt
Returns 'A' for 0 to 'Z' for 25
Synopsis
Prototype
ajint ajBasecodeFromInt (
ajint n
);
Type | Name | Read/Write | Description |
ajint | n | Input | character to convert |
ajint | | RETURN | 0 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
Returns A=0 to Z=25 or 27 otherwise
Synopsis
Prototype
ajint ajBasecodeToInt (
ajint c
);
Type | Name | Read/Write | Description |
ajint | c | Input | character to convert |
ajint | | RETURN | A=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