Permalink
Browse files

fixed a minor issue about +/-1

  • Loading branch information...
1 parent 7168f5c commit 7664795ffb15a568b2e5e2dffe26f492f4f230e9 Heng Li committed Oct 25, 2011
Showing with 3 additions and 3 deletions.
  1. +1 −1 bntseq.h
  2. +1 −1 bwase.c
  3. +1 −1 main.c
View
@@ -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
View
@@ -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
}
View
2 main.c
@@ -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()

0 comments on commit 7664795

Please sign in to comment.