minimap2 0.2.21 → 0.2.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/minimap2.rb +33 -17
- data/lib/minimap2/ffi/constants.rb +57 -42
- data/lib/minimap2/version.rb +2 -2
- data/vendor/libminimap2.so +0 -0
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ceb411a88448c6ed13e6d842450264e91569260c9b19d77e699a93736768522
|
4
|
+
data.tar.gz: 76c1f3466375b73c54db6cd2574ffe19a817b11994d50e9e8473a209566b14f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05a313f05984e2afab772da3971249327a9461a92d8b1fbcf53329ea5cd9d421e4ab8a137bd16213b86d6912bf1d43fd7f22c1bb5408a36004a64296fab294d9
|
7
|
+
data.tar.gz: 7739312455aba2b14192eef634623f351fc4cea721d142b815ce41d651bc3de84e0fe413de6d24e8551ed90a2d71bcbf82a3df5b87685cb1474e6a134ed9fefe
|
data/lib/minimap2.rb
CHANGED
@@ -34,27 +34,31 @@ module Minimap2
|
|
34
34
|
|
35
35
|
# methods from mappy
|
36
36
|
class << self
|
37
|
+
# Set verbosity level.
|
38
|
+
# @param [Integer] level
|
39
|
+
|
40
|
+
def verbose(level = -1)
|
41
|
+
FFI.mm_verbose_level(level)
|
42
|
+
end
|
43
|
+
|
37
44
|
# Read fasta/fastq file.
|
38
45
|
# @param [String] file_path
|
39
|
-
# @param [Boolean]
|
46
|
+
# @param [Boolean] comment If True, the comment will be read.
|
40
47
|
# @yield [name, seq, qual, comment]
|
41
|
-
#
|
48
|
+
# @return [Enumerator] enum Retrun Enumerator if not block given.
|
49
|
+
# Note: You can BioRuby instead of this method.
|
42
50
|
|
43
|
-
def fastx_read(file_path,
|
51
|
+
def fastx_read(file_path, comment: false, &block)
|
44
52
|
path = File.expand_path(file_path)
|
45
53
|
ks = FFI.mm_fastx_open(path)
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
comment
|
52
|
-
yield [name, seq, qual, comment]
|
53
|
-
else
|
54
|
-
yield [name, seq, qual]
|
54
|
+
if block_given?
|
55
|
+
fastx_each(ks, comment, &block)
|
56
|
+
else
|
57
|
+
Enumerator.new do |y|
|
58
|
+
# rewind not work
|
59
|
+
fastx_each(ks, comment) { |r| y << r }
|
55
60
|
end
|
56
61
|
end
|
57
|
-
FFI.mm_fastx_close(ks)
|
58
62
|
end
|
59
63
|
|
60
64
|
# Reverse complement sequence.
|
@@ -68,11 +72,23 @@ module Minimap2
|
|
68
72
|
FFI.mappy_revcomp(l, bseq)
|
69
73
|
end
|
70
74
|
|
71
|
-
|
72
|
-
# @param [Integer] level
|
75
|
+
private
|
73
76
|
|
74
|
-
def
|
75
|
-
FFI.
|
77
|
+
def fastx_each(ks, comment)
|
78
|
+
yield fastx_next(ks, comment) while FFI.kseq_read(ks) >= 0
|
79
|
+
FFI.mm_fastx_close(ks)
|
80
|
+
end
|
81
|
+
|
82
|
+
def fastx_next(ks, read_comment)
|
83
|
+
qual = ks[:qual][:s] if (ks[:qual][:l]).positive?
|
84
|
+
name = ks[:name][:s]
|
85
|
+
seq = ks[:seq][:s]
|
86
|
+
if read_comment
|
87
|
+
comment = ks[:comment][:s] if (ks[:comment][:l]).positive?
|
88
|
+
[name, seq, qual, comment]
|
89
|
+
else
|
90
|
+
[name, seq, qual]
|
91
|
+
end
|
76
92
|
end
|
77
93
|
end
|
78
94
|
end
|
@@ -3,48 +3,60 @@
|
|
3
3
|
module Minimap2
|
4
4
|
module FFI
|
5
5
|
# flags
|
6
|
-
NO_DIAG
|
7
|
-
NO_DUAL
|
8
|
-
CIGAR
|
9
|
-
OUT_SAM
|
10
|
-
NO_QUAL
|
11
|
-
OUT_CG
|
12
|
-
OUT_CS
|
13
|
-
SPLICE
|
14
|
-
SPLICE_FOR
|
15
|
-
SPLICE_REV
|
16
|
-
NO_LJOIN
|
17
|
-
OUT_CS_LONG
|
18
|
-
SR
|
19
|
-
FRAG_MODE
|
20
|
-
NO_PRINT_2ND
|
21
|
-
TWO_IO_THREADS
|
22
|
-
LONG_CIGAR
|
23
|
-
INDEPEND_SEG
|
24
|
-
SPLICE_FLANK
|
25
|
-
SOFTCLIP
|
26
|
-
FOR_ONLY
|
27
|
-
REV_ONLY
|
28
|
-
HEAP_SORT
|
29
|
-
ALL_CHAINS
|
30
|
-
OUT_MD
|
31
|
-
COPY_COMMENT
|
32
|
-
EQX
|
33
|
-
PAF_NO_HIT
|
34
|
-
NO_END_FLT
|
35
|
-
HARD_MLEVEL
|
36
|
-
SAM_HIT_ONLY
|
37
|
-
RMQ
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
6
|
+
NO_DIAG = 0x001 # no exact diagonal hit
|
7
|
+
NO_DUAL = 0x002 # skip pairs where query name is lexicographically larger than target name
|
8
|
+
CIGAR = 0x004
|
9
|
+
OUT_SAM = 0x008
|
10
|
+
NO_QUAL = 0x010
|
11
|
+
OUT_CG = 0x020
|
12
|
+
OUT_CS = 0x040
|
13
|
+
SPLICE = 0x080 # splice mode
|
14
|
+
SPLICE_FOR = 0x100 # match GT-AG
|
15
|
+
SPLICE_REV = 0x200 # match CT-AC, the reverse complement of GT-AG
|
16
|
+
NO_LJOIN = 0x400
|
17
|
+
OUT_CS_LONG = 0x800
|
18
|
+
SR = 0x1000
|
19
|
+
FRAG_MODE = 0x2000
|
20
|
+
NO_PRINT_2ND = 0x4000
|
21
|
+
TWO_IO_THREADS = 0x8000 # Translator's Note. MM_F_2_IO_THREADS. Constants starting with numbers cannot be defined.
|
22
|
+
LONG_CIGAR = 0x10000
|
23
|
+
INDEPEND_SEG = 0x20000
|
24
|
+
SPLICE_FLANK = 0x40000
|
25
|
+
SOFTCLIP = 0x80000
|
26
|
+
FOR_ONLY = 0x100000
|
27
|
+
REV_ONLY = 0x200000
|
28
|
+
HEAP_SORT = 0x400000
|
29
|
+
ALL_CHAINS = 0x800000
|
30
|
+
OUT_MD = 0x1000000
|
31
|
+
COPY_COMMENT = 0x2000000
|
32
|
+
EQX = 0x4000000 # use =/X instead of M
|
33
|
+
PAF_NO_HIT = 0x8000000 # output unmapped reads to PAF
|
34
|
+
NO_END_FLT = 0x10000000
|
35
|
+
HARD_MLEVEL = 0x20000000
|
36
|
+
SAM_HIT_ONLY = 0x40000000
|
37
|
+
RMQ = 0x80000000 # LL
|
38
|
+
QSTRAND = 0x100000000 # LL
|
39
|
+
NO_INV = 0x200000000
|
40
|
+
|
41
|
+
HPC = 0x1
|
42
|
+
NO_SEQ = 0x2
|
43
|
+
NO_NAME = 0x4
|
44
|
+
|
45
|
+
IDX_MAGIC = "MMI\2"
|
46
|
+
|
47
|
+
MAX_SEG = 255
|
48
|
+
|
49
|
+
CIGAR_MATCH = 0
|
50
|
+
CIGAR_INS = 1
|
51
|
+
CIGAR_DEL = 2
|
52
|
+
CIGAR_N_SKIP = 3
|
53
|
+
CIGAR_SOFTCLIP = 4
|
54
|
+
CIGAR_HARDCLIP = 5
|
55
|
+
CIGAR_PADDING = 6
|
56
|
+
CIGAR_EQ_MATCH = 7
|
57
|
+
CIGAR_X_MISMATCH = 8
|
58
|
+
|
59
|
+
CIGAR_STR = 'MIDNSHP=XB'
|
48
60
|
|
49
61
|
# emulate 128-bit integers
|
50
62
|
class MM128 < ::FFI::Struct
|
@@ -115,6 +127,8 @@ module Minimap2
|
|
115
127
|
:anchor_ext_len, :int,
|
116
128
|
:anchor_ext_shift, :int,
|
117
129
|
:max_clip_ratio, :float, # drop an alignment if BOTH ends are clipped above this ratio
|
130
|
+
:rank_min_len, :int,
|
131
|
+
:rank_frac, :float,
|
118
132
|
:pe_ori, :int,
|
119
133
|
:pe_bonus, :int,
|
120
134
|
:mid_occ_frac, :float, # only used by mm_mapopt_update(); see below
|
@@ -123,6 +137,7 @@ module Minimap2
|
|
123
137
|
:max_occ, :int32_t,
|
124
138
|
:mini_batch_size, :int64_t, # size of a batch of query bases to process in parallel
|
125
139
|
:max_sw_mat, :int64_t,
|
140
|
+
:cap_kalloc, :int64_t,
|
126
141
|
:split_prefix, :string
|
127
142
|
end
|
128
143
|
|
data/lib/minimap2/version.rb
CHANGED
data/vendor/libminimap2.so
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minimap2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.22.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kojix2
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: irb
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: minitest
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -132,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
146
|
- !ruby/object:Gem::Version
|
133
147
|
version: '0'
|
134
148
|
requirements: []
|
135
|
-
rubygems_version: 3.2.
|
149
|
+
rubygems_version: 3.2.22
|
136
150
|
signing_key:
|
137
151
|
specification_version: 4
|
138
152
|
summary: minimap2
|