Skip to content

Commit

Permalink
fixed a minor issue about +/-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Heng Li committed Oct 25, 2011
1 parent 7168f5c commit 7664795
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bntseq.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ extern "C" {

static inline int64_t bns_depos(const bntseq_t *bns, int64_t pos, int *is_rev)
{
return (*is_rev = (pos >= bns->l_pac))? (bns->l_pac<<1) - pos : pos;
return (*is_rev = (pos >= bns->l_pac))? (bns->l_pac<<1) - 1 - pos : pos;
}

#endif
2 changes: 1 addition & 1 deletion bwase.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ bwtint_t bwa_sa2pos(const bntseq_t *bns, const bwt_t *bwt, bwtint_t sapos, int l
/* NB: For gapped alignment, pacpos may not be correct, which will be fixed
* in refine_gapped_core(). This line also determines the way "x" is
* calculated in refine_gapped_core() when (ext < 0 && is_end == 0). */
if (is_rev) pos_f = pos_f < len? 0 : pos_f - len; // mapped to the forward strand
if (is_rev) pos_f = pos_f + 1 < len? 0 : pos_f - len + 1; // mapped to the forward strand
return pos_f; // FIXME: it is possible that pos_f < bns->anns[ref_id].offset
}

Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "utils.h"

#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "0.6.0-r63-dev"
#define PACKAGE_VERSION "0.6.0-r64-dev"
#endif

static int usage()
Expand Down

0 comments on commit 7664795

Please sign in to comment.