minimap2 0.2.30.3 → 1.2.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +48 -63
  3. data/ext/minimap2/Makefile +1 -1
  4. data/ext/minimap2/format.c +12 -2
  5. data/ext/minimap2/hit.c +19 -8
  6. data/ext/minimap2/ksw2_ll_sse.c +2 -2
  7. data/ext/minimap2/minimap.h +2 -1
  8. data/ext/minimap2/pe.c +7 -2
  9. data/ext/ruby_minimap2/extconf.rb +47 -0
  10. data/ext/ruby_minimap2/native_main.c +15 -0
  11. data/ext/ruby_minimap2/ruby_minimap2.c +1134 -0
  12. data/lib/minimap2/aligner.rb +66 -374
  13. data/lib/minimap2/alignment.rb +22 -11
  14. data/lib/minimap2/version.rb +2 -1
  15. data/lib/minimap2.rb +39 -110
  16. metadata +8 -89
  17. data/ext/Rakefile +0 -60
  18. data/ext/cmappy/cmappy.c +0 -134
  19. data/ext/cmappy/cmappy.h +0 -46
  20. data/ext/minimap2/FAQ.md +0 -46
  21. data/ext/minimap2/MANIFEST.in +0 -10
  22. data/ext/minimap2/Makefile.simde +0 -97
  23. data/ext/minimap2/NEWS.md +0 -989
  24. data/ext/minimap2/README.md +0 -428
  25. data/ext/minimap2/code_of_conduct.md +0 -30
  26. data/ext/minimap2/cookbook.md +0 -243
  27. data/ext/minimap2/minimap2.1 +0 -844
  28. data/ext/minimap2/misc/README.md +0 -180
  29. data/ext/minimap2/misc/pafcluster.js +0 -241
  30. data/ext/minimap2/misc/paftools.js +0 -3734
  31. data/ext/minimap2/pyproject.toml +0 -2
  32. data/ext/minimap2/python/README.rst +0 -198
  33. data/ext/minimap2/python/cmappy.h +0 -152
  34. data/ext/minimap2/python/cmappy.pxd +0 -156
  35. data/ext/minimap2/python/mappy.pyx +0 -289
  36. data/ext/minimap2/python/minimap2.py +0 -41
  37. data/ext/minimap2/setup.py +0 -55
  38. data/ext/minimap2/test/MT-human.fa +0 -278
  39. data/ext/minimap2/test/MT-orang.fa +0 -276
  40. data/ext/minimap2/test/q-inv.fa +0 -4
  41. data/ext/minimap2/test/q2.fa +0 -2
  42. data/ext/minimap2/test/t-inv.fa +0 -127
  43. data/ext/minimap2/test/t2.fa +0 -2
  44. data/ext/minimap2/test/x3s-aln.txt +0 -5
  45. data/ext/minimap2/test/x3s-qry.fa +0 -5
  46. data/ext/minimap2/test/x3s-ref.fa +0 -10
  47. data/ext/minimap2/tex/Makefile +0 -21
  48. data/ext/minimap2/tex/bioinfo.cls +0 -930
  49. data/ext/minimap2/tex/blasr-mc.eval +0 -17
  50. data/ext/minimap2/tex/bowtie2-s3.sam.eval +0 -28
  51. data/ext/minimap2/tex/bwa-s3.sam.eval +0 -52
  52. data/ext/minimap2/tex/bwa.eval +0 -55
  53. data/ext/minimap2/tex/eval2roc.pl +0 -33
  54. data/ext/minimap2/tex/graphmap.eval +0 -4
  55. data/ext/minimap2/tex/hs38-simu.sh +0 -10
  56. data/ext/minimap2/tex/minialign.eval +0 -49
  57. data/ext/minimap2/tex/minimap2.bib +0 -460
  58. data/ext/minimap2/tex/minimap2.tex +0 -724
  59. data/ext/minimap2/tex/mm2-s3.sam.eval +0 -62
  60. data/ext/minimap2/tex/mm2-update.tex +0 -240
  61. data/ext/minimap2/tex/mm2.approx.eval +0 -12
  62. data/ext/minimap2/tex/mm2.eval +0 -13
  63. data/ext/minimap2/tex/natbib.bst +0 -1288
  64. data/ext/minimap2/tex/natbib.sty +0 -803
  65. data/ext/minimap2/tex/ngmlr.eval +0 -38
  66. data/ext/minimap2/tex/roc.gp +0 -60
  67. data/ext/minimap2/tex/snap-s3.sam.eval +0 -62
  68. data/ext/minimap2.patch +0 -19
  69. data/lib/minimap2/ffi/constants.rb +0 -267
  70. data/lib/minimap2/ffi/functions.rb +0 -239
  71. data/lib/minimap2/ffi/mappy.rb +0 -104
  72. data/lib/minimap2/ffi.rb +0 -27
@@ -1,38 +0,0 @@
1
- Q 60 23616 0 0.000000000
2
- Q 45 3520 1 0.000036851
3
- Q 41 1840 1 0.000069023
4
- Q 37 328 2 0.000136500
5
- Q 36 276 1 0.000169033
6
- Q 35 480 1 0.000199601
7
- Q 33 375 2 0.000262855
8
- Q 31 178 2 0.000326659
9
- Q 30 153 5 0.000487551
10
- Q 29 200 1 0.000516696
11
- Q 27 100 3 0.000611601
12
- Q 26 93 3 0.000706056
13
- Q 25 75 2 0.000768393
14
- Q 24 82 1 0.000798314
15
- Q 23 80 6 0.000987387
16
- Q 22 71 6 0.001175835
17
- Q 21 76 7 0.001394921
18
- Q 20 63 9 0.001676897
19
- Q 19 55 4 0.001800322
20
- Q 18 62 8 0.002048987
21
- Q 17 55 7 0.002265718
22
- Q 16 60 10 0.002575539
23
- Q 15 82 9 0.002850877
24
- Q 14 67 7 0.003063745
25
- Q 13 62 11 0.003401042
26
- Q 12 64 13 0.003799084
27
- Q 11 56 5 0.003947900
28
- Q 10 58 17 0.004468303
29
- Q 9 70 22 0.005139796
30
- Q 8 23 9 0.005414604
31
- Q 7 41 17 0.005933068
32
- Q 6 42 18 0.006480881
33
- Q 5 33 9 0.006751757
34
- Q 4 29 9 0.007022948
35
- Q 3 27 15 0.007478764
36
- Q 2 23 10 0.007781024
37
- Q 1 9 2 0.007840364
38
- Q 0 13 8 0.008083105
@@ -1,60 +0,0 @@
1
- set t po eps enh co so "Helvetica,26"
2
-
3
- set style line 1 lt 1 pt 1 lc rgb "#e41a1c" lw 2;
4
- set style line 2 lt 1 pt 2 lc rgb "#377eb8" lw 2;
5
- set style line 3 lt 1 pt 3 lc rgb "#4daf4a" lw 2;
6
- set style line 4 lt 1 pt 4 lc rgb "#984ea3" lw 2;
7
- set style line 5 lt 1 pt 6 lc rgb "#ff7f00" lw 2;
8
- set style line 6 lt 1 pt 8 lc rgb "#f781bf" lw 2;
9
-
10
- set out "roc-color.eps"
11
-
12
- set pointsize 2.0
13
- set size 1.59,1.04
14
- set multiplot layout 1,2
15
-
16
- set label "(a)" at graph -0.245,1.06 font "Helvetica-bold,40"
17
- set xlab "Error rate of mapped PacBio reads"
18
- set ylab "Fraction of mapped reads" off +1.8
19
- set ytics 0.02
20
- set yran [0.9:1]
21
-
22
- set size 0.8,1
23
- set log x
24
- set format x "10^{%L}"
25
- set key bot right
26
- plot "<./eval2roc.pl blasr-mc.eval" u 2:3 t "blasr-mc" w lp ls 4, \
27
- "<./eval2roc.pl bwa.eval" u 2:3 t "bwa-mem" w lp ls 2, \
28
- "<./eval2roc.pl graphmap.eval" u 2:3 t "graphmap" w lp ls 3, \
29
- "<./eval2roc.pl minialign.eval" u 2:3 t "minialign" w lp ls 1, \
30
- "<./eval2roc.pl mm2.eval" u 2:3 t "minimap2" w lp ls 6, \
31
- "<./eval2roc.pl ngmlr.eval" u 2:3 t "ngm-lr" w lp ls 5
32
- unset label
33
-
34
- set origin 0.8,0
35
- set size 0.79,1
36
- set label "(b)" at graph -0.245,1.06 font "Helvetica-bold,40"
37
- set xlab "Error rate of mapped short reads"
38
-
39
- set key top left
40
- plot "<./eval2roc.pl -n2e7 bowtie2-s3.sam.eval" u 2:3 t "bowtie2" w lp ls 5, \
41
- "<./eval2roc.pl -n2e7 bwa-s3.sam.eval" u 2:3 t "bwa-mem" w lp ls 2, \
42
- "<./eval2roc.pl -n2e7 mm2-s3.sam.eval" u 2:3 t "minimap2" w lp ls 6, \
43
- "<./eval2roc.pl -n2e7 snap-s3.sam.eval" u 2:3 t "snap" w lp ls 3
44
-
45
- #unset log
46
- #unset format
47
- #unset key
48
- #set log y
49
- #set ylab "Accumulative mapping error rate" off +0
50
- #set xlab "Mapping quality"
51
- #set yran [1e-5:0.1]
52
- #set ytics 1e-5,0.1
53
- #set format y "10^{%L}"
54
- #set xran [60:0] reverse
55
- #plot "<./eval2roc.pl blasr-mc.eval" u 1:2 w lp ls 4, \
56
- # "<./eval2roc.pl bwa.eval" u 1:2 t "bwa-mem" w lp ls 2, \
57
- # "<./eval2roc.pl graphmap.eval" u 1:2 t "graphmap" w lp ls 3, \
58
- # "<./eval2roc.pl minialign.eval" u 1:2 t "minialign" w lp ls 1, \
59
- # "<./eval2roc.pl mm2.eval" u 1:2 t "minimap2" w lp ls 6, \
60
- # "<./eval2roc.pl ngmlr.eval" u 1:2 t "ngm-lr" w lp ls 5
@@ -1,62 +0,0 @@
1
- Q 60 18993268 10320 0.000543350 18993268
2
- Q 59 33156 216 0.000553756 19026424
3
- Q 58 29982 295 0.000568365 19056406
4
- Q 57 9412 278 0.000582666 19065818
5
- Q 56 11012 228 0.000594281 19076830
6
- Q 55 9968 235 0.000606283 19086798
7
- Q 54 8602 292 0.000621301 19095400
8
- Q 53 6094 259 0.000634662 19101494
9
- Q 52 5026 257 0.000647946 19106520
10
- Q 51 4278 224 0.000659522 19110798
11
- Q 50 3682 178 0.000668708 19114480
12
- Q 49 2750 156 0.000676772 19117230
13
- Q 48 2314 112 0.000682548 19119544
14
- Q 47 2056 96 0.000687495 19121600
15
- Q 46 1658 62 0.000690677 19123258
16
- Q 45 1492 74 0.000694493 19124750
17
- Q 44 1150 56 0.000697379 19125900
18
- Q 43 1062 48 0.000699850 19126962
19
- Q 42 976 60 0.000702951 19127938
20
- Q 41 884 36 0.000704800 19128822
21
- Q 40 708 52 0.000707493 19129530
22
- Q 39 870 26 0.000708819 19130400
23
- Q 38 598 26 0.000710156 19130998
24
- Q 37 542 34 0.000711913 19131540
25
- Q 36 846 50 0.000714495 19132386
26
- Q 35 590 50 0.000717087 19132976
27
- Q 34 550 42 0.000719261 19133526
28
- Q 33 2174 66 0.000722628 19135700
29
- Q 32 876 86 0.000727089 19136576
30
- Q 31 638 104 0.000732500 19137214
31
- Q 30 1718 196 0.000742675 19138932
32
- Q 29 91022 968 0.000789497 19229954
33
- Q 28 12864 781 0.000829556 19242818
34
- Q 27 5806 427 0.000851489 19248624
35
- Q 26 25274 728 0.000888144 19273898
36
- Q 25 7418 680 0.000923070 19281316
37
- Q 24 11800 701 0.000958839 19293116
38
- Q 23 57328 3933 0.001159250 19350444
39
- Q 22 7662 846 0.001202494 19358106
40
- Q 21 5924 617 0.001233989 19364030
41
- Q 20 4623 574 0.001263330 19368653
42
- Q 19 4988 942 0.001311627 19373641
43
- Q 18 3968 793 0.001352282 19377609
44
- Q 17 3630 681 0.001387166 19381239
45
- Q 16 2921 513 0.001413422 19384160
46
- Q 15 2716 424 0.001435095 19386876
47
- Q 14 2366 365 0.001453744 19389242
48
- Q 13 2169 412 0.001474828 19391411
49
- Q 12 2077 360 0.001493233 19393488
50
- Q 11 2016 441 0.001515815 19395504
51
- Q 10 2292 738 0.001553682 19397796
52
- Q 9 4165 1832 0.001647772 19401961
53
- Q 8 3963 1862 0.001743385 19405924
54
- Q 7 3927 1793 0.001835408 19409851
55
- Q 6 3572 1639 0.001919497 19413423
56
- Q 5 3270 1533 0.001998126 19416693
57
- Q 4 3046 1610 0.002080718 19419739
58
- Q 3 251447 125550 0.008436553 19671186
59
- Q 2 24390 13537 0.009113417 19695576
60
- Q 1 124406 86780 0.013434624 19819982
61
- Q 0 171254 153874 0.021016609 19991236
62
- U 8764
data/ext/minimap2.patch DELETED
@@ -1,19 +0,0 @@
1
- --- a/Makefile
2
- +++ b/Makefile
3
- @@ -1,9 +1,9 @@
4
- -CFLAGS= -g -Wall -O2 -Wc++-compat #-Wextra
5
- +CFLAGS= -g -Wall -O2 -Wc++-compat -fPIC #-Wextra
6
- CPPFLAGS= -DHAVE_KALLOC
7
- INCLUDES=
8
- OBJS= kthread.o kalloc.o misc.o bseq.o sketch.o sdust.o options.o index.o \
9
- lchain.o align.o hit.o seed.o jump.o map.o format.o pe.o esterr.o splitidx.o \
10
- - ksw2_ll_sse.o
11
- + ksw2_ll_sse.o cmappy.o
12
- PROG= minimap2
13
- PROG_EXTRA= sdust minimap2-lite
14
- LIBS= -lm -lz -lpthread
15
- @@ -135,3 +135,4 @@ sdust.o: kalloc.h kdq.h kvec.h sdust.h
16
- seed.o: mmpriv.h minimap.h bseq.h kseq.h kalloc.h ksort.h
17
- sketch.o: kvec.h kalloc.h mmpriv.h minimap.h bseq.h kseq.h
18
- splitidx.o: mmpriv.h minimap.h bseq.h kseq.h
19
- +cmappy.o: cmappy.h
@@ -1,267 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Minimap2
4
- module FFI
5
- # flags
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
38
- QSTRAND = 0x100000000
39
- NO_INV = 0x200000000
40
- NO_HASH_NAME = 0x400000000
41
- SPLICE_OLD = 0x800000000
42
- SECONDARY_SEQ = 0x1000000000 # output SEQ field for secondary alignments using hard clipping
43
- OUT_DS = 0x2000000000
44
- WEAK_PAIRING = 0x4000000000
45
- SR_RNA = 0x8000000000
46
- OUT_JUNC = 0x10000000000
47
-
48
- HPC = 0x1
49
- NO_SEQ = 0x2
50
- NO_NAME = 0x4
51
-
52
- IDX_MAGIC = "MMI\2"
53
-
54
- MAX_SEG = 255
55
-
56
- CIGAR_MATCH = 0
57
- CIGAR_INS = 1
58
- CIGAR_DEL = 2
59
- CIGAR_N_SKIP = 3
60
- CIGAR_SOFTCLIP = 4
61
- CIGAR_HARDCLIP = 5
62
- CIGAR_PADDING = 6
63
- CIGAR_EQ_MATCH = 7
64
- CIGAR_X_MISMATCH = 8
65
-
66
- CIGAR_STR = "MIDNSHP=XB"
67
-
68
- # emulate 128-bit integers
69
- class MM128 < ::FFI::Struct
70
- layout \
71
- :x, :uint64_t,
72
- :y, :uint64_t
73
- end
74
-
75
- # emulate 128-bit arrays
76
- class MM128V < ::FFI::Struct
77
- layout \
78
- :n, :size_t,
79
- :m, :size_t,
80
- :a, MM128.ptr
81
- end
82
-
83
- # minimap2 index
84
- class IdxSeq < ::FFI::Struct
85
- layout \
86
- :name, :string, # name of the db sequence
87
- :offset, :uint64_t, # offset in mm_idx_t::S
88
- :len, :uint32, # length
89
- :is_alt, :uint32
90
- end
91
-
92
- class Idx < ::FFI::Struct
93
- layout \
94
- :b, :int32,
95
- :w, :int32,
96
- :k, :int32,
97
- :flag, :int32,
98
- :n_seq, :uint32, # number of reference sequences
99
- :index, :int32,
100
- :n_alt, :int32,
101
- :seq, IdxSeq.ptr, # sequence name, length and offset
102
- :S, :pointer, # 4-bit packed sequence
103
- :B, :pointer, # index (hidden)
104
- :I, :pointer, # intervals (hidden)
105
- :spsc, :pointer, # splice score (hidden)
106
- :J, :pointer, # junctions to create jumps (hidden)
107
- :km, :pointer,
108
- :h, :pointer
109
- end
110
-
111
- # minimap2 alignment
112
- class Extra < ::FFI::BitStruct
113
- layout \
114
- :capacity, :uint32, # the capacity of cigar[]
115
- :dp_score, :int32, # DP score
116
- :dp_max, :int32, # score of the max-scoring segment
117
- :dp_max2, :int32, # score of the best alternate mappings
118
- :dp_max0, :int32, # DP score before mm_update_dp_max() adjustment
119
- :n_ambi_trans_strand, :uint32,
120
- :n_cigar, :uint32
121
- # :cigar, :pointer # variable length array (see cigar method below)
122
-
123
- bit_field :n_ambi_trans_strand,
124
- :n_ambi, 30, # number of ambiguous bases
125
- :trans_strand, 2 # transcript strand: 0 for unknown, 1 for +, 2 for -
126
-
127
- # variable length array
128
- def cigar
129
- pointer.get_array_of_uint32(size, self[:n_cigar])
130
- end
131
- end
132
-
133
- class Reg1 < ::FFI::BitStruct
134
- layout \
135
- :id, :int32, # ID for internal uses (see also parent below)
136
- :cnt, :int32, # number of minimizers; if on the reverse strand
137
- :rid, :int32, # reference index; if this is an alignment from inversion rescue
138
- :score, :int32, # DP alignment score
139
- :qs, :int32, # query start
140
- :qe, :int32, # query end
141
- :rs, :int32, # reference start
142
- :re, :int32, # reference end
143
- :parent, :int32, # parent==id if primary
144
- :subsc, :int32, # best alternate mapping score
145
- :as, :int32, # offset in the a[] array (for internal uses only)
146
- :mlen, :int32, # seeded exact match length
147
- :blen, :int32, # seeded alignment block length
148
- :n_sub, :int32, # number of suboptimal mappings
149
- :score0, :int32, # initial chaining score (before chain merging/spliting)
150
- :fields, :uint32,
151
- :hash, :uint32,
152
- :div, :float,
153
- :p, Extra.ptr
154
-
155
- bit_field :fields,
156
- :mapq, 8,
157
- :split, 2,
158
- :rev, 1,
159
- :inv, 1,
160
- :sam_pri, 1,
161
- :proper_frag, 1,
162
- :pe_thru, 1,
163
- :seg_split, 1,
164
- :seg_id, 8,
165
- :split_inv, 1,
166
- :is_alt, 1,
167
- :strand_retained, 1,
168
- :is_spliced, 1,
169
- :dummy, 4
170
- end
171
-
172
- # indexing option
173
- class IdxOpt < ::FFI::Struct
174
- layout \
175
- :k, :short,
176
- :w, :short,
177
- :flag, :short,
178
- :bucket_bits, :short,
179
- :mini_batch_size, :int64_t,
180
- :batch_size, :uint64_t
181
- end
182
-
183
- # mapping option
184
- class MapOpt < ::FFI::Struct
185
- layout \
186
- :flag, :int64_t, # see MM_F_* macros
187
- :seed, :int,
188
- :sdust_thres, :int, # score threshold for SDUST; 0 to disable
189
- :max_qlen, :int, # max query length
190
- :bw, :int, # bandwidth
191
- :bw_long, :int,
192
- :max_gap, :int, # break a chain if there are no minimizers in a max_gap window
193
- :max_gap_ref, :int,
194
- :max_frag_len, :int,
195
- :max_chain_skip, :int,
196
- :max_chain_iter, :int,
197
- :min_cnt, :int, # min number of minimizers on each chain
198
- :min_chain_score, :int, # min chaining score
199
- :chain_gap_scale, :float,
200
- :chain_skip_scale, :float,
201
- :rmq_size_cap, :int,
202
- :rmq_inner_dist, :int,
203
- :rmq_rescue_size, :int,
204
- :rmq_rescue_ratio, :float,
205
- :mask_level, :float,
206
- :mask_len, :int,
207
- :pri_ratio, :float,
208
- :best_n, :int, # top best_n chains are subjected to DP alignment
209
- :alt_drop, :float,
210
- :a, :int, # matching score
211
- :b, :int, # mismatch
212
- :q, :int, # gap-open
213
- :e, :int, # gap-ext
214
- :q2, :int, # gap-open
215
- :e2, :int, # gap-ext
216
- :transition, :int, # transition mismatch score (A:G, C:T)
217
- :sc_ambi, :int, # score when one or both bases are "N"
218
- :noncan, :int, # cost of non-canonical splicing sites
219
- :junc_bonus, :int, # bonus for a splice site in annotation
220
- :junc_pen, :int, # penalty for GT- or -AG not scored in --spsc
221
- :zdrop, :int, # break alignment if alignment score drops too fast along the diagonal
222
- :zdrop_inv, :int,
223
- :end_bonus, :int,
224
- :min_dp_max, :int, # drop an alignment if the score of the max scoring segment is below this threshold
225
- :min_ksw_len, :int,
226
- :anchor_ext_len, :int,
227
- :anchor_ext_shift, :int,
228
- :max_clip_ratio, :float, # drop an alignment if BOTH ends are clipped above this ratio
229
- :rank_min_len, :int,
230
- :rank_frac, :float,
231
- :pe_ori, :int,
232
- :pe_bonus, :int,
233
- :jump_min_match, :int32,
234
- :mid_occ_frac, :float, # only used by mm_mapopt_update(); see below
235
- :q_occ_frac, :float,
236
- :min_mid_occ, :int32,
237
- :max_mid_occ, :int32,
238
- :mid_occ, :int32, # ignore seeds with occurrences above this threshold
239
- :max_occ, :int32,
240
- :max_max_occ, :int32,
241
- :occ_dist, :int32,
242
- :mini_batch_size, :int64_t, # size of a batch of query bases to process in parallel
243
- :max_sw_mat, :int64_t,
244
- :cap_kalloc, :int64_t,
245
- :split_prefix, :string
246
- end
247
-
248
- # index reader
249
- class IdxReader < ::FFI::Struct
250
- layout \
251
- :is_idx, :int,
252
- :n_parts, :int,
253
- :idx_size, :int64_t,
254
- :opt, IdxOpt,
255
- :fp_out, :pointer, # FILE
256
- :seq_or_idx, :pointer # FIXME: Union mm_bseq_files or FILE
257
- end
258
-
259
- # memory buffer for thread-local storage during mapping
260
- class TBuf < ::FFI::Struct
261
- layout \
262
- :km, :pointer,
263
- :rep_len, :int,
264
- :frag_gap, :int
265
- end
266
- end
267
- end
@@ -1,239 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Minimap2
4
- module FFI
5
- attach_function \
6
- :main,
7
- %i[int pointer],
8
- :int
9
-
10
- # int mm_set_opt(const char *preset, mm_idxopt_t *io, mm_mapopt_t *mo);
11
- attach_function \
12
- :mm_set_opt_raw, :mm_set_opt,
13
- [:pointer, IdxOpt.by_ref, MapOpt.by_ref],
14
- :int
15
-
16
- private_class_method :mm_set_opt_raw
17
-
18
- def self.mm_set_opt(preset, io, mo)
19
- ptr = case preset
20
- when 0, nil
21
- ::FFI::Pointer.new(:int, 0)
22
- else
23
- ::FFI::MemoryPointer.from_string(preset.to_s)
24
- end
25
- mm_set_opt_raw(ptr, io, mo)
26
- end
27
-
28
- # int mm_check_opt(const mm_idxopt_t *io, const mm_mapopt_t *mo);
29
- attach_function \
30
- :mm_check_opt,
31
- [IdxOpt.by_ref, MapOpt.by_ref],
32
- :int
33
-
34
- # void mm_mapopt_update(mm_mapopt_t *opt, const mm_idx_t *mi);
35
- attach_function \
36
- :mm_mapopt_update,
37
- [MapOpt.by_ref, Idx.by_ref],
38
- :void
39
-
40
- # void mm_mapopt_max_intron_len(mm_mapopt_t *opt, int max_intron_len);
41
- attach_function \
42
- :mm_mapopt_max_intron_len,
43
- [MapOpt.by_ref, :int],
44
- :void
45
-
46
- # mm_idx_reader_t *mm_idx_reader_open(const char *fn, const mm_idxopt_t *opt, const char *fn_out);
47
- attach_function \
48
- :mm_idx_reader_open,
49
- [:string, IdxOpt.by_ref, :string],
50
- IdxReader.by_ref
51
-
52
- # mm_idx_t *mm_idx_reader_read(mm_idx_reader_t *r, int n_threads);
53
- attach_function \
54
- :mm_idx_reader_read,
55
- [IdxReader.by_ref, :int],
56
- Idx.by_ref
57
-
58
- # void mm_idx_reader_close(mm_idx_reader_t *r);
59
- attach_function \
60
- :mm_idx_reader_close,
61
- [IdxReader.by_ref],
62
- :void
63
-
64
- # int mm_idx_reader_eof(const mm_idx_reader_t *r);
65
- attach_function \
66
- :mm_idx_reader_eof,
67
- [IdxReader.by_ref],
68
- :int
69
-
70
- # int64_t mm_idx_is_idx(const char *fn);
71
- attach_function \
72
- :mm_idx_is_idx,
73
- [:string],
74
- :int64_t
75
-
76
- # mm_idx_t *mm_idx_load(FILE *fp);
77
- attach_function \
78
- :mm_idx_load,
79
- [:pointer], # FILE pointer
80
- Idx.by_ref
81
-
82
- # void mm_idx_dump(FILE *fp, const mm_idx_t *mi);
83
- attach_function \
84
- :mm_idx_dump,
85
- [:pointer, Idx.by_ref], # FILE pointer
86
- :void
87
-
88
- # mm_idx_t *mm_idx_str(int w, int k, int is_hpc, int bucket_bits, int n, const char **seq, const char **name);
89
- attach_function \
90
- :mm_idx_str,
91
- %i[int int int int int pointer pointer],
92
- Idx.by_ref
93
-
94
- # void mm_idx_stat(const mm_idx_t *idx);
95
- attach_function \
96
- :mm_idx_stat,
97
- [Idx.by_ref],
98
- :void
99
-
100
- # void mm_idx_destroy(mm_idx_t *mi);
101
- attach_function \
102
- :mm_idx_destroy,
103
- [Idx.by_ref],
104
- :void
105
-
106
- # mm_tbuf_t *mm_tbuf_init(void);
107
- attach_function \
108
- :mm_tbuf_init,
109
- [],
110
- TBuf.by_ref
111
-
112
- # void mm_tbuf_destroy(mm_tbuf_t *b);
113
- attach_function \
114
- :mm_tbuf_destroy,
115
- [TBuf.by_ref],
116
- :void
117
-
118
- # void *mm_tbuf_get_km(mm_tbuf_t *b);
119
- attach_function \
120
- :mm_tbuf_get_km,
121
- [TBuf.by_ref],
122
- :pointer
123
-
124
- # mm_reg1_t *mm_map(const mm_idx_t *mi, int l_seq, const char *seq, int *n_regs, mm_tbuf_t *b, const mm_mapopt_t *opt, const char *name);
125
- attach_function \
126
- :mm_map,
127
- [Idx.by_ref, :int, :string, :pointer, TBuf.by_ref, MapOpt.by_ref, :string],
128
- Reg1.by_ref
129
-
130
- # void mm_map_frag(const mm_idx_t *mi, int n_segs, const int *qlens, const char **seqs, int *n_regs, mm_reg1_t **regs, mm_tbuf_t *b, const mm_mapopt_t *opt, const char *qname);
131
- attach_function \
132
- :mm_map_frag,
133
- [Idx.by_ref, :int, :pointer, :pointer, :pointer, :pointer, TBuf.by_ref, MapOpt.by_ref, :string],
134
- :void
135
-
136
- # int mm_map_file(const mm_idx_t *idx, const char *fn, const mm_mapopt_t *opt, int n_threads);
137
- attach_function \
138
- :mm_map_file,
139
- [Idx.by_ref, :string, MapOpt.by_ref, :int],
140
- :int
141
-
142
- # int mm_map_file_frag(const mm_idx_t *idx, int n_segs, const char **fn, const mm_mapopt_t *opt, int n_threads);
143
- attach_function \
144
- :mm_map_file_frag,
145
- [Idx.by_ref, :int, :pointer, MapOpt.by_ref, :int],
146
- :int
147
-
148
- # int mm_gen_cs(void *km, char **buf, int *max_len, const mm_idx_t *mi, const mm_reg1_t *r, const char *seq, int no_iden);
149
- attach_function \
150
- :mm_gen_cs,
151
- [:pointer, :pointer, :pointer, Idx.by_ref, Reg1.by_ref, :string, :int],
152
- :int
153
-
154
- # int mm_gen_MD(void *km, char **buf, int *max_len, const mm_idx_t *mi, const mm_reg1_t *r, const char *seq);
155
- attach_function \
156
- :mm_gen_md, :mm_gen_MD, # Avoid uppercase letters in method names.
157
- [:pointer, :pointer, :pointer, Idx.by_ref, Reg1.by_ref, :string],
158
- :int
159
-
160
- # int mm_idx_index_name(mm_idx_t *mi);
161
- attach_function \
162
- :mm_idx_index_name,
163
- [Idx.by_ref],
164
- :int
165
-
166
- # int mm_idx_name2id(const mm_idx_t *mi, const char *name);
167
- attach_function \
168
- :mm_idx_name2id,
169
- [Idx.by_ref, :string],
170
- :int
171
-
172
- # int mm_idx_getseq(const mm_idx_t *mi, uint32_t rid, uint32_t st, uint32_t en, uint8_t *seq);
173
- attach_function \
174
- :mm_idx_getseq,
175
- [Idx.by_ref, :uint32, :uint32, :uint32, :pointer],
176
- :int
177
-
178
- # int mm_idx_alt_read(mm_idx_t *mi, const char *fn);
179
- attach_function \
180
- :mm_idx_alt_read,
181
- [Idx.by_ref, :string],
182
- :int
183
-
184
- # int mm_idx_bed_read(mm_idx_t *mi, const char *fn, int read_junc);
185
- attach_function \
186
- :mm_idx_bed_read,
187
- [Idx.by_ref, :string, :int],
188
- :int
189
-
190
- # int mm_idx_bed_junc(const mm_idx_t *mi, int32_t ctg, int32_t st, int32_t en, uint8_t *s);
191
- attach_function \
192
- :mm_idx_bed_junc,
193
- [Idx.by_ref, :int32, :int32, :int32, :pointer],
194
- :int
195
-
196
- # int mm_max_spsc_bonus(const mm_mapopt_t *mo);
197
- attach_function \
198
- :mm_max_spsc_bonus,
199
- [MapOpt.by_ref],
200
- :int
201
-
202
- # int32_t mm_idx_spsc_read(mm_idx_t *idx, const char *fn, int32_t max_sc);
203
- attach_function \
204
- :mm_idx_spsc_read,
205
- [Idx.by_ref, :string, :int32],
206
- :int32
207
-
208
- # int32_t mm_idx_spsc_read2(mm_idx_t *idx, const char *fn, int32_t max_sc, float scale);
209
- attach_function \
210
- :mm_idx_spsc_read2,
211
- [Idx.by_ref, :string, :int32, :float],
212
- :int32
213
-
214
- # 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);
215
- attach_function \
216
- :mm_idx_spsc_get,
217
- [Idx.by_ref, :int32, :int64, :int64, :int32, :pointer],
218
- :int64
219
-
220
- # void mm_mapopt_init(mm_mapopt_t *opt);
221
- attach_function \
222
- :mm_mapopt_init,
223
- [MapOpt.by_ref],
224
- :void
225
-
226
- # mm_idx_t *mm_idx_build(const char *fn, int w, int k, int flag, int n_threads);
227
- attach_function \
228
- :mm_idx_build,
229
- %i[string int int int int],
230
- Idx.by_ref
231
-
232
- # mmpriv.h
233
-
234
- attach_function \
235
- :mm_idxopt_init,
236
- [IdxOpt.by_ref],
237
- :void
238
- end
239
- end