From 858b95a3bb821dbfd15a933fa608be7a0de1bee5 Mon Sep 17 00:00:00 2001 From: chhylp123 Date: Thu, 17 Aug 2023 19:58:35 -0400 Subject: [PATCH] disable multiple assertions --- CommandLines.cpp | 5 +++++ CommandLines.h | 3 ++- inter.cpp | 16 +++++++--------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CommandLines.cpp b/CommandLines.cpp index c582d87..1fdeebb 100644 --- a/CommandLines.cpp +++ b/CommandLines.cpp @@ -61,6 +61,7 @@ static ko_longopt_t long_options[] = { { "path-max", ko_required_argument, 346}, { "path-min", ko_required_argument, 347}, { "trio-dual", ko_no_argument, 348}, + { "ul-cut", ko_required_argument, 349}, // { "path-round", ko_required_argument, 348}, { 0, 0, 0 } }; @@ -174,6 +175,8 @@ void Print_H(hifiasm_opt_t* asm_opt) fprintf(stderr, " --path-min FLOAT\n"); fprintf(stderr, " min path drop ratio [%.2g]; higher number may make the assembly cleaner\n", asm_opt->min_path_drop_rate); fprintf(stderr, " but may lead to more misassemblies\n"); + fprintf(stderr, " --ul-cut INT\n"); + fprintf(stderr, " filter out ul_min_base); // fprintf(stderr, " --low-het enable it for genomes with very low het heterozygosity rate (<0.0001%%)\n"); fprintf(stderr, "Example: ./hifiasm -o NA12878.asm -t 32 NA12878.fq.gz\n"); @@ -290,6 +293,7 @@ void init_opt(hifiasm_opt_t* asm_opt) asm_opt->hifi_pst_join = 1; asm_opt->ul_pst_join = 1; asm_opt->trio_cov_het_ovlp = -1; + asm_opt->ul_min_base = 0; } void destory_enzyme(enzyme* f) @@ -835,6 +839,7 @@ int CommandLine_process(int argc, char *argv[], hifiasm_opt_t* asm_opt) else if (c == 346) asm_opt->max_path_drop_rate = atof(opt.arg); else if (c == 347) asm_opt->min_path_drop_rate = atof(opt.arg); else if (c == 348) asm_opt->trio_cov_het_ovlp = 1; + else if (c == 349) asm_opt->ul_min_base = atol(opt.arg); else if (c == 'l') { ///0: disable purge_dup; 1: purge containment; 2: purge overlap asm_opt->purge_level_primary = asm_opt->purge_level_trio = atoi(opt.arg); } diff --git a/CommandLines.h b/CommandLines.h index 8a1f66e..b037651 100644 --- a/CommandLines.h +++ b/CommandLines.h @@ -5,7 +5,7 @@ #include #include -#define HA_VERSION "0.19.5-r593" +#define HA_VERSION "0.19.6-r595" #define VERBOSE 0 @@ -146,6 +146,7 @@ typedef struct { int32_t integer_correct_round; uint8_t dbg_ovec_cal; uint8_t hifi_pst_join, ul_pst_join; + uint32_t ul_min_base; } hifiasm_opt_t; extern hifiasm_opt_t asm_opt; diff --git a/inter.cpp b/inter.cpp index f20ef20..41885c0 100644 --- a/inter.cpp +++ b/inter.cpp @@ -12692,7 +12692,7 @@ static void *worker_ul_scall_pipeline(void *data, int step, void *in) // callbac s->opt = p->opt; s->uu = p->uu; s->uopt = p->uopt; s->rg = p->rg; while ((ret = kseq_read(p->ks)) >= 0) { - if (p->ks->seq.l < (uint64_t)p->opt->k) continue; + if ((p->ks->seq.l < (uint64_t)p->opt->k) || (p->ks->seq.l < asm_opt.ul_min_base)) continue; if (s->n == s->m) { s->m = s->m < 16? 16 : s->m + (s->n>>1); REALLOC(s->len, s->m); @@ -12823,7 +12823,7 @@ static void *worker_ul_rescall_pipeline(void *data, int step, void *in) // callb s->opt = p->opt; s->uu = p->uu; s->uopt = p->uopt; s->rg = p->rg; s->mm = p->mm; while ((ret = kseq_read(p->ks)) >= 0) { - if (p->ks->seq.l < (uint64_t)p->opt->k) continue; + if ((p->ks->seq.l < (uint64_t)p->opt->k) || (p->ks->seq.l < asm_opt.ul_min_base)) continue; if (s->n == s->m) { s->m = s->m < 16? 16 : s->m + (s->n>>1); REALLOC(s->len, s->m); @@ -15956,7 +15956,7 @@ uint32_t refine_rid_chain(const asg_t *rg, mg_tbuf_t *b, ul_vec_t *rch, uint64_t { if(rch->bb.n == 1 && rch->bb.a[0].base) return 1;///no alignment if(rch->bb.n == 0) return 1;///no alignment - uint64_t i, m, c[2], nc, cc, ni[2]; + uint64_t i, m, c[2], nc, cc/**, ni[2]**/; for (i = c[1] = rch->bb.n-1, m = nc = 0; i != (uint32_t)-1; i = rch->bb.a[i].pidx) { m++; c[0] = i; if(!(rg->seq[rch->bb.a[i].hid].del)) nc++; } @@ -15967,16 +15967,14 @@ uint32_t refine_rid_chain(const asg_t *rg, mg_tbuf_t *b, ul_vec_t *rch, uint64_t if(rg->seq[rch->bb.a[i].hid].del) cc++; else break; } - ni[1] = i; + // ni[1] = i; for (i = c[0]; i != (uint32_t)-1; i = rch->bb.a[i].aidx) { if(rg->seq[rch->bb.a[i].hid].del) cc++; else break; } - ni[0] = i; + // ni[0] = i; if(nc + cc == m) return 1; - assert(ni[1] > ni[0] && ni[0] != (uint32_t)-1 && ni[1] != (uint32_t)-1); - // fprintf(stderr, "[M::%s::%.*s(id:%ld), len:%u] aln::%lu, m::%lu, nc::%lu, cc::%lu\n", __func__, - // UL_INF.nid.a[ulid].n, UL_INF.nid.a[ulid].a, ulid, rch->rlen, (uint64_t)rch->bb.n, m, nc, cc); + // assert(ni[1] > ni[0] && ni[0] != (uint32_t)-1 && ni[1] != (uint32_t)-1); return 2; } return 0; @@ -16042,7 +16040,7 @@ uint32_t refine_contain_consensus_chain(const asg_t *rg, ul_vec_t *rch, R_to_U * if(!is_end) continue; i = m = k; occ = 0; while (i != ((uint32_t)-1)) { - assert(bu->a[i] == ((uint64_t)-1)); + //assert(bu->a[i] == ((uint64_t)-1)); if(rg->seq[rch->bb.a[i].hid].del) { if(occ > 1) { bu->a[m] = occ;