-
Notifications
You must be signed in to change notification settings - Fork 0
Usage
Building versalignLib creates shared objects for each Kernel implementation in the bin/Versalign-0.1.0/lib
subfolder. These can be dynamically loaded and directly used in your program.
An example how to do this can be found in the reference implementation.
Each shared object exports the following functions.
void set_parameters(AlignmentParameters * parameters)
Sets parameters for alignment.
void set_logger(AlignmentLogger * logger)
Sets logger for alignment.
AlignmentKernel * spawn_alignment_kernel()
Creates alignment.
void delete_alignment_kernel(AlignmentKernel * instance)
Deletes alignment.
Caveat: Before instantiating an AlignmentKernel
, all parameters and loggers have to be set using set_parameters
and set_logger
functions!
All Kernels implement the AlignmentKernel
interface in include/AlignmentKernel.h
providing two functions:
This function will return an alignment score for each sequence pair.
void score_alignments(int const & opt, int const & aln_number, char const * const * const reads,
char const * const * const refs, short * const scores)
Argument | Type | Description |
---|---|---|
opt |
int | Type of alignment (0 Smith-Waterman, 1 Needleman-Wunsch) |
aln_number |
int | Number of reads vs refs pairs |
reads |
char * [] | Array of sequences to align to refs
|
refs |
char * [] | Array of sequences to align to reads
|
scores |
short [] | One score for each pair in reads vs refs
|
This function will return an alignment struct object for each sequence pair.
void compute_alignments(int const & opt, int const & aln_number, char const * const * const reads,
char const * const * const refs, Alignment * const alignments)
Argument | Type | Description |
---|---|---|
opt |
int | Type of alignment (0 Smith-Waterman, 1 Needleman-Wunsch) |
aln_number |
int | Number of reads vs refs pairs |
reads |
char * [] | Array of sequences to align to refs
|
refs |
char * [] | Array of sequences to align to reads
|
alignments |
Alignment [] | One Alignment object for each pair in reads vs refs
|
It is required to set the alignment parameters (scoring schema, number of threads...) before instantiating any of the Kernel shared objects.
This can be done using an object implementing the AlignmentParameters
interface defined in include/AlignmentParameters.h
. An example is shown in the reference implementation.
The following table lists the minimal set of parameters that needs to be available.
Parameter | Type | Description |
---|---|---|
score_match |
int | Score for base match |
score_mismatch |
int | Score for base mismatch |
score_gap_read |
int | Score for introducing a gap in the first sequence |
score_gap_ref |
int | Score for introducing a gap in the second sequence |
read_length |
int | Maximum length of first sequence |
ref_length |
int | Maximum length of second sequence |
num_threads |
int | Number of threads to use |
Logging of Kernels is also supported by implementing the AlignmentLogger
interface defined in include/AlignmentLogger.h
. An example implementation can be found in the reference implementation.