2
kalign2_string_matching.c
4
Released under GPL - see the 'COPYING' file
6
Copyright (C) 2006 Timo Lassmann <timolassmann@gmail.com>
8
This program is free software; you can redistribute it and/or modify
9
it under the terms of the GNU General Public License as published by
10
the Free Software Foundation; either version 2 of the License, or
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU General Public License for more details.
18
You should have received a copy of the GNU General Public License
19
along with this program; if not, write to the Free Software
20
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
Please send bug reports, comments etc. to:
23
timolassmann@gmail.com
28
int byg_detect(int* text,int n)
34
for (i = 0;i < 256;i++){
38
//char *unique_aa = "EFILPQXZ";//permissiv
39
//ABCDEFGHIJKLMNOPQRSTUVWXYZ
40
char *unique_aa = "BDEFHIJKLMNOPQRSVWYZ";//restrictive
41
int aacode[26] = {0,1,2,3,4,5,6,7,8,-1,9,10,11,12,23,13,14,15,16,17,17,18,19,20,21,22};
42
for (i= 0;i < 20;i++){
43
T[(int)aacode[unique_aa[i]-65]] |= 1;
45
for (i = 0;i < n;i++){
46
// fprintf(stderr,"%d\n",text[i]);
60
int check_identity(char* n,char*m)
71
for (i = 0; i < len_n;i++){
81
int byg_count(char* pattern,char*text)
88
for (i = 0;i < 256;i++){
92
int m = strlen(pattern);
93
int n = strlen (text);
94
int mb = (1 << (m-1));
97
T[(int)pattern[i]] |= (1 << i);
100
for (i = 0;i < n;i++){
103
Tc = T[(int)text[i]];
112
int byg_end(char* pattern,char*text)
118
for (i = 0;i < 256;i++){
122
int m = strlen(pattern);
123
int n = strlen (text);
124
int mb = (1 << (m-1));
126
for (i= 0;i < m;i++){
127
T[(int)pattern[i]] |= (1 << i);
130
for (i = 0;i < n;i++){
136
Tc = T[(int)text[i]];
145
int byg_start(char* pattern,char*text)
151
for (i = 0;i < 256;i++){
155
int m = strlen(pattern);
156
int n = strlen(text);
157
int mb = (1 << (m-1));
159
for (i= 0;i < m;i++){
160
T[(int)pattern[i]] |= (1 << i);
163
for (i = 0;i < n;i++){
166
Tc = T[(int)text[i]];