assgin disconnected parts

This commit is contained in:
chhylp123
2021-04-28 20:27:43 -04:00
parent 2fc2268268
commit 71e91f3fc2
3 changed files with 10 additions and 7 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
#include <pthread.h>
#include <stdint.h>
#define HA_VERSION "0.15.1-r330"
#define HA_VERSION "0.15.1-r331"
#define VERBOSE 0
+6 -5
View File
@@ -11298,8 +11298,9 @@ void refine_u_trans_t(u_trans_hit_t *q, kv_ca_buf_t* cb)
if(q->tScur >= q->tEcur) fprintf(stderr, "ERROR5\n");
///might be equal
if(q->tScur > q->tEcur) fprintf(stderr, "ERROR5\n");
// if(q->tScur >= q->tEcur)
// {
// fprintf(stderr, "\n###q->tScur: %u, s: %u, si: %u, q->tEcur: %u, e: %u, ei: %u\n",
// q->tScur, s, si, q->tEcur, e, ei);
@@ -11780,6 +11781,7 @@ ma_ug_t *ug, uint32_t flag, double score, const char* cmd)
t_ch->c_buf.a[0].c_y_p = t_ch->c_buf.a[1].c_y_p - len;
}
///chain is [s, e)
if(t_ch->c_buf.a[0].c_x_p != 0 && t_ch->c_buf.a[0].c_y_p != 0) fprintf(stderr, "ERROR1\n");
if(t_ch->c_buf.a[t_ch->c_buf.n-1].c_x_p!= pri_len &&
t_ch->c_buf.a[t_ch->c_buf.n-1].c_y_p!= aux_len)
@@ -11817,6 +11819,8 @@ ma_ug_t *ug, uint32_t flag, double score, const char* cmd)
for (i = bn; i < t_ch->k_t_b.n; i++)
{
kh = &(t_ch->k_t_b.a[i]);
if(kh->qEpre <= kh->qSpre) continue;
if(kh->tEpre <= kh->tSpre) continue;
kv_pushp(u_trans_t, t_ch->k_trans, &kt);
kt->f = flag; kt->rev = ((kh->qn ^ kh->tn) & 1); kt->del = 0;
kt->qn = kh->qn>>1; kt->qs = kh->qSpre; kt->qe = kh->qEpre;
@@ -11831,9 +11835,6 @@ ma_ug_t *ug, uint32_t flag, double score, const char* cmd)
y_score = ((double)(kt->te-kt->ts)/(double)(t_ch->c_buf.a[t_ch->c_buf.n-1].c_y_p-t_ch->c_buf.a[0].c_y_p))*score;
kt->nw = MIN(x_score, y_score);
}
// fprintf(stderr, "s-utg%.6ul\t%u\t%u\td-utg%.6ul\t%u\t%u\trev(%u)\n",
// kt->qn+1, kt->qs, kt->qe, kt->tn+1, kt->ts, kt->te, kt->rev);
}
+3 -1
View File
@@ -14598,7 +14598,7 @@ void print_kv_weight(kv_u_trans_t *ta)
void print_debug_hc_links(ha_ug_index* idx, bubble_type* bub, hc_links* lk, kv_u_trans_t *ta, kvec_pe_hit* hits)
{
uint64_t k, len = 0, shif = 64 - idx->uID_bits, beg, end;
uint64_t k, len = 0, occ = 0, shif = 64 - idx->uID_bits, beg, end;
hc_edge *e = NULL;
for (k = 0; k < hits->a.n; ++k)
{
@@ -14608,9 +14608,11 @@ void print_debug_hc_links(ha_ug_index* idx, bubble_type* bub, hc_links* lk, kv_u
if(IF_HOM(beg, *bub)) continue;
if(IF_HOM(end, *bub)) continue;
len += (hits->a.a[k].len>>32) + ((uint32_t)hits->a.a[k].len);
occ++;
}
fprintf(stderr, "# total Hi-C aligned bases: %lu\n", len);
fprintf(stderr, "# total Hi-C aligned pairs: %lu\n", occ);
for (k = 0; k < ta->n; k++)
{
e = get_hc_edge(lk, ta->a[k].qn, ta->a[k].tn, 0);