libuproc  1.2.0
Data Structures | Functions

Array of matrices of amino acid distances. More...

Data Structures

struct  uproc_substmat
 Array of matrices of amino acid distances. More...
 

Functions

uproc_substmatuproc_substmat_create (void)
 Create substmat object. More...
 
void uproc_substmat_destroy (uproc_substmat *mat)
 Destroy substmat object. More...
 
double uproc_substmat_get (const uproc_substmat *mat, unsigned pos, uproc_amino x, uproc_amino y)
 Get distance of two amino acids. More...
 
void uproc_substmat_set (uproc_substmat *mat, unsigned pos, uproc_amino x, uproc_amino y, double dist)
 Set distance of two amino acids. More...
 
void uproc_substmat_align_suffixes (const uproc_substmat *mat, uproc_suffix s1, uproc_suffix s2, double *dist)
 Look up all distances between amino acids in a suffix. More...
 
uproc_substmatuproc_substmat_load (enum uproc_io_type iotype, const char *pathfmt,...)
 Load substmat from file. More...
 
uproc_substmatuproc_substmat_loadv (enum uproc_io_type iotype, const char *pathfmt, va_list ap)
 Load substmat from file. More...
 

Detailed Description

Array of matrices of amino acid distances.

An array of UPROC_SUFFIX_LEN matrices used to obtain pairwise distances of the suffix part of two uproc_word instances.

Function Documentation

uproc_substmat* uproc_substmat_create ( void  )

Create substmat object.

Create substitution matrix object with all entries set to 0.

void uproc_substmat_destroy ( uproc_substmat mat)

Destroy substmat object.

double uproc_substmat_get ( const uproc_substmat mat,
unsigned  pos,
uproc_amino  x,
uproc_amino  y 
)

Get distance of two amino acids.

Retrieves distance between two amino acids x and y at the suffix position pos

Parameters
matdistance matrix
posposition (between 0 and UPROC_SUFFIX_LEN)
xamino acid
yanother amino acid
Returns
distance between x and y
void uproc_substmat_set ( uproc_substmat mat,
unsigned  pos,
uproc_amino  x,
uproc_amino  y,
double  dist 
)

Set distance of two amino acids.

Sets the distance between two amino acids x and y at the suffix position pos to dist.

Parameters
matdistance matrix
posposition (between 0 and UPROC_SUFFIX_LEN)
xamino acid
yanother amino acid
distdistance between x and y
void uproc_substmat_align_suffixes ( const uproc_substmat mat,
uproc_suffix  s1,
uproc_suffix  s2,
double *  dist 
)

Look up all distances between amino acids in a suffix.

dist must be a pointer into an array with at least UPROC_SUFFIX_LEN elements.

Parameters
matsubstitution matrix
s1first suffix
s2second suffix
distOUT: array containing distance of each amino acid pair
uproc_substmat* uproc_substmat_load ( enum uproc_io_type  iotype,
const char *  pathfmt,
  ... 
)

Load substmat from file.

Parameters
iotypeIO type, see uproc_io_type
pathfmtprintf format string for file path
...format string arguments
uproc_substmat* uproc_substmat_loadv ( enum uproc_io_type  iotype,
const char *  pathfmt,
va_list  ap 
)

Load substmat from file.

Like uproc_substmat_load, but with a va_list instead of a variable number of arguments.