Compare commits
7 Commits
sumatra_v1
...
master
Author | SHA1 | Date | |
---|---|---|---|
c40d884cc4 | |||
84d9d96f94 | |||
9f08b85eaf | |||
d7cd7e2677 | |||
b11748eac8 | |||
ed56cb1d6b | |||
6373bc1c20 |
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) $@
|
|
41
libfasta/fasta_header_handler.c
Normal file → Executable file
41
libfasta/fasta_header_handler.c
Normal file → Executable file
@ -69,34 +69,15 @@ char* fastaSeqPtr_header_add_field(fastaSeqPtr seq, char* name, char* value)
|
|||||||
element_from_header* table_header_add_field(element_from_header* header, char* name, char* value)
|
element_from_header* table_header_add_field(element_from_header* header, char* name, char* value)
|
||||||
{
|
{
|
||||||
int nbf;
|
int nbf;
|
||||||
int i, j;
|
|
||||||
element_from_header* new_header;
|
|
||||||
|
|
||||||
nbf = atoi(header[0].value);
|
nbf = atoi(header[0].value);
|
||||||
new_header = (element_from_header*) realloc(header, ((nbf+1)*sizeof(element_from_header)));
|
nbf++;
|
||||||
|
header = (element_from_header*) realloc(header, (nbf+1)*sizeof(element_from_header));
|
||||||
i=0;
|
header[nbf].name = (char*) malloc((1+strlen(name))*sizeof(char));
|
||||||
while ((strcmp(new_header[i].name, "definition") != 0) && (i < nbf))
|
strcpy(header[nbf].name, name);
|
||||||
i++;
|
header[nbf].value = (char*) malloc((1+strlen(value))*sizeof(char));
|
||||||
|
strcpy(header[nbf].value, value);
|
||||||
if (strcmp(new_header[i].name, "definition") == 0)
|
sprintf(header[0].value, "%d", nbf);
|
||||||
{
|
return(header);
|
||||||
j = nbf-1;
|
|
||||||
while (strcmp(new_header[j].name, "definition") == 0)
|
|
||||||
{
|
|
||||||
new_header[j+1].name = new_header[j].name;
|
|
||||||
new_header[j+1].value = new_header[j].value;
|
|
||||||
j--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
new_header[i].name = (char*) malloc((1+strlen(name))*sizeof(char));
|
|
||||||
strcpy(new_header[i].name, name);
|
|
||||||
new_header[i].value = (char*) malloc((1+strlen(value))*sizeof(char));
|
|
||||||
strcpy(new_header[i].value, value);
|
|
||||||
sprintf(new_header[0].value, "%d", nbf+1);
|
|
||||||
|
|
||||||
return(new_header);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -105,7 +86,7 @@ void free_header_table(element_from_header* header)
|
|||||||
int i;
|
int i;
|
||||||
int nbf = atoi(header[0].value);
|
int nbf = atoi(header[0].value);
|
||||||
|
|
||||||
for (i = 0; i < nbf; i++)
|
for (i = 0; i <= nbf; i++)
|
||||||
{
|
{
|
||||||
free((header[i]).name);
|
free((header[i]).name);
|
||||||
free((header[i]).value);
|
free((header[i]).value);
|
||||||
@ -120,7 +101,7 @@ char* getItemFromHeader(char* name, element_from_header* header)
|
|||||||
int nbf;
|
int nbf;
|
||||||
int i;
|
int i;
|
||||||
nbf = atoi(header[0].value);
|
nbf = atoi(header[0].value);
|
||||||
for (i = 1; i < nbf; i++)
|
for (i = 1; i <= nbf; i++)
|
||||||
{
|
{
|
||||||
if (strcmp(header[i].name,name)==0)
|
if (strcmp(header[i].name,name)==0)
|
||||||
value = header[i].value;
|
value = header[i].value;
|
||||||
@ -134,7 +115,7 @@ void changeValue(element_from_header* header, char* name, char* newValue)
|
|||||||
int i;
|
int i;
|
||||||
int nbf = atoi(header[0].value);
|
int nbf = atoi(header[0].value);
|
||||||
|
|
||||||
for (i = 1; i < nbf; i++)
|
for (i = 1; i <= nbf; i++)
|
||||||
{
|
{
|
||||||
if (strcmp(header[i].name, name)==0)
|
if (strcmp(header[i].name, name)==0)
|
||||||
{
|
{
|
||||||
|
0
libfasta/fasta_header_handler.h
Normal file → Executable file
0
libfasta/fasta_header_handler.h
Normal file → Executable file
61
libfasta/fasta_header_parser.c
Normal file → Executable file
61
libfasta/fasta_header_parser.c
Normal file → Executable file
@ -798,7 +798,7 @@ YY_RULE_SETUP
|
|||||||
(*p_header)[*nbf].value = (char*) malloc(sizeof(char)*size_needed);
|
(*p_header)[*nbf].value = (char*) malloc(sizeof(char)*size_needed);
|
||||||
strcpy(((*p_header)[*nbf]).value,header_yytext);
|
strcpy(((*p_header)[*nbf]).value,header_yytext);
|
||||||
|
|
||||||
p_header = check_and_realloc_mem_in_header_table(p_header, nbf, memory_allocated);
|
(*nbf)++;
|
||||||
}
|
}
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 3:
|
case 3:
|
||||||
@ -820,7 +820,7 @@ YY_RULE_SETUP
|
|||||||
case 5:
|
case 5:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 69 "fasta_header_parser.l"
|
#line 69 "fasta_header_parser.l"
|
||||||
{ // TODO
|
{
|
||||||
/*fprintf(stderr,"\n<REGNAME>{SPACE} **%s**",header_yytext);*/
|
/*fprintf(stderr,"\n<REGNAME>{SPACE} **%s**",header_yytext);*/
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
field = store_in_field(field,header_yytext,&free_size,&i);
|
field = store_in_field(field,header_yytext,&free_size,&i);
|
||||||
@ -886,21 +886,24 @@ case YY_STATE_EOF(REGVAL):
|
|||||||
#line 113 "fasta_header_parser.l"
|
#line 113 "fasta_header_parser.l"
|
||||||
{
|
{
|
||||||
field = store_in_header_table(field, &((*p_header)[*nbf].value), &free_size, &i);
|
field = store_in_header_table(field, &((*p_header)[*nbf].value), &free_size, &i);
|
||||||
(*nbf)++;
|
p_header = check_and_realloc_mem_in_header_table(p_header, nbf, memory_allocated);
|
||||||
end_header_table(p_header, *nbf);
|
end_header_table(p_header, *nbf);
|
||||||
|
|
||||||
free(field);
|
free(field);
|
||||||
BEGIN(INITIAL);
|
BEGIN(INITIAL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
YY_BREAK
|
YY_BREAK
|
||||||
case YY_STATE_EOF(REGNAME):
|
case YY_STATE_EOF(REGNAME):
|
||||||
#line 122 "fasta_header_parser.l"
|
#line 123 "fasta_header_parser.l"
|
||||||
{
|
{
|
||||||
(*p_header)[*nbf].name = (char*) malloc(sizeof(char)*19);
|
/*(*p_header)[*nbf].name = (char*) malloc(sizeof(char)*19);
|
||||||
strcpy((*p_header)[*nbf].name,"definition");
|
strcpy((*p_header)[*nbf].name,"other_informations");
|
||||||
field = store_in_header_table(field, &((*p_header)[*nbf].value), &free_size, &i);
|
field = store_in_header_table(field, &((*p_header)[*nbf].value), &free_size, &i);
|
||||||
(*nbf)++;
|
p_header = check_and_realloc_mem_in_header_table(p_header, nbf, memory_allocated);
|
||||||
end_header_table(p_header, nbf);
|
*/
|
||||||
|
end_header_table(p_header, *nbf);
|
||||||
|
|
||||||
free(field);
|
free(field);
|
||||||
BEGIN(INITIAL);
|
BEGIN(INITIAL);
|
||||||
return 0;
|
return 0;
|
||||||
@ -908,10 +911,10 @@ case YY_STATE_EOF(REGNAME):
|
|||||||
YY_BREAK
|
YY_BREAK
|
||||||
case 12:
|
case 12:
|
||||||
YY_RULE_SETUP
|
YY_RULE_SETUP
|
||||||
#line 133 "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();
|
||||||
@ -1909,7 +1912,7 @@ void header_yyfree (void * ptr )
|
|||||||
|
|
||||||
#define YYTABLES_NAME "yytables"
|
#define YYTABLES_NAME "yytables"
|
||||||
|
|
||||||
#line 133 "fasta_header_parser.l"
|
#line 136 "fasta_header_parser.l"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1920,32 +1923,38 @@ int header_yywrap()
|
|||||||
|
|
||||||
element_from_header* header_parser_main(char *h)
|
element_from_header* header_parser_main(char *h)
|
||||||
{
|
{
|
||||||
int nbfields, memory_allocated;
|
int nbfields,memory_allocated;
|
||||||
element_from_header* header;
|
element_from_header* header;
|
||||||
char* nbfields_n;
|
char* nbfields_n;
|
||||||
YY_BUFFER_STATE state;
|
char* nbfields_v;
|
||||||
|
|
||||||
state=header_yy_scan_string(h);
|
nbfields_n = (char*) malloc(9*sizeof(char));
|
||||||
|
nbfields_v = (char*) malloc(5*sizeof(char));
|
||||||
|
|
||||||
memory_allocated=MEMALLOCATED;
|
memory_allocated=MEMALLOCATED;
|
||||||
|
|
||||||
header = (element_from_header*) malloc(memory_allocated * sizeof(element_from_header));
|
|
||||||
|
|
||||||
nbfields_n = (char*) malloc(9*sizeof(char));
|
|
||||||
strcpy(nbfields_n, "nbfields");
|
|
||||||
header[0].name = nbfields_n;
|
|
||||||
|
|
||||||
// Initialize memory to store the number of fields
|
|
||||||
header[0].value = (char*) malloc(10*sizeof(char));
|
|
||||||
|
|
||||||
nbfields=1;
|
nbfields=1;
|
||||||
|
|
||||||
|
strcpy(nbfields_n, "nbfields");
|
||||||
|
strcpy(nbfields_v, "1");
|
||||||
|
|
||||||
|
header = (element_from_header*) malloc(memory_allocated * sizeof(element_from_header));
|
||||||
|
|
||||||
|
header[0].name = nbfields_n;
|
||||||
|
header[0].value = nbfields_v;
|
||||||
|
|
||||||
|
YY_BUFFER_STATE state;
|
||||||
|
|
||||||
|
state=header_yy_scan_string(h);
|
||||||
|
|
||||||
header_parser(&nbfields, &memory_allocated, &header);
|
header_parser(&nbfields, &memory_allocated, &header);
|
||||||
|
|
||||||
header_yy_delete_buffer(state);
|
header_yy_delete_buffer(state);
|
||||||
|
|
||||||
return header;
|
return header;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
0
libfasta/fasta_header_parser.h
Normal file → Executable file
0
libfasta/fasta_header_parser.h
Normal file → Executable file
53
libfasta/fasta_header_parser.l
Normal file → Executable file
53
libfasta/fasta_header_parser.l
Normal file → Executable file
@ -53,7 +53,7 @@ EQUAL =
|
|||||||
(*p_header)[*nbf].value = (char*) malloc(sizeof(char)*size_needed);
|
(*p_header)[*nbf].value = (char*) malloc(sizeof(char)*size_needed);
|
||||||
strcpy(((*p_header)[*nbf]).value,yytext);
|
strcpy(((*p_header)[*nbf]).value,yytext);
|
||||||
|
|
||||||
p_header = check_and_realloc_mem_in_header_table(p_header, nbf, memory_allocated);
|
(*nbf)++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ EQUAL =
|
|||||||
field = store_in_field(field,yytext,&free_size,&i);
|
field = store_in_field(field,yytext,&free_size,&i);
|
||||||
}
|
}
|
||||||
|
|
||||||
<REGNAME>{SPACE} { // TODO
|
<REGNAME>{SPACE} {
|
||||||
/*fprintf(stderr,"\n<REGNAME>{SPACE} **%s**",yytext);*/
|
/*fprintf(stderr,"\n<REGNAME>{SPACE} **%s**",yytext);*/
|
||||||
if (i != 0)
|
if (i != 0)
|
||||||
field = store_in_field(field,yytext,&free_size,&i);
|
field = store_in_field(field,yytext,&free_size,&i);
|
||||||
@ -112,19 +112,22 @@ EQUAL =
|
|||||||
|
|
||||||
<REGVAL><<EOF>> {
|
<REGVAL><<EOF>> {
|
||||||
field = store_in_header_table(field, &((*p_header)[*nbf].value), &free_size, &i);
|
field = store_in_header_table(field, &((*p_header)[*nbf].value), &free_size, &i);
|
||||||
(*nbf)++;
|
p_header = check_and_realloc_mem_in_header_table(p_header, nbf, memory_allocated);
|
||||||
end_header_table(p_header, *nbf);
|
end_header_table(p_header, *nbf);
|
||||||
|
|
||||||
free(field);
|
free(field);
|
||||||
BEGIN(INITIAL);
|
BEGIN(INITIAL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
<REGNAME><<EOF>> {
|
<REGNAME><<EOF>> {
|
||||||
(*p_header)[*nbf].name = (char*) malloc(sizeof(char)*19);
|
/*(*p_header)[*nbf].name = (char*) malloc(sizeof(char)*19);
|
||||||
strcpy((*p_header)[*nbf].name,"definition");
|
strcpy((*p_header)[*nbf].name,"other_informations");
|
||||||
field = store_in_header_table(field, &((*p_header)[*nbf].value), &free_size, &i);
|
field = store_in_header_table(field, &((*p_header)[*nbf].value), &free_size, &i);
|
||||||
(*nbf)++;
|
p_header = check_and_realloc_mem_in_header_table(p_header, nbf, memory_allocated);
|
||||||
end_header_table(p_header, nbf);
|
*/
|
||||||
|
end_header_table(p_header, *nbf);
|
||||||
|
|
||||||
free(field);
|
free(field);
|
||||||
BEGIN(INITIAL);
|
BEGIN(INITIAL);
|
||||||
return 0;
|
return 0;
|
||||||
@ -139,31 +142,37 @@ int header_yywrap()
|
|||||||
|
|
||||||
element_from_header* header_parser_main(char *h)
|
element_from_header* header_parser_main(char *h)
|
||||||
{
|
{
|
||||||
int nbfields, memory_allocated;
|
int nbfields,memory_allocated;
|
||||||
element_from_header* header;
|
element_from_header* header;
|
||||||
char* nbfields_n;
|
char* nbfields_n;
|
||||||
YY_BUFFER_STATE state;
|
char* nbfields_v;
|
||||||
|
|
||||||
state=yy_scan_string(h);
|
nbfields_n = (char*) malloc(9*sizeof(char));
|
||||||
|
nbfields_v = (char*) malloc(5*sizeof(char));
|
||||||
|
|
||||||
memory_allocated=MEMALLOCATED;
|
memory_allocated=MEMALLOCATED;
|
||||||
|
|
||||||
header = (element_from_header*) malloc(memory_allocated * sizeof(element_from_header));
|
|
||||||
|
|
||||||
nbfields_n = (char*) malloc(9*sizeof(char));
|
|
||||||
strcpy(nbfields_n, "nbfields");
|
|
||||||
header[0].name = nbfields_n;
|
|
||||||
|
|
||||||
// Initialize memory to store the number of fields
|
|
||||||
header[0].value = (char*) malloc(10*sizeof(char));
|
|
||||||
|
|
||||||
nbfields=1;
|
nbfields=1;
|
||||||
|
|
||||||
|
strcpy(nbfields_n, "nbfields");
|
||||||
|
strcpy(nbfields_v, "1");
|
||||||
|
|
||||||
|
header = (element_from_header*) malloc(memory_allocated * sizeof(element_from_header));
|
||||||
|
|
||||||
|
header[0].name = nbfields_n;
|
||||||
|
header[0].value = nbfields_v;
|
||||||
|
|
||||||
|
YY_BUFFER_STATE state;
|
||||||
|
|
||||||
|
state=yy_scan_string(h);
|
||||||
|
|
||||||
header_parser(&nbfields, &memory_allocated, &header);
|
header_parser(&nbfields, &memory_allocated, &header);
|
||||||
|
|
||||||
yy_delete_buffer(state);
|
yy_delete_buffer(state);
|
||||||
|
|
||||||
return header;
|
return header;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
7
libfasta/fasta_seq_writer.c
Normal file → Executable file
7
libfasta/fasta_seq_writer.c
Normal file → Executable file
@ -52,7 +52,7 @@ void printOnlyHeaderFromTable(element_from_header* header, FILE* output)
|
|||||||
|
|
||||||
fprintf(output,">%s ",header[1].value);
|
fprintf(output,">%s ",header[1].value);
|
||||||
|
|
||||||
for (i = 2; i < nbf; i++)
|
for (i = 2; i <= nbf; i++)
|
||||||
{
|
{
|
||||||
if (strcmp(header[i].name, "definition") != 0)
|
if (strcmp(header[i].name, "definition") != 0)
|
||||||
{
|
{
|
||||||
@ -60,10 +60,11 @@ void printOnlyHeaderFromTable(element_from_header* header, FILE* output)
|
|||||||
fprintf(output,"=");
|
fprintf(output,"=");
|
||||||
fprintf(output,"%s; ",header[i].value);
|
fprintf(output,"%s; ",header[i].value);
|
||||||
}
|
}
|
||||||
else if (strcmp(header[i].name, "definition") == 0)
|
|
||||||
fprintf(output,"%s ", header[i].value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strcmp(header[nbf].name, "definition") == 0)
|
||||||
|
fprintf(output,"%s; ",header[nbf].value);
|
||||||
|
|
||||||
fprintf(output,"\n");
|
fprintf(output,"\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
0
libfasta/fasta_seq_writer.h
Normal file → Executable file
0
libfasta/fasta_seq_writer.h
Normal file → Executable file
5
libfasta/header_mem_handler.c
Normal file → Executable file
5
libfasta/header_mem_handler.c
Normal file → Executable file
@ -76,7 +76,7 @@ element_from_header** check_and_realloc_mem_in_header_table(element_from_header*
|
|||||||
{
|
{
|
||||||
(*nbf)++;
|
(*nbf)++;
|
||||||
|
|
||||||
if ((*nbf)+1 == *memory_allocated)
|
if (*nbf == *memory_allocated)
|
||||||
{
|
{
|
||||||
(*memory_allocated)++;
|
(*memory_allocated)++;
|
||||||
*p_header = (element_from_header*) realloc(*p_header, (*memory_allocated) * sizeof(element_from_header));
|
*p_header = (element_from_header*) realloc(*p_header, (*memory_allocated) * sizeof(element_from_header));
|
||||||
@ -87,6 +87,7 @@ element_from_header** check_and_realloc_mem_in_header_table(element_from_header*
|
|||||||
|
|
||||||
void end_header_table(element_from_header** p_header, int nbf)
|
void end_header_table(element_from_header** p_header, int nbf)
|
||||||
{
|
{
|
||||||
*p_header = (element_from_header*) realloc(*p_header, nbf * sizeof(element_from_header));
|
nbf = nbf - 1;
|
||||||
|
//fprintf(stderr, "nbf = %d", nbf);
|
||||||
sprintf((*p_header)->value, "%d", nbf);
|
sprintf((*p_header)->value, "%d", nbf);
|
||||||
}
|
}
|
||||||
|
0
libfasta/header_mem_handler.h
Normal file → Executable file
0
libfasta/header_mem_handler.h
Normal file → Executable file
9
libfasta/sequence.c
Normal file → Executable file
9
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)
|
||||||
|
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) $@
|
|
0
libfile/fileHandling.c
Normal file → Executable file
0
libfile/fileHandling.c
Normal file → Executable file
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
0
liblcs/sse_banded_LCS_alignment.c
Normal file → Executable file
0
liblcs/sse_banded_LCS_alignment.c
Normal file → Executable file
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