From 9823317e8fe51dba7edf2c583f002f8f6cb45037 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Wed, 5 Jul 2017 18:23:50 -0400 Subject: [PATCH] r158: optionally ignore base quality --- main.c | 6 ++++-- map.c | 3 ++- minimap.h | 1 + minimap2.1 | 5 ++++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/main.c b/main.c index 6b15266..153f408 100644 --- a/main.c +++ b/main.c @@ -10,7 +10,7 @@ #include "minimap.h" #include "mmpriv.h" -#define MM_VERSION "2.0-r153-pre" +#define MM_VERSION "2.0-r158-pre" void liftrlimit() { @@ -70,7 +70,7 @@ int main(int argc, char *argv[]) mm_realtime0 = realtime(); mm_mapopt_init(&opt); - while ((c = getopt_long(argc, argv, "aw:k:t:r:f:Vv:g:I:d:XT:s:x:Hcp:M:n:z:A:B:O:E:m:D:N:", long_options, &long_idx)) >= 0) { + while ((c = getopt_long(argc, argv, "aw:k:t:r:f:Vv:g:I:d:XT:s:x:Hcp:M:n:z:A:B:O:E:m:D:N:Q", long_options, &long_idx)) >= 0) { if (c == 'w') w = atoi(optarg); else if (c == 'k') k = atoi(optarg); else if (c == 'H') is_hpc = 1; @@ -87,6 +87,7 @@ int main(int argc, char *argv[]) else if (c == 'c') opt.flag |= MM_F_CIGAR; else if (c == 'X') opt.flag |= MM_F_AVA | MM_F_NO_SELF; else if (c == 'a') opt.flag |= MM_F_OUT_SAM | MM_F_CIGAR; + else if (c == 'Q') opt.flag |= MM_F_NO_QUAL; else if (c == 'T') opt.sdust_thres = atoi(optarg); else if (c == 'n') opt.min_cnt = atoi(optarg); else if (c == 'm') opt.min_chain_score = atoi(optarg); @@ -161,6 +162,7 @@ int main(int argc, char *argv[]) fprintf(stderr, " -z INT Z-drop score [%d]\n", opt.zdrop); fprintf(stderr, " -s INT minimal peak DP alignment score [%d]\n", opt.min_dp_max); fprintf(stderr, " Input/Output:\n"); + fprintf(stderr, " -Q ignore base quality in the input\n"); fprintf(stderr, " -a output in the SAM format (PAF by default)\n"); fprintf(stderr, " -c output CIGAR in PAF\n"); fprintf(stderr, " -t INT number of threads [%d]\n", n_threads); diff --git a/map.c b/map.c index 1b2f1d1..2c4a220 100644 --- a/map.c +++ b/map.c @@ -305,9 +305,10 @@ static void *worker_pipeline(void *shared, int step, void *in) int i, j; pipeline_t *p = (pipeline_t*)shared; if (step == 0) { // step 0: read sequences + int with_qual = (!!(p->opt->flag & MM_F_OUT_SAM) && !(p->opt->flag & MM_F_NO_QUAL)); step_t *s; s = (step_t*)calloc(1, sizeof(step_t)); - s->seq = bseq_read(p->fp, p->mini_batch_size, !!(p->opt->flag & MM_F_OUT_SAM), &s->n_seq); + s->seq = bseq_read(p->fp, p->mini_batch_size, with_qual, &s->n_seq); if (s->seq) { s->p = p; for (i = 0; i < s->n_seq; ++i) diff --git a/minimap.h b/minimap.h index fc3f4fc..ef3d713 100644 --- a/minimap.h +++ b/minimap.h @@ -11,6 +11,7 @@ #define MM_F_AVA 0x02 #define MM_F_CIGAR 0x04 #define MM_F_OUT_SAM 0x08 +#define MM_F_NO_QUAL 0x10 #define MM_IDX_MAGIC "MMI\2" diff --git a/minimap2.1 b/minimap2.1 index ee6c3e0..2f81a1d 100644 --- a/minimap2.1 +++ b/minimap2.1 @@ -1,4 +1,4 @@ -.TH minimap2 1 "1 July 2017" "minimap2-2.0-r145-pre" "Bioinformatics tools" +.TH minimap2 1 "5 July 2017" "minimap2-2.0-r158-pre" "Bioinformatics tools" .SH NAME .PP minimap2 - mapping and alignment between collections of DNA sequences @@ -218,6 +218,9 @@ the final CIGAR. It is the score of the max scoring segment in the alignment and may be different from the total alignment score. .SS Input/output options .TP 10 +.B -Q +Ignore base quality in the input file. +.TP .B -a Generate CIGAR and output alignments in the SAM format. Minimap2 outputs in PAF by default.