Release minimap2-2.28 (r1209)

This commit is contained in:
Heng Li
2024-03-27 10:57:17 -04:00
parent e3d8c708ac
commit 8170693de3
9 changed files with 45 additions and 13 deletions

View File

@@ -3,7 +3,7 @@ from libc.stdlib cimport free
cimport cmappy
import sys
__version__ = '2.27'
__version__ = '2.28'
cmappy.mm_reset_timer()
@@ -96,6 +96,7 @@ cdef class Alignment:
a = [str(self._q_st), str(self._q_en), strand, self._ctg, str(self._ctg_len), str(self._r_st), str(self._r_en),
str(self._mlen), str(self._blen), str(self._mapq), tp, ts, "cg:Z:" + self.cigar_str]
if self._cs != "": a.append("cs:Z:" + self._cs)
if self._MD != "": a.append("MD:Z:" + self._MD)
return "\t".join(a)
cdef class ThreadBuffer:

View File

@@ -5,7 +5,7 @@ import getopt
import mappy as mp
def main(argv):
opts, args = getopt.getopt(argv[1:], "x:n:m:k:w:r:c")
opts, args = getopt.getopt(argv[1:], "x:n:m:k:w:r:cM")
if len(args) < 2:
print("Usage: minimap2.py [options] <ref.fa>|<ref.mmi> <query.fq>")
print("Options:")
@@ -16,10 +16,11 @@ def main(argv):
print(" -w INT minimizer window length")
print(" -r INT band width")
print(" -c output the cs tag")
print(" -M output the MD tag")
sys.exit(1)
preset = min_cnt = min_sc = k = w = bw = None
out_cs = False
out_cs = out_MD = False
for opt, arg in opts:
if opt == '-x': preset = arg
elif opt == '-n': min_cnt = int(arg)
@@ -28,11 +29,12 @@ def main(argv):
elif opt == '-k': k = int(arg)
elif opt == '-w': w = int(arg)
elif opt == '-c': out_cs = True
elif opt == '-M': out_MD = True
a = mp.Aligner(args[0], preset=preset, min_cnt=min_cnt, min_chain_score=min_sc, k=k, w=w, bw=bw)
if not a: raise Exception("ERROR: failed to load/build index file '{}'".format(args[0]))
for name, seq, qual in mp.fastx_read(args[1]): # read one sequence
for h in a.map(seq, cs=out_cs): # traverse hits
for h in a.map(seq, cs=out_cs, MD=out_MD): # traverse hits
print('{}\t{}\t{}'.format(name, len(seq), h))
if __name__ == "__main__":