From 71e91f3fc2b6cbd6f69adf656c0d9f3446bb8eb6 Mon Sep 17 00:00:00 2001 From: chhylp123 Date: Wed, 28 Apr 2021 20:27:43 -0400 Subject: [PATCH] assgin disconnected parts --- CommandLines.h | 2 +- Overlaps.cpp | 11 ++++++----- hic.cpp | 4 +++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/CommandLines.h b/CommandLines.h index b71d83d..04584f8 100644 --- a/CommandLines.h +++ b/CommandLines.h @@ -4,7 +4,7 @@ #include #include -#define HA_VERSION "0.15.1-r330" +#define HA_VERSION "0.15.1-r331" #define VERBOSE 0 diff --git a/Overlaps.cpp b/Overlaps.cpp index 915c447..192d097 100644 --- a/Overlaps.cpp +++ b/Overlaps.cpp @@ -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); } diff --git a/hic.cpp b/hic.cpp index 75b0b99..1cc981f 100644 --- a/hic.cpp +++ b/hic.cpp @@ -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);