From b276772890c98fd6ec86aa91696a5ebad32c7ea0 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Thu, 18 Nov 2021 21:26:41 -0500 Subject: [PATCH] r1112: added --print-chains for debugging --- main.c | 4 +++- map.c | 2 +- mmpriv.h | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index eabda3d..0329522 100644 --- a/main.c +++ b/main.c @@ -7,7 +7,7 @@ #include "mmpriv.h" #include "ketopt.h" -#define MM_VERSION "2.23-r1111" +#define MM_VERSION "2.23-r1112-dirty" #ifdef __linux__ #include @@ -76,6 +76,7 @@ static ko_longopt_t long_options[] = { { "cap-kalloc", ko_required_argument, 349 }, { "q-occ-frac", ko_required_argument, 350 }, { "chain-skip-scale",ko_required_argument,351 }, + { "print-chains", ko_no_argument, 352 }, { "help", ko_no_argument, 'h' }, { "max-intron-len", ko_required_argument, 'G' }, { "version", ko_no_argument, 'V' }, @@ -233,6 +234,7 @@ int main(int argc, char *argv[]) else if (c == 348) opt.flag |= MM_F_QSTRAND | MM_F_NO_INV; // --qstrand else if (c == 349) opt.cap_kalloc = mm_parse_num(o.arg); // --cap-kalloc else if (c == 350) opt.q_occ_frac = atof(o.arg); // --q-occ-frac + else if (c == 352) mm_dbg_flag |= MM_DBG_PRINT_CHAIN; // --print-chains else if (c == 330) { fprintf(stderr, "[WARNING] \033[1;31m --lj-min-ratio has been deprecated.\033[0m\n"); } else if (c == 314) { // --frag diff --git a/map.c b/map.c index 16c4716..5c31208 100644 --- a/map.c +++ b/map.c @@ -328,7 +328,7 @@ void mm_map_frag(const mm_idx_t *mi, int n_segs, const int *qlens, const char ** mm_hit_sort(b->km, &n_regs0, regs0, opt->alt_drop); // this step can be merged into mm_gen_regs(); will do if this shows up in profile } - if (mm_dbg_flag & MM_DBG_PRINT_SEED) + if (mm_dbg_flag & (MM_DBG_PRINT_SEED|MM_DBG_PRINT_CHAIN)) for (j = 0; j < n_regs0; ++j) for (i = regs0[j].as; i < regs0[j].as + regs0[j].cnt; ++i) fprintf(stderr, "CN\t%d\t%s\t%d\t%c\t%d\t%d\t%d\n", j, mi->seq[a[i].x<<1>>33].name, (int32_t)a[i].x, "+-"[a[i].x>>63], (int32_t)a[i].y, (int32_t)(a[i].y>>32&0xff), diff --git a/mmpriv.h b/mmpriv.h index e765b47..2f5034b 100644 --- a/mmpriv.h +++ b/mmpriv.h @@ -13,6 +13,7 @@ #define MM_DBG_PRINT_QNAME 0x2 #define MM_DBG_PRINT_SEED 0x4 #define MM_DBG_PRINT_ALN_SEQ 0x8 +#define MM_DBG_PRINT_CHAIN 0x10 #define MM_SEED_LONG_JOIN (1ULL<<40) #define MM_SEED_IGNORE (1ULL<<41)