Hitmap 1.3
 All Data Structures Namespaces Files Functions Variables Typedefs Friends Macros Groups Pages
Macros | Functions | Variables
SWseq_ref.c File Reference
#include "SWcommon.h"
#include "SWcommon_ref.h"
Include dependency graph for SWseq_ref.c:

Go to the source code of this file.

Macros

#define h(i, j)   (H[((i)*(size[1]+1))+(j)])
 
#define xback(i, j)   (xTraceback[((i)*(size[1]+1))+(j)])
 
#define yback(i, j)   (yTraceback[((i)*(size[1]+1))+(j)])
 

Functions

void phase_read_sequences ()
 
void phase_comp_hmatrix ()
 
void phase_comp_back ()
 
int main (int argc, char *argv[])
 

Variables

aa_tp1
 
aa_tp2
 
h_tH
 
trace_txTraceback
 
trace_tyTraceback
 
aa_tout1
 
aa_tout2
 
int xMax
 
int yMax
 
int xBegin
 
int yBegin
 
int match_length
 
int match_length1
 
int match_length2
 
int match_pos
 

Detailed Description

Sequential version for the Smith-Waterman algorihtm. The Smith–Waterman algorithm performs local sequence alignment of protein sequences.

This version assumes a linear gap penalty. This algorithm creates the matrix H as follows:

              | H(i-1,j-1) + PAM(a_i,b_j)    (diagonal)

H(i,j) = MAX of | H(i-1,j) + gappenalty (up) | H(i,j-1) + gappenalty (left) | 0

The PAM matrix is the amino acid substitution matrix that encode the expected evolutionary change at the amino acid level.

To obtain the optimum local alignment, we start with the highest value in the matrix (i,j). Then, we go backwards to one of positions (i − 1,j), (i, j − 1), and (i − 1, j − 1) depending on the direction of movement used to construct the matrix.

Note
This is a reimplemtation of the SW.c program by Peter Clote, this program support different protein sizes and the names of the amino acids are readed from the PAM matrix file. https://github.com/jawad-manzoor/DNASequenceAlignment
Author
Javier Fresno
Date
May 2013

Definition in file SWseq_ref.c.

Macro Definition Documentation

#define h (   i,
 
)    (H[((i)*(size[1]+1))+(j)])

Definition at line 102 of file SWseq_ref.c.

#define xback (   i,
 
)    (xTraceback[((i)*(size[1]+1))+(j)])

Definition at line 107 of file SWseq_ref.c.

#define yback (   i,
 
)    (yTraceback[((i)*(size[1]+1))+(j)])

Definition at line 108 of file SWseq_ref.c.

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Main function.

< Time init start

< Time init end

< Time computation start

< Time computation end

< Aux start timer for phases

< Aux end timer for phases

< Accumulate time in read

< Accumulate time in H matrix computation

< Accumulate time in backtracking

Definition at line 134 of file SWseq_ref.c.

Here is the call graph for this function:

void phase_comp_back ( )

Compute the traceback

void phase_comp_hmatrix ( )

Calculate the similarity matrix (H)

void phase_read_sequences ( )

Read the protein sequences

Variable Documentation

h_t* H

Definition at line 101 of file SWseq_ref.c.

int match_length

Definition at line 123 of file SWseq_ref.c.

int match_length1

Definition at line 124 of file SWseq_ref.c.

int match_length2

Definition at line 125 of file SWseq_ref.c.

int match_pos

Definition at line 128 of file SWseq_ref.c.

aa_t* out1

Definition at line 111 of file SWseq_ref.c.

aa_t* out2

Definition at line 112 of file SWseq_ref.c.

aa_t* p1

Definition at line 97 of file SWseq_ref.c.

aa_t* p2

Definition at line 98 of file SWseq_ref.c.

int xBegin

Definition at line 119 of file SWseq_ref.c.

int xMax

Definition at line 115 of file SWseq_ref.c.

trace_t* xTraceback

Definition at line 105 of file SWseq_ref.c.

int yBegin

Definition at line 120 of file SWseq_ref.c.

int yMax

Definition at line 116 of file SWseq_ref.c.

trace_t* yTraceback

Definition at line 106 of file SWseq_ref.c.