r158: optionally ignore base quality

This commit is contained in:
Heng Li 2017-07-05 18:23:50 -04:00
parent d1f518e3ca
commit 9823317e8f
4 changed files with 11 additions and 4 deletions

6
main.c
View File

@ -10,7 +10,7 @@
#include "minimap.h" #include "minimap.h"
#include "mmpriv.h" #include "mmpriv.h"
#define MM_VERSION "2.0-r153-pre" #define MM_VERSION "2.0-r158-pre"
void liftrlimit() void liftrlimit()
{ {
@ -70,7 +70,7 @@ int main(int argc, char *argv[])
mm_realtime0 = realtime(); mm_realtime0 = realtime();
mm_mapopt_init(&opt); 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); if (c == 'w') w = atoi(optarg);
else if (c == 'k') k = atoi(optarg); else if (c == 'k') k = atoi(optarg);
else if (c == 'H') is_hpc = 1; 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 == 'c') opt.flag |= MM_F_CIGAR;
else if (c == 'X') opt.flag |= MM_F_AVA | MM_F_NO_SELF; 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 == '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 == 'T') opt.sdust_thres = atoi(optarg);
else if (c == 'n') opt.min_cnt = atoi(optarg); else if (c == 'n') opt.min_cnt = atoi(optarg);
else if (c == 'm') opt.min_chain_score = 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, " -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, " -s INT minimal peak DP alignment score [%d]\n", opt.min_dp_max);
fprintf(stderr, " Input/Output:\n"); 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, " -a output in the SAM format (PAF by default)\n");
fprintf(stderr, " -c output CIGAR in PAF\n"); fprintf(stderr, " -c output CIGAR in PAF\n");
fprintf(stderr, " -t INT number of threads [%d]\n", n_threads); fprintf(stderr, " -t INT number of threads [%d]\n", n_threads);

3
map.c
View File

@ -305,9 +305,10 @@ static void *worker_pipeline(void *shared, int step, void *in)
int i, j; int i, j;
pipeline_t *p = (pipeline_t*)shared; pipeline_t *p = (pipeline_t*)shared;
if (step == 0) { // step 0: read sequences 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; step_t *s;
s = (step_t*)calloc(1, sizeof(step_t)); 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) { if (s->seq) {
s->p = p; s->p = p;
for (i = 0; i < s->n_seq; ++i) for (i = 0; i < s->n_seq; ++i)

View File

@ -11,6 +11,7 @@
#define MM_F_AVA 0x02 #define MM_F_AVA 0x02
#define MM_F_CIGAR 0x04 #define MM_F_CIGAR 0x04
#define MM_F_OUT_SAM 0x08 #define MM_F_OUT_SAM 0x08
#define MM_F_NO_QUAL 0x10
#define MM_IDX_MAGIC "MMI\2" #define MM_IDX_MAGIC "MMI\2"

View File

@ -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 .SH NAME
.PP .PP
minimap2 - mapping and alignment between collections of DNA sequences 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. and may be different from the total alignment score.
.SS Input/output options .SS Input/output options
.TP 10 .TP 10
.B -Q
Ignore base quality in the input file.
.TP
.B -a .B -a
Generate CIGAR and output alignments in the SAM format. Minimap2 outputs in PAF Generate CIGAR and output alignments in the SAM format. Minimap2 outputs in PAF
by default. by default.