Compare commits
7 Commits
sumatra_v1
...
sumatra_v1
Author | SHA1 | Date | |
---|---|---|---|
89eafb3772 | |||
29081ddbb3 | |||
c4822c4874 | |||
294a31624c | |||
646bfd44d4 | |||
1edde50609 | |||
6613bcb74a |
33
Makefile
33
Makefile
@ -1,14 +1,17 @@
|
||||
EXEC=sumatra
|
||||
PREFIX=/usr/local
|
||||
|
||||
SUMATRA_SRC= sumatra.c \
|
||||
mtcompare_sumatra.c
|
||||
CFLAGS=-I$(PREFIX)/include
|
||||
|
||||
EXEC = sumatra
|
||||
|
||||
SUMATRA_SRC = sumatra.c \
|
||||
mtcompare_sumatra.c
|
||||
|
||||
SUMATRA_OBJ= $(patsubst %.c,%.o,$(SUMATRA_SRC))
|
||||
SUMATRA_OBJ = $(patsubst %.c,%.o,$(SUMATRA_SRC))
|
||||
|
||||
SRCS = $(SUMATRA_SRC)
|
||||
|
||||
SRCS= $(SUMATRA_SRC)
|
||||
|
||||
LIB= -lfasta -llcs -lfile -lutils -lz -lm
|
||||
LIB = -lsuma -lz -lm
|
||||
|
||||
include ./global.mk
|
||||
|
||||
@ -23,8 +26,8 @@ all: $(EXEC)
|
||||
|
||||
# executable compilation and link
|
||||
|
||||
sumatra: $(SUMATRA_OBJ) $(LIBFASTA) $(LIBLCS) $(LIBFILE) $(LIBUTILS)
|
||||
$(CC) $(LDFLAGS) -o $@ -pthread $(SUMATRA_OBJ) $(LIBFASTAPATH) $(LIBLCSPATH) $(LIBFILEPATH) $(LIBUTILSPATH) $(LIB)
|
||||
sumatra: $(SUMATRA_OBJ)
|
||||
$(CC) $(LDFLAGS) -o $@ -pthread $(SUMATRA_OBJ) $(LIBSUMAPATH) $(LIB)
|
||||
|
||||
########
|
||||
#
|
||||
@ -33,12 +36,10 @@ sumatra: $(SUMATRA_OBJ) $(LIBFASTA) $(LIBLCS) $(LIBFILE) $(LIBUTILS)
|
||||
########
|
||||
|
||||
clean:
|
||||
rm -f *.o
|
||||
rm -f *.P
|
||||
rm -f $(SUMATRA_OBJ)
|
||||
rm -f $(EXEC)
|
||||
$(MAKE) -C ./sumalibs/libfasta clean
|
||||
$(MAKE) -C ./sumalibs/liblcs clean
|
||||
$(MAKE) -C ./sumalibs/libfile clean
|
||||
$(MAKE) -C ./sumalibs/libutils clean
|
||||
$(MAKE) -C ./sumalibs clean
|
||||
|
||||
|
||||
install: all
|
||||
install -d $(DESTDIR)$(PREFIX)/bin/
|
||||
install -m 755 $(EXEC) $(DESTDIR)$(PREFIX)/bin/
|
||||
|
25
global.mk
25
global.mk
@ -1,20 +1,14 @@
|
||||
|
||||
LIBFASTAPATH = -L./sumalibs/libfasta
|
||||
LIBLCSPATH = -L./sumalibs/liblcs
|
||||
LIBFILEPATH = -L./sumalibs/libfile
|
||||
LIBUTILSPATH = -L./sumalibs/libutils
|
||||
LIBSUMAPATH = -L./sumalibs
|
||||
|
||||
LIBFASTA = ./sumalibs/libfasta/libfasta.a
|
||||
LIBLCS = ./sumalibs/liblcs/liblcs.a
|
||||
LIBFILE = ./sumalibs/libfile/libfile.a
|
||||
LIBUTILS = ./sumalibs/libutils/libutils.a
|
||||
LIBSUMA = ./sumalibs/libsuma.a
|
||||
|
||||
CC=gcc
|
||||
LDFLAGS=
|
||||
|
||||
|
||||
ifeq ($(CC),gcc)
|
||||
CFLAGS = -O3 -s -DOMP_SUPPORT -fopenmp -w
|
||||
CFLAGS = -O3 -s -DOMP_SUPPORT -w
|
||||
else
|
||||
CFLAGS = -O3 -w
|
||||
endif
|
||||
@ -32,14 +26,5 @@ default: all
|
||||
#
|
||||
########
|
||||
|
||||
./sumalibs/libfasta/libfasta.a:
|
||||
$(MAKE) -C ./sumalibs/libfasta
|
||||
|
||||
./sumalibs/liblcs/liblcs.a:
|
||||
$(MAKE) -C ./sumalibs/liblcs
|
||||
|
||||
./sumalibs/libfile/libfile.a:
|
||||
$(MAKE) -C ./sumalibs/libfile
|
||||
|
||||
./sumalibs/libutils/libutils.a:
|
||||
$(MAKE) -C ./sumalibs/libutils
|
||||
./sumalibs/libsuma.a:
|
||||
$(MAKE) -C ./sumalibs
|
||||
|
@ -10,10 +10,10 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "sumatra.h"
|
||||
#include "./sumalibs/libfasta/sequence.h"
|
||||
#include "./sumalibs/libutils/utilities.h"
|
||||
#include "./sumalibs/liblcs/upperband.h"
|
||||
#include "./sumalibs/liblcs/sse_banded_LCS_alignment.h"
|
||||
#include "libfasta/sequence.h"
|
||||
#include "libutils/utilities.h"
|
||||
#include "liblcs/upperband.h"
|
||||
#include "liblcs/sse_banded_LCS_alignment.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
|
2
sumalibs
2
sumalibs
Submodule sumalibs updated: 049129488e...b11748eac8
32
sumatra.c
32
sumatra.c
@ -14,13 +14,13 @@
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
#include "./sumalibs/libfasta/sequence.h"
|
||||
#include "./sumalibs/liblcs/upperband.h"
|
||||
#include "./sumalibs/liblcs/sse_banded_LCS_alignment.h"
|
||||
#include "./sumalibs/libutils/utilities.h"
|
||||
#include "libfasta/sequence.h"
|
||||
#include "liblcs/upperband.h"
|
||||
#include "liblcs/sse_banded_LCS_alignment.h"
|
||||
#include "libutils/utilities.h"
|
||||
#include "mtcompare_sumatra.h"
|
||||
|
||||
#define VERSION "1.0.20"
|
||||
#define VERSION "1.0.34"
|
||||
|
||||
|
||||
/* ----------------------------------------------- */
|
||||
@ -214,7 +214,7 @@ int compare1(fastaSeqCount db1, double threshold, BOOL normalize, int reference,
|
||||
BOOL always = TRUE;
|
||||
int64_t pairs = (int64_t)(db1.count - 1) * (int64_t)db1.count /2;
|
||||
BOOL print;
|
||||
double score;
|
||||
double score, scoreG;
|
||||
int32_t i,j;
|
||||
char* s1;
|
||||
char* s2;
|
||||
@ -239,7 +239,7 @@ int compare1(fastaSeqCount db1, double threshold, BOOL normalize, int reference,
|
||||
calculateMaxAndMinLenDB(db1, &lmax, &lmin);
|
||||
sizeForSeqs = prepareTablesForSumathings(lmax, lmin, threshold, normalize, reference, lcsmode, &address, &iseq1, &iseq2);
|
||||
|
||||
for (i=0; i < db1.count; i++) // ...??
|
||||
for (i=0; i < db1.count; i++) // ...?? db1.count - 1 probably
|
||||
for (j=i+1; j < db1.count; j++)
|
||||
{
|
||||
print = FALSE;
|
||||
@ -252,7 +252,23 @@ int compare1(fastaSeqCount db1, double threshold, BOOL normalize, int reference,
|
||||
l1 = (db1.fastaSeqs+i)->length;
|
||||
s2 = (db1.fastaSeqs+j)->sequence;
|
||||
l2 = (db1.fastaSeqs+j)->length;
|
||||
|
||||
/* fprintf(stderr, "\n%s", s1);
|
||||
fprintf(stderr, "\n%s", s2);
|
||||
fprintf(stderr, "\n%f", threshold);
|
||||
fprintf(stderr, "\n%d", normalize);
|
||||
fprintf(stderr, "\n%d", reference);
|
||||
fprintf(stderr, "\n%d\n", lcsmode);
|
||||
*/
|
||||
// score = generic_sse_banded_lcs_align(s1, s2, threshold, normalize, reference, lcsmode);
|
||||
// fprintf(stderr, "\nscore generic = %f", scoreG);
|
||||
score = alignForSumathings(s1, iseq1, s2, iseq2, l1, l2, normalize, reference, lcsmode, address, sizeForSeqs, LCSmin);
|
||||
// fprintf(stderr, "\nscore = %f\n", score);
|
||||
// if (scoreG != score)
|
||||
// {
|
||||
// fprintf(stderr, "\nscores differents\n");
|
||||
// exit(1);
|
||||
// }
|
||||
print = always || (((normalize || lcsmode) && (score >= threshold)) || ((!lcsmode && !normalize) && (score <= threshold)));
|
||||
if (print && !lcsmode && normalize)
|
||||
score = 1.0 - score;
|
||||
@ -322,7 +338,7 @@ int compare2(fastaSeqCount db1, fastaSeqCount db2, double threshold, BOOL normal
|
||||
score = alignForSumathings(s1, iseq1, s2, iseq2, l1, l2, normalize, reference, lcsmode, address, sizeForSeqs, LCSmin);
|
||||
print = always || (((normalize || lcsmode) && (score >= threshold)) || ((!lcsmode && !normalize) && (score <= threshold)));
|
||||
if (print && !lcsmode && normalize)
|
||||
score = 1.0 - score;
|
||||
score = 1.0 - score; // TODO isn't that already done?
|
||||
}
|
||||
printResults(db1.fastaSeqs+i, db2.fastaSeqs+j, score, extradata, pairs, print);
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
#ifndef SUMATRA_H_
|
||||
#define SUMATRA_H_
|
||||
|
||||
#include "./sumalibs/libfasta/sequence.h"
|
||||
#include "libfasta/sequence.h"
|
||||
|
||||
void printResults(fastaSeqPtr seq1, fastaSeqPtr seq2, double score, BOOL extradata, int64_t pairs, BOOL print);
|
||||
|
||||
|
@ -29,7 +29,8 @@ Untar the archive, go into the newly created directory and compile:
|
||||
```
|
||||
tar –zxvf sumatra_v[x.x.xx].tar.gz
|
||||
cd sumatra_v[x.x.xx]
|
||||
make
|
||||
make -C sumalibs install
|
||||
make install
|
||||
```
|
||||
|
||||
## Documentation
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user