]> git.donarmstrong.com Git - fastq-tools.git/blob - src/fastq-sw.h
a couple fixes to smith-waterman
[fastq-tools.git] / src / fastq-sw.h
1 /*
2  * This file is part of fastq-tools.
3  *
4  * Copyright (c) 2011 by Daniel C. Jones <dcjones@cs.washington.edu>
5  *
6  * fastq-sw :
7  * Local alignments of nucleotide sequences via Smith-Waterman.
8  *
9  */
10
11 #ifndef FASTQ_TOOLS_SW_H
12 #define FASTQ_TOOLS_SW_H
13
14
15 typedef struct
16 {
17     unsigned char* subject;
18     int size;
19
20     int d[25];      /* cost matrix */
21     int gap_open;   /* gap open    */
22     int gap_extend; /* gap extend  */
23
24     /* matrix rows, used internally */
25     int* work0;
26     int* work1;
27
28 } sw_t;
29
30 /* convert a n ASCII nucleotide sequence to one suitable for fastq_sw */
31 void fastq_sw_conv_seq(unsigned char*, int n);
32
33 sw_t* fastq_alloc_sw(const unsigned char *subject, int size);
34 void  fastq_free_sw(sw_t*);
35
36 int fastq_sw(sw_t*, const unsigned char* query, int size);
37
38 #endif
39