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

Preprocessing utilities header. More...

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

Go to the source code of this file.

Functions

ChaincreateChainComplement (Chain *chain)
 Creates chain complement. More...
 
void readFastaChain (Chain **chain, const char *path)
 Fasta chain reading function. More...
 
void readFastaChains (Chain ***chains, int *chainsLen, const char *path)
 Fasta chain reading function. More...
 
void scorerCreateScalar (Scorer **scorer, int match, int mismatch, int gapOpen, int gapExtend)
 Scalar scorer creation utility functions. More...
 
void scorerCreateMatrix (Scorer **scorer, char *name, int gapOpen, int gapExtend)
 Nonscalar scorer creation utility functions. More...
 

Detailed Description

Preprocessing utilities header.

Function Documentation

Chain* createChainComplement ( Chain chain)

Creates chain complement.

Function persumes the characters in the chain are nucleotides. Every 'A' is turned into 'T', every 'C' to 'G' and vice versa. Any other characters are left intact. Also the complement chain is in the reverse order of the original.

Parameters
chainchain object
Returns
chain complement
void readFastaChain ( Chain **  chain,
const char *  path 
)

Fasta chain reading function.

Function reads file from the given path, which should be in the fasta format. More on fasta format http://en.wikipedia.org/wiki/FASTA_format. Function persumes only one chain is in the file. Function persumes that the fasta chain name is no more than 1000 characters long.

Parameters
chainoutput chain object
pathfile path
void readFastaChains ( Chain ***  chains,
int *  chainsLen,
const char *  path 
)

Fasta chain reading function.

Function works in the same way as the readFastaChain() but does not persume only one chain is in the file.

Parameters
chainsoutput chain array object
chainsLenoutput chain array length
pathfile path
void scorerCreateMatrix ( Scorer **  scorer,
char *  name,
int  gapOpen,
int  gapExtend 
)

Nonscalar scorer creation utility functions.

Scorer is created with the max score equal to 26. Observing the scorerEncode() method it means this scorer only accepts alphabet characters and it must not be used with no other characters. This function is used for creating the scorer with the most common standard similarity matrices.

Parameters
scoreroutput scorer object
namename can be one of the "BLOSUM_62", "BLOSUM_45", "BLOSUM_50", "BLOSUM_80", "BLOSUM_90", "PAM_30", "PAM_70" or "PAM_250"
gapOpenaffine gap open penalty, defined as positive integer
gapExtendaffine gap extend penalty, defined as positive integer
void scorerCreateScalar ( Scorer **  scorer,
int  match,
int  mismatch,
int  gapOpen,
int  gapExtend 
)

Scalar scorer creation utility functions.

Scorer is created with the max score equal to 26. Observing the scorerEncode() method it means this scorer only accepts alphabet characters and it must not be used with no other characters. This scorer is scalar, see scorerIsScalar().

Parameters
scoreroutput scorer object
matchmatch score for every two equal codes, defined as positive integer
mismatchmismatch penalty for every two unequal codes, defined as negative integer
gapOpenaffine gap open penalty, defined as positive integer
gapExtendaffine gap extend penalty, defined as positive integer