Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add non-SIMD version of the extd2 kernel. #7

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CPPFLAGS= -g -Wall -Wextra -O2 #-DHAVE_KALLOC
INCLUDES= -I.
OBJS= ksw2_gg.o ksw2_gg2.o ksw2_gg2_sse.o ksw2_extz.o ksw2_extz2_sse.o \
ksw2_extd.o ksw2_extd2_sse.o ksw2_extf2_sse.o ksw2_exts2_sse.o \
ksw2_extd2.o ksw2_extd2_cpp.o
ksw2_extd2.o ksw2_extd2_cpp.o ksw2_extd2_no_sse.o
PROG= ksw2-test
LIBS= -lz
coverage = n
Expand Down Expand Up @@ -63,6 +63,9 @@ report:

ksw2-test:cli.o kalloc.o $(OBJS)
$(CXX) $(CFLAGS) $^ -o $@ $(LIBS_MORE) $(LIBS)

test_vector: test_vector.o
$(CXX) $(CFLAGS) -Wno-incompatible-pointer-types $^ -o [email protected] $(LIBS_MORE) $(LIBS)

clean:
rm -fr gmon.out *.o a.out $(PROG) $(PROG_EXTRA) *~ *.a *.dSYM session*
Expand All @@ -78,6 +81,7 @@ kalloc.o: kalloc.h
ksw2_extd.o: ksw2.h
ksw2_extd2_sse.o: ksw2.h
ksw2_extf2_sse.o: ksw2.h
ksw2_extd2_no_sse.o: ksw2.h vector.h
ksw2_extz.o: ksw2.h
ksw2_extz2_sse.o: ksw2.h
ksw2_gg.o: ksw2.h
Expand Down
4 changes: 3 additions & 1 deletion cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ static void global_aln(const char *algo, void *km, const char *qseq_, const char
else if (strcmp(algo, "extz2_sse") == 0) ksw_extz2_sse(km, qlen, (uint8_t*)qseq, tlen, (uint8_t*)tseq, m, mat, q, e, w, zdrop, 0, flag, ez);
else if (strcmp(algo, "extd") == 0) ksw_extd(km, qlen, (uint8_t*)qseq, tlen, (uint8_t*)tseq, m, mat, q, e, q2, e2, w, zdrop, flag, ez);
else if (strcmp(algo, "extd2_sse") == 0) ksw_extd2_sse(km, qlen, (uint8_t*)qseq, tlen, (uint8_t*)tseq, m, mat, q, e, q2, e2, w, zdrop, end_bonus, flag, ez);
else if (strcmp(algo, "extd2_no_sse") == 0) ksw_extd2_no_sse(km, qlen, (uint8_t*)qseq, tlen, (uint8_t*)tseq, m, mat, q, e, q2, e2, w, zdrop, end_bonus, flag, ez);
// NOTE: add our c version of alignment
else if (strcmp(algo, "extd2") == 0)
ksw_extd2_c(km, qlen, (uint8_t *)qseq, tlen, (uint8_t *)tseq, m, mat, q,
Expand Down Expand Up @@ -181,7 +182,7 @@ int main(int argc, char *argv[])
ksw_extz_t ez;
gzFile fp[2];

while ((c = getopt(argc, argv, "t:w:R:e:rscxvgz:A:B:O:E:Ka")) >= 0) {
while ((c = getopt(argc, argv, "t:w:R:e:rscxvgqz:A:B:O:E:Ka")) >= 0) {
if (c == 't') algo = optarg;
else if (c == 'w') w = atoi(optarg);
else if (c == 'R') rep = atoi(optarg);
Expand All @@ -193,6 +194,7 @@ int main(int argc, char *argv[])
else if (c == 'x') flag |= KSW_EZ_EXTZ_ONLY;
else if (c == 'v') flag |= KSW_EZ_REV_CIGAR;
else if (c == 'g') flag |= KSW_EZ_APPROX_MAX | KSW_EZ_APPROX_DROP;
else if (c == 'q') flag |= KSW_EZ_EQX;
else if (c == 'K') no_kalloc = 1;
else if (c == 'A') a = atoi(optarg);
else if (c == 'B') b = atoi(optarg);
Expand Down
23 changes: 15 additions & 8 deletions coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ if [ -z "$KSW2COV" ]; then
KSW2COV=./ksw2-test
fi

# Test code coverage of ksw2
# Test code coverage of ksw2
u=$1
t=$2

Expand All @@ -13,14 +13,21 @@ $KSW2COV $u $t ${@:2}
# Enables KSW_EZ_RIGHT
$KSW2COV $u $t -r ${@:2}

## Enables KSW_EZ_GENERIC_SC
$KSW2COV $u $t -c ${@:2}
## Enables KSW_EZ_GENERIC_SC
$KSW2COV $u $t -c ${@:2}

# Enables KSW_EZ_REV_CIGAR
$KSW2COV $u $t -v ${@:2}
# Enables KSW_EZ_REV_CIGAR
$KSW2COV $u $t -v ${@:2}

# Enables KSW_EZ_EXTZ_ONLY
$KSW2COV $u $t -x ${@:2}
# Enables KSW_EZ_EXTZ_ONLY
$KSW2COV $u $t -x ${@:2}

# Enables KSW_EZ_APPROX_MAX
$KSW2COV $u $t -g ${@:2}

# Enables KSW_EZ_EQX
# This option is disabled because the baseline kernel segmentation faults with this option enabled
# $KSW2COV $u $t -q ${@:2}

# Sets end_bonus and zdrop
$KSW2COV $u $t ${@:2} -x -e 1 -z 1
Expand All @@ -29,4 +36,4 @@ $KSW2COV $u $t ${@:2} -x -e 1 -z 1
$KSW2COV $u $t -s ${@:2}

# Modify the gap penalty to trigger long thres
$KSW2COV -t extd2_cpp $u $t -x -E 2
$KSW2COV $u $t -x -E 2 ${@:2}
3 changes: 3 additions & 0 deletions ksw2.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ void ksw_extd(void *km, int qlen, const uint8_t *query, int tlen, const uint8_t
void ksw_extd2_sse(void *km, int qlen, const uint8_t *query, int tlen, const uint8_t *target, int8_t m, const int8_t *mat,
int8_t gapo, int8_t gape, int8_t gapo2, int8_t gape2, int w, int zdrop, int end_bonus, int flag, ksw_extz_t *ez);

void ksw_extd2_no_sse(void *km, int qlen, const uint8_t *query, int tlen, const uint8_t *target, int8_t m, const int8_t *mat,
int8_t gapo, int8_t gape, int8_t gapo2, int8_t gape2, int w, int zdrop, int end_bonus, int flag, ksw_extz_t *ez);

void ksw_exts2_sse(void *km, int qlen, const uint8_t *query, int tlen, const uint8_t *target, int8_t m, const int8_t *mat,
int8_t gapo, int8_t gape, int8_t gapo2, int8_t noncan, int zdrop, int8_t junc_bonus, int flag, const uint8_t *junc, ksw_extz_t *ez);

Expand Down
Loading