mirror of
https://github.com/chhylp123/hifiasm.git
synced 2026-10-10 02:20:55 +08:00
fixed wrong coordinate
This commit is contained in:
+10
-14
@@ -1,3 +1,4 @@
|
|||||||
|
#include <stdio.h>
|
||||||
#include "htab.h"
|
#include "htab.h"
|
||||||
#include "ksort.h"
|
#include "ksort.h"
|
||||||
#include "Hash_Table.h"
|
#include "Hash_Table.h"
|
||||||
@@ -71,16 +72,9 @@ void ha_get_new_candidates(ha_abuf_t *ab, int64_t rid, UC_Read *ucr, overlap_reg
|
|||||||
for (j = 0; j < s->n; ++j) {
|
for (j = 0; j < s->n; ++j) {
|
||||||
const ha_idxpos_t *y = &s->a[j];
|
const ha_idxpos_t *y = &s->a[j];
|
||||||
anchor1_t *an = &ab->a[k++];
|
anchor1_t *an = &ab->a[k++];
|
||||||
uint8_t rev;
|
uint8_t rev = z->rev == y->rev? 0 : 1;
|
||||||
if (z->rev == y->rev) { // forward strand
|
an->other_off = y->pos;
|
||||||
rev = 0;
|
an->self_off = rev? ucr->length - 1 - (z->pos + 1 - z->span) : z->pos;
|
||||||
an->self_off = z->pos;
|
|
||||||
an->other_off = y->pos;
|
|
||||||
} else { // reverse strand
|
|
||||||
rev = 1;
|
|
||||||
an->self_off = ucr->length - 1 - (z->pos + 1 - z->span);
|
|
||||||
an->other_off = R_INF.read_length[y->rid] - 1 - (y->pos + 1 - y->span);
|
|
||||||
}
|
|
||||||
an->srt = (uint64_t)y->rid<<33 | (uint64_t)rev<<32 | an->other_off;
|
an->srt = (uint64_t)y->rid<<33 | (uint64_t)rev<<32 | an->other_off;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,10 +95,12 @@ void ha_get_new_candidates(ha_abuf_t *ab, int64_t rid, UC_Read *ucr, overlap_reg
|
|||||||
REALLOC(cl->list, cl->size);
|
REALLOC(cl->list, cl->size);
|
||||||
}
|
}
|
||||||
for (k = 0; k < ab->n_a; ++k) {
|
for (k = 0; k < ab->n_a; ++k) {
|
||||||
cl->list[k].readID = ab->a[k].srt >> 33;
|
k_mer_hit *p = &cl->list[k];
|
||||||
cl->list[k].strand = ab->a[k].srt >> 32 & 1;
|
p->readID = ab->a[k].srt >> 33;
|
||||||
cl->list[k].offset = ab->a[k].other_off;
|
p->strand = ab->a[k].srt >> 32 & 1;
|
||||||
cl->list[k].self_offset = ab->a[k].self_off;
|
p->offset = ab->a[k].other_off;
|
||||||
|
p->self_offset = ab->a[k].self_off;
|
||||||
|
//fprintf(stderr, "A\t%ld\t%d\t%c\t%d\t%d\n", (long)rid, p->self_offset, "+-"[p->strand], p->readID, p->offset);
|
||||||
}
|
}
|
||||||
cl->length = ab->n_a;
|
cl->length = ab->n_a;
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ typedef struct {
|
|||||||
} ha_mz1_t;
|
} ha_mz1_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint64_t rid:28, pos:27, rev:1, span:8;
|
uint64_t rid:28, pos:27, rev:1, span:8; // actually it is not necessary to keep span in the index
|
||||||
} ha_idxpos_t;
|
} ha_idxpos_t;
|
||||||
|
|
||||||
typedef struct { uint32_t n, m; ha_mz1_t *a; } ha_mz1_v;
|
typedef struct { uint32_t n, m; ha_mz1_t *a; } ha_mz1_v;
|
||||||
|
|||||||
Reference in New Issue
Block a user