Compare commits
13 Commits
sumaclust_
...
master
Author | SHA1 | Date | |
---|---|---|---|
c40d884cc4 | |||
84d9d96f94 | |||
9f08b85eaf | |||
d7cd7e2677 | |||
b11748eac8 | |||
ed56cb1d6b | |||
6373bc1c20 | |||
f9d0ac00aa | |||
a258d334b1 | |||
52e94bbea7 | |||
d44eca19ce | |||
0c4c37d5ab | |||
fa22ffb493 |
0
Licence_CeCILL_V2-en.txt
Normal file → Executable file
0
Licence_CeCILL_V2-en.txt
Normal file → Executable file
0
Licence_CeCILL_V2-fr.txt
Normal file → Executable file
0
Licence_CeCILL_V2-fr.txt
Normal file → Executable file
56
Makefile
Executable file
56
Makefile
Executable file
@ -0,0 +1,56 @@
|
|||||||
|
PREFIX=/usr/local
|
||||||
|
|
||||||
|
SOURCES = libfasta/fasta_header_parser.c \
|
||||||
|
libfasta/fasta_seq_writer.c \
|
||||||
|
libfasta/fasta_header_handler.c \
|
||||||
|
libfasta/header_mem_handler.c \
|
||||||
|
libfasta/sequence.c \
|
||||||
|
libfile/fileHandling.c \
|
||||||
|
liblcs/sse_banded_LCS_alignment.c \
|
||||||
|
liblcs/upperband.c \
|
||||||
|
libutils/utilities.c \
|
||||||
|
libutils/debug.c
|
||||||
|
|
||||||
|
SRCS=$(SOURCES)
|
||||||
|
|
||||||
|
OBJECTS= $(patsubst %.c,%.o,$(SOURCES))
|
||||||
|
|
||||||
|
LIBFILE = libsuma.a
|
||||||
|
|
||||||
|
RANLIB = ranlib
|
||||||
|
|
||||||
|
CC=gcc
|
||||||
|
|
||||||
|
LDFLAGS=
|
||||||
|
|
||||||
|
CFLAGS = -O3 -w
|
||||||
|
|
||||||
|
default: all
|
||||||
|
|
||||||
|
all: $(LIBFILE)
|
||||||
|
|
||||||
|
%.o: %.c
|
||||||
|
$(CC) $(CFLAGS) -c -o $@ $< $(LIB)
|
||||||
|
|
||||||
|
libfasta/fasta_header_parser.c: libfasta/fasta_header_parser.l
|
||||||
|
flex -Pheader_yy -t $< > $@
|
||||||
|
|
||||||
|
libfasta/dic_parser.c: libfasta/dic_parser.l
|
||||||
|
lex -Phashtable_yy -t $< > $@
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(OBJECTS) $(LIBFILE)
|
||||||
|
|
||||||
|
$(LIBFILE): $(OBJECTS)
|
||||||
|
ar -cr $@ $?
|
||||||
|
$(RANLIB) $@
|
||||||
|
|
||||||
|
install: all
|
||||||
|
install -d $(DESTDIR)$(PREFIX)/lib/
|
||||||
|
install -m 644 $(LIBFILE) $(DESTDIR)$(PREFIX)/lib/
|
||||||
|
install -d $(DESTDIR)$(PREFIX)/include/
|
||||||
|
for lib in libfasta liblcs libsse libutils libfile ; do \
|
||||||
|
install -d $(DESTDIR)$(PREFIX)/include/$$lib ; \
|
||||||
|
cp $$lib/*.h $(DESTDIR)$(PREFIX)/include/$$lib ; \
|
||||||
|
done
|
||||||
|
|
10
global.mk
10
global.mk
@ -1,10 +0,0 @@
|
|||||||
|
|
||||||
CC=gcc
|
|
||||||
LDFLAGS=
|
|
||||||
|
|
||||||
CFLAGS = -O3 -w
|
|
||||||
|
|
||||||
default: all
|
|
||||||
|
|
||||||
%.o: %.c
|
|
||||||
$(CC) $(CFLAGS) -c -o $@ $< $(LIB)
|
|
BIN
libfasta/.DS_Store
vendored
BIN
libfasta/.DS_Store
vendored
Binary file not shown.
@ -1,33 +0,0 @@
|
|||||||
|
|
||||||
SOURCES = fasta_header_parser.c \
|
|
||||||
fasta_seq_writer.c \
|
|
||||||
fasta_header_handler.c \
|
|
||||||
header_mem_handler.c \
|
|
||||||
sequence.c
|
|
||||||
|
|
||||||
SRCS=$(SOURCES)
|
|
||||||
|
|
||||||
|
|
||||||
OBJECTS= $(patsubst %.c,%.o,$(SOURCES))
|
|
||||||
|
|
||||||
LIBFILE = libfasta.a
|
|
||||||
RANLIB = ranlib
|
|
||||||
|
|
||||||
|
|
||||||
include ../global.mk
|
|
||||||
|
|
||||||
all: $(LIBFILE)
|
|
||||||
|
|
||||||
fasta_header_parser.c: fasta_header_parser.l
|
|
||||||
flex -Pheader_yy -t $< > $@
|
|
||||||
|
|
||||||
dic_parser.c: dic_parser.l
|
|
||||||
lex -Phashtable_yy -t $< > $@
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf $(OBJECTS) $(LIBFILE)
|
|
||||||
rm -f *.a
|
|
||||||
|
|
||||||
$(LIBFILE): $(OBJECTS)
|
|
||||||
ar -cr $@ $?
|
|
||||||
$(RANLIB) $@
|
|
0
libfasta/fasta_header_handler.c
Normal file → Executable file
0
libfasta/fasta_header_handler.c
Normal file → Executable file
0
libfasta/fasta_header_handler.h
Normal file → Executable file
0
libfasta/fasta_header_handler.h
Normal file → Executable file
108
libfasta/fasta_header_parser.c
Normal file → Executable file
108
libfasta/fasta_header_parser.c
Normal file → Executable file
@ -27,7 +27,7 @@
|
|||||||
#define FLEX_SCANNER
|
#define FLEX_SCANNER
|
||||||
#define YY_FLEX_MAJOR_VERSION 2
|
#define YY_FLEX_MAJOR_VERSION 2
|
||||||
#define YY_FLEX_MINOR_VERSION 5
|
#define YY_FLEX_MINOR_VERSION 5
|
||||||
#define YY_FLEX_SUBMINOR_VERSION 37
|
#define YY_FLEX_SUBMINOR_VERSION 35
|
||||||
#if YY_FLEX_SUBMINOR_VERSION > 0
|
#if YY_FLEX_SUBMINOR_VERSION > 0
|
||||||
#define FLEX_BETA
|
#define FLEX_BETA
|
||||||
#endif
|
#endif
|
||||||
@ -65,6 +65,7 @@ typedef int16_t flex_int16_t;
|
|||||||
typedef uint16_t flex_uint16_t;
|
typedef uint16_t flex_uint16_t;
|
||||||
typedef int32_t flex_int32_t;
|
typedef int32_t flex_int32_t;
|
||||||
typedef uint32_t flex_uint32_t;
|
typedef uint32_t flex_uint32_t;
|
||||||
|
typedef uint64_t flex_uint64_t;
|
||||||
#else
|
#else
|
||||||
typedef signed char flex_int8_t;
|
typedef signed char flex_int8_t;
|
||||||
typedef short int flex_int16_t;
|
typedef short int flex_int16_t;
|
||||||
@ -72,6 +73,7 @@ typedef int flex_int32_t;
|
|||||||
typedef unsigned char flex_uint8_t;
|
typedef unsigned char flex_uint8_t;
|
||||||
typedef unsigned short int flex_uint16_t;
|
typedef unsigned short int flex_uint16_t;
|
||||||
typedef unsigned int flex_uint32_t;
|
typedef unsigned int flex_uint32_t;
|
||||||
|
#endif /* ! C99 */
|
||||||
|
|
||||||
/* Limits of integral types. */
|
/* Limits of integral types. */
|
||||||
#ifndef INT8_MIN
|
#ifndef INT8_MIN
|
||||||
@ -102,8 +104,6 @@ typedef unsigned int flex_uint32_t;
|
|||||||
#define UINT32_MAX (4294967295U)
|
#define UINT32_MAX (4294967295U)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* ! C99 */
|
|
||||||
|
|
||||||
#endif /* ! FLEXINT_H */
|
#endif /* ! FLEXINT_H */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
@ -374,7 +374,7 @@ static void yy_fatal_error (yyconst char msg[] );
|
|||||||
*/
|
*/
|
||||||
#define YY_DO_BEFORE_ACTION \
|
#define YY_DO_BEFORE_ACTION \
|
||||||
(yytext_ptr) = yy_bp; \
|
(yytext_ptr) = yy_bp; \
|
||||||
header_yyleng = (size_t) (yy_cp - yy_bp); \
|
header_yyleng = (yy_size_t) (yy_cp - yy_bp); \
|
||||||
(yy_hold_char) = *yy_cp; \
|
(yy_hold_char) = *yy_cp; \
|
||||||
*yy_cp = '\0'; \
|
*yy_cp = '\0'; \
|
||||||
(yy_c_buf_p) = yy_cp;
|
(yy_c_buf_p) = yy_cp;
|
||||||
@ -390,9 +390,9 @@ struct yy_trans_info
|
|||||||
};
|
};
|
||||||
static yyconst flex_int16_t yy_accept[29] =
|
static yyconst flex_int16_t yy_accept[29] =
|
||||||
{ 0,
|
{ 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 13, 12,
|
0, 0, 0, 0, 0, 0, 0, 0, 13, 2,
|
||||||
3, 2, 1, 5, 4, 7, 6, 9, 8, 10,
|
3, 1, 12, 4, 5, 7, 6, 8, 9, 10,
|
||||||
11, 3, 2, 5, 4, 9, 8, 0
|
11, 2, 3, 4, 5, 8, 9, 0
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
static yyconst flex_int32_t yy_ec[256] =
|
static yyconst flex_int32_t yy_ec[256] =
|
||||||
@ -400,17 +400,17 @@ static yyconst flex_int32_t yy_ec[256] =
|
|||||||
1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
|
1, 1, 1, 1, 1, 1, 1, 1, 2, 1,
|
||||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
1, 2, 1, 3, 3, 1, 3, 3, 3, 3,
|
1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
3, 1, 3, 3, 3, 3, 3, 3, 3, 3,
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
3, 3, 3, 3, 3, 3, 3, 3, 4, 1,
|
1, 1, 1, 1, 1, 1, 1, 1, 3, 1,
|
||||||
5, 6, 1, 1, 3, 3, 3, 3, 3, 3,
|
4, 5, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
3, 1, 3, 1, 3, 1, 3, 3, 3, 3,
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
|
|
||||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
3, 3, 3, 3, 3, 1, 1, 1, 1, 1,
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
|
||||||
@ -427,41 +427,41 @@ static yyconst flex_int32_t yy_ec[256] =
|
|||||||
1, 1, 1, 1, 1
|
1, 1, 1, 1, 1
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
static yyconst flex_int32_t yy_meta[7] =
|
static yyconst flex_int32_t yy_meta[6] =
|
||||||
{ 0,
|
{ 0,
|
||||||
1, 2, 3, 4, 4, 1
|
1, 2, 3, 3, 4
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
static yyconst flex_int16_t yy_base[35] =
|
static yyconst flex_int16_t yy_base[36] =
|
||||||
{ 0,
|
{ 0,
|
||||||
0, 0, 22, 21, 6, 0, 12, 0, 26, 29,
|
0, 4, 23, 0, 9, 0, 14, 0, 27, 0,
|
||||||
0, 0, 29, 0, 0, 29, 29, 0, 0, 29,
|
0, 29, 29, 0, 0, 29, 29, 0, 0, 29,
|
||||||
29, 0, 0, 0, 0, 0, 0, 29, 23, 16,
|
29, 0, 0, 0, 0, 0, 0, 29, 19, 23,
|
||||||
22, 20, 20, 18
|
23, 7, 5, 3, 1
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
static yyconst flex_int16_t yy_def[35] =
|
static yyconst flex_int16_t yy_def[36] =
|
||||||
{ 0,
|
{ 0,
|
||||||
28, 1, 1, 1, 28, 5, 28, 7, 28, 28,
|
29, 29, 2, 3, 28, 5, 28, 7, 28, 30,
|
||||||
29, 30, 28, 31, 32, 28, 28, 33, 34, 28,
|
31, 28, 28, 32, 33, 28, 28, 34, 35, 28,
|
||||||
28, 29, 30, 31, 32, 33, 34, 0, 28, 28,
|
28, 30, 31, 32, 33, 34, 35, 0, 28, 28,
|
||||||
|
28, 28, 28, 28, 28
|
||||||
|
} ;
|
||||||
|
|
||||||
|
static yyconst flex_int16_t yy_nxt[35] =
|
||||||
|
{ 0,
|
||||||
|
28, 11, 27, 26, 12, 11, 25, 24, 12, 14,
|
||||||
|
15, 16, 17, 13, 18, 19, 20, 21, 13, 10,
|
||||||
|
10, 10, 10, 22, 23, 22, 28, 13, 9, 28,
|
||||||
28, 28, 28, 28
|
28, 28, 28, 28
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
static yyconst flex_int16_t yy_nxt[36] =
|
static yyconst flex_int16_t yy_chk[35] =
|
||||||
{ 0,
|
{ 0,
|
||||||
10, 11, 12, 12, 12, 13, 10, 14, 15, 16,
|
0, 1, 35, 34, 1, 2, 33, 32, 2, 5,
|
||||||
17, 10, 10, 18, 19, 20, 21, 10, 23, 23,
|
5, 5, 5, 5, 7, 7, 7, 7, 7, 29,
|
||||||
27, 26, 25, 24, 22, 28, 10, 10, 9, 28,
|
29, 29, 29, 30, 31, 30, 9, 3, 28, 28,
|
||||||
28, 28, 28, 28, 28
|
28, 28, 28, 28
|
||||||
} ;
|
|
||||||
|
|
||||||
static yyconst flex_int16_t yy_chk[36] =
|
|
||||||
{ 0,
|
|
||||||
1, 1, 1, 1, 1, 1, 5, 5, 5, 5,
|
|
||||||
5, 5, 7, 7, 7, 7, 7, 7, 30, 30,
|
|
||||||
34, 33, 32, 31, 29, 9, 4, 3, 28, 28,
|
|
||||||
28, 28, 28, 28, 28
|
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
static yy_state_type yy_last_accepting_state;
|
static yy_state_type yy_last_accepting_state;
|
||||||
@ -590,7 +590,7 @@ static int input (void );
|
|||||||
/* This used to be an fputs(), but since the string might contain NUL's,
|
/* This used to be an fputs(), but since the string might contain NUL's,
|
||||||
* we now use fwrite().
|
* we now use fwrite().
|
||||||
*/
|
*/
|
||||||
#define ECHO do { if (fwrite( header_yytext, header_yyleng, 1, header_yyout )) {} } while (0)
|
#define ECHO fwrite( header_yytext, header_yyleng, 1, header_yyout )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
|
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
|
||||||
@ -601,7 +601,7 @@ static int input (void );
|
|||||||
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
|
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
|
||||||
{ \
|
{ \
|
||||||
int c = '*'; \
|
int c = '*'; \
|
||||||
size_t n; \
|
yy_size_t n; \
|
||||||
for ( n = 0; n < max_size && \
|
for ( n = 0; n < max_size && \
|
||||||
(c = getc( header_yyin )) != EOF && c != '\n'; ++n ) \
|
(c = getc( header_yyin )) != EOF && c != '\n'; ++n ) \
|
||||||
buf[n] = (char) c; \
|
buf[n] = (char) c; \
|
||||||
@ -784,6 +784,7 @@ YY_RULE_SETUP
|
|||||||
}
|
}
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 2:
|
case 2:
|
||||||
|
/* rule 2 can match eol */
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 45 "fasta_header_parser.l"
|
#line 45 "fasta_header_parser.l"
|
||||||
{
|
{
|
||||||
@ -808,6 +809,7 @@ YY_RULE_SETUP
|
|||||||
}
|
}
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 4:
|
case 4:
|
||||||
|
/* rule 4 can match eol */
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 64 "fasta_header_parser.l"
|
#line 64 "fasta_header_parser.l"
|
||||||
{
|
{
|
||||||
@ -846,6 +848,7 @@ YY_RULE_SETUP
|
|||||||
}
|
}
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 8:
|
case 8:
|
||||||
|
/* rule 8 can match eol */
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 90 "fasta_header_parser.l"
|
#line 90 "fasta_header_parser.l"
|
||||||
{
|
{
|
||||||
@ -911,7 +914,7 @@ YY_RULE_SETUP
|
|||||||
#line 136 "fasta_header_parser.l"
|
#line 136 "fasta_header_parser.l"
|
||||||
ECHO;
|
ECHO;
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
#line 915 "<stdout>"
|
#line 918 "<stdout>"
|
||||||
case YY_STATE_EOF(INITIAL):
|
case YY_STATE_EOF(INITIAL):
|
||||||
case YY_STATE_EOF(REGID):
|
case YY_STATE_EOF(REGID):
|
||||||
yyterminate();
|
yyterminate();
|
||||||
@ -1105,7 +1108,7 @@ static int yy_get_next_buffer (void)
|
|||||||
{ /* Not enough room in the buffer - grow it. */
|
{ /* Not enough room in the buffer - grow it. */
|
||||||
|
|
||||||
/* just a shorter name for the current buffer */
|
/* just a shorter name for the current buffer */
|
||||||
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
|
YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
|
||||||
|
|
||||||
int yy_c_buf_p_offset =
|
int yy_c_buf_p_offset =
|
||||||
(int) ((yy_c_buf_p) - b->yy_ch_buf);
|
(int) ((yy_c_buf_p) - b->yy_ch_buf);
|
||||||
@ -1238,7 +1241,7 @@ static int yy_get_next_buffer (void)
|
|||||||
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
|
||||||
yy_is_jam = (yy_current_state == 28);
|
yy_is_jam = (yy_current_state == 28);
|
||||||
|
|
||||||
return yy_is_jam ? 0 : yy_current_state;
|
return yy_is_jam ? 0 : yy_current_state;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void yyunput (int c, register char * yy_bp )
|
static void yyunput (int c, register char * yy_bp )
|
||||||
@ -1326,7 +1329,7 @@ static int yy_get_next_buffer (void)
|
|||||||
case EOB_ACT_END_OF_FILE:
|
case EOB_ACT_END_OF_FILE:
|
||||||
{
|
{
|
||||||
if ( header_yywrap( ) )
|
if ( header_yywrap( ) )
|
||||||
return EOF;
|
return 0;
|
||||||
|
|
||||||
if ( ! (yy_did_buffer_switch_on_eof) )
|
if ( ! (yy_did_buffer_switch_on_eof) )
|
||||||
YY_NEW_FILE;
|
YY_NEW_FILE;
|
||||||
@ -1462,6 +1465,10 @@ static void header_yy_load_buffer_state (void)
|
|||||||
header_yyfree((void *) b );
|
header_yyfree((void *) b );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __cplusplus
|
||||||
|
extern int isatty (int );
|
||||||
|
#endif /* __cplusplus */
|
||||||
|
|
||||||
/* Initializes or reinitializes a buffer.
|
/* Initializes or reinitializes a buffer.
|
||||||
* This function is sometimes called more than once on the same buffer,
|
* This function is sometimes called more than once on the same buffer,
|
||||||
* such as during a header_yyrestart() or at EOF.
|
* such as during a header_yyrestart() or at EOF.
|
||||||
@ -1666,8 +1673,8 @@ YY_BUFFER_STATE header_yy_scan_string (yyconst char * yystr )
|
|||||||
|
|
||||||
/** Setup the input buffer state to scan the given bytes. The next call to header_yylex() will
|
/** Setup the input buffer state to scan the given bytes. The next call to header_yylex() will
|
||||||
* scan from a @e copy of @a bytes.
|
* scan from a @e copy of @a bytes.
|
||||||
* @param yybytes the byte buffer to scan
|
* @param bytes the byte buffer to scan
|
||||||
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
|
* @param len the number of bytes in the buffer pointed to by @a bytes.
|
||||||
*
|
*
|
||||||
* @return the newly allocated buffer state object.
|
* @return the newly allocated buffer state object.
|
||||||
*/
|
*/
|
||||||
@ -1675,8 +1682,7 @@ YY_BUFFER_STATE header_yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybyt
|
|||||||
{
|
{
|
||||||
YY_BUFFER_STATE b;
|
YY_BUFFER_STATE b;
|
||||||
char *buf;
|
char *buf;
|
||||||
yy_size_t n;
|
yy_size_t n, i;
|
||||||
int i;
|
|
||||||
|
|
||||||
/* Get memory for full buffer, including space for trailing EOB's. */
|
/* Get memory for full buffer, including space for trailing EOB's. */
|
||||||
n = _yybytes_len + 2;
|
n = _yybytes_len + 2;
|
||||||
|
0
libfasta/fasta_header_parser.h
Normal file → Executable file
0
libfasta/fasta_header_parser.h
Normal file → Executable file
4
libfasta/fasta_header_parser.l
Normal file → Executable file
4
libfasta/fasta_header_parser.l
Normal file → Executable file
@ -21,8 +21,8 @@
|
|||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
WORD [[:alnum:]:\-.{},'_()\#\[\]\|\&\"\'\/\%\+]+
|
WORD [^>[:blank:]=;]+
|
||||||
WORDID [[:alnum:]:\-.{},'_()\#\[\]\|\&\"\'\/\%\+=;]+
|
WORDID [^>[:blank:]]+
|
||||||
SUP >
|
SUP >
|
||||||
EOL \n
|
EOL \n
|
||||||
SEP ;
|
SEP ;
|
||||||
|
0
libfasta/fasta_seq_writer.c
Normal file → Executable file
0
libfasta/fasta_seq_writer.c
Normal file → Executable file
0
libfasta/fasta_seq_writer.h
Normal file → Executable file
0
libfasta/fasta_seq_writer.h
Normal file → Executable file
0
libfasta/header_mem_handler.c
Normal file → Executable file
0
libfasta/header_mem_handler.c
Normal file → Executable file
0
libfasta/header_mem_handler.h
Normal file → Executable file
0
libfasta/header_mem_handler.h
Normal file → Executable file
19
libfasta/sequence.c
Normal file → Executable file
19
libfasta/sequence.c
Normal file → Executable file
@ -162,19 +162,24 @@ void seq_fillSeqOnlyATGC(char *seq, fastaSeqPtr seqElem, int seqLen)
|
|||||||
{
|
{
|
||||||
char* seqTemp;
|
char* seqTemp;
|
||||||
char c;
|
char c;
|
||||||
int32_t index = 0, seqIndex = 0, len = strlen(seq);
|
int32_t index = 1, seqIndex = 0, len = strlen(seq);
|
||||||
char* seqAlphabets = "acgtACGT";
|
char* seqAlphabets = "acgtACGT";
|
||||||
int notAllATGC = 0;
|
int notAllATGC = 0;
|
||||||
|
int goOnParsing = 1;
|
||||||
|
|
||||||
seqTemp = (char*) util_malloc(seqLen*sizeof(char), __FILE__, __LINE__);
|
seqTemp = (char*) util_malloc(seqLen*sizeof(char), __FILE__, __LINE__);
|
||||||
|
|
||||||
while (index < len)
|
while (goOnParsing)
|
||||||
{
|
{
|
||||||
c = seq[index++];
|
c = seq[index++];
|
||||||
if (strchr(seqAlphabets, c) != NULL)
|
if (strchr(seqAlphabets, c) != NULL)
|
||||||
seqTemp[seqIndex++] = tolower(c);
|
seqTemp[seqIndex++] = tolower(c);
|
||||||
|
else if (seq[index+1]=='\0')
|
||||||
|
goOnParsing = 0; // end of the sequence has been reached.
|
||||||
else if (c != '\n')
|
else if (c != '\n')
|
||||||
notAllATGC = 1;
|
notAllATGC = 1;
|
||||||
|
if (index == len)
|
||||||
|
goOnParsing = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notAllATGC)
|
if (notAllATGC)
|
||||||
@ -223,7 +228,13 @@ fastaSeqCount seq_readAllSeq2(char *fileName, BOOL isStandardSeq, BOOL onlyATGC)
|
|||||||
fastaSeqCount allseqs;
|
fastaSeqCount allseqs;
|
||||||
int32_t discarded=0;
|
int32_t discarded=0;
|
||||||
|
|
||||||
fp = file_open(fileName, TRUE);
|
if ((fileName == NULL) || (strcmp(fileName, "-") == 0))
|
||||||
|
fp = stdin;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fp = file_open(fileName, TRUE);
|
||||||
|
exitIfEmptyFile(fp);
|
||||||
|
}
|
||||||
|
|
||||||
if (fp == NULL)
|
if (fp == NULL)
|
||||||
{
|
{
|
||||||
@ -231,8 +242,6 @@ fastaSeqCount seq_readAllSeq2(char *fileName, BOOL isStandardSeq, BOOL onlyATGC)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
exitIfEmptyFile(fp);
|
|
||||||
|
|
||||||
seqPtrAr = (fastaSeqPtr) util_malloc(slots*sizeof(fastaSeq), __FILE__, __LINE__);
|
seqPtrAr = (fastaSeqPtr) util_malloc(slots*sizeof(fastaSeq), __FILE__, __LINE__);
|
||||||
|
|
||||||
seqPtr = seq_getNext(fp, " ", isStandardSeq, onlyATGC);
|
seqPtr = seq_getNext(fp, " ", isStandardSeq, onlyATGC);
|
||||||
|
0
libfasta/sequence.h
Normal file → Executable file
0
libfasta/sequence.h
Normal file → Executable file
BIN
libfile/.DS_Store
vendored
BIN
libfile/.DS_Store
vendored
Binary file not shown.
@ -1,25 +0,0 @@
|
|||||||
|
|
||||||
SOURCES = fileHandling.c
|
|
||||||
|
|
||||||
|
|
||||||
SRCS=$(SOURCES)
|
|
||||||
|
|
||||||
|
|
||||||
OBJECTS= $(patsubst %.c,%.o,$(SOURCES))
|
|
||||||
|
|
||||||
LIBFILE= libfile.a
|
|
||||||
RANLIB=ranlib
|
|
||||||
|
|
||||||
|
|
||||||
include ../global.mk
|
|
||||||
|
|
||||||
all: $(LIBFILE)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf $(OBJECTS) $(LIBFILE)
|
|
||||||
rm -f *.P
|
|
||||||
rm -f *.a
|
|
||||||
|
|
||||||
$(LIBFILE): $(OBJECTS)
|
|
||||||
ar -cr $@ $?
|
|
||||||
$(RANLIB) $@
|
|
10
libfile/fileHandling.c
Normal file → Executable file
10
libfile/fileHandling.c
Normal file → Executable file
@ -44,7 +44,7 @@ FILE *file_openrw(char* fileName, BOOL abortOnError)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Function Name: fileNextChar(FILE* fp)
|
* Function Name: fileNextChar(FILE* fp)
|
||||||
* Description: Reads the file and returns next character, if file is null or its end of file, returns \<5C>.
|
* Description: Reads the file and returns next character, if file is null or its end of file, returns \<5C>.
|
||||||
*/
|
*/
|
||||||
char file_nextChar(FILE* fp)
|
char file_nextChar(FILE* fp)
|
||||||
{
|
{
|
||||||
@ -59,7 +59,7 @@ char file_nextChar(FILE* fp)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Function Name: *fileNextLine(FILE *fp, char *buffer, int32_t bufferSize)
|
* Function Name: *fileNextLine(FILE *fp, char *buffer, int32_t bufferSize)
|
||||||
* Description: Reads the file and returns next line, if file is null or its end of file, returns \<5C>.
|
* Description: Reads the file and returns next line, if file is null or its end of file, returns \<5C>.
|
||||||
*/
|
*/
|
||||||
char *file_nextLine(FILE *fp, char *buffer, int32_t bufferSize)
|
char *file_nextLine(FILE *fp, char *buffer, int32_t bufferSize)
|
||||||
{
|
{
|
||||||
@ -76,7 +76,11 @@ char *file_nextLine(FILE *fp, char *buffer, int32_t bufferSize)
|
|||||||
void exitIfEmptyFile(FILE *file)
|
void exitIfEmptyFile(FILE *file)
|
||||||
{
|
{
|
||||||
long savedOffset = ftell(file);
|
long savedOffset = ftell(file);
|
||||||
fseek(file, 0, SEEK_END);
|
if (fseek(file, 0, SEEK_END) != 0)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "\nError moving the offset in an input file\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
if (ftell(file) == 0)
|
if (ftell(file) == 0)
|
||||||
{
|
{
|
||||||
|
0
libfile/fileHandling.h
Normal file → Executable file
0
libfile/fileHandling.h
Normal file → Executable file
BIN
liblcs/.DS_Store
vendored
BIN
liblcs/.DS_Store
vendored
Binary file not shown.
@ -1,25 +0,0 @@
|
|||||||
|
|
||||||
SOURCES = sse_banded_LCS_alignment.c \
|
|
||||||
upperband.c
|
|
||||||
|
|
||||||
SRCS=$(SOURCES)
|
|
||||||
|
|
||||||
|
|
||||||
OBJECTS= $(patsubst %.c,%.o,$(SOURCES))
|
|
||||||
|
|
||||||
LIBFILE= liblcs.a
|
|
||||||
RANLIB=ranlib
|
|
||||||
|
|
||||||
|
|
||||||
include ../global.mk
|
|
||||||
|
|
||||||
all: $(LIBFILE)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf $(OBJECTS) $(LIBFILE)
|
|
||||||
rm -f *.P
|
|
||||||
rm -f *.a
|
|
||||||
|
|
||||||
$(LIBFILE): $(OBJECTS)
|
|
||||||
ar -cr $@ $?
|
|
||||||
$(RANLIB) $@
|
|
0
liblcs/_lcs.ext.1.c
Normal file → Executable file
0
liblcs/_lcs.ext.1.c
Normal file → Executable file
0
liblcs/_lcs.ext.2.c
Normal file → Executable file
0
liblcs/_lcs.ext.2.c
Normal file → Executable file
0
liblcs/_lcs.ext.3.c
Normal file → Executable file
0
liblcs/_lcs.ext.3.c
Normal file → Executable file
0
liblcs/_lcs.h
Normal file → Executable file
0
liblcs/_lcs.h
Normal file → Executable file
0
liblcs/_lcs_fast.h
Normal file → Executable file
0
liblcs/_lcs_fast.h
Normal file → Executable file
0
liblcs/banded_LCS_alignment.c
Normal file → Executable file
0
liblcs/banded_LCS_alignment.c
Normal file → Executable file
0
liblcs/banded_LCS_alignment.h
Normal file → Executable file
0
liblcs/banded_LCS_alignment.h
Normal file → Executable file
3
liblcs/sse_banded_LCS_alignment.c
Normal file → Executable file
3
liblcs/sse_banded_LCS_alignment.c
Normal file → Executable file
@ -458,6 +458,9 @@ int calculateSizeToAllocate(int maxLen, int minLen, int LCSmin)
|
|||||||
|
|
||||||
calculateBandLengths(maxLen, minLen, ¬Used, &size, LCSmin); // max size = max left band length * 2
|
calculateBandLengths(maxLen, minLen, ¬Used, &size, LCSmin); // max size = max left band length * 2
|
||||||
|
|
||||||
|
if (!size) // Happens if there is no threshold (threshold is 100% similarity) and generates bugs if left to 0
|
||||||
|
size = 1;
|
||||||
|
|
||||||
//fprintf(stderr, "\nsize for address before %8 = %d", size);
|
//fprintf(stderr, "\nsize for address before %8 = %d", size);
|
||||||
|
|
||||||
size*= 2;
|
size*= 2;
|
||||||
|
0
liblcs/sse_banded_LCS_alignment.h
Normal file → Executable file
0
liblcs/sse_banded_LCS_alignment.h
Normal file → Executable file
0
liblcs/upperband.c
Normal file → Executable file
0
liblcs/upperband.c
Normal file → Executable file
0
liblcs/upperband.h
Normal file → Executable file
0
liblcs/upperband.h
Normal file → Executable file
BIN
libsse/.DS_Store
vendored
BIN
libsse/.DS_Store
vendored
Binary file not shown.
13
libsse/_sse.h
Normal file → Executable file
13
libsse/_sse.h
Normal file → Executable file
@ -4,11 +4,16 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#ifdef __SSE2__
|
|
||||||
#include <xmmintrin.h>
|
#if defined(__SSE2__)
|
||||||
|
#define USE_SSE2
|
||||||
|
#elif defined(__ARM_NEON)
|
||||||
|
#define USE_SSE2
|
||||||
|
#include "sse2neon.h"
|
||||||
#else
|
#else
|
||||||
|
// no SSE2 support, use emulation
|
||||||
typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
|
typedef long long __m128i __attribute__ ((__vector_size__ (16), __may_alias__));
|
||||||
#endif /* __SSE2__ */
|
#endif
|
||||||
|
|
||||||
#ifndef MAX
|
#ifndef MAX
|
||||||
#define MAX(x,y) (((x)>(y)) ? (x):(y))
|
#define MAX(x,y) (((x)>(y)) ? (x):(y))
|
||||||
@ -55,7 +60,7 @@ typedef union
|
|||||||
} uint64_v;
|
} uint64_v;
|
||||||
|
|
||||||
|
|
||||||
#ifdef __SSE2__
|
#ifdef USE_SSE2
|
||||||
|
|
||||||
static inline int8_t _s2_extract_epi8(__m128i r, const int p)
|
static inline int8_t _s2_extract_epi8(__m128i r, const int p)
|
||||||
{
|
{
|
||||||
|
8848
libsse/sse2neon.h
Normal file
8848
libsse/sse2neon.h
Normal file
File diff suppressed because it is too large
Load Diff
BIN
libutils/.DS_Store
vendored
BIN
libutils/.DS_Store
vendored
Binary file not shown.
@ -1,25 +0,0 @@
|
|||||||
|
|
||||||
SOURCES = utilities.c \
|
|
||||||
debug.c
|
|
||||||
|
|
||||||
SRCS=$(SOURCES)
|
|
||||||
|
|
||||||
|
|
||||||
OBJECTS= $(patsubst %.c,%.o,$(SOURCES))
|
|
||||||
|
|
||||||
LIBFILE= libutils.a
|
|
||||||
RANLIB=ranlib
|
|
||||||
|
|
||||||
|
|
||||||
include ../global.mk
|
|
||||||
|
|
||||||
all: $(LIBFILE)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -rf $(OBJECTS) $(LIBFILE)
|
|
||||||
rm -f *.P
|
|
||||||
rm -f *.a
|
|
||||||
|
|
||||||
$(LIBFILE): $(OBJECTS)
|
|
||||||
ar -cr $@ $?
|
|
||||||
$(RANLIB) $@
|
|
0
libutils/debug.c
Normal file → Executable file
0
libutils/debug.c
Normal file → Executable file
0
libutils/debug.h
Normal file → Executable file
0
libutils/debug.h
Normal file → Executable file
0
libutils/utilities.c
Normal file → Executable file
0
libutils/utilities.c
Normal file → Executable file
0
libutils/utilities.h
Normal file → Executable file
0
libutils/utilities.h
Normal file → Executable file
Reference in New Issue
Block a user