fixed a minor issue about +/-1
This commit is contained in:
parent
7168f5c10a
commit
7664795ffb
2
bntseq.h
2
bntseq.h
|
|
@ -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
bwase.c
2
bwase.c
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue