r463: optionally disable secondary hits

This commit is contained in:
Heng Li 2017-10-04 13:24:19 -04:00
parent 5babf41a38
commit 2581c44a21
3 changed files with 11 additions and 2 deletions

7
main.c
View File

@ -6,7 +6,7 @@
#include "mmpriv.h"
#include "getopt.h"
#define MM_VERSION "2.2-r462-dirty"
#define MM_VERSION "2.2-r463-dirty"
#ifdef __linux__
#include <sys/resource.h>
@ -40,6 +40,7 @@ static struct option long_options[] = {
{ "multi", optional_argument, 0, 0 },
{ "no-long-join", no_argument, 0, 0 },
{ "seed", required_argument, 0, 0 },
{ "print-2nd", optional_argument, 0, 0 },
{ "help", no_argument, 0, 'h' },
{ "max-intron-len", required_argument, 0, 'G' },
{ "version", no_argument, 0, 'V' },
@ -124,6 +125,10 @@ int main(int argc, char *argv[])
if (optarg == 0 || strcmp(optarg, "yes") == 0 || strcmp(optarg, "y") == 0)
opt.flag |= MM_F_MULTI_SEG;
else opt.flag &= ~MM_F_MULTI_SEG;
} else if (c == 0 && long_idx ==17) { // --print-2nd
if (optarg == 0 || strcmp(optarg, "yes") == 0 || strcmp(optarg, "y") == 0)
opt.flag &= ~MM_F_NO_PRINT_2ND;
else opt.flag |= MM_F_NO_PRINT_2ND;
} else if (c == 'V') {
puts(MM_VERSION);
return 0;

5
map.c
View File

@ -80,7 +80,7 @@ int mm_set_opt(const char *preset, mm_idxopt_t *io, mm_mapopt_t *mo)
mo->min_dp_max = 200;
} else if (strcmp(preset, "short") == 0 || strcmp(preset, "sr") == 0) {
io->is_hpc = 0, io->k = 21, io->w = 11;
mo->flag |= MM_F_SR | MM_F_MULTI_SEG;
mo->flag |= MM_F_SR | MM_F_MULTI_SEG | MM_F_NO_PRINT_2ND;
mo->pe_ori = 0<<1|1; // FR
mo->a = 2, mo->b = 8, mo->q = 12, mo->e = 2, mo->q2 = 32, mo->e2 = 1;
mo->max_gap = 200;
@ -452,6 +452,9 @@ static void *worker_pipeline(void *shared, int step, void *in)
mm_bseq1_t *t = &s->seq[i];
for (j = 0; j < s->n_reg[i]; ++j) {
mm_reg1_t *r = &s->reg[i][j];
assert(!r->sam_pri || r->id == r->parent);
if ((p->opt->flag & MM_F_NO_PRINT_2ND) && r->id != r->parent)
continue;
if (p->opt->flag & MM_F_OUT_SAM)
mm_write_sam(&p->str, mi, t, r, s->n_reg[i], s->reg[i]);
else

View File

@ -19,6 +19,7 @@
#define MM_F_NO_SAM_SQ 0x800
#define MM_F_SR 0x1000
#define MM_F_MULTI_SEG 0x2000
#define MM_F_NO_PRINT_2ND 0x4000
#define MM_IDX_MAGIC "MMI\2"