Database alignment oriented functions header.
More...
#include "chain.h"
#include "db_alignment.h"
#include "scorer.h"
#include "thread.h"
Go to the source code of this file.
|
ChainDatabase * | chainDatabaseCreate (Chain **database, int databaseStart, int databaseLen, int *cards, int cardsLen) |
| ChainDatabase constructor. More...
|
|
void | chainDatabaseDelete (ChainDatabase *chainDatabase) |
| ChainDatabase destructor. More...
|
|
void | alignDatabase (DbAlignment ***dbAlignments, int *dbAlignmentsLen, int type, Chain *query, ChainDatabase *chainDatabase, Scorer *scorer, int maxAlignments, ValueFunction valueFunction, void *valueFunctionParam, double valueThreshold, int *indexes, int indexesLen, int *cards, int cardsLen, Thread *thread) |
| Database aligning function. More...
|
|
void | shotgunDatabase (DbAlignment ****dbAlignments, int **dbAlignmentsLen, int type, Chain **queries, int queriesLen, ChainDatabase *chainDatabase, Scorer *scorer, int maxAlignments, ValueFunction valueFunction, void *valueFunctionParam, double valueThreshold, int *indexes, int indexesLen, int *cards, int cardsLen, Thread *thread) |
| Shotgun aligning function. More...
|
|
Database alignment oriented functions header.
Ddatabase scoring object.
In the database aligning, queries are often changed and the database is fairly static. ChainDatabase is the chain database prepared for both CPU and GPU usage to reduce the preperation time in repetitive aligning.
typedef void(* ValueFunction)(double *values, int *scores, Chain *query, Chain **database, int databaseLen, void *param) |
Database alignments are often scored by other methods than the alignment score. ValueFunction defines function type for valueing the align scores between a query and the database. Function should calculate the values and store them in the values array which has length equal to databaseLen. Better alignment scores should have smaller value.
- Parameters
-
values | output, values of the align scores |
scores | scores between the query and targets in the database |
query | query chain |
database | target chain array |
databaseLen | target chain array length |
param | additional parameters for the value function |
void alignDatabase |
( |
DbAlignment *** |
dbAlignments, |
|
|
int * |
dbAlignmentsLen, |
|
|
int |
type, |
|
|
Chain * |
query, |
|
|
ChainDatabase * |
chainDatabase, |
|
|
Scorer * |
scorer, |
|
|
int |
maxAlignments, |
|
|
ValueFunction |
valueFunction, |
|
|
void * |
valueFunctionParam, |
|
|
double |
valueThreshold, |
|
|
int * |
indexes, |
|
|
int |
indexesLen, |
|
|
int * |
cards, |
|
|
int |
cardsLen, |
|
|
Thread * |
thread |
|
) |
| |
Database aligning function.
Function scores the query with every target in the chainDatabase, in other words with every chain in the database array with witch the chainDatabase was created. After the scoring function values the scores with the valueFunction and every pair with value over the valueThreshold is discarded. If there is more than maxAlignments pairs left only the best maxAlignments pairs are aligned and returned. If the indexes array is given only the targets with given indexes will be considered, other will be ignored.
- Parameters
-
dbAlignments | output dbAlignments array, new array is created |
dbAlignmentsLen | output, length of the output dbAlignments array |
type | aligning type, can be SW_ALIGN, NW_ALIGN, HW_ALIGN or OV_ALIGN |
query | query chain |
chainDatabase | chain database object |
scorer | scorer object used for alignment |
maxAlignments | maximum number of alignments to return, if negative number of alignments wont be limited |
valueFunction | function for valueing the alignment scores |
valueThreshold | maximum value of returned alignments |
valueFunctionParam | additional parameters for the value function |
indexes | array of indexes of which chains from the database to score, if NULL all are solved |
indexesLen | indexes array length |
cards | cuda cards index array |
cardsLen | cuda cards index array length, greater or equal to 1 |
thread | thread on which the function will be executed, if NULL function is executed on the current thread |
ChainDatabase* chainDatabaseCreate |
( |
Chain ** |
database, |
|
|
int |
databaseStart, |
|
|
int |
databaseLen, |
|
|
int * |
cards, |
|
|
int |
cardsLen |
|
) |
| |
ChainDatabase constructor.
- Parameters
-
database | chain array |
databaseStart | index of the first chain to solve |
databaseLen | length offset from databaseStart to last chain that needs to be solved |
cards | cuda cards index array which the database will be available on |
cardsLen | cuda cards index array length, greater or equal to 1 |
- Returns
- chainDatabase object
ChainDatabase destructor.
- Parameters
-
chainDatabase | chainDatabase object |
void shotgunDatabase |
( |
DbAlignment **** |
dbAlignments, |
|
|
int ** |
dbAlignmentsLen, |
|
|
int |
type, |
|
|
Chain ** |
queries, |
|
|
int |
queriesLen, |
|
|
ChainDatabase * |
chainDatabase, |
|
|
Scorer * |
scorer, |
|
|
int |
maxAlignments, |
|
|
ValueFunction |
valueFunction, |
|
|
void * |
valueFunctionParam, |
|
|
double |
valueThreshold, |
|
|
int * |
indexes, |
|
|
int |
indexesLen, |
|
|
int * |
cards, |
|
|
int |
cardsLen, |
|
|
Thread * |
thread |
|
) |
| |
Shotgun aligning function.
Function is the same as the alignDatabase() but it works on the array of queries. As result of the an array of arrays of alignments is outputed as well as the array of coresponding lengths. This function is faster than calling alignDatabase() for every query separately.
- Parameters
-
dbAlignments | output dbAlignments array of arrays, one for each query, new array of arrays is created |
dbAlignmentsLen | output, lengths of the output dbAlignments arrays, one for each query, new array is created |
type | aligning type, can be SW_ALIGN, NW_ALIGN, HW_ALIGN or OV_ALIGN |
queries | query chains array |
queriesLen | query chains array length |
chainDatabase | chain database object |
scorer | scorer object used for alignment |
maxAlignments | maximum number of alignments to return, if negative number of alignments wont be limited |
valueFunction | function for valueing the alignment scores |
valueThreshold | maximum value of returned alignments |
valueFunctionParam | additional parameters for the value function |
indexes | array of indexes of which chains from the database to score, if NULL all are solved |
indexesLen | indexes array length |
cards | cuda cards index array |
cardsLen | cuda cards index array length, greater or equal to 1 |
thread | thread on which the function will be executed, if NULL function is executed on the current thread |