mirror of
https://github.com/lh3/minimap2.git
synced 2026-09-24 19:38:12 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79c9cc186b | ||
|
|
ea4c8935bd | ||
|
|
3187782b1a | ||
|
|
005c9a1f6b |
@@ -1,3 +1,18 @@
|
||||
Release 2.30-r1287 (15 June 2025)
|
||||
---------------------------------
|
||||
|
||||
Notable changes:
|
||||
|
||||
* Improvement: consolidated `--spsc`.
|
||||
|
||||
* Deprecation: subcommands `splice2bed`, `gff2bed`, `gff2junc`, `junceval` and
|
||||
`exoneval` in `paftools.js` are deprecated by minigff. They will remain
|
||||
indefinitely for backward compatibility.
|
||||
|
||||
(2.30: 15 June 2025, r1287)
|
||||
|
||||
|
||||
|
||||
Release 2.29-r1283 (18 April 2025)
|
||||
----------------------------------
|
||||
|
||||
|
||||
@@ -77,8 +77,8 @@ Detailed evaluations are available from the [minimap2 paper][doi] or the
|
||||
Minimap2 is optimized for x86-64 CPUs. You can acquire precompiled binaries from
|
||||
the [release page][release] with:
|
||||
```sh
|
||||
curl -L https://github.com/lh3/minimap2/releases/download/v2.29/minimap2-2.29_x64-linux.tar.bz2 | tar -jxvf -
|
||||
./minimap2-2.29_x64-linux/minimap2
|
||||
curl -L https://github.com/lh3/minimap2/releases/download/v2.30/minimap2-2.30_x64-linux.tar.bz2 | tar -jxvf -
|
||||
./minimap2-2.30_x64-linux/minimap2
|
||||
```
|
||||
If you want to compile from the source, you need to have a C compiler, GNU make
|
||||
and zlib development files installed. Then type `make` in the source code
|
||||
|
||||
+2
-2
@@ -31,8 +31,8 @@ To acquire the data used in this cookbook and to install minimap2 and paftools,
|
||||
please follow the command lines below:
|
||||
```sh
|
||||
# install minimap2 executables
|
||||
curl -L https://github.com/lh3/minimap2/releases/download/v2.29/minimap2-2.29_x64-linux.tar.bz2 | tar jxf -
|
||||
cp minimap2-2.29_x64-linux/{minimap2,k8,paftools.js} . # copy executables
|
||||
curl -L https://github.com/lh3/minimap2/releases/download/v2.30/minimap2-2.30_x64-linux.tar.bz2 | tar jxf -
|
||||
cp minimap2-2.30_x64-linux/{minimap2,k8,paftools.js} . # copy executables
|
||||
export PATH="$PATH:"`pwd` # put the current directory on PATH
|
||||
# download example datasets
|
||||
curl -L https://github.com/lh3/minimap2/releases/download/v2.10/cookbook-data.tgz | tar zxf -
|
||||
|
||||
@@ -967,7 +967,7 @@ typedef struct mm_idx_spsc_s {
|
||||
uint64_t *a; // pos<<56 | score<<1 | acceptor
|
||||
} mm_idx_spsc_t;
|
||||
|
||||
int32_t mm_idx_spsc_read(mm_idx_t *idx, const char *fn, int32_t max_sc)
|
||||
int32_t mm_idx_spsc_read2(mm_idx_t *idx, const char *fn, int32_t max_sc, float scale)
|
||||
{
|
||||
gzFile fp;
|
||||
kstring_t str = {0,0,0};
|
||||
@@ -1007,6 +1007,8 @@ int32_t mm_idx_spsc_read(mm_idx_t *idx, const char *fn, int32_t max_sc)
|
||||
}
|
||||
}
|
||||
if (i < 4) continue; // not enough fields
|
||||
if (scale > 0.0f && scale < 1.0f)
|
||||
score = score > 0.0f? (int)(score * scale + .499) : (int)(score * scale - .499);
|
||||
if (score > max_sc) score = max_sc;
|
||||
if (score < -max_sc) score = -max_sc;
|
||||
cid = mm_idx_name2id(idx, name);
|
||||
@@ -1030,6 +1032,11 @@ int32_t mm_idx_spsc_read(mm_idx_t *idx, const char *fn, int32_t max_sc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int32_t mm_idx_spsc_read(mm_idx_t *idx, const char *fn, int32_t max_sc)
|
||||
{
|
||||
return mm_idx_spsc_read2(idx, fn, max_sc, 1.0f);
|
||||
}
|
||||
|
||||
static int32_t mm_idx_find_intv(int32_t n, const uint64_t *a, int64_t x)
|
||||
{
|
||||
int32_t s = 0, e = n;
|
||||
|
||||
@@ -85,6 +85,8 @@ static ko_longopt_t long_options[] = {
|
||||
{ "jump-min-match", ko_required_argument, 360 },
|
||||
{ "write-junc", ko_no_argument, 361 },
|
||||
{ "pass1", ko_required_argument, 362 },
|
||||
{ "spsc-scale", ko_required_argument, 363 },
|
||||
{ "spsc0", ko_required_argument, 364 },
|
||||
{ "dbg-seed-occ", ko_no_argument, 501 },
|
||||
{ "help", ko_no_argument, 'h' },
|
||||
{ "max-intron-len", ko_required_argument, 'G' },
|
||||
@@ -134,6 +136,7 @@ int main(int argc, char *argv[])
|
||||
mm_mapopt_t opt;
|
||||
mm_idxopt_t ipt;
|
||||
int i, c, n_threads = 3, n_parts, old_best_n = -1;
|
||||
float spsc_scale = 0.7f;
|
||||
char *fnw = 0, *rg = 0, *fn_bed_junc = 0, *fn_bed_jump = 0, *fn_bed_pass1 = 0, *fn_spsc = 0, *s, *alt_list = 0;
|
||||
FILE *fp_help = stderr;
|
||||
mm_idx_reader_t *idx_rdr;
|
||||
@@ -240,7 +243,6 @@ int main(int argc, char *argv[])
|
||||
else if (c == 338) opt.max_qlen = mm_parse_num(o.arg); // --max-qlen
|
||||
else if (c == 340) fn_bed_junc = 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
|
||||
@@ -260,6 +262,8 @@ int main(int argc, char *argv[])
|
||||
else if (c == 361) opt.flag |= MM_F_OUT_JUNC | MM_F_CIGAR; // --write-junc
|
||||
else if (c == 362) fn_bed_pass1 = o.arg; // --jump-pass1
|
||||
else if (c == 501) mm_dbg_flag |= MM_DBG_SEED_FREQ; // --dbg-seed-occ
|
||||
else if (c == 363) spsc_scale = atof(o.arg); // --spsc-scale
|
||||
else if (c == 358 || c == 364) opt.junc_pen = atoi(o.arg); // --junc-pen or --spsc0
|
||||
else if (c == 330) {
|
||||
fprintf(stderr, "[WARNING] \033[1;31m --lj-min-ratio has been deprecated.\033[0m\n");
|
||||
} else if (c == 313) { // --sr
|
||||
@@ -476,7 +480,7 @@ int main(int argc, char *argv[])
|
||||
fprintf(stderr, "[WARNING] failed to load the pass-1 jump BED file\n");
|
||||
}
|
||||
if (fn_spsc) {
|
||||
mm_idx_spsc_read(mi, fn_spsc, mm_max_spsc_bonus(&opt));
|
||||
mm_idx_spsc_read2(mi, fn_spsc, mm_max_spsc_bonus(&opt), spsc_scale);
|
||||
if (mi->spsc == 0 && mm_verbose >= 2)
|
||||
fprintf(stderr, "[WARNING] failed to load the splice score file\n");
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#define MM_VERSION "2.29-r1283"
|
||||
#define MM_VERSION "2.30-r1287"
|
||||
|
||||
#define MM_F_NO_DIAG (0x001LL) // no exact diagonal hit
|
||||
#define MM_F_NO_DUAL (0x002LL) // skip pairs where query name is lexicographically larger than target name
|
||||
@@ -163,7 +163,8 @@ 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, junc_pen;
|
||||
int junc_bonus; // bonus for a splice site in annotation
|
||||
int junc_pen; // penalty for GT- or -AG not scored in --spsc
|
||||
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
|
||||
@@ -420,6 +421,7 @@ int mm_idx_bed_junc(const mm_idx_t *mi, int32_t ctg, int32_t st, int32_t en, uin
|
||||
|
||||
int mm_max_spsc_bonus(const mm_mapopt_t *mo);
|
||||
int32_t mm_idx_spsc_read(mm_idx_t *idx, const char *fn, int32_t max_sc);
|
||||
int32_t mm_idx_spsc_read2(mm_idx_t *idx, const char *fn, int32_t max_sc, float scale);
|
||||
int64_t mm_idx_spsc_get(const mm_idx_t *db, int32_t cid, int64_t st0, int64_t en0, int32_t rev, uint8_t *sc);
|
||||
|
||||
// deprecated APIs for backward compatibility
|
||||
|
||||
+12
-3
@@ -1,4 +1,4 @@
|
||||
.TH minimap2 1 "18 April 2025" "minimap2-2.29 (r1283)" "Bioinformatics tools"
|
||||
.TH minimap2 1 "15 June 2025" "minimap2-2.30 (r1287)" "Bioinformatics tools"
|
||||
.SH NAME
|
||||
.PP
|
||||
minimap2 - mapping and alignment between collections of DNA sequences
|
||||
@@ -443,14 +443,23 @@ line corresponds to a donor site and `A' for an acceptor site.
|
||||
A positive score suggests the junction is preferred and a negative score
|
||||
suggests the junction is not preferred.
|
||||
.TP
|
||||
.BR --junc-pen \ INT
|
||||
Penalty for a position not in FILE specified by
|
||||
.BR --spsc0 \ INT
|
||||
Penalty for positions not in
|
||||
.I FILE
|
||||
specified by
|
||||
.B --spsc
|
||||
[5]. Effective with
|
||||
.B --spsc
|
||||
but not
|
||||
.BR --junc-bed .
|
||||
.TP
|
||||
.BR --spsc-scale \ FLOAT
|
||||
Scale splice scores in
|
||||
.B --spsc
|
||||
by
|
||||
.IR FLOAT
|
||||
rounded to the nearest integer [0.7].
|
||||
.TP
|
||||
.BR --junc-bed \ FILE
|
||||
Junctions to prefer during base alignment [].
|
||||
Same format as
|
||||
|
||||
+9
-2
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env k8
|
||||
|
||||
var paftools_version = '2.29-r1283';
|
||||
var paftools_version = '2.30-r1287';
|
||||
|
||||
/*****************************
|
||||
***** Library functions *****
|
||||
@@ -2613,7 +2613,8 @@ function paf_junceval(args)
|
||||
function paf_exoneval(args) // adapted from paf_junceval()
|
||||
{
|
||||
var c, l_fuzzy = 0, print_ovlp = false, print_err_only = false, first_only = false, chr_only = false, aa = false, is_bed = false, use_cds = false, eval_base = false;
|
||||
while ((c = getopt(args, "l:epcab1ds")) != null) {
|
||||
var skip_start = false, skip_last = false;
|
||||
while ((c = getopt(args, "l:epcab1dsft")) != null) {
|
||||
if (c == 'l') l_fuzzy = parseInt(getopt.arg);
|
||||
else if (c == 'e') print_err_only = print_ovlp = true;
|
||||
else if (c == 'p') print_ovlp = true;
|
||||
@@ -2623,6 +2624,8 @@ function paf_exoneval(args) // adapted from paf_junceval()
|
||||
else if (c == '1') first_only = true;
|
||||
else if (c == 'd') use_cds = true;
|
||||
else if (c == 's') eval_base = true;
|
||||
else if (c == 'f') skip_start = true;
|
||||
else if (c == 't') skip_last = skip_start = true;
|
||||
}
|
||||
|
||||
if (args.length - getopt.ind < 1) {
|
||||
@@ -2635,6 +2638,8 @@ function paf_exoneval(args) // adapted from paf_junceval()
|
||||
print(" -e print erroreous overlapping exons");
|
||||
print(" -c only consider alignments to /^(chr)?([0-9]+|X|Y)$/");
|
||||
print(" -1 only process the first alignment of each query");
|
||||
print(" -f skip the first exon in the miniprot mode");
|
||||
print(" -t skip the first and the last exons");
|
||||
print(" -b BED as input");
|
||||
print(" -s compute base Sn and Sp (more memory)");
|
||||
exit(1);
|
||||
@@ -2764,6 +2769,8 @@ function paf_exoneval(args) // adapted from paf_junceval()
|
||||
for (var i = tmp_exon.length - 1; i >= 0; --i)
|
||||
exon.push([pos + (glen - tmp_exon[i][1]), pos + (glen - tmp_exon[i][0])]);
|
||||
}
|
||||
if (skip_start) exon.shift();
|
||||
if (skip_last) exon.pop();
|
||||
} else {
|
||||
var tmp_st = pos;
|
||||
while ((m = re_cigar.exec(cigar)) != null) {
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ from libc.stdlib cimport free
|
||||
cimport cmappy
|
||||
import sys
|
||||
|
||||
__version__ = '2.29'
|
||||
__version__ = '2.30'
|
||||
|
||||
cmappy.mm_reset_timer()
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ def readme():
|
||||
|
||||
setup(
|
||||
name = 'mappy',
|
||||
version = '2.29',
|
||||
version = '2.30',
|
||||
url = 'https://github.com/lh3/minimap2',
|
||||
description = 'Minimap2 python binding',
|
||||
long_description = readme(),
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
mm2: TGTTATCCCTAGGGTAACTTGTTCCGTTGGTCAAGTTATTGGATCAATTGAGTATAGTAGTGCACTCAC......................................................................................................................................CACTTGGAGCCATTCATACAGGTCCCTATTTAAGGAACAAGTGATTATGCTACCTTTGCACGGTT
|
||||
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
ref: TGTTATCCCTAGGGTAACTTGTTCCGTTGGTCAAGTTATTGGATCAATTGAGTATAGTAGTGCACTCACctGCTTCGCTTTGACTGGTGAAGTCTTAGCATGTACTGCTCGGAGGTTGGGTTCTGCTCCGAGGTCGCCCCAACCGAAATTTTTAATGCAGGTTTGGTAGTTTAGGACCTGTGGGTTTGTTAGGCTAACCTCacCACTTGGAGCCATTCATACAGGTCCCTATTTAAGGAACAAGTGATTATGCTACCTTTGCACGGTT
|
||||
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||
sta: TGTTATCCCTAGGGTAACTTGTTCCGTTGGTCAAGTTATTGGATCAATTGAGTATAGTAGTGCA......................................................................................................................................CTCACCACTTGGAGCCATTCATACAGGTCCCTATTTAAGGAACAAGTGATTATGCTACCTTTGCACGGTT
|
||||
@@ -0,0 +1,5 @@
|
||||
>query
|
||||
AACCGTGCAAAGGTAGCATAATCACTTGTTCCTTAAATAGGGACCTGTATGAATGGCTCC
|
||||
AAGTG
|
||||
GTGAGTGCA
|
||||
CTACTATACTCAATTGATCCAATAACTTGACCAACGGAACAAGTTACCCTAGGGATAACA
|
||||
@@ -0,0 +1,10 @@
|
||||
>ref
|
||||
TGATCCAACATCGAGGTCGTAAACCCTATTGTTGATATGGACTCTAGAATAGGATTGCGC
|
||||
TGTTATCCCTAGGGTAACTTGTTCCGTTGGTCAAGTTATTGGATCAATTGAGTATAGTAG
|
||||
TGCACTCAC
|
||||
ctGCTTCGCTTTGACTGGTGAAGTCTTAGCATGTACTGCTCGGAGGTTGGGTTCTGCTCC
|
||||
GAGGTCGCCCCAACCGAAATTTTTAATGCAGGTTTGGTAGTTTAGGACCTGTGGGTTTGT
|
||||
TAGGCTAACCTCac
|
||||
CACTTGGAGCCATTCATACAGGTCCCTATTTAAGGAACAAGTGATTATGCTACCTTTGCA
|
||||
CGGTTAGGGTACCGCGGCCGTTAAACATGTGTCACTGGGCAGGCGGTGCCTCTAATACTG
|
||||
GTGAT
|
||||
Reference in New Issue
Block a user