diff --git a/index.c b/index.c index cfdef19..d7ddc6e 100644 --- a/index.c +++ b/index.c @@ -48,10 +48,12 @@ void mm_idx_destroy(mm_idx_t *mi) uint32_t i; if (mi == 0) return; if (mi->h) kh_destroy(str, (khash_t(str)*)mi->h); - for (i = 0; i < 1U<b; ++i) { - free(mi->B[i].p); - free(mi->B[i].a.a); - kh_destroy(idx, (idxhash_t*)mi->B[i].h); + if (mi->B) { + for (i = 0; i < 1U<b; ++i) { + free(mi->B[i].p); + free(mi->B[i].a.a); + kh_destroy(idx, (idxhash_t*)mi->B[i].h); + } } if (!mi->km) { for (i = 0; i < mi->n_seq; ++i) diff --git a/main.c b/main.c index ee12823..00324ed 100644 --- a/main.c +++ b/main.c @@ -10,7 +10,7 @@ #include "getopt.h" #endif -#define MM_VERSION "2.11-r814-dirty" +#define MM_VERSION "2.11-r815-dirty" #ifdef __linux__ #include @@ -330,7 +330,7 @@ int main(int argc, char *argv[]) } else { mm_write_sam_hdr(0, rg, MM_VERSION, argc, argv); if (opt.split_prefix == 0 && mm_verbose >= 2) - fprintf(stderr, "[WARNING]\033[1;31m For a multi-part index, no @SQ lines will be outputted.\033[0m\n"); + fprintf(stderr, "[WARNING]\033[1;31m For a multi-part index, no @SQ lines will be outputted. Please use --split-prefix.\033[0m\n"); } } if (mm_verbose >= 3) diff --git a/map.c b/map.c index 1a6ff1a..ba04d32 100644 --- a/map.c +++ b/map.c @@ -659,6 +659,7 @@ int mm_split_merge(int n_segs, const char **fn, const mm_mapopt_t *opt, int n_sp { int i; pipeline_t pl; + mm_idx_t *mi; if (n_segs < 1 || n_split_idx < 1) return -1; memset(&pl, 0, sizeof(pipeline_t)); pl.n_fp = n_segs; @@ -670,7 +671,7 @@ int mm_split_merge(int n_segs, const char **fn, const mm_mapopt_t *opt, int n_sp pl.n_parts = n_split_idx; pl.fp_parts = CALLOC(FILE*, pl.n_parts); pl.rid_shift = CALLOC(uint32_t, pl.n_parts); - pl.mi = mm_split_merge_prep(opt->split_prefix, n_split_idx, pl.fp_parts, pl.rid_shift); + pl.mi = mi = mm_split_merge_prep(opt->split_prefix, n_split_idx, pl.fp_parts, pl.rid_shift); if (pl.mi == 0) { free(pl.fp_parts); free(pl.rid_shift); @@ -687,6 +688,7 @@ int mm_split_merge(int n_segs, const char **fn, const mm_mapopt_t *opt, int n_sp kt_pipeline(2, worker_pipeline, &pl, 3); free(pl.str.s); + mm_idx_destroy(mi); free(pl.rid_shift); for (i = 0; i < n_split_idx; ++i) fclose(pl.fp_parts[i]); diff --git a/minimap2.1 b/minimap2.1 index 0d240d1..ced6c8c 100644 --- a/minimap2.1 +++ b/minimap2.1 @@ -239,7 +239,7 @@ Disable the long gap patching heuristic. When this option is applied, the maximum alignment gap is mostly controlled by .BR -r . .TP -.B --lj-min-ratio \ FLOAT +.BI --lj-min-ratio \ FLOAT Fraction of query sequence length required to bridge a long gap [0.5]. A smaller value helps to recover longer gaps, at the cost of more false gaps. .TP @@ -252,6 +252,9 @@ applies a second round of chaining with a higher minimizer occurrence threshold if no good chain is found. In addition, minimap2 attempts to patch gaps between seeds with ungapped alignment. .TP +.BI --split-prefix \ STR +Prefix to create temporary files. Typically used for a multi-part index. +.TP .BR --frag = no | yes Whether to enable the fragment mode [no] .TP