#ifndef __AC_KSW_H #define __AC_KSW_H #include #define KSW_XBYTE 0x10000 #define KSW_XSTOP 0x20000 #define KSW_XSUBO 0x40000 #define KSW_XSTART 0x80000 struct _kswq_t; typedef struct _kswq_t kswq_t; typedef struct { int score; // best score int te, qe; // target end and query end int score2, te2; // second best score and ending position on the target int tb, qb; // target start and query start } kswr_t; #ifdef __cplusplus extern "C" { #endif /** * Aligning two sequences * * @param qlen length of the query sequence (typically =0, *gscore keeps the best score such that * the entire query sequence is aligned; *gtle keeps the position on the * target where *gscore is achieved. Returning *gscore and *gtle helps the * caller to decide whether an end-to-end hit or a partial hit is preferred. * * The first 9 parameters are identical to those in ksw_global() * * @param h0 alignment score of upstream sequences * @param _qle (out) length of the query in the alignment * @param _tle (out) length of the target in the alignment * @param _gtle (out) length of the target if query is fully aligned * @param _gscore (out) score of the best end-to-end alignment; negative if not found * * @return best semi-local alignment score */ int ksw_extend(int qlen, const uint8_t *query, int tlen, const uint8_t *target, int m, const int8_t *mat, int gapo, int gape, int w, int end_bonus, int zdrop, int h0, int *qle, int *tle, int *gtle, int *gscore, int *max_off); int ksw_extend2(int qlen, const uint8_t *query, int tlen, const uint8_t *target, int m, const int8_t *mat, int o_del, int e_del, int o_ins, int e_ins, int w, int end_bonus, int zdrop, int h0, int *qle, int *tle, int *gtle, int *gscore, int *max_off); #ifdef __cplusplus } #endif #endif