From d4b5dfc2974cd0a6c087eb53242ae7e3cefe8a19 Mon Sep 17 00:00:00 2001 From: Heng Li Date: Mon, 23 Oct 2017 14:09:32 -0400 Subject: [PATCH] r533: added --no-pairing to prevent the use of any pairing information for paired-end reads. --- main.c | 4 +++- map.c | 7 ++++++- minimap.h | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 0d02673..4d5618c 100644 --- a/main.c +++ b/main.c @@ -6,7 +6,7 @@ #include "mmpriv.h" #include "getopt.h" -#define MM_VERSION "2.3-r531" +#define MM_VERSION "2.3-r533-dirty" #ifdef __linux__ #include @@ -41,6 +41,7 @@ static struct option long_options[] = { { "secondary", optional_argument, 0, 0 }, { "cs", optional_argument, 0, 0 }, { "end-bonus", required_argument, 0, 0 }, + { "no-pairing", no_argument, 0, 0 }, { "help", no_argument, 0, 'h' }, { "max-intron-len", required_argument, 0, 'G' }, { "version", no_argument, 0, 'V' }, @@ -135,6 +136,7 @@ int main(int argc, char *argv[]) else if (c == 0 && long_idx ==12) opt.flag |= MM_F_NO_LJOIN; // --no-long-join else if (c == 0 && long_idx ==13) opt.flag |= MM_F_SR; // --sr else if (c == 0 && long_idx ==17) opt.end_bonus = atoi(optarg); // --end-bonus + else if (c == 0 && long_idx ==18) opt.flag |= MM_F_INDEPEND_SEG; // --no-pairing else if (c == 0 && long_idx == 14) { // --frag if (optarg == 0 || strcmp(optarg, "yes") == 0 || strcmp(optarg, "y") == 0) opt.flag |= MM_F_FRAG_MODE; diff --git a/map.c b/map.c index 35efa6d..a31bceb 100644 --- a/map.c +++ b/map.c @@ -414,7 +414,12 @@ static void worker_for(void *_data, long i, int tid) // kt_for() callback qseqs[j] = s->seq[off + j].seq; quals[j] = is_sr? s->seq[off + j].qual : 0; } - mm_map_frag(s->p->mi, s->n_seg[i], qlens, qseqs, quals, &s->n_reg[off], &s->reg[off], b, s->p->opt, s->seq[off].name); + if (s->p->opt->flag & MM_F_INDEPEND_SEG) { + for (j = 0; j < s->n_seg[i]; ++j) + mm_map_frag(s->p->mi, 1, &qlens[j], &qseqs[j], &quals[j], &s->n_reg[off+j], &s->reg[off+j], b, s->p->opt, s->seq[off+j].name); + } else { + mm_map_frag(s->p->mi, s->n_seg[i], qlens, qseqs, quals, &s->n_reg[off], &s->reg[off], b, s->p->opt, s->seq[off].name); + } for (j = 0; j < s->n_seg[i]; ++j) // flip the query strand and coordinate to the original read strand if (s->n_seg[i] == 2 && ((j == 0 && (pe_ori>>1&1)) || (j == 1 && (pe_ori&1)))) { int k, t; diff --git a/minimap.h b/minimap.h index e1dbf88..058c1e3 100644 --- a/minimap.h +++ b/minimap.h @@ -22,6 +22,7 @@ #define MM_F_NO_PRINT_2ND 0x4000 #define MM_F_2_IO_THREADS 0x8000 #define MM_F_LONG_CIGAR 0x10000 +#define MM_F_INDEPEND_SEG 0x20000 #define MM_IDX_MAGIC "MMI\2"