comparison bwa-0.6.2/ksw.h @ 2:a294fbfcb1db draft default tip

Uploaded BWA
author ashvark
date Fri, 18 Jul 2014 07:55:59 -0400
parents dd1186b11b3b
children
comparison
equal deleted inserted replaced
1:a9636dc1e99a 2:a294fbfcb1db
1 #ifndef __AC_KSW_H
2 #define __AC_KSW_H
3
4 struct _ksw_query_t;
5 typedef struct _ksw_query_t ksw_query_t;
6
7 typedef struct {
8 // input
9 unsigned gapo, gape; // the first gap costs gapo+gape
10 unsigned T; // threshold
11 // output
12 int score, te, qe, score2, te2;
13 } ksw_aux_t;
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 /**
20 * Initialize the query data structure
21 *
22 * @param size Number of bytes used to store a score; valid valures are 1 or 2
23 * @param qlen Length of the query sequence
24 * @param query Query sequence
25 * @param m Size of the alphabet
26 * @param mat Scoring matrix in a one-dimension array
27 *
28 * @return Query data structure
29 */
30 ksw_query_t *ksw_qinit(int size, int qlen, const uint8_t *query, int m, const int8_t *mat); // to free, simply call free()
31
32 /**
33 * Compute the maximum local score for queries initialized with ksw_qinit(1, ...)
34 *
35 * @param q Query data structure returned by ksw_qinit(1, ...)
36 * @param tlen Length of the target sequence
37 * @param target Target sequence
38 * @param a Auxiliary data structure (see ksw.h)
39 *
40 * @return The maximum local score; if the returned value equals 255, the SW may not be finished
41 */
42 int ksw_sse2_8(ksw_query_t *q, int tlen, const uint8_t *target, ksw_aux_t *a);
43
44 /** Compute the maximum local score for queries initialized with ksw_qinit(2, ...) */
45 int ksw_sse2_16(ksw_query_t *q, int tlen, const uint8_t *target, ksw_aux_t *a);
46
47 /** Unified interface for ksw_sse2_8() and ksw_sse2_16() */
48 int ksw_sse2(ksw_query_t *q, int tlen, const uint8_t *target, ksw_aux_t *a);
49
50 #ifdef __cplusplus
51 }
52 #endif
53
54 #endif