Skip to content
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
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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//`; \
Expand All @@ -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)


Expand Down
8 changes: 4 additions & 4 deletions bwt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Expand Down Expand Up @@ -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;
Expand All @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions bwt.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions bwt_lite.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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)) {
Expand All @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions bwt_lite.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down