SW#
All Files Functions Variables Typedefs Macros
Macros | Typedefs | Functions
alignment.h File Reference

Pairwise sequnce alignment result storage header. More...

#include "chain.h"
#include "scorer.h"
Include dependency graph for alignment.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MOVE_STOP   0
 Stop move. More...
 
#define MOVE_LEFT   2
 Path insertion move. More...
 
#define MOVE_UP   3
 Path deletion move. More...
 
#define MOVE_DIAG   1
 Path alignment move. More...
 

Typedefs

typedef struct Alignment Alignment
 Pairwise sequnce alignment result storage object. More...
 

Functions

AlignmentalignmentCreate (Chain *query, int queryStart, int queryEnd, Chain *target, int targetStart, int targetEnd, int score, Scorer *scorer, char *path, int pathLen)
 Alignment object constructor. More...
 
void alignmentDelete (Alignment *alignment)
 Alignment destructor. More...
 
char alignmentGetMove (Alignment *alignment, int index)
 Move getter. More...
 
int alignmentGetPathLen (Alignment *alignment)
 Path len getter. More...
 
ChainalignmentGetQuery (Alignment *alignment)
 Query getter. More...
 
int alignmentGetQueryEnd (Alignment *alignment)
 Query end getter. More...
 
int alignmentGetQueryStart (Alignment *alignment)
 Query start getter. More...
 
int alignmentGetScore (Alignment *alignment)
 Score getter. More...
 
ScoreralignmentGetScorer (Alignment *alignment)
 Scorer getter. More...
 
ChainalignmentGetTarget (Alignment *alignment)
 Target getter. More...
 
int alignmentGetTargetEnd (Alignment *alignment)
 Target end getter. More...
 
int alignmentGetTargetStart (Alignment *alignment)
 Target start getter. More...
 
void alignmentCopyPath (Alignment *alignment, char *dest)
 Copies path to the destination buffer. More...
 
AlignmentalignmentDeserialize (char *bytes)
 Alignment deserialization method. More...
 
void alignmentSerialize (char **bytes, int *bytesLen, Alignment *alignment)
 Alignment serialization method. More...
 

Detailed Description

Pairwise sequnce alignment result storage header.

Macro Definition Documentation

#define MOVE_DIAG   1

Path alignment move.

Named diagonal move because of the diagonal move in matrix done while backtracking.

#define MOVE_LEFT   2

Path insertion move.

Named diagonal move because of the up move in matrix done while backtracking.

#define MOVE_STOP   0

Stop move.

Stop move is not used in alignment path. However it is used internaly in sequnce alignment algorithms.

#define MOVE_UP   3

Path deletion move.

Named diagonal move because of the up move in matrix done while backtracking.

Typedef Documentation

typedef struct Alignment Alignment

Pairwise sequnce alignment result storage object.

All off the pairwise sequnce alignment algorithms produce a similiar result. Input query and target sequences are stored as Chain object. Algorithm scoring system is stored as Scorer object. Alignment stores the query and target start and endpoints as well as the alignment score. Alignment path is stored as a character array. Every character represents one move and can be MOVE_LEFT, MOVE_UP or MOVE_DIAG. Alignment path is stored in format convinient for backtracking, in other words the moves are named by the matrix movement while backtracking.

Function Documentation

void alignmentCopyPath ( Alignment alignment,
char *  dest 
)

Copies path to the destination buffer.

Method copies path to the destination buffer which should be at least long as the alignment path length.

Parameters
alignmentalignment object
destdestination buffer
Alignment* alignmentCreate ( Chain query,
int  queryStart,
int  queryEnd,
Chain target,
int  targetStart,
int  targetEnd,
int  score,
Scorer scorer,
char *  path,
int  pathLen 
)

Alignment object constructor.

Alignment object is constructed from the query and target sequence aligned and their coresponding start and stop positions, alignment score, scorer which was used for alignment and the alignment path. None of the input objects are copied via the constructor.

Parameters
queryquery sequnce
queryStartquery start position
queryEndquery end position, inclusive
targettarget sequnce
targetStarttarget start position
targetEndtarget end position, inclusive
scorealignment score
scorerscorer object used for alignment
pathalignment path
pathLenalignment path length
Returns
alignment object
void alignmentDelete ( Alignment alignment)

Alignment destructor.

Parameters
alignmentalignment object
Alignment* alignmentDeserialize ( char *  bytes)

Alignment deserialization method.

Method deserializes alignment object from a byte buffer.

Parameters
bytesbyte buffer
Returns
alignment object
char alignmentGetMove ( Alignment alignment,
int  index 
)

Move getter.

Given index must be greater or equal to zero and less than alignment path length.

Parameters
alignmentalignment object
indexpath move index
Returns
path move
int alignmentGetPathLen ( Alignment alignment)

Path len getter.

Parameters
alignmentalignment object
Returns
path len
Chain* alignmentGetQuery ( Alignment alignment)

Query getter.

Parameters
alignmentalignment object
Returns
query
int alignmentGetQueryEnd ( Alignment alignment)

Query end getter.

Parameters
alignmentalignment object
Returns
query end
int alignmentGetQueryStart ( Alignment alignment)

Query start getter.

Parameters
alignmentalignment object
Returns
query start
int alignmentGetScore ( Alignment alignment)

Score getter.

Parameters
alignmentalignment object
Returns
score
Scorer* alignmentGetScorer ( Alignment alignment)

Scorer getter.

Parameters
alignmentalignment object
Returns
scorer
Chain* alignmentGetTarget ( Alignment alignment)

Target getter.

Parameters
alignmentalignment object
Returns
target
int alignmentGetTargetEnd ( Alignment alignment)

Target end getter.

Parameters
alignmentalignment object
Returns
target end
int alignmentGetTargetStart ( Alignment alignment)

Target start getter.

Parameters
alignmentalignment object
Returns
target start
void alignmentSerialize ( char **  bytes,
int *  bytesLen,
Alignment alignment 
)

Alignment serialization method.

Method serializes alignment object to a byte buffer.

Parameters
bytesoutput byte buffer
bytesLenoutput byte buffer length
alignmentalignment object