diff --git a/CommandLines.h b/CommandLines.h index e6505bf..7cf00dc 100644 --- a/CommandLines.h +++ b/CommandLines.h @@ -5,7 +5,7 @@ #include #include -#define HA_VERSION "0.21.0-r686" +#define HA_VERSION "0.22.0-r687" #define VERBOSE 0 diff --git a/Hash_Table.cpp b/Hash_Table.cpp index c39c542..cfcadfb 100644 --- a/Hash_Table.cpp +++ b/Hash_Table.cpp @@ -1749,16 +1749,6 @@ uint64_t lchain_qdp(k_mer_hit* a, int64_t a_n, k_mer_hit* des, Chain_Data* dp, o return cL; } - -#define kv_pushp_ol(type, v, p) do { \ - if ((v).length == (v).size) { \ - (v).list = (type*)realloc((v).list, sizeof(type)*((v).size?((v).size<<1):(2))); \ - memset((v).list+(v).size, 0, sizeof(overlap_region)*(((v).size?((v).size<<1):2)-(v).size));\ - (v).size = (v).size?((v).size<<1):(2); \ - } \ - *(p) = &((v).list[(v).length++]); \ - } while (0) - void push_ovlp_chain_qgen(overlap_region* o, uint32_t xid, int64_t xl, int64_t yl, int64_t sc, k_mer_hit *beg, k_mer_hit *end) { diff --git a/Hash_Table.h b/Hash_Table.h index b7ad647..8247484 100644 --- a/Hash_Table.h +++ b/Hash_Table.h @@ -248,4 +248,13 @@ uint64_t lchain_qdp_mcopy_fast(Candidates_list *cl, int64_t a_idx, int64_t a_n, int64_t gen_cigar, int64_t enable_mcopy, double mcopy_rate, int64_t mcopy_khit_cutoff, int64_t khit_n); +#define kv_pushp_ol(type, v, p) do { \ + if ((v).length == (v).size) { \ + (v).list = (type*)realloc((v).list, sizeof(type)*((v).size?((v).size<<1):(2))); \ + memset((v).list+(v).size, 0, sizeof(overlap_region)*(((v).size?((v).size<<1):2)-(v).size));\ + (v).size = (v).size?((v).size<<1):(2); \ + } \ + *(p) = &((v).list[(v).length++]); \ + } while (0) + #endif diff --git a/Overlaps.cpp b/Overlaps.cpp index d4fd9ba..3c2005b 100644 --- a/Overlaps.cpp +++ b/Overlaps.cpp @@ -17664,6 +17664,7 @@ long long gap_fuzz, ug_opt_t *opt) set_trio_flag_by_cov(ug, sg, cov); // print_r_het(cov, R_INF.trio_flag, "out-1"); // print_debug_gfa(ug, sg, coverage_cut, output_file_name, sources, ruIndex); + // exit(1); destory_hap_cov_t(&cov); ma_ug_destroy(ug); diff --git a/anchor.cpp b/anchor.cpp index 450ebcf..0adaf37 100644 --- a/anchor.cpp +++ b/anchor.cpp @@ -1943,10 +1943,11 @@ void lchain_qgen_mcopy_fast(Candidates_list* cl, overlap_region_alloc* ol, uint3 } cl->length = m; + // fprintf(stderr, "[M::%s::] rn::%lu\tmax_n_chain::%lu\n", __func__, ol->length, max_n_chain); // for (k = 0; k < ol->length; k++) { - // fprintf(stderr, "---[M::%s::utg%.6dl] q[%d, %d), t[%d, %d), khit_off::%u\n", __func__, - // (int32_t)ol->list[k].y_id+1, ol->list[k].x_pos_s, ol->list[k].x_pos_e+1, - // ol->list[k].y_pos_s, ol->list[k].y_pos_e+1, ol->list[k].non_homopolymer_errors); + // fprintf(stderr, "---[M::%s::%.*s(qid::%u)] q[%d, %d), t[%d, %d), khit_off::%u\n", __func__, + // (int32_t)Get_NAME_LENGTH(R_INF, ol->list[k].y_id), Get_NAME(R_INF, ol->list[k].y_id), ol->list[k].y_id, + // ol->list[k].x_pos_s, ol->list[k].x_pos_e+1, ol->list[k].y_pos_s, ol->list[k].y_pos_e+1, ol->list[k].non_homopolymer_errors); // } k = ol->length; diff --git a/ecovlp.cpp b/ecovlp.cpp index 91d7c7c..07e2f6f 100644 --- a/ecovlp.cpp +++ b/ecovlp.cpp @@ -3220,7 +3220,7 @@ static void worker_hap_ec(void *data, long i, int tid) // if(i != 1124) return; // if(i != 700) return; // if(i != 2243244) return; - // if(i != 19350) return; + // if(i != 15139) return; // debug_retrive_bqual(D, &b->v8t, i, 256); return; @@ -3233,6 +3233,8 @@ static void worker_hap_ec(void *data, long i, int tid) aux_o = fetch_aux_ovlp(&b->olist);///must be here + // stderr_phase_ovlp(&b->olist); + ///debug for memory // snprintf(NULL, 0, "dwn::%u\tdcn::%u", (uint32_t)aux_o->w_list.n, (uint32_t)aux_o->w_list.c.n); @@ -4849,7 +4851,12 @@ void h_ec_lchain_fast_new(ha_abuf_t *ab, uint32_t rid, UC_Read *qu, UC_Read *tu, oa = in0->buffer; on = in0->length; for (k = 0; k < on; k++) { if(oa[k].el) { - z = &(ol->list[ol->length++]); + // z = &(ol->list[ol->length++]); + kv_pushp_ol(overlap_region, (*ol), &z); + clear_fake_cigar(&(z->f_cigar)); + clear_window_list_alloc(&(z->w_list)); + clear_window_list_alloc(&(z->boundary_cigars)); + z->x_id = rid; z->y_id = oa[k].tn; z->x_pos_strand = 0; z->y_pos_strand = oa[k].rev; z->x_pos_s = (uint32_t)oa[k].qns;