GPU implementations of common functions. More...
Go to the source code of this file.
Typedefs | |
typedef struct ChainDatabaseGpu | ChainDatabaseGpu |
GPU database scoring object. More... | |
Functions | |
void | hwEndDataGpu (int *queryEnd, int *targetEnd, int *outScore, Chain *query, Chain *target, Scorer *scorer, int score, int card, Thread *thread) |
GPU implementation of the semiglobal scoring function. More... | |
void | nwFindScoreGpu (int *queryStart, int *targetStart, Chain *query, Chain *target, Scorer *scorer, int score, int card, Thread *thread) |
GPU implementation of score finding function. More... | |
void | nwLinearDataGpu (int **scores, int **affines, Chain *query, int queryFrontGap, Chain *target, int targetFrontGap, Scorer *scorer, int pLeft, int pRight, int card, Thread *thread) |
GPU implementation of Needleman-Wunsch scoring function. More... | |
void | ovEndDataGpu (int *queryEnd, int *targetEnd, int *outScore, Chain *query, Chain *target, Scorer *scorer, int score, int card, Thread *thread) |
GPU implementation of the overlap scoring function. More... | |
void | ovFindScoreGpu (int *queryStart, int *targetStart, Chain *query, Chain *target, Scorer *scorer, int score, int card, Thread *thread) |
GPU implementation of score finding function. More... | |
void | swEndDataGpu (int *queryEnd, int *targetEnd, int *outScore, int **scores, int **affines, Chain *query, Chain *target, Scorer *scorer, int score, int card, Thread *thread) |
GPU implementation of Smith-Waterman scoring function. More... | |
ChainDatabaseGpu * | chainDatabaseGpuCreate (Chain **database, int databaseLen, int *cards, int cardsLen) |
ChainDatabaseGpu constructor. More... | |
void | chainDatabaseGpuDelete (ChainDatabaseGpu *chainDatabaseGpu) |
ChainDatabaseGpu destructor. More... | |
void | scoreDatabaseGpu (int **scores, int type, Chain *query, ChainDatabaseGpu *chainDatabaseGpu, Scorer *scorer, int *indexes, int indexesLen, int *cards, int cardsLen, Thread *thread) |
GPU database aligning function. More... | |
void | scoreDatabasesGpu (int **scores, int type, Chain **queries, int queriesLen, ChainDatabaseGpu *chainDatabaseGpu, Scorer *scorer, int *indexes, int indexesLen, int *cards, int cardsLen, Thread *thread) |
GPU shotgun database aligning function. More... | |
GPU implementations of common functions.
typedef struct ChainDatabaseGpu ChainDatabaseGpu |
GPU database scoring object.
In the database aligning, queries are often changed and the database is fairly static. ChainDatabaseGpu is the chain database prepared for GPU usage to reduce the preperation time in repetitive aligning.
ChainDatabaseGpu* chainDatabaseGpuCreate | ( | Chain ** | database, |
int | databaseLen, | ||
int * | cards, | ||
int | cardsLen | ||
) |
ChainDatabaseGpu constructor.
database | chain array |
databaseLen | chain array length |
cards | cuda cards index array which the database will be available on |
cardsLen | cuda cards index array length, greater or equal to 1 |
void chainDatabaseGpuDelete | ( | ChainDatabaseGpu * | chainDatabaseGpu | ) |
ChainDatabaseGpu destructor.
chainDatabaseGpu | chainDatabaseGpu object |
void hwEndDataGpu | ( | int * | queryEnd, |
int * | targetEnd, | ||
int * | outScore, | ||
Chain * | query, | ||
Chain * | target, | ||
Scorer * | scorer, | ||
int | score, | ||
int | card, | ||
Thread * | thread | ||
) |
GPU implementation of the semiglobal scoring function.
Function provides the semiglobal end data, the position of the maximum score on the query and target sequences as well as the maximum score. QueryEnd must be equal to the length of the query minus one.
queryEnd | output, position of the maximum score on the query sequences |
targetEnd | output, position of the maximum score on the target sequences |
outScore | output, maximum score |
query | query chain |
target | target chain |
scorer | scorer object used for alignment |
score | input alignment score if known, otherwise NO_SCORE |
card | CUDA card on which the function will be executed |
thread | thread on which the function will be executed, if NULL function is executed on the current thread |
void nwFindScoreGpu | ( | int * | queryStart, |
int * | targetStart, | ||
Chain * | query, | ||
Chain * | target, | ||
Scorer * | scorer, | ||
int | score, | ||
int | card, | ||
Thread * | thread | ||
) |
GPU implementation of score finding function.
Method uses Needleman-Wunsch algorithm with all of the start conditions set to infinity. This assures path contains the first cell and does not start with gaps. If the score is found it returns the coordinates of the cell with the provided score, (-1, -1) otherwise.
queryStart | output, if found query index of found cell, -1 otherwise |
targetStart | output, if found target index of found cell, -1 otherwise |
query | query chain |
target | target chain |
scorer | scorer object used for alignment |
score | input alignment score |
card | CUDA card on which the function will be executed |
thread | thread on which the function will be executed, if NULL function is executed on the current thread |
void nwLinearDataGpu | ( | int ** | scores, |
int ** | affines, | ||
Chain * | query, | ||
int | queryFrontGap, | ||
Chain * | target, | ||
int | targetFrontGap, | ||
Scorer * | scorer, | ||
int | pLeft, | ||
int | pRight, | ||
int | card, | ||
Thread * | thread | ||
) |
GPU implementation of Needleman-Wunsch scoring function.
If scores and/or affines pointers are not equal to NULL method provides the last row of the scoring matrix and the affine deletion matrix, respectively. Method uses Ukkonen's banded optimization with the pLeft and pRight margins. PLeft margin is defined as diagonal left of the diagonal from the (0, 0) cell, and pRight as the right diagonal, respectively. Only the cells lying between those diagonals are calculated.
scores | output, if not NULL the last row of the scoring matrix, new array is created |
affines | output, if not NULL the last row of the affine deletion matrix, new array is created |
query | query chain |
queryFrontGap | if not 0, force that alignments start with a query gap |
target | target chain |
targetFrontGap | if not 0, force that alignments start with a target gap |
scorer | scorer object used for alignment |
pLeft | left Ukkonen's margin |
pRight | right Ukkonen's margin |
card | CUDA card on which the function will be executed |
thread | thread on which the function will be executed, if NULL function is executed on the current thread |
void ovEndDataGpu | ( | int * | queryEnd, |
int * | targetEnd, | ||
int * | outScore, | ||
Chain * | query, | ||
Chain * | target, | ||
Scorer * | scorer, | ||
int | score, | ||
int | card, | ||
Thread * | thread | ||
) |
GPU implementation of the overlap scoring function.
Function provides the overlap end data, the position of the maximum score on the query and target sequences as well as the maximum score. QueryEnd must be equal to the length of the query minus one or targetEnd must be equal to the length of the target minus one.
queryEnd | output, position of the maximum score on the query sequences |
targetEnd | output, position of the maximum score on the target sequences |
outScore | output, maximum score |
query | query chain |
target | target chain |
scorer | scorer object used for alignment |
score | input alignment score if known, otherwise NO_SCORE |
card | CUDA card on which the function will be executed |
thread | thread on which the function will be executed, if NULL function is executed on the current thread |
void ovFindScoreGpu | ( | int * | queryStart, |
int * | targetStart, | ||
Chain * | query, | ||
Chain * | target, | ||
Scorer * | scorer, | ||
int | score, | ||
int | card, | ||
Thread * | thread | ||
) |
GPU implementation of score finding function.
Method uses Needleman-Wunsch algorithm. If the score is found and the indicies of the coresponding cell are on the border of the solving matrix, functions returns the coordinates of the cell with the provided score, (-1, -1) otherwise.
queryStart | output, if found query index of found cell, -1 otherwise |
targetStart | output, if found target index of found cell, -1 otherwise |
query | query chain |
target | target chain |
scorer | scorer object used for alignment |
score | input alignment score |
card | CUDA card on which the function will be executed |
thread | thread on which the function will be executed, if NULL function is executed on the current thread |
void scoreDatabaseGpu | ( | int ** | scores, |
int | type, | ||
Chain * | query, | ||
ChainDatabaseGpu * | chainDatabaseGpu, | ||
Scorer * | scorer, | ||
int * | indexes, | ||
int | indexesLen, | ||
int * | cards, | ||
int | cardsLen, | ||
Thread * | thread | ||
) |
GPU database aligning function.
Function scores the query with every target in the chainDatabaseGpu, in other words with every chain in the database array with witch the chainDatabaseGpu was created. The new score array has legnth of databaseLen, where databaseLen is the argument with which the chainDatabaseGpu was created. If the indexes array is given only the targets with given indexes will be scored, other targets will have the NO_SCORE score. CUDA cards are necessary for this function to work.
scores | output, array of scores coresponding to every chain in the database array with which the chainDatabaseGpu was created, new array is created |
type | aligning type, can be SW_ALIGN, NW_ALIGN, HW_ALIGN or OV_ALIGN |
query | query chain |
chainDatabaseGpu | gpu chain database object |
scorer | scorer object used for alignment |
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 |
void scoreDatabasesGpu | ( | int ** | scores, |
int | type, | ||
Chain ** | queries, | ||
int | queriesLen, | ||
ChainDatabaseGpu * | chainDatabaseGpu, | ||
Scorer * | scorer, | ||
int * | indexes, | ||
int | indexesLen, | ||
int * | cards, | ||
int | cardsLen, | ||
Thread * | thread | ||
) |
GPU shotgun database aligning function.
Function scores every query with every target in the chainDatabaseGpu, in other words with every chain in the database array with witch the chainDatabaseGpu was created. The new score array has legnth of databaseLen * queriesLen, where databaseLen is the argument with which the chainDatabaseGpu was created. Array is organized as a table of databaseLen columns and queriesLen rows, where rows correspond to queries and columns to targets in the database. If the indexes array is given only the targets with given indexes will be scored, other targets will have the NO_SCORE score. CUDA cards are necessary for this function to work. This function is faster than calling scoreDatabaseGpu() for every query separately.
scores | output, array of scores coresponding to every query scored with every chain in the database array with which the chainDatabaseGpu was created, 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 |
chainDatabaseGpu | gpu chain database object |
scorer | scorer object used for alignment |
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 |
void swEndDataGpu | ( | int * | queryEnd, |
int * | targetEnd, | ||
int * | outScore, | ||
int ** | scores, | ||
int ** | affines, | ||
Chain * | query, | ||
Chain * | target, | ||
Scorer * | scorer, | ||
int | score, | ||
int | card, | ||
Thread * | thread | ||
) |
GPU implementation of Smith-Waterman scoring function.
Function provides the Smith-Waterman end data, the position of the maximum score on the query and target sequences as well as the maximum score. Additionally if scores and/or affines pointers are not equal to NULL method provides the last row of the scoring matrix and the affine deletion matrix, respectively.
queryEnd | output, position of the maximum score on the query sequences |
targetEnd | output, position of the maximum score on the target sequences |
scores | output, if not NULL the last row of the scoring matrix, new array is created |
affines | output, if not NULL the last row of the affine deletion matrix, new array is created |
outScore | output, maximum score |
query | query chain |
target | target chain |
scorer | scorer object used for alignment |
score | input alignment score if known, otherwise NO_SCORE |
card | CUDA card on which the function will be executed |
thread | thread on which the function will be executed, if NULL function is executed on the current thread |