Skip to content

Commit 3cce4fb

Browse files
committed
Release miniprot-0.12 (r237)
1 parent e9aa3a4 commit 3cce4fb

File tree

5 files changed

+36
-9
lines changed

5 files changed

+36
-9
lines changed

NEWS.md

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
Release 0.12-r237 (24 June 2023)
2+
--------------------------------
3+
4+
Notable changes:
5+
6+
* New feature: added option --no-cs to disable the cs tag. This tag is not as
7+
useful as the cs tag for nucleotide alignment because it does not encode the
8+
matching amino acids.
9+
10+
* New feature: output the number of frameshifts and in-frame stop codons in
11+
the PAF output. It is non-trivial to parse in-frame stop codons.
12+
13+
* Bugfix: fixed malformatted protein sequences when --gtf and --trans are both
14+
specified (#45).
15+
16+
(0.12: 24 June 2023, r237)
17+
18+
19+
120
Release 0.11-r234 (18 April 2023)
221
---------------------------------
322

format.c

+9-7
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@ static void mp_write_residue(kstring_t *out, const mp_idx_t *mi, const mp_mapopt
296296
kfree(0, str[0]);
297297
}
298298

299-
void mp_write_paf(kstring_t *s, const mp_idx_t *mi, const mp_bseq1_t *seq, const mp_reg1_t *r, int32_t gff_out)
299+
void mp_write_paf(kstring_t *s, const mp_idx_t *mi, const mp_mapopt_t *opt, const mp_bseq1_t *seq, const mp_reg1_t *r)
300300
{
301301
const mp_ctg_t *ctg;
302-
if (gff_out) mp_sprintf_lite(s, "##PAF\t");
302+
if (opt->flag & (MP_F_GFF|MP_F_GTF)) mp_sprintf_lite(s, "##PAF\t");
303303
if (r == 0) {
304304
mp_sprintf_lite(s, "%s\t%d\t0\t0\t*\t*\t0\t0\t0\t0\t0\t0\n", seq->name, seq->l_seq);
305305
return;
@@ -316,8 +316,10 @@ void mp_write_paf(kstring_t *s, const mp_idx_t *mi, const mp_bseq1_t *seq, const
316316
for (k = 0; k < r->p->n_cigar; ++k)
317317
mp_sprintf_lite(s, "%d%c", r->p->cigar[k]>>4, NS_CIGAR_STR[r->p->cigar[k]&0xf]);
318318
} else mp_sprintf_lite(s, "%d\t%d\t%d", r->chn_sc, r->chn_sc_ungap, r->cnt);
319-
mp_sprintf_lite(s, "\t");
320-
mp_write_cs(s, mi, &seq->seq[r->qs], r);
319+
if (!(opt->flag & MP_F_NO_CS)) {
320+
mp_sprintf_lite(s, "\t");
321+
mp_write_cs(s, mi, &seq->seq[r->qs], r);
322+
}
321323
mp_sprintf_lite(s, "\n");
322324
}
323325

@@ -416,16 +418,16 @@ void mp_write_output(kstring_t *s, void *km, const mp_idx_t *mi, const mp_bseq1_
416418
s->l = 0;
417419
if (r == 0) {
418420
if (opt->flag&MP_F_SHOW_UNMAP)
419-
mp_write_paf(s, mi, seq, 0, opt->flag&MP_F_GFF);
421+
mp_write_paf(s, mi, opt, seq, 0);
420422
} else if (opt->flag&MP_F_GTF) {
421423
if (opt->flag & (MP_F_SHOW_RESIDUE|MP_F_SHOW_TRANS)) {
422-
mp_write_paf(s, mi, seq, r, opt->flag&MP_F_GTF);
424+
mp_write_paf(s, mi, opt, seq, r);
423425
mp_write_residue(s, mi, opt, seq->seq, r);
424426
}
425427
mp_write_gtf(s, km, mi, seq, r, opt->gff_prefix, id, seq->name);
426428
} else {
427429
if (!(opt->flag&MP_F_NO_PAF))
428-
mp_write_paf(s, mi, seq, r, opt->flag&MP_F_GFF);
430+
mp_write_paf(s, mi, opt, seq, r);
429431
if (opt->flag & (MP_F_SHOW_RESIDUE|MP_F_SHOW_TRANS))
430432
mp_write_residue(s, mi, opt, seq->seq, r);
431433
if (opt->flag&MP_F_GFF)

main.c

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ static ko_longopt_t long_options[] = {
1919
{ "outc", ko_required_argument, 313 },
2020
{ "ie-coef", ko_required_argument, 314 },
2121
{ "trans", ko_no_argument, 315 },
22+
{ "no-cs", ko_no_argument, 316 },
2223
{ "version", ko_no_argument, 401 },
2324
{ "no-kalloc", ko_no_argument, 501 },
2425
{ "dbg-qname", ko_no_argument, 502 },
@@ -148,6 +149,7 @@ int main(int argc, char *argv[])
148149
else if (c == 313) mo.out_cov = atof(o.arg); // --outc
149150
else if (c == 314) mo.ie_coef = atof(o.arg); // --ie-coef
150151
else if (c == 315) mo.flag |= MP_F_SHOW_TRANS; // --trans
152+
else if (c == 316) mo.flag |= MP_F_NO_CS; // --no-cs
151153
else if (c == 501) mp_dbg_flag |= MP_DBG_NO_KALLOC; // --no-kalloc
152154
else if (c == 502) mp_dbg_flag |= MP_DBG_QNAME; // --dbg-qname
153155
else if (c == 503) mp_dbg_flag |= MP_DBG_NO_REFINE; // --dbg-no-refine

miniprot.1

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH miniprot 1 "18 April 2023" "miniprot-0.11 (r234)" "Bioinformatics tools"
1+
.TH miniprot 1 "24 June 2023" "miniprot-0.12 (r237)" "Bioinformatics tools"
22
.SH NAME
33
.PP
44
miniprot - protein-to-genome alignment with splicing and frameshifts
@@ -156,6 +156,9 @@ substitution corresponding to the `G' operator.
156156
.B --trans
157157
Output translated protein sequences on `##STA' lines.
158158
.TP
159+
.B --no-cs
160+
Do not output the cs tag
161+
.TP
159162
.BI --max-intron-out \ NUM
160163
In the
161164
.B --aln

miniprot.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include <stdint.h>
55

6-
#define MP_VERSION "0.11-r236-dirty"
6+
#define MP_VERSION "0.12-r237"
77

88
#define MP_F_NO_SPLICE 0x1
99
#define MP_F_NO_ALIGN 0x2
@@ -14,6 +14,7 @@
1414
#define MP_F_NO_PRE_CHAIN 0x40
1515
#define MP_F_SHOW_RESIDUE 0x80
1616
#define MP_F_SHOW_TRANS 0x100
17+
#define MP_F_NO_CS 0x200
1718

1819
#define MP_FEAT_CDS 0
1920
#define MP_FEAT_STOP 1

0 commit comments

Comments
 (0)