-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstdaln.h
More file actions
105 lines (83 loc) · 2.83 KB
/
stdaln.h
File metadata and controls
105 lines (83 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*
* stdaln.h -- standard alignment (local and banded global alignment)
*
* Copyright (c) 2003-2006, Heng Li <liheng@genomics.org.cn>
* <lh3lh3@gmail.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef LH3_STDALN_H_
#define LH3_STDALN_H_
#define STDALN_VERSION 0.9.5
#ifndef MYALLOC
# define MYALLOC malloc
#endif
#ifndef MYFREE
# define MYFREE free
#endif
#define FROM_M 0
#define FROM_I 1
#define FROM_D 2
/* This is the smallest integer. It might be CPU-dependent in very RARE cases. */
#define MINOR_INF -1073741823
typedef struct
{
int gap_open;
int gap_ext;
int gap_end;
int *matrix;
int row;
int band_width;
} AlnParam;
typedef struct
{
int i, j;
unsigned char ctype;
} path_t;
typedef struct
{
path_t *path; /* for advanced users... :-) */
int path_len; /* for advanced users... :-) */
int start1, end1; /* start and end of the first sequence, coordinations are 1-based */
int start2, end2; /* start and end of the second sequence, coordinations are 1-based */
int score; /* score */
char *out1, *out2; /* print them, and then you will know */
char *outm;
} AlnAln;
#ifdef __cplusplus
extern "C" {
#endif
AlnAln *aln_stdaln_aux(const char *seq1, const char *seq2, const AlnParam *ap, int is_global, int do_align, int len1, int len2);
AlnAln *aln_stdaln(const char *seq1, const char *seq2, const AlnParam *ap, int is_global, int do_align);
void aln_free_AlnAln(AlnAln *aa);
#ifdef __cplusplus
}
#endif
/********************
* global variables *
********************/
extern AlnParam aln_param_nt2nt; /* = { 10, 2, 2, aln_sm_nt, 16, 75 }; */
extern AlnParam aln_param_aa2aa; /* = { 20, 19, 19, aln_sm_read, 16, 75 }; */
extern AlnParam aln_param_rd2rd; /* = { 12, 2, 2, aln_sm_blosum62, 22, 50 }; */
/* common nucleotide score matrix for 16 bases */
extern int aln_sm_nt[];
/* BLOSUM62 and BLOSUM45 */
extern int aln_sm_blosum62[], aln_sm_blosum45[];
/* common read for 16 bases. note that read alignment is quite different from common nucleotide alignment */
extern int aln_sm_read[];
/* human-mouse score matrix for 4 bases */
extern int aln_sm_hs[];
#endif