Hitmap 1.3
 All Data Structures Namespaces Files Functions Variables Typedefs Friends Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
SWcommon.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <time.h>
Include dependency graph for SWcommon.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PAM
 
struct  ProteinFile
 
struct  AAName
 

Macros

#define DEBUG
 
#define MAX_NUM_AA   30
 
#define DEFAULT_SIZE   8
 
#define DEFAULT_GAPPENALTY   -1.0
 
#define DEFAULT_ITERATIONS   1
 
#define is_root()   (1)
 
#define printfroot(...)   if( is_root() ) { printf(__VA_ARGS__); }
 
#define fprintfroot(...)   if( is_root() ) { fprintf(__VA_ARGS__); }
 
#define pam(a, b)   (pam_matrix.data[(a)*(pam_matrix.num_aa)+(b)])
 
#define NOTFOUND_AA   -2
 
#define NOTFOUND_CHAR   '!'
 
#define GAP_AA   MAX_NUM_AA
 
#define GAP_CHAR   '-'
 
#define NOT_USED(p)   ((void)(p))
 
#define CHECK_NULL(check)
 

Typedefs

typedef short aa_t
 
typedef double h_t
 
typedef short trace_t
 

Functions

void initPAM (char *file)
 
void openProtein (ProteinFile *fprotein, char *filename)
 
void closeProtein (ProteinFile *fprotein)
 
void exit_error (const char *s)
 
void input_parameters (int argc, char *argv[])
 

Variables

PAM pam_matrix
 
AAName aa_names
 
char * prot_name1
 
char * prot_name2
 
char * pam_name
 
double gapPenalty
 
int size [2]
 
int iterations
 
ProteinFile pfile1
 
ProteinFile pfile2
 

Detailed Description

Common definitions and utilities for the Smith-Waterman algorihtm.

Author
Javier Fresno
Date
Jun 2013

Definition in file SWcommon.h.

Macro Definition Documentation

#define CHECK_NULL (   check)
Value:
{\
if ((check)==NULL) \
exit_error("Null Pointer allocating memory\n");\
}
void exit_error(const char *s)
Definition: SWcommon.c:263

Check NULL pointers

Definition at line 275 of file SWcommon.h.

#define DEBUG

Flag to see the debug messages.

Definition at line 48 of file SWcommon.h.

#define DEFAULT_GAPPENALTY   -1.0

Default Gap Penalty.

Definition at line 91 of file SWcommon.h.

#define DEFAULT_ITERATIONS   1

Default number of iterations

Definition at line 93 of file SWcommon.h.

#define DEFAULT_SIZE   8

Default protein size.

Definition at line 89 of file SWcommon.h.

#define fprintfroot (   ...)    if( is_root() ) { fprintf(__VA_ARGS__); }

fprintf function for the root processor.

Definition at line 140 of file SWcommon.h.

#define GAP_AA   MAX_NUM_AA

Value for the gap AA code.

Definition at line 243 of file SWcommon.h.

#define GAP_CHAR   '-'

Value for the gap char name.

Definition at line 245 of file SWcommon.h.

#define is_root ( )    (1)

In sequential there is only one processor.

Definition at line 123 of file SWcommon.h.

#define MAX_NUM_AA   30

Max number of amino acids.

Definition at line 87 of file SWcommon.h.

#define NOT_USED (   p)    ((void)(p))

Hides the not used warning

Definition at line 271 of file SWcommon.h.

#define NOTFOUND_AA   -2

Value for not found AA code.

Definition at line 239 of file SWcommon.h.

#define NOTFOUND_CHAR   '!'

Value for not found char name.

Definition at line 241 of file SWcommon.h.

#define pam (   a,
 
)    (pam_matrix.data[(a)*(pam_matrix.num_aa)+(b)])

Macro to access the PAM Matrix.

Definition at line 181 of file SWcommon.h.

#define printfroot (   ...)    if( is_root() ) { printf(__VA_ARGS__); }

printf function for the root processor.

Definition at line 135 of file SWcommon.h.

Typedef Documentation

typedef short aa_t

Typedef for the amino acid.

Definition at line 59 of file SWcommon.h.

typedef double h_t

Typedef of the H and PAM matrices

Definition at line 61 of file SWcommon.h.

typedef short trace_t

Typedef for the traceback matrix.

Definition at line 63 of file SWcommon.h.

Function Documentation

void closeProtein ( ProteinFile fprotein)

Close the protein file.

Definition at line 255 of file SWcommon.c.

Here is the caller graph for this function:

void exit_error ( const char *  s)

Exit printing the given error.

Definition at line 263 of file SWcommon.c.

Here is the caller graph for this function:

void initPAM ( char *  filename)

Inits the PAM Matrix with the content of this file and also the AAName conversion structure.

Definition at line 128 of file SWcommon.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void input_parameters ( int  argc,
char *  argv[] 
)

Process the input parameters

Definition at line 75 of file SWcommon.c.

Here is the caller graph for this function:

void openProtein ( ProteinFile fprotein,
char *  filename 
)

Open a protein file.

Definition at line 241 of file SWcommon.c.

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

AAName aa_names

Variable for the PAM Matrix.

Definition at line 69 of file SWcommon.c.

double gapPenalty

Definition at line 54 of file SWcommon.c.

int iterations

Definition at line 60 of file SWcommon.c.

PAM pam_matrix

The PAM matrix.

Definition at line 67 of file SWcommon.c.

char* pam_name

Definition at line 51 of file SWcommon.c.

ProteinFile pfile1

Definition at line 63 of file SWcommon.c.

ProteinFile pfile2

Definition at line 64 of file SWcommon.c.

char* prot_name1

Definition at line 49 of file SWcommon.c.

char* prot_name2

Definition at line 50 of file SWcommon.c.

int size[2]

Definition at line 57 of file SWcommon.c.