diff --git a/Makefile b/Makefile index 32966c2..58cb711 100644 --- a/Makefile +++ b/Makefile @@ -14,7 +14,7 @@ OBJS= utils.o bwt.o bwtio.o bwtaln.o bwtgap.o is.o \ bwtsw2_core.o bwtsw2_main.o bwtsw2_aux.o bwt_lite.o \ bwtsw2_chain.o bamlite.o bam2bam.o bgzf.o \ insert_size.o -PROG= bwa +PROG= network-aware-bwa INCLUDES= LIBS= -lm -lz -lpthread -Lbwt_gen -lbwtgen LIBS+= `pkg-config --libs libzmq` @@ -33,9 +33,9 @@ all:$(PROG) install: all install -d $(prefix)/bin - install -m 775 bwa $(prefix)/bin/ + install -m 775 network-aware-bwa $(prefix)/bin/ install -d $(prefix)/share/man/man1 - install -m 644 bwa.1 $(prefix)/share/man/man1/ + install -m 644 network-aware-bwa.1 $(prefix)/share/man/man1/ lib-recur all-recur clean-recur cleanlocal-recur install-recur: @target=`echo $@ | sed s/-recur//`; \ @@ -49,7 +49,7 @@ lib-recur all-recur clean-recur cleanlocal-recur install-recur: lib: -bwa:lib-recur $(OBJS) main.o +network-aware-bwa:lib-recur $(OBJS) main.o $(CC) $(CFLAGS) $(DFLAGS) $(OBJS) main.o -o $@ $(LIBS) diff --git a/bwt.c b/bwt.c index 44a86b2..3e568d5 100644 --- a/bwt.c +++ b/bwt.c @@ -89,7 +89,7 @@ static inline int __occ_aux(uint64_t y, int c) return ((y + (y >> 4)) & 0xf0f0f0f0f0f0f0full) * 0x101010101010101ull >> 56; } -inline bwtint_t bwt_occ(const bwt_t *bwt, bwtint_t k, ubyte_t c) +bwtint_t bwt_occ(const bwt_t *bwt, bwtint_t k, ubyte_t c) { bwtint_t n, l, j; uint32_t *p; @@ -115,7 +115,7 @@ inline bwtint_t bwt_occ(const bwt_t *bwt, bwtint_t k, ubyte_t c) } // an analogy to bwt_occ() but more efficient, requiring k <= l -inline void bwt_2occ(const bwt_t *bwt, bwtint_t k, bwtint_t l, ubyte_t c, bwtint_t *ok, bwtint_t *ol) +void bwt_2occ(const bwt_t *bwt, bwtint_t k, bwtint_t l, ubyte_t c, bwtint_t *ok, bwtint_t *ol) { bwtint_t _k, _l; if (k == l) { @@ -156,7 +156,7 @@ inline void bwt_2occ(const bwt_t *bwt, bwtint_t k, bwtint_t l, ubyte_t c, bwtint ((bwt)->cnt_table[(b)&0xff] + (bwt)->cnt_table[(b)>>8&0xff] \ + (bwt)->cnt_table[(b)>>16&0xff] + (bwt)->cnt_table[(b)>>24]) -inline void bwt_occ4(const bwt_t *bwt, bwtint_t k, bwtint_t cnt[4]) +void bwt_occ4(const bwt_t *bwt, bwtint_t k, bwtint_t cnt[4]) { bwtint_t l, j, x; uint32_t *p; @@ -176,7 +176,7 @@ inline void bwt_occ4(const bwt_t *bwt, bwtint_t k, bwtint_t cnt[4]) } // an analogy to bwt_occ4() but more efficient, requiring k <= l -inline void bwt_2occ4(const bwt_t *bwt, bwtint_t k, bwtint_t l, bwtint_t cntk[4], bwtint_t cntl[4]) +void bwt_2occ4(const bwt_t *bwt, bwtint_t k, bwtint_t l, bwtint_t cntk[4], bwtint_t cntl[4]) { bwtint_t _k, _l; if (k == l) { diff --git a/bwt.h b/bwt.h index c9cc4ed..b99b951 100644 --- a/bwt.h +++ b/bwt.h @@ -95,14 +95,14 @@ extern "C" { void bwt_bwtupdate_core(bwt_t *bwt); - inline bwtint_t bwt_occ(const bwt_t *bwt, bwtint_t k, ubyte_t c); - inline void bwt_occ4(const bwt_t *bwt, bwtint_t k, bwtint_t cnt[4]); + bwtint_t bwt_occ(const bwt_t *bwt, bwtint_t k, ubyte_t c); + void bwt_occ4(const bwt_t *bwt, bwtint_t k, bwtint_t cnt[4]); bwtint_t bwt_sa(const bwt_t *bwt, bwtint_t k); // more efficient version of bwt_occ/bwt_occ4 for retrieving two close Occ values void bwt_gen_cnt_table(bwt_t *bwt); - inline void bwt_2occ(const bwt_t *bwt, bwtint_t k, bwtint_t l, ubyte_t c, bwtint_t *ok, bwtint_t *ol); - inline void bwt_2occ4(const bwt_t *bwt, bwtint_t k, bwtint_t l, bwtint_t cntk[4], bwtint_t cntl[4]); + void bwt_2occ(const bwt_t *bwt, bwtint_t k, bwtint_t l, ubyte_t c, bwtint_t *ok, bwtint_t *ol); + void bwt_2occ4(const bwt_t *bwt, bwtint_t k, bwtint_t l, bwtint_t cntk[4], bwtint_t cntl[4]); int bwt_match_exact(const bwt_t *bwt, int len, const ubyte_t *str, bwtint_t *sa_begin, bwtint_t *sa_end); int bwt_match_exact_alt(const bwt_t *bwt, int len, const ubyte_t *str, bwtint_t *k0, bwtint_t *l0); diff --git a/bwt_lite.c b/bwt_lite.c index dd411e1..3355f8d 100644 --- a/bwt_lite.c +++ b/bwt_lite.c @@ -52,7 +52,7 @@ bwtl_t *bwtl_seq2bwtl(int len, const uint8_t *seq) } return b; } -inline uint32_t bwtl_occ(const bwtl_t *bwt, uint32_t k, uint8_t c) +uint32_t bwtl_occ(const bwtl_t *bwt, uint32_t k, uint8_t c) { uint32_t n, b; if (k == bwt->seq_len) return bwt->L2[c+1] - bwt->L2[c]; @@ -65,7 +65,7 @@ inline uint32_t bwtl_occ(const bwtl_t *bwt, uint32_t k, uint8_t c) if (c == 0) n -= 15 - (k&15); // corrected for the masked bits return n; } -inline void bwtl_occ4(const bwtl_t *bwt, uint32_t k, uint32_t cnt[4]) +void bwtl_occ4(const bwtl_t *bwt, uint32_t k, uint32_t cnt[4]) { uint32_t x, b; if (k == (uint32_t)(-1)) { @@ -80,7 +80,7 @@ inline void bwtl_occ4(const bwtl_t *bwt, uint32_t k, uint32_t cnt[4]) x -= 15 - (k&15); cnt[0] += x&0xff; cnt[1] += x>>8&0xff; cnt[2] += x>>16&0xff; cnt[3] += x>>24; } -inline void bwtl_2occ4(const bwtl_t *bwt, uint32_t k, uint32_t l, uint32_t cntk[4], uint32_t cntl[4]) +void bwtl_2occ4(const bwtl_t *bwt, uint32_t k, uint32_t l, uint32_t cntk[4], uint32_t cntl[4]) { bwtl_occ4(bwt, k, cntk); bwtl_occ4(bwt, l, cntl); diff --git a/bwt_lite.h b/bwt_lite.h index 0096b93..4fadcce 100644 --- a/bwt_lite.h +++ b/bwt_lite.h @@ -17,9 +17,9 @@ extern "C" { #endif bwtl_t *bwtl_seq2bwtl(int len, const uint8_t *seq); - inline uint32_t bwtl_occ(const bwtl_t *bwt, uint32_t k, uint8_t c); - inline void bwtl_occ4(const bwtl_t *bwt, uint32_t k, uint32_t cnt[4]); - inline void bwtl_2occ4(const bwtl_t *bwt, uint32_t k, uint32_t l, uint32_t cntk[4], uint32_t cntl[4]); + uint32_t bwtl_occ(const bwtl_t *bwt, uint32_t k, uint8_t c); + void bwtl_occ4(const bwtl_t *bwt, uint32_t k, uint32_t cnt[4]); + void bwtl_2occ4(const bwtl_t *bwt, uint32_t k, uint32_t l, uint32_t cntk[4], uint32_t cntl[4]); void bwtl_destroy(bwtl_t *bwt); #ifdef __cplusplus