7 Commits

36 changed files with 76 additions and 59 deletions

0
Licence_CeCILL_V2-en.txt Normal file → Executable file
View File

0
Licence_CeCILL_V2-fr.txt Normal file → Executable file
View File

0
global.mk Normal file → Executable file
View File

0
libfasta/Makefile Normal file → Executable file
View File

0
libfasta/fasta_header_handler.c Normal file → Executable file
View File

0
libfasta/fasta_header_handler.h Normal file → Executable file
View File

108
libfasta/fasta_header_parser.c Normal file → Executable file
View File

@ -27,7 +27,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 37
#define YY_FLEX_SUBMINOR_VERSION 35
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
@ -65,6 +65,7 @@ typedef int16_t flex_int16_t;
typedef uint16_t flex_uint16_t;
typedef int32_t flex_int32_t;
typedef uint32_t flex_uint32_t;
typedef uint64_t flex_uint64_t;
#else
typedef signed char flex_int8_t;
typedef short int flex_int16_t;
@ -72,6 +73,7 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */
/* Limits of integral types. */
#ifndef INT8_MIN
@ -102,8 +104,6 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
#ifdef __cplusplus
@ -374,7 +374,7 @@ static void yy_fatal_error (yyconst char msg[] );
*/
#define YY_DO_BEFORE_ACTION \
(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_cp = '\0'; \
(yy_c_buf_p) = yy_cp;
@ -390,9 +390,9 @@ struct yy_trans_info
};
static yyconst flex_int16_t yy_accept[29] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 13, 12,
3, 2, 1, 5, 4, 7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ex_int32_t yy_meta[7] =
static yyconst flex_int32_t yy_meta[6] =
{ 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, 22, 21, 6, 0, 12, 0, 26, 29,
0, 0, 29, 0, 0, 29, 29, 0, 0, 29,
29, 0, 0, 0, 0, 0, 0, 29, 23, 16,
22, 20, 20, 18
0, 4, 23, 0, 9, 0, 14, 0, 27, 0,
0, 29, 29, 0, 0, 29, 29, 0, 0, 29,
29, 0, 0, 0, 0, 0, 0, 29, 19, 23,
23, 7, 5, 3, 1
} ;
static yyconst flex_int16_t yy_def[35] =
static yyconst flex_int16_t yy_def[36] =
{ 0,
28, 1, 1, 1, 28, 5, 28, 7, 28, 28,
29, 30, 28, 31, 32, 28, 28, 33, 34, 28,
28, 29, 30, 31, 32, 33, 34, 0, 28, 28,
29, 29, 2, 3, 28, 5, 28, 7, 28, 30,
31, 28, 28, 32, 33, 28, 28, 34, 35, 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
} ;
static yyconst flex_int16_t yy_nxt[36] =
static yyconst flex_int16_t yy_chk[35] =
{ 0,
10, 11, 12, 12, 12, 13, 10, 14, 15, 16,
17, 10, 10, 18, 19, 20, 21, 10, 23, 23,
27, 26, 25, 24, 22, 28, 10, 10, 9, 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
0, 1, 35, 34, 1, 2, 33, 32, 2, 5,
5, 5, 5, 5, 7, 7, 7, 7, 7, 29,
29, 29, 29, 30, 31, 30, 9, 3, 28, 28,
28, 28, 28, 28
} ;
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,
* 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
/* 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 ) \
{ \
int c = '*'; \
size_t n; \
yy_size_t n; \
for ( n = 0; n < max_size && \
(c = getc( header_yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@ -784,6 +784,7 @@ YY_RULE_SETUP
}
YY_BREAK
case 2:
/* rule 2 can match eol */
YY_RULE_SETUP
#line 45 "fasta_header_parser.l"
{
@ -808,6 +809,7 @@ YY_RULE_SETUP
}
YY_BREAK
case 4:
/* rule 4 can match eol */
YY_RULE_SETUP
#line 64 "fasta_header_parser.l"
{
@ -846,6 +848,7 @@ YY_RULE_SETUP
}
YY_BREAK
case 8:
/* rule 8 can match eol */
YY_RULE_SETUP
#line 90 "fasta_header_parser.l"
{
@ -911,7 +914,7 @@ YY_RULE_SETUP
#line 136 "fasta_header_parser.l"
ECHO;
YY_BREAK
#line 915 "<stdout>"
#line 918 "<stdout>"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(REGID):
yyterminate();
@ -1105,7 +1108,7 @@ static int yy_get_next_buffer (void)
{ /* Not enough room in the buffer - grow it. */
/* 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) - 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_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 )
@ -1326,7 +1329,7 @@ static int yy_get_next_buffer (void)
case EOB_ACT_END_OF_FILE:
{
if ( header_yywrap( ) )
return EOF;
return 0;
if ( ! (yy_did_buffer_switch_on_eof) )
YY_NEW_FILE;
@ -1462,6 +1465,10 @@ static void header_yy_load_buffer_state (void)
header_yyfree((void *) b );
}
#ifndef __cplusplus
extern int isatty (int );
#endif /* __cplusplus */
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
* 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
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
*
* @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;
char *buf;
yy_size_t n;
int i;
yy_size_t n, i;
/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;

0
libfasta/fasta_header_parser.h Normal file → Executable file
View File

4
libfasta/fasta_header_parser.l Normal file → Executable file
View File

@ -21,8 +21,8 @@
%}
WORD [[:alnum:]:\-.{},'_()\#\[\]\|\&\"\'\/\%\+]+
WORDID [[:alnum:]:\-.{},'_()\#\[\]\|\&\"\'\/\%\+=;]+
WORD [^>[:blank:]=;]+
WORDID [^>[:blank:]]+
SUP >
EOL \n
SEP ;

0
libfasta/fasta_seq_writer.c Normal file → Executable file
View File

0
libfasta/fasta_seq_writer.h Normal file → Executable file
View File

0
libfasta/header_mem_handler.c Normal file → Executable file
View File

0
libfasta/header_mem_handler.h Normal file → Executable file
View File

10
libfasta/sequence.c Normal file → Executable file
View File

@ -223,7 +223,13 @@ fastaSeqCount seq_readAllSeq2(char *fileName, BOOL isStandardSeq, BOOL onlyATGC)
fastaSeqCount allseqs;
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)
{
@ -231,8 +237,6 @@ fastaSeqCount seq_readAllSeq2(char *fileName, BOOL isStandardSeq, BOOL onlyATGC)
exit(1);
}
exitIfEmptyFile(fp);
seqPtrAr = (fastaSeqPtr) util_malloc(slots*sizeof(fastaSeq), __FILE__, __LINE__);
seqPtr = seq_getNext(fp, " ", isStandardSeq, onlyATGC);

0
libfasta/sequence.h Normal file → Executable file
View File

0
libfile/Makefile Normal file → Executable file
View File

10
libfile/fileHandling.c Normal file → Executable file
View File

@ -44,7 +44,7 @@ FILE *file_openrw(char* fileName, BOOL abortOnError)
/*
* 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)
{
@ -59,7 +59,7 @@ char file_nextChar(FILE* fp)
/*
* 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)
{
@ -76,7 +76,11 @@ char *file_nextLine(FILE *fp, char *buffer, int32_t bufferSize)
void exitIfEmptyFile(FILE *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)
{

0
libfile/fileHandling.h Normal file → Executable file
View File

0
liblcs/Makefile Normal file → Executable file
View File

0
liblcs/_lcs.ext.1.c Normal file → Executable file
View File

0
liblcs/_lcs.ext.2.c Normal file → Executable file
View File

0
liblcs/_lcs.ext.3.c Normal file → Executable file
View File

0
liblcs/_lcs.h Normal file → Executable file
View File

0
liblcs/_lcs_fast.h Normal file → Executable file
View File

0
liblcs/banded_LCS_alignment.c Normal file → Executable file
View File

0
liblcs/banded_LCS_alignment.h Normal file → Executable file
View File

3
liblcs/sse_banded_LCS_alignment.c Normal file → Executable file
View File

@ -458,6 +458,9 @@ int calculateSizeToAllocate(int maxLen, int minLen, int LCSmin)
calculateBandLengths(maxLen, minLen, &notUsed, &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);
size*= 2;

0
liblcs/sse_banded_LCS_alignment.h Normal file → Executable file
View File

0
liblcs/upperband.c Normal file → Executable file
View File

0
liblcs/upperband.h Normal file → Executable file
View File

0
libsse/_sse.h Normal file → Executable file
View File

0
libutils/Makefile Normal file → Executable file
View File

0
libutils/debug.c Normal file → Executable file
View File

0
libutils/debug.h Normal file → Executable file
View File

0
libutils/utilities.c Normal file → Executable file
View File

0
libutils/utilities.h Normal file → Executable file
View File