NumericAlign.c



static int NumericSearchForBest(int **matrix, int length1, int length2, int *BestI, int *BestJ, int *seq1, int *seq2, int *align1, int *align2)

Inputs

int **matrix N&W matrix
int length1 Length of first sequence
int length2 Length of second sequence
int *BestI x position of highest score
int *BestJ y position of highest score
int *seq1 First sequence
int *seq2 Second sequence

Outputs

int *align1 First sequence with end aligned correctly
int *align2 Second sequence with end aligned correctly

Returns

int Alignment length thus far

Description

Searches the outside of the matrix for the best score and starts the alignment by putting in any starting 0s as insertion symbols.

Identical to align.c/SearchForBest(), but uses int arrays rather than characters

Created: 08.03.00 Last Modified: 08.03.00


BOOL NumericReadMDM(char *mdmfile)

Inputs

char *mdmfile Mutation data matrix filename

Returns

BOOL Success?

Description

Read mutation data matrix into static global arrays. The matrix may have comments at the start introduced with a ! in the first column. The matrix must be complete (i.e. a triangular matrix will not work). A line describing the residue types must appear, and may be placed before or after the matrix itself

Identical to align.c/ReadMDM() but reads into a different static 2D array and doesn't read a symbol identifier line from the file as the symbols are numeric and always start from 1 (0 is used as the insert character)

Created: 08.03.00 Last Modified: 08.03.00


int NumericCalcMDMScore(int resa, int resb)

Inputs

int resa First token
int resb Second token

Returns

int score

Description

Calculate score from static globally stored mutation data matrix

Identical to align.c/CalcMDMScore(), but uses a different static score array and takes integer parameters. These are used as direct lookups into the score array rather than being searched.

Created: 08.03.00 Last Modified: 08.03.00


int NumericAffineAlign(int *seq1, int length1, int *seq2, int length2, BOOL verbose, BOOL identity, int penalty, int penext, int *align1, int *align2, int *align_len)

Inputs

int *seq1 First sequence of tokens
int length1 First sequence length
int *seq2 Second sequence of tokens
int length2 Second sequence length
BOOL verbose Display N&W matrix
BOOL identity Use identity matrix
int penalty Gap insertion penalty value
int penext Extension penalty

Outputs

int *align1 Sequence 1 aligned
int *align2 Sequence 2 aligned
int *align_len Alignment length

Returns

int Alignment score (0 on error)

Description

Perform simple N&W alignment of seq1 and seq2. No window is used, so will be slow for long sequences.

The sequences come as integer arrays containing numeric tokens

Note that you must allocate sufficient memory for the aligned sequences. The easy way to do this is to ensure that align1 and align2 are of length (length1+length2).

Identical to align.c/affinealign(), but uses integer arrays

Created: 08.03.00 Last Modified: 08.03.00


static int NumericTraceBack(int **matrix, XY **dirn, int length1, int length2, int *seq1, int *seq2, int *align1, int *align2, int *align_len)

Inputs

int **matrix N&W matrix
XY **dirn Direction Matrix
int length1 Length of first sequence
int length2 Length of second sequence
int *seq1 First sequence
int *seq2 Second sequence

Outputs

int *align1 First sequence aligned
int *align2 Second sequence aligned
int *align_len Aligned sequence length

Returns

int Alignment score

Description

Does the traceback to find the aligment.

Identical to align.c/TraceBack(), but uses integer arrays.

Created: 08.03.00 Last Modified: 28.09.00