diff --git a/align.c b/align.c index 9586dd8..5981e13 100644 --- a/align.c +++ b/align.c @@ -343,7 +343,7 @@ static void mm_align_pair(void *km, const mm_mapopt_t *opt, int qlen, const uint } else if (opt->flag & MM_F_SPLICE) { int flag_tmp = flag; if (!(opt->flag & MM_F_SPLICE_OLD)) flag_tmp |= KSW_EZ_SPLICE_CMPLX; - ksw_exts2_sse(km, qlen, qseq, tlen, tseq, 5, mat, opt->q, opt->e, opt->q2, opt->noncan, zdrop, opt->junc_bonus, flag_tmp, junc, ez); + ksw_exts2_sse(km, qlen, qseq, tlen, tseq, 5, mat, opt->q, opt->e, opt->q2, opt->noncan, zdrop, opt->junc_bonus, opt->junc_pen, flag_tmp, junc, ez); } else if (opt->q == opt->q2 && opt->e == opt->e2) ksw_extz2_sse(km, qlen, qseq, tlen, tseq, 5, mat, opt->q, opt->e, w, zdrop, end_bonus, flag, ez); else diff --git a/ksw2.h b/ksw2.h index 296030b..71c6aad 100644 --- a/ksw2.h +++ b/ksw2.h @@ -71,7 +71,7 @@ void ksw_extd2_sse(void *km, int qlen, const uint8_t *query, int tlen, const uin int8_t gapo, int8_t gape, int8_t gapo2, int8_t gape2, int w, int zdrop, int end_bonus, int flag, ksw_extz_t *ez); void ksw_exts2_sse(void *km, int qlen, const uint8_t *query, int tlen, const uint8_t *target, int8_t m, const int8_t *mat, - int8_t gapo, int8_t gape, int8_t gapo2, int8_t noncan, int zdrop, int8_t junc_bonus, int flag, const uint8_t *junc, ksw_extz_t *ez); + int8_t gapo, int8_t gape, int8_t gapo2, int8_t noncan, int zdrop, int8_t junc_bonus, int8_t junc_pen, int flag, const uint8_t *junc, ksw_extz_t *ez); void ksw_extf2_sse(void *km, int qlen, const uint8_t *query, int tlen, const uint8_t *target, int8_t mch, int8_t mis, int8_t e, int w, int xdrop, ksw_extz_t *ez); diff --git a/ksw2_dispatch.c b/ksw2_dispatch.c index 792b267..6083214 100644 --- a/ksw2_dispatch.c +++ b/ksw2_dispatch.c @@ -80,17 +80,17 @@ void ksw_extd2_sse(void *km, int qlen, const uint8_t *query, int tlen, const uin } void ksw_exts2_sse(void *km, int qlen, const uint8_t *query, int tlen, const uint8_t *target, int8_t m, const int8_t *mat, - int8_t q, int8_t e, int8_t q2, int8_t noncan, int zdrop, int8_t junc_bonus, int flag, const uint8_t *junc, ksw_extz_t *ez) + int8_t q, int8_t e, int8_t q2, int8_t noncan, int zdrop, int8_t junc_bonus, int8_t junc_pen, int flag, const uint8_t *junc, ksw_extz_t *ez) { extern void ksw_exts2_sse2(void *km, int qlen, const uint8_t *query, int tlen, const uint8_t *target, int8_t m, const int8_t *mat, - int8_t q, int8_t e, int8_t q2, int8_t noncan, int zdrop, int8_t junc_bonus, int flag, const uint8_t *junc, ksw_extz_t *ez); + int8_t q, int8_t e, int8_t q2, int8_t noncan, int zdrop, int8_t junc_bonus, int8_t junc_pen, int flag, const uint8_t *junc, ksw_extz_t *ez); extern void ksw_exts2_sse41(void *km, int qlen, const uint8_t *query, int tlen, const uint8_t *target, int8_t m, const int8_t *mat, - int8_t q, int8_t e, int8_t q2, int8_t noncan, int zdrop, int8_t junc_bonus, int flag, const uint8_t *junc, ksw_extz_t *ez); + int8_t q, int8_t e, int8_t q2, int8_t noncan, int zdrop, int8_t junc_bonus, int8_t junc_pen, int flag, const uint8_t *junc, ksw_extz_t *ez); if (ksw_simd < 0) ksw_simd = x86_simd(); if (ksw_simd & SIMD_SSE4_1) - ksw_exts2_sse41(km, qlen, query, tlen, target, m, mat, q, e, q2, noncan, zdrop, junc_bonus, flag, junc, ez); + ksw_exts2_sse41(km, qlen, query, tlen, target, m, mat, q, e, q2, noncan, zdrop, junc_bonus, junc_pen, flag, junc, ez); else if (ksw_simd & SIMD_SSE2) - ksw_exts2_sse2(km, qlen, query, tlen, target, m, mat, q, e, q2, noncan, zdrop, junc_bonus, flag, junc, ez); + ksw_exts2_sse2(km, qlen, query, tlen, target, m, mat, q, e, q2, noncan, zdrop, junc_bonus, junc_pen, flag, junc, ez); else abort(); } #endif diff --git a/ksw2_exts2_sse.c b/ksw2_exts2_sse.c index 746778e..590742e 100644 --- a/ksw2_exts2_sse.c +++ b/ksw2_exts2_sse.c @@ -24,14 +24,14 @@ #ifdef KSW_CPU_DISPATCH #ifdef __SSE4_1__ void ksw_exts2_sse41(void *km, int qlen, const uint8_t *query, int tlen, const uint8_t *target, int8_t m, const int8_t *mat, - int8_t q, int8_t e, int8_t q2, int8_t noncan, int zdrop, int8_t junc_bonus, int flag, const uint8_t *junc, ksw_extz_t *ez) + int8_t q, int8_t e, int8_t q2, int8_t noncan, int zdrop, int8_t junc_bonus, int8_t junc_pen, int flag, const uint8_t *junc, ksw_extz_t *ez) #else void ksw_exts2_sse2(void *km, int qlen, const uint8_t *query, int tlen, const uint8_t *target, int8_t m, const int8_t *mat, - int8_t q, int8_t e, int8_t q2, int8_t noncan, int zdrop, int8_t junc_bonus, int flag, const uint8_t *junc, ksw_extz_t *ez) + int8_t q, int8_t e, int8_t q2, int8_t noncan, int zdrop, int8_t junc_bonus, int8_t junc_pen, int flag, const uint8_t *junc, ksw_extz_t *ez) #endif #else void ksw_exts2_sse(void *km, int qlen, const uint8_t *query, int tlen, const uint8_t *target, int8_t m, const int8_t *mat, - int8_t q, int8_t e, int8_t q2, int8_t noncan, int zdrop, int8_t junc_bonus, int flag, const uint8_t *junc, ksw_extz_t *ez) + int8_t q, int8_t e, int8_t q2, int8_t noncan, int zdrop, int8_t junc_bonus, int8_t junc_pen, int flag, const uint8_t *junc, ksw_extz_t *ez) #endif // ~KSW_CPU_DISPATCH { #define __dp_code_block1 \ diff --git a/main.c b/main.c index 004d0ba..beee9ff 100644 --- a/main.c +++ b/main.c @@ -80,6 +80,8 @@ static ko_longopt_t long_options[] = { { "ds", ko_no_argument, 355 }, { "rmq-inner", ko_required_argument, 356 }, { "spsc", ko_required_argument, 357 }, + { "spsc0", ko_required_argument, 358 }, + { "junc-pen", ko_required_argument, 358 }, // an alias to --spsc0; this is not a typo { "dbg-seed-occ", ko_no_argument, 501 }, { "help", ko_no_argument, 'h' }, { "max-intron-len", ko_required_argument, 'G' }, @@ -235,6 +237,7 @@ int main(int argc, char *argv[]) else if (c == 338) opt.max_qlen = mm_parse_num(o.arg); // --max-qlen else if (c == 340) junc_bed = o.arg; // --junc-bed else if (c == 341) opt.junc_bonus = atoi(o.arg); // --junc-bonus + else if (c == 358) opt.junc_pen = atoi(o.arg); // --junc-pen else if (c == 342) opt.flag |= MM_F_SAM_HIT_ONLY; // --sam-hit-only else if (c == 343) opt.chain_gap_scale = atof(o.arg); // --chain-gap-scale else if (c == 351) opt.chain_skip_scale = atof(o.arg); // --chain-skip-scale diff --git a/minimap.h b/minimap.h index aec09e6..8b4a7a7 100644 --- a/minimap.h +++ b/minimap.h @@ -159,7 +159,7 @@ typedef struct { int transition; // transition mismatch score (A:G, C:T) int sc_ambi; // score when one or both bases are "N" int noncan; // cost of non-canonical splicing sites - int junc_bonus; + int junc_bonus, junc_pen; int zdrop, zdrop_inv; // break alignment if alignment score drops too fast along the diagonal int end_bonus; int min_dp_max; // drop an alignment if the score of the max scoring segment is below this threshold diff --git a/options.c b/options.c index 1689471..3d5f9a0 100644 --- a/options.c +++ b/options.c @@ -172,6 +172,7 @@ int mm_set_opt(const char *preset, mm_idxopt_t *io, mm_mapopt_t *mo) mo->a = 1, mo->b = 2, mo->q = 2, mo->e = 1, mo->q2 = 32, mo->e2 = 0; mo->noncan = 9; mo->junc_bonus = 9; + mo->junc_pen = 5; mo->zdrop = 200, mo->zdrop_inv = 100; // because mo->a is halved if (strcmp(preset, "splice:hq") == 0) mo->noncan = 5, mo->b = 4, mo->q = 6, mo->q2 = 24;