ajmatrices.c


Function ajMatrixNew

Creates a new, zero matrix from an array of strings and a matrix name. If the matrix is a residue substitution matrix then each string would be a defined sequence character.

The matrix comparison value table Matrix is created and initialised with zeroes.

Synopsis

Prototype
AjPMatrix ajMatrixNew (
      const AjPPStr codes,
      ajint n,
      const AjPStr filename
);

TypeNameRead/WriteDescription
const AjPPStrcodesInputMatrix labels, e.g. valid sequence character codes
ajintnInputNumber of labels
const AjPStrfilenameInputMatrix filename
AjPMatrix RETURNNew matrix, or NULL if codes, n or filename are 0.

Input
codes:(Input)Matrix labels, e.g. valid sequence character codes
n:(Input)Number of labels
filename:(Input)Matrix filename
Returns
AjPMatrix:New matrix, or NULL if codes, n or filename are 0.

Description

Creates a new, zero matrix from an array of strings and a matrix name. If the matrix is a residue substitution matrix then each string would be a defined sequence character.

The matrix comparison value table Matrix is created and initialised with zeroes.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixNewAsym

Creates a new, zero asymmetrical matrix from two array of strings and a matrix name. If the matrix is a substitution matrix then each string would be a defined code, e.g. sequence character.

The matrix comparison value table Matrix is created and initialised with zeroes.

Synopsis

Prototype
AjPMatrix ajMatrixNewAsym (
      const AjPPStr codes,
      ajint n,
      const AjPPStr rcodes,
      ajint rn,
      const AjPStr filename
);

TypeNameRead/WriteDescription
const AjPPStrcodesInputMatrix column labels, e.g. valid sequence character codes
ajintnInputNumber of column labels
const AjPPStrrcodesInputMatrix row labels, e.g. valid sequence character codes
ajintrnInputNumber of row labels
const AjPStrfilenameInputMatrix filename
AjPMatrix RETURNNew matrix, or NULL if codes, n or filename are 0.

Input
codes:(Input)Matrix column labels, e.g. valid sequence character codes
n:(Input)Number of column labels
rcodes:(Input)Matrix row labels, e.g. valid sequence character codes
rn:(Input)Number of row labels
filename:(Input)Matrix filename
Returns
AjPMatrix:New matrix, or NULL if codes, n or filename are 0.

Description

Creates a new, zero asymmetrical matrix from two array of strings and a matrix name. If the matrix is a substitution matrix then each string would be a defined code, e.g. sequence character.

The matrix comparison value table Matrix is created and initialised with zeroes.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixfNew

Creates a new, zero matrix from an array of strings and a matrix name. If the matrix is a residue substitution matrix then each string would be a defined sequence character.

The matrix comparison value table Matrix is created and initialised with zeroes.

Synopsis

Prototype
AjPMatrixf ajMatrixfNew (
      const AjPPStr codes,
      ajint n,
      const AjPStr filename
);

TypeNameRead/WriteDescription
const AjPPStrcodesInputMatrix labels, e.g. valid sequence char codes
ajintnInputNumber of labels
const AjPStrfilenameInputMatrix filename
AjPMatrixf RETURNNew matrix, or NULL if codes, n or filename are 0.

Input
codes:(Input)Matrix labels, e.g. valid sequence char codes
n:(Input)Number of labels
filename:(Input)Matrix filename
Returns
AjPMatrixf:New matrix, or NULL if codes, n or filename are 0.

Description

Creates a new, zero matrix from an array of strings and a matrix name. If the matrix is a residue substitution matrix then each string would be a defined sequence character.

The matrix comparison value table Matrix is created and initialised with zeroes.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixfNewAsym

Creates a new, zero asymmetrical matrix from an array of strings and a matrix name. If the matrix is a residue substitution matrix then each string would be a defined sequence character.

The matrix comparison value table Matrix is created and initialised with zeroes.

Synopsis

Prototype
AjPMatrixf ajMatrixfNewAsym (
      const AjPPStr codes,
      ajint n,
      const AjPPStr rcodes,
      ajint rn,
      const AjPStr filename
);

TypeNameRead/WriteDescription
const AjPPStrcodesInputMatrix labels, e.g. valid sequence char codes
ajintnInputNumber of labels
const AjPPStrrcodesInputMatrix row labels, e.g. valid sequence character codes.
ajintrnInputNumber of row labels
const AjPStrfilenameInputMatrix filename
AjPMatrixf RETURNNew matrix, or NULL if codes, n or filename are 0.

Input
codes:(Input)Matrix labels, e.g. valid sequence char codes
n:(Input)Number of labels
rcodes:(Input)Matrix row labels, e.g. valid sequence character codes.
rn:(Input)Number of row labels
filename:(Input)Matrix filename
Returns
AjPMatrixf:New matrix, or NULL if codes, n or filename are 0.

Description

Creates a new, zero asymmetrical matrix from an array of strings and a matrix name. If the matrix is a residue substitution matrix then each string would be a defined sequence character.

The matrix comparison value table Matrix is created and initialised with zeroes.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixfDel

Delete a float matrix

Synopsis

Prototype
void ajMatrixfDel (
      AjPMatrixf* thys
);

TypeNameRead/WriteDescription
AjPMatrixf*thysOutputMatrix to delete
void RETURN

Output
thys:(Output)Matrix to delete
Returns
void:No return value

Description

Delete a float matrix

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixDel

Delete an integer matrix

Synopsis

Prototype
void ajMatrixDel (
      AjPMatrix* thys
);

TypeNameRead/WriteDescription
AjPMatrix*thysOutputMatrix to delete
void RETURN

Output
thys:(Output)Matrix to delete
Returns
void:No return value

Description

Delete an integer matrix

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixNewFile

Constructs a comparison matrix from a given local data file

Synopsis

Prototype
AjPMatrix ajMatrixNewFile (
      const AjPStr filename
);

TypeNameRead/WriteDescription
const AjPStrfilenameInputInput filename
AjPMatrix RETURNMatrix object

Input
filename:(Input)Input filename
Returns
AjPMatrix:Matrix object

Description

Constructs a comparison matrix from a given local data file

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixfNewFile

Constructs a comparison matrix from a given local data file

Synopsis

Prototype
AjPMatrixf ajMatrixfNewFile (
      const AjPStr filename
);

TypeNameRead/WriteDescription
const AjPStrfilenameInputInput filename
AjPMatrixf RETURNFloat matrix object

Input
filename:(Input)Input filename
Returns
AjPMatrixf:Float matrix object

Description

Constructs a comparison matrix from a given local data file

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixSeqIndex

Converts a sequence to index numbers using the matrix's internal conversion table. Sequence characters not defined in the matrix are converted to zero.

Synopsis

Prototype
AjBool ajMatrixSeqIndex (
      const AjPMatrix thys,
      const AjPSeq seq,
      AjPStr* numseq
);

TypeNameRead/WriteDescription
const AjPMatrixthysInputMatrix object
const AjPSeqseqInputSequence object
AjPStr*numseqOutputIndex code version of the sequence
AjBool RETURNajTrue on success.

Input
thys:(Input)Matrix object
seq:(Input)Sequence object
Output
numseq:(Output)Index code version of the sequence
Returns
AjBool:ajTrue on success.

Description

Converts a sequence to index numbers using the matrix's internal conversion table. Sequence characters not defined in the matrix are converted to zero.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixfSeqIndex

Converts a sequence to index numbers using the matrix's internal conversion table. Sequence characters not defined in the matrix are converted to zero.

Synopsis

Prototype
AjBool ajMatrixfSeqIndex (
      const AjPMatrixf thys,
      const AjPSeq seq,
      AjPStr* numseq
);

TypeNameRead/WriteDescription
const AjPMatrixfthysInputFloat Matrix object
const AjPSeqseqInputSequence object
AjPStr*numseqOutputIndex code version of the sequence
AjBool RETURNajTrue on success.

Input
thys:(Input)Float Matrix object
seq:(Input)Sequence object
Output
numseq:(Output)Index code version of the sequence
Returns
AjBool:ajTrue on success.

Description

Converts a sequence to index numbers using the matrix's internal conversion table. Sequence characters not defined in the matrix are converted to zero.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixGetCodes

Returns the character codes for each offset in the matrix

Synopsis

Prototype
AjPStr ajMatrixGetCodes (
      const AjPMatrix thys
);

TypeNameRead/WriteDescription
const AjPMatrixthysInputMatrix object
AjPStr RETURNMatrix codes

Input
thys:(Input)Matrix object
Returns
AjPStr:Matrix codes

Description

Returns the character codes for each offset in the matrix

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixfGetCodes

Returns the character codes for each offset in the matrix

Synopsis

Prototype
AjPStr ajMatrixfGetCodes (
      const AjPMatrixf thys
);

TypeNameRead/WriteDescription
const AjPMatrixfthysInputMatrix object
AjPStr RETURNMatrix codes

Input
thys:(Input)Matrix object
Returns
AjPStr:Matrix codes

Description

Returns the character codes for each offset in the matrix

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixGetMatrix

Returns the matrix values array in the matrix

Synopsis

Prototype
AjIntArray* ajMatrixGetMatrix (
      const AjPMatrix thys
);

TypeNameRead/WriteDescription
const AjPMatrixthysInputMatrix object
AjIntArray* RETURNMatrix values array

Input
thys:(Input)Matrix object
Returns
AjIntArray*:Matrix values array

Description

Returns the matrix values array in the matrix

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixfGetMatrix

Returns the matrix values array in the matrix

Synopsis

Prototype
AjFloatArray* ajMatrixfGetMatrix (
      const AjPMatrixf thys
);

TypeNameRead/WriteDescription
const AjPMatrixfthysInputMatrix object
AjFloatArray* RETURNMatrix values array

Input
thys:(Input)Matrix object
Returns
AjFloatArray*:Matrix values array

Description

Returns the matrix values array in the matrix

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixGetRows

Returns the comparison matrix row size.

Synopsis

Prototype
ajuint ajMatrixGetRows (
      const AjPMatrix thys
);

TypeNameRead/WriteDescription
const AjPMatrixthysInputMatrix object
ajuint RETURN.

Input
thys:(Input)Matrix object
Returns
ajuint:.

Description

Returns the comparison matrix row size.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixGetSize

Returns the comparison matrix size.

Synopsis

Prototype
ajuint ajMatrixGetSize (
      const AjPMatrix thys
);

TypeNameRead/WriteDescription
const AjPMatrixthysInputMatrix object
ajuint RETURN.

Input
thys:(Input)Matrix object
Returns
ajuint:.

Description

Returns the comparison matrix size.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixfGetRows

Returns the comparison matrix row size.

Synopsis

Prototype
ajuint ajMatrixfGetRows (
      const AjPMatrixf thys
);

TypeNameRead/WriteDescription
const AjPMatrixfthysInputMatrix object
ajuint RETURN.

Input
thys:(Input)Matrix object
Returns
ajuint:.

Description

Returns the comparison matrix row size.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixfGetSize

Returns the comparison matrix size.

Synopsis

Prototype
ajuint ajMatrixfGetSize (
      const AjPMatrixf thys
);

TypeNameRead/WriteDescription
const AjPMatrixfthysInputMatrix object
ajuint RETURN.

Input
thys:(Input)Matrix object
Returns
ajuint:.

Description

Returns the comparison matrix size.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixGetCvt

Returns the sequence character conversion table for a matrix. This table converts any character defined in the matrix to a positive integer, and any other character is converted to zero.

Synopsis

Prototype
AjPSeqCvt ajMatrixGetCvt (
      const AjPMatrix thys
);

TypeNameRead/WriteDescription
const AjPMatrixthysInputMatrix object
AjPSeqCvt RETURNsequence character conversion table

Input
thys:(Input)Matrix object
Returns
AjPSeqCvt:sequence character conversion table

Description

Returns the sequence character conversion table for a matrix. This table converts any character defined in the matrix to a positive integer, and any other character is converted to zero.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixfGetCvt

Returns the sequence character conversion table for a matrix. This table converts any character defined in the matrix to a positive integer, and any other character is converted to zero.

Synopsis

Prototype
AjPSeqCvt ajMatrixfGetCvt (
      const AjPMatrixf thys
);

TypeNameRead/WriteDescription
const AjPMatrixfthysInputFloat Matrix object
AjPSeqCvt RETURNsequence character conversion table

Input
thys:(Input)Float Matrix object
Returns
AjPSeqCvt:sequence character conversion table

Description

Returns the sequence character conversion table for a matrix. This table converts any character defined in the matrix to a positive integer, and any other character is converted to zero.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixGetLabelNum

Returns the sequence character (or asymmetric matrix label) for a matrix column.

Synopsis

Prototype
const AjPStr ajMatrixGetLabelNum (
      const AjPMatrix thys,
      ajint i
);

TypeNameRead/WriteDescription
const AjPMatrixthysInputMatrix object
ajintiInputCharacter index
const AjPStr RETURNMatrix label, e.g. sequence character code or '?' if not found

Input
thys:(Input)Matrix object
i:(Input)Character index
Returns
const AjPStr:Matrix label, e.g. sequence character code or '?' if not found

Description

Returns the sequence character (or asymmetric matrix label) for a matrix column.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixfGetLabelNum

Returns the sequence character (or asymmetric matrix label) for a matrix column.

Synopsis

Prototype
const AjPStr ajMatrixfGetLabelNum (
      const AjPMatrixf thys,
      ajint i
);

TypeNameRead/WriteDescription
const AjPMatrixfthysInputMatrix object
ajintiInputCharacter index
const AjPStr RETURNMatrix label, e.g. sequence character code or '?' if not found

Input
thys:(Input)Matrix object
i:(Input)Character index
Returns
const AjPStr:Matrix label, e.g. sequence character code or '?' if not found

Description

Returns the sequence character (or asymmetric matrix label) for a matrix column.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixGetName

Returns the name of a matrix object, usually the filename from which it was read.

Synopsis

Prototype
const AjPStr ajMatrixGetName (
      const AjPMatrix thys
);

TypeNameRead/WriteDescription
const AjPMatrixthysInputMatrix object
const AjPStr RETURNThe name, a pointer to the internal name.

Input
thys:(Input)Matrix object
Returns
const AjPStr:The name, a pointer to the internal name.

Description

Returns the name of a matrix object, usually the filename from which it was read.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixfGetName

Returns the name of a matrix object, usually the filename from which it was read.

Synopsis

Prototype
const AjPStr ajMatrixfGetName (
      const AjPMatrixf thys
);

TypeNameRead/WriteDescription
const AjPMatrixfthysInputMatrix object
const AjPStr RETURNThe name, a pointer to the internal name.

Input
thys:(Input)Matrix object
Returns
const AjPStr:The name, a pointer to the internal name.

Description

Returns the name of a matrix object, usually the filename from which it was read.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajMatrixExit

Cleans matrix processing internals

Synopsis

Prototype
void ajMatrixExit (
      void
);

TypeNameRead/WriteDescription
void RETURN

Returns
void:No return value

Description

Cleans matrix processing internals

See Also

See other functions in this section

Availability

In release 6.4.0