Edlib
1.1.2.
Lightweight, super fast C/C++ library for sequence alignment using edit distance.
|
Main header file, containing all public functions and structures. More...
Go to the source code of this file.
Classes | |
struct | EdlibAlignConfig |
Configuration object for edlibAlign() function. More... | |
struct | EdlibAlignResult |
Macros | |
#define | EDLIB_STATUS_OK 0 |
#define | EDLIB_STATUS_ERROR 1 |
#define | EDLIB_EDOP_MATCH 0 |
Match. | |
#define | EDLIB_EDOP_INSERT 1 |
Insertion to target = deletion from query. | |
#define | EDLIB_EDOP_DELETE 2 |
Deletion from target = insertion to query. | |
#define | EDLIB_EDOP_MISMATCH 3 |
Mismatch. | |
Enumerations | |
enum | EdlibAlignMode { EDLIB_MODE_NW, EDLIB_MODE_SHW, EDLIB_MODE_HW } |
enum | EdlibAlignTask { EDLIB_TASK_DISTANCE, EDLIB_TASK_LOC, EDLIB_TASK_PATH } |
enum | EdlibCigarFormat { EDLIB_CIGAR_STANDARD, EDLIB_CIGAR_EXTENDED } |
Functions | |
EdlibAlignConfig | edlibNewAlignConfig (int k, EdlibAlignMode mode, EdlibAlignTask task) |
EdlibAlignConfig | edlibDefaultAlignConfig (void) |
void | edlibFreeAlignResult (EdlibAlignResult result) |
EdlibAlignResult | edlibAlign (const char *query, int queryLength, const char *target, int targetLength, const EdlibAlignConfig config) |
char * | edlibAlignmentToCigar (const unsigned char *alignment, int alignmentLength, EdlibCigarFormat cigarFormat) |
Main header file, containing all public functions and structures.
enum EdlibAlignMode |
Alignment methods - how should Edlib treat gaps before and after query?
enum EdlibAlignTask |
enum EdlibCigarFormat |
EdlibAlignResult edlibAlign | ( | const char * | query, |
int | queryLength, | ||
const char * | target, | ||
int | targetLength, | ||
const EdlibAlignConfig | config | ||
) |
Aligns two sequences (query and target) using edit distance (levenshtein distance). Through config parameter, this function supports different alignment methods (global, prefix, infix), as well as different modes of search (tasks). It always returns edit distance and end locations of optimal alignment in target. It optionally returns start locations of optimal alignment in target and alignment path, if you choose appropriate tasks.
[in] | query | First sequence. Character codes should be in range [0, 127]. |
[in] | queryLength | Number of characters in first sequence. |
[in] | target | Second sequence. Character codes should be in range [0, 127]. |
[in] | targetLength | Number of characters in second sequence. |
[in] | config | Additional alignment parameters, like alignment method and wanted results. |
char* edlibAlignmentToCigar | ( | const unsigned char * | alignment, |
int | alignmentLength, | ||
EdlibCigarFormat | cigarFormat | ||
) |
Builds cigar string from given alignment sequence.
[in] | alignment | Alignment sequence. 0 stands for match. 1 stands for insertion to target. 2 stands for insertion to query. 3 stands for mismatch. |
[in] | alignmentLength | |
[in] | cigarFormat | Cigar will be returned in specified format. |
EdlibAlignConfig edlibDefaultAlignConfig | ( | void | ) |
void edlibFreeAlignResult | ( | EdlibAlignResult | result | ) |
Frees memory in EdlibAlignResult that was allocated by edlib. If you do not use it, make sure to free needed members manually using free().
EdlibAlignConfig edlibNewAlignConfig | ( | int | k, |
EdlibAlignMode | mode, | ||
EdlibAlignTask | task | ||
) |
Helper method for easy construction of configuration object.