minimap2 0.2.31.0 → 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 (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +47 -64
  3. data/ext/ruby_minimap2/extconf.rb +47 -0
  4. data/ext/ruby_minimap2/native_main.c +15 -0
  5. data/ext/ruby_minimap2/ruby_minimap2.c +1134 -0
  6. data/lib/minimap2/aligner.rb +66 -383
  7. data/lib/minimap2/alignment.rb +15 -8
  8. data/lib/minimap2/version.rb +2 -1
  9. data/lib/minimap2.rb +39 -110
  10. metadata +8 -89
  11. data/ext/Rakefile +0 -63
  12. data/ext/cmappy/cmappy.c +0 -134
  13. data/ext/cmappy/cmappy.h +0 -46
  14. data/ext/minimap2/FAQ.md +0 -46
  15. data/ext/minimap2/MANIFEST.in +0 -10
  16. data/ext/minimap2/Makefile.simde +0 -97
  17. data/ext/minimap2/NEWS.md +0 -1022
  18. data/ext/minimap2/README.md +0 -429
  19. data/ext/minimap2/code_of_conduct.md +0 -30
  20. data/ext/minimap2/cookbook.md +0 -243
  21. data/ext/minimap2/minimap2.1 +0 -844
  22. data/ext/minimap2/misc/README.md +0 -180
  23. data/ext/minimap2/misc/pafcluster.js +0 -241
  24. data/ext/minimap2/misc/paftools.js +0 -3830
  25. data/ext/minimap2/pyproject.toml +0 -2
  26. data/ext/minimap2/python/README.rst +0 -198
  27. data/ext/minimap2/python/cmappy.h +0 -152
  28. data/ext/minimap2/python/cmappy.pxd +0 -157
  29. data/ext/minimap2/python/mappy.pyx +0 -297
  30. data/ext/minimap2/python/minimap2.py +0 -43
  31. data/ext/minimap2/setup.py +0 -55
  32. data/ext/minimap2/test/MT-human.fa +0 -278
  33. data/ext/minimap2/test/MT-orang.fa +0 -276
  34. data/ext/minimap2/test/q-inv.fa +0 -4
  35. data/ext/minimap2/test/q2.fa +0 -2
  36. data/ext/minimap2/test/t-inv.fa +0 -127
  37. data/ext/minimap2/test/t2.fa +0 -2
  38. data/ext/minimap2/test/x3s-aln.txt +0 -5
  39. data/ext/minimap2/test/x3s-qry.fa +0 -5
  40. data/ext/minimap2/test/x3s-ref.fa +0 -10
  41. data/ext/minimap2/tex/Makefile +0 -21
  42. data/ext/minimap2/tex/bioinfo.cls +0 -930
  43. data/ext/minimap2/tex/blasr-mc.eval +0 -17
  44. data/ext/minimap2/tex/bowtie2-s3.sam.eval +0 -28
  45. data/ext/minimap2/tex/bwa-s3.sam.eval +0 -52
  46. data/ext/minimap2/tex/bwa.eval +0 -55
  47. data/ext/minimap2/tex/eval2roc.pl +0 -33
  48. data/ext/minimap2/tex/graphmap.eval +0 -4
  49. data/ext/minimap2/tex/hs38-simu.sh +0 -10
  50. data/ext/minimap2/tex/minialign.eval +0 -49
  51. data/ext/minimap2/tex/minimap2.bib +0 -460
  52. data/ext/minimap2/tex/minimap2.tex +0 -724
  53. data/ext/minimap2/tex/mm2-s3.sam.eval +0 -62
  54. data/ext/minimap2/tex/mm2-update.tex +0 -240
  55. data/ext/minimap2/tex/mm2.approx.eval +0 -12
  56. data/ext/minimap2/tex/mm2.eval +0 -13
  57. data/ext/minimap2/tex/natbib.bst +0 -1288
  58. data/ext/minimap2/tex/natbib.sty +0 -803
  59. data/ext/minimap2/tex/ngmlr.eval +0 -38
  60. data/ext/minimap2/tex/roc.gp +0 -60
  61. data/ext/minimap2/tex/snap-s3.sam.eval +0 -62
  62. data/ext/minimap2.patch +0 -19
  63. data/lib/minimap2/ffi/constants.rb +0 -267
  64. data/lib/minimap2/ffi/functions.rb +0 -245
  65. data/lib/minimap2/ffi/mappy.rb +0 -104
  66. data/lib/minimap2/ffi.rb +0 -27
@@ -1,429 +0,0 @@
1
- [![GitHub Downloads](https://img.shields.io/github/downloads/lh3/minimap2/total.svg?style=social&logo=github&label=Download)](https://github.com/lh3/minimap2/releases)
2
- [![BioConda Install](https://img.shields.io/conda/dn/bioconda/minimap2.svg?style=flag&label=BioConda%20install)](https://anaconda.org/bioconda/minimap2)
3
- [![PyPI](https://img.shields.io/pypi/v/mappy.svg?style=flat)](https://pypi.python.org/pypi/mappy)
4
- [![Build Status](https://github.com/lh3/minimap2/actions/workflows/ci.yaml/badge.svg)](https://github.com/lh3/minimap2/actions)
5
- ## <a name="started"></a>Getting Started
6
- **ALERT:** `minimap2.com` is a [phishing site](https://github.com/lh3/minimap2/issues/1316). Please don't use anything from that website.
7
- ```sh
8
- git clone https://github.com/lh3/minimap2
9
- cd minimap2 && make
10
- # long sequences against a reference genome
11
- ./minimap2 -a test/MT-human.fa test/MT-orang.fa > test.sam
12
- # create an index first and then map
13
- ./minimap2 -x map-ont -d MT-human-ont.mmi test/MT-human.fa
14
- ./minimap2 -a MT-human-ont.mmi test/MT-orang.fa > test.sam
15
- # use presets (no test data)
16
- ./minimap2 -ax map-pb ref.fa pacbio.fq.gz > aln.sam # PacBio CLR genomic reads
17
- ./minimap2 -ax map-ont ref.fa ont.fq.gz > aln.sam # Oxford Nanopore genomic reads
18
- ./minimap2 -ax map-hifi ref.fa pacbio-ccs.fq.gz > aln.sam # PacBio HiFi/CCS genomic reads (v2.19+)
19
- ./minimap2 -ax lr:hq ref.fa ont-Q20.fq.gz > aln.sam # Nanopore Q20 genomic reads (v2.27+)
20
- ./minimap2 -ax sr ref.fa read1.fa read2.fa > aln.sam # short genomic paired-end reads
21
- ./minimap2 -ax splice ref.fa rna-reads.fa > aln.sam # spliced long reads (strand unknown)
22
- ./minimap2 -ax splice -uf -k14 ref.fa reads.fa > aln.sam # noisy Nanopore direct RNA-seq
23
- ./minimap2 -ax splice:hq -uf ref.fa query.fa > aln.sam # PacBio Kinnex/Iso-seq (RNA-seq)
24
- ./minimap2 -ax splice --junc-bed=anno.bed12 ref.fa query.fa > aln.sam # use annotated junctions
25
- ./minimap2 -ax splice:sr ref.fa r1.fq r2.fq > aln.sam # short-read RNA-seq (v2.29+)
26
- ./minimap2 -ax splice:sr -j anno.bed12 ref.fa r1.fq r2.fq > aln.sam
27
- ./minimap2 -cx asm5 asm1.fa asm2.fa > aln.paf # intra-species asm-to-asm alignment
28
- ./minimap2 -x ava-pb reads.fa reads.fa > overlaps.paf # PacBio read overlap
29
- ./minimap2 -x ava-ont reads.fa reads.fa > overlaps.paf # Nanopore read overlap
30
- # man page for detailed command line options
31
- man ./minimap2.1
32
- ```
33
-
34
- ## Table of Contents
35
-
36
- - [Getting Started](#started)
37
- - [Users' Guide](#uguide)
38
- - [Installation](#install)
39
- - [General usage](#general)
40
- - [Use cases](#cases)
41
- - [Map long noisy genomic reads](#map-long-genomic)
42
- - [Map long mRNA/cDNA reads](#map-long-splice)
43
- - [Find overlaps between long reads](#long-overlap)
44
- - [Map short genomic reads](#short-genomic)
45
- - [Map short RNA-seq reads](#short-rna-seq)
46
- - [Full genome/assembly alignment](#full-genome)
47
- - [Advanced features](#advanced)
48
- - [Working with >65535 CIGAR operations](#long-cigar)
49
- - [The cs optional tag](#cs)
50
- - [Working with the PAF format](#paftools)
51
- - [Algorithm overview](#algo)
52
- - [Getting help](#help)
53
- - [Citing minimap2](#cite)
54
- - [Developers' Guide](#dguide)
55
- - [Limitations](#limit)
56
-
57
- ## <a name="uguide"></a>Users' Guide
58
-
59
- Minimap2 is a versatile sequence alignment program that aligns DNA or mRNA
60
- sequences against a large reference database. Typical use cases include: (1)
61
- mapping PacBio or Oxford Nanopore genomic reads to the human genome; (2)
62
- finding overlaps between long reads with error rate up to ~15%; (3)
63
- splice-aware alignment of PacBio Iso-Seq or Nanopore cDNA or Direct RNA reads
64
- against a reference genome; (4) aligning Illumina single- or paired-end reads;
65
- (5) assembly-to-assembly alignment; (6) full-genome alignment between two
66
- closely related species with divergence below ~15%.
67
-
68
- For ~10kb noisy reads sequences, minimap2 is tens of times faster than
69
- mainstream long-read mappers such as BLASR, BWA-MEM, NGMLR and GMAP. It is more
70
- accurate on simulated long reads and produces biologically meaningful alignment
71
- ready for downstream analyses. For >100bp Illumina short reads, minimap2 is
72
- three times as fast as BWA-MEM and Bowtie2, and as accurate on simulated data.
73
- Detailed evaluations are available from the [minimap2 paper][doi] or the
74
- [preprint][preprint].
75
-
76
- ### <a name="install"></a>Installation
77
-
78
- Minimap2 is optimized for x86-64 CPUs. You can acquire precompiled binaries from
79
- the [release page][release] with:
80
- ```sh
81
- curl -L https://github.com/lh3/minimap2/releases/download/v2.31/minimap2-2.31_x64-linux.tar.bz2 | tar -jxvf -
82
- ./minimap2-2.31_x64-linux/minimap2
83
- ```
84
- If you want to compile from the source, you need to have a C compiler, GNU make
85
- and zlib development files installed. Then type `make` in the source code
86
- directory to compile. If you see compilation errors, try `make sse2only=1`
87
- to disable SSE4 code, which will make minimap2 slightly slower.
88
-
89
- Minimap2 also works with ARM CPUs supporting the NEON instruction sets. To
90
- compile for 32 bit ARM architectures (such as ARMv7), use `make arm_neon=1`. To
91
- compile for for 64 bit ARM architectures (such as ARMv8), use `make arm_neon=1
92
- aarch64=1`.
93
-
94
- Minimap2 can use [SIMD Everywhere (SIMDe)][simde] library for porting
95
- implementation to the different SIMD instruction sets. To compile using SIMDe,
96
- use `make -f Makefile.simde`. To compile for ARM CPUs, use `Makefile.simde`
97
- with the ARM related command lines given above.
98
-
99
- ### <a name="general"></a>General usage
100
-
101
- Without any options, minimap2 takes a reference database and a query sequence
102
- file as input and produce approximate mapping, without base-level alignment
103
- (i.e. coordinates are only approximate and no CIGAR in output), in the [PAF format][paf]:
104
- ```sh
105
- minimap2 ref.fa query.fq > approx-mapping.paf
106
- ```
107
- You can ask minimap2 to generate CIGAR at the `cg` tag of PAF with:
108
- ```sh
109
- minimap2 -c ref.fa query.fq > alignment.paf
110
- ```
111
- or to output alignments in the [SAM format][sam]:
112
- ```sh
113
- minimap2 -a ref.fa query.fq > alignment.sam
114
- ```
115
- Minimap2 seamlessly works with gzip'd FASTA and FASTQ formats as input. You
116
- don't need to convert between FASTA and FASTQ or decompress gzip'd files first.
117
-
118
- For the human reference genome, minimap2 takes a few minutes to generate a
119
- minimizer index for the reference before mapping. To reduce indexing time, you
120
- can optionally save the index with option **-d** and replace the reference
121
- sequence file with the index file on the minimap2 command line:
122
- ```sh
123
- minimap2 -d ref.mmi ref.fa # indexing
124
- minimap2 -a ref.mmi reads.fq > alignment.sam # alignment
125
- ```
126
- ***Importantly***, it should be noted that once you build the index, indexing
127
- parameters such as **-k**, **-w**, **-H** and **-I** can't be changed during
128
- mapping. If you are running minimap2 for different data types, you will
129
- probably need to keep multiple indexes generated with different parameters.
130
- This makes minimap2 different from BWA which always uses the same index
131
- regardless of query data types.
132
-
133
- ### <a name="cases"></a>Use cases
134
-
135
- Minimap2 uses the same base algorithm for all applications. However, due to the
136
- different data types it supports (e.g. short vs long reads; DNA vs mRNA reads),
137
- minimap2 needs to be tuned for optimal performance and accuracy. It is usually
138
- recommended to choose a preset with option **-x**, which sets multiple
139
- parameters at the same time. The default setting is the same as `map-ont`.
140
-
141
- #### <a name="map-long-genomic"></a>Map long noisy genomic reads
142
-
143
- ```sh
144
- minimap2 -ax map-pb ref.fa pacbio-reads.fq > aln.sam # for PacBio CLR reads
145
- minimap2 -ax map-ont ref.fa ont-reads.fq > aln.sam # for Oxford Nanopore reads
146
- minimap2 -ax map-iclr ref.fa iclr-reads.fq > aln.sam # for Illumina Complete Long Reads
147
- ```
148
- The difference between `map-pb` and `map-ont` is that `map-pb` uses
149
- homopolymer-compressed (HPC) minimizers as seeds, while `map-ont` uses ordinary
150
- minimizers as seeds. Empirical evaluation suggests HPC minimizers improve
151
- performance and sensitivity when aligning PacBio CLR reads, but hurt when aligning
152
- Nanopore reads. `map-iclr` uses an adjusted alignment scoring matrix that
153
- accounts for the low overall error rate in the reads, with transversion errors
154
- being less frequent than transitions.
155
-
156
- #### <a name="map-long-splice"></a>Map long mRNA/cDNA reads
157
-
158
- ```sh
159
- minimap2 -ax splice:hq -uf ref.fa iso-seq.fq > aln.sam # PacBio Iso-seq/traditional cDNA
160
- minimap2 -ax splice ref.fa nanopore-cdna.fa > aln.sam # Nanopore 2D cDNA-seq
161
- minimap2 -ax splice -uf -k14 ref.fa direct-rna.fq > aln.sam # Nanopore Direct RNA-seq
162
- minimap2 -ax splice --splice-flank=no SIRV.fa SIRV-seq.fa # mapping against SIRV control
163
- ```
164
- There are different long-read RNA-seq technologies, including tranditional
165
- full-length cDNA, EST, PacBio Iso-seq, Nanopore 2D cDNA-seq and Direct RNA-seq.
166
- They produce data of varying quality and properties. By default, `-x splice`
167
- assumes the read orientation relative to the transcript strand is unknown. It
168
- tries two rounds of alignment to infer the orientation and write the strand to
169
- the `ts` SAM/PAF tag if possible. For Iso-seq, Direct RNA-seq and tranditional
170
- full-length cDNAs, it would be desired to apply `-u f` to force minimap2 to
171
- consider the forward transcript strand only. This speeds up alignment with
172
- slight improvement to accuracy. For noisy Nanopore Direct RNA-seq reads, it is
173
- recommended to use a smaller k-mer size for increased sensitivity to the first
174
- or the last exons.
175
-
176
- Minimap2 rates an alignment by the score of the max-scoring sub-segment,
177
- *excluding* introns, and marks the best alignment as primary in SAM. When a
178
- spliced gene also has unspliced pseudogenes, minimap2 slightly prefers
179
- the spliced alignment. By default, minimap2 outputs up to five secondary
180
- alignments (i.e. likely pseudogenes in the context of RNA-seq mapping). This
181
- can be tuned with option **-N**.
182
-
183
- For long RNA-seq reads, minimap2 may produce chimeric alignments potentially
184
- caused by gene fusions/structural variations or by an intron longer than the
185
- max intron length **-G** (200k by default). For now, it is not recommended to
186
- apply an excessively large **-G** as this slows down minimap2 and sometimes
187
- leads to false alignments.
188
-
189
- It is worth noting that by default `-x splice` prefers GT[A/G]..[C/T]AG
190
- over GT[C/T]..[A/G]AG, and then over other splicing signals. Considering
191
- one additional base improves the junction accuracy for noisy reads, but
192
- reduces the accuracy when aligning against the widely used SIRV control data.
193
- This is because SIRV does not honor the evolutionarily conservative splicing
194
- signal. If you are studying SIRV, you may apply `--splice-flank=no` to let
195
- minimap2 only model GT..AG, ignoring the additional base.
196
-
197
- Since v2.17, minimap2 can optionally take annotated genes as input and
198
- prioritize on annotated splice junctions. To use this feature, you can
199
- ```sh
200
- paftools.js gff2bed anno.gff > anno.bed
201
- minimap2 -ax splice --junc-bed anno.bed ref.fa query.fa > aln.sam
202
- ```
203
- Here, `anno.gff` is the gene annotation in the GTF or GFF3 format (`gff2bed`
204
- automatically tests the format). The output of `gff2bed` is in the 12-column
205
- BED format, or the BED12 format. With the `--junc-bed` option, minimap2 adds a
206
- bonus score (tuned by `--junc-bonus`) if an aligned junction matches a junction
207
- in the annotation. Option `--junc-bed` also takes 5-column BED, including the
208
- strand field. In this case, each line indicates an oriented junction.
209
-
210
- **Note:** `--junc-bed` is intended for long noisy RNA-seq reads only.
211
- Applying the option to short RNA-seq reads would increase run time with little
212
- improvement to junction accuracy.
213
-
214
- #### <a name="long-overlap"></a>Find overlaps between long reads
215
-
216
- ```sh
217
- minimap2 -x ava-pb reads.fq reads.fq > ovlp.paf # PacBio CLR read overlap
218
- minimap2 -x ava-ont reads.fq reads.fq > ovlp.paf # Oxford Nanopore read overlap
219
- ```
220
- Similarly, `ava-pb` uses HPC minimizers while `ava-ont` uses ordinary
221
- minimizers. It is usually not recommended to perform base-level alignment in
222
- the overlapping mode because it is slow and may produce false positive
223
- overlaps. However, if performance is not a concern, you may try to add `-a` or
224
- `-c` anyway.
225
-
226
- #### <a name="short-genomic"></a>Map short genomic reads
227
-
228
- ```sh
229
- minimap2 -ax sr ref.fa reads-se.fq > aln.sam # single-end alignment
230
- minimap2 -ax sr ref.fa read1.fq read2.fq > aln.sam # paired-end alignment
231
- minimap2 -ax sr ref.fa reads-interleaved.fq > aln.sam # paired-end alignment
232
- ```
233
- When two read files are specified, minimap2 reads from each file in turn and
234
- merge them into an interleaved stream internally. Two reads are considered to
235
- be paired if they are adjacent in the input stream and have the same name (with
236
- the `/[0-9]` suffix trimmed if present). Single- and paired-end reads can be
237
- mixed.
238
-
239
- #### <a name="short-rna-seq"></a>Map short RNA-seq reads
240
-
241
- ```sh
242
- minimap2 -ax splice:sr ref.fa reads-se.fq.gz > aln.sam # single-end
243
- minimap2 -ax splice:sr ref.fa r1.fq.gz r2.fq.gz > aln.sam # paired-end
244
- minimap2 -ax splice:sr -j anno.bed ref.fa r1.fq r2.fq > aln.sam # use annotation
245
- # 2-pass alignment
246
- minimap2 -x splice:sr -j anno.bed --write-junc ref.fa r1.fq r2.fq > junc.bed
247
- minimap2 -ax splice:sr -j anno.bed --pass1=junc.bed ref.fa r1.fq r2.fq > aln.sam
248
- ```
249
- The new preset `splice:sr` was added in v2.29. It functions similarly to `sr`
250
- except that it performs spliced alignment.
251
-
252
- #### <a name="full-genome"></a>Full genome/assembly alignment
253
-
254
- ```sh
255
- minimap2 -ax asm5 ref.fa asm.fa > aln.sam # assembly to assembly/ref alignment
256
- ```
257
- For cross-species full-genome alignment, the scoring system needs to be tuned
258
- according to the sequence divergence.
259
-
260
- ### <a name="advanced"></a>Advanced features
261
-
262
- #### <a name="long-cigar"></a>Working with >65535 CIGAR operations
263
-
264
- Due to a design flaw, BAM does not work with CIGAR strings with >65535
265
- operations (SAM and CRAM work). However, for ultra-long nanopore reads minimap2
266
- may align ~1% of read bases with long CIGARs beyond the capability of BAM. If
267
- you convert such SAM/CRAM to BAM, Picard and recent samtools will throw an
268
- error and abort. Older samtools and other tools may create corrupted BAM.
269
-
270
- To avoid this issue, you can add option `-L` at the minimap2 command line.
271
- This option moves a long CIGAR to the `CG` tag and leaves a fully clipped CIGAR
272
- at the SAM CIGAR column. Current tools that don't read CIGAR (e.g. merging and
273
- sorting) still work with such BAM records; tools that read CIGAR will
274
- effectively ignore these records. It has been decided that future tools
275
- will seamlessly recognize long-cigar records generated by option `-L`.
276
-
277
- **TL;DR**: if you work with ultra-long reads and use tools that only process
278
- BAM files, please add option `-L`.
279
-
280
- #### <a name="cs"></a>The cs optional tag
281
-
282
- The `cs` SAM/PAF tag encodes bases at mismatches and INDELs. It matches regular
283
- expression `/(:[0-9]+|\*[a-z][a-z]|[=\+\-][A-Za-z]+)+/`. Like CIGAR, `cs`
284
- consists of series of operations. Each leading character specifies the
285
- operation; the following sequence is the one involved in the operation.
286
-
287
- The `cs` tag is enabled by command line option `--cs`. The following alignment,
288
- for example:
289
- ```txt
290
- CGATCGATAAATAGAGTAG---GAATAGCA
291
- |||||| |||||||||| |||| |||
292
- CGATCG---AATAGAGTAGGTCGAATtGCA
293
- ```
294
- is represented as `:6-ata:10+gtc:4*at:3`, where `:[0-9]+` represents an
295
- identical block, `-ata` represents a deletion, `+gtc` an insertion and `*at`
296
- indicates reference base `a` is substituted with a query base `t`. It is
297
- similar to the `MD` SAM tag but is standalone and easier to parse.
298
-
299
- If `--cs=long` is used, the `cs` string also contains identical sequences in
300
- the alignment. The above example will become
301
- `=CGATCG-ata=AATAGAGTAG+gtc=GAAT*at=GCA`. The long form of `cs` encodes both
302
- reference and query sequences in one string. The `cs` tag also encodes intron
303
- positions and splicing signals (see the [minimap2 manpage][manpage-cs] for
304
- details).
305
-
306
- #### <a name="paftools"></a>Working with the PAF format
307
-
308
- Minimap2 also comes with a (java)script [paftools.js](misc/paftools.js) that
309
- processes alignments in the PAF format. It calls variants from
310
- assembly-to-reference alignment, lifts over BED files based on alignment,
311
- converts between formats and provides utilities for various evaluations. For
312
- details, please see [misc/README.md](misc/README.md).
313
-
314
- ### <a name="algo"></a>Algorithm overview
315
-
316
- In the following, minimap2 command line options have a dash ahead and are
317
- highlighted in bold. The description may help to tune minimap2 parameters.
318
-
319
- 1. Read **-I** [=*4G*] reference bases, extract (**-k**,**-w**)-minimizers and
320
- index them in a hash table.
321
-
322
- 2. Read **-K** [=*200M*] query bases. For each query sequence, do step 3
323
- through 7:
324
-
325
- 3. For each (**-k**,**-w**)-minimizer on the query, check against the reference
326
- index. If a reference minimizer is not among the top **-f** [=*2e-4*] most
327
- frequent, collect its the occurrences in the reference, which are called
328
- *seeds*.
329
-
330
- 4. Sort seeds by position in the reference. Chain them with dynamic
331
- programming. Each chain represents a potential mapping. For read
332
- overlapping, report all chains and then go to step 8. For reference mapping,
333
- do step 5 through 7:
334
-
335
- 5. Let *P* be the set of primary mappings, which is an empty set initially. For
336
- each chain from the best to the worst according to their chaining scores: if
337
- on the query, the chain overlaps with a chain in *P* by **--mask-level**
338
- [=*0.5*] or higher fraction of the shorter chain, mark the chain as
339
- *secondary* to the chain in *P*; otherwise, add the chain to *P*.
340
-
341
- 6. Retain all primary mappings. Also retain up to **-N** [=*5*] top secondary
342
- mappings if their chaining scores are higher than **-p** [=*0.8*] of their
343
- corresponding primary mappings.
344
-
345
- 7. If alignment is requested, filter out an internal seed if it potentially
346
- leads to both a long insertion and a long deletion. Extend from the
347
- left-most seed. Perform global alignments between internal seeds. Split the
348
- chain if the accumulative score along the global alignment drops by **-z**
349
- [=*400*], disregarding long gaps. Extend from the right-most seed. Output
350
- chains and their alignments.
351
-
352
- 8. If there are more query sequences in the input, go to step 2 until no more
353
- queries are left.
354
-
355
- 9. If there are more reference sequences, reopen the query file from the start
356
- and go to step 1; otherwise stop.
357
-
358
- ### <a name="help"></a>Getting help
359
-
360
- Manpage [minimap2.1][manpage] provides detailed description of minimap2
361
- command line options and optional tags. The [FAQ](FAQ.md) page answers several
362
- frequently asked questions. If you encounter bugs or have further questions or
363
- requests, you can raise an issue at the [issue page][issue]. There is not a
364
- specific mailing list for the time being.
365
-
366
- ### <a name="cite"></a>Citing minimap2
367
-
368
- If you use minimap2 in your work, please cite:
369
-
370
- > Li, H. (2018). Minimap2: pairwise alignment for nucleotide sequences.
371
- > *Bioinformatics*, **34**:3094-3100. [doi:10.1093/bioinformatics/bty191][doi]
372
-
373
- and/or:
374
-
375
- > Li, H. (2021). New strategies to improve minimap2 alignment accuracy.
376
- > *Bioinformatics*, **37**:4572-4574. [doi:10.1093/bioinformatics/btab705][doi2]
377
-
378
- ## <a name="dguide"></a>Developers' Guide
379
-
380
- Minimap2 is not only a command line tool, but also a programming library.
381
- It provides C APIs to build/load index and to align sequences against the
382
- index. File [example.c](example.c) demonstrates typical uses of C APIs. Header
383
- file [minimap.h](minimap.h) gives more detailed API documentation. Minimap2
384
- aims to keep APIs in this header stable. File [mmpriv.h](mmpriv.h) contains
385
- additional private APIs which may be subjected to changes frequently.
386
-
387
- This repository also provides Python bindings to a subset of C APIs. File
388
- [python/README.rst](python/README.rst) gives the full documentation;
389
- [python/minimap2.py](python/minimap2.py) shows an example. This Python
390
- extension, mappy, is also [available from PyPI][mappypypi] via `pip install
391
- mappy` or [from BioConda][mappyconda] via `conda install -c bioconda mappy`.
392
-
393
- ## <a name="limit"></a>Limitations
394
-
395
- * Minimap2 may produce suboptimal alignments through long low-complexity
396
- regions where seed positions may be suboptimal. This should not be a big
397
- concern because even the optimal alignment may be wrong in such regions.
398
-
399
- * Minimap2 requires SSE2 instructions on x86 CPUs or NEON on ARM CPUs. It is
400
- possible to add non-SIMD support, but it would make minimap2 slower by
401
- several times.
402
-
403
- * Minimap2 does not work with a single query or database sequence ~2
404
- billion bases or longer (2,147,483,647 to be exact). The total length of all
405
- sequences can well exceed this threshold.
406
-
407
- * Minimap2 often misses small exons.
408
-
409
-
410
-
411
- [paf]: https://github.com/lh3/miniasm/blob/master/PAF.md
412
- [sam]: https://samtools.github.io/hts-specs/SAMv1.pdf
413
- [minimap]: https://github.com/lh3/minimap
414
- [smartdenovo]: https://github.com/ruanjue/smartdenovo
415
- [longislnd]: https://www.ncbi.nlm.nih.gov/pubmed/27667791
416
- [gaba]: https://github.com/ocxtal/libgaba
417
- [ksw2]: https://github.com/lh3/ksw2
418
- [preprint]: https://arxiv.org/abs/1708.01492
419
- [release]: https://github.com/lh3/minimap2/releases
420
- [mappypypi]: https://pypi.python.org/pypi/mappy
421
- [mappyconda]: https://anaconda.org/bioconda/mappy
422
- [issue]: https://github.com/lh3/minimap2/issues
423
- [k8]: https://github.com/attractivechaos/k8
424
- [manpage]: https://lh3.github.io/minimap2/minimap2.html
425
- [manpage-cs]: https://lh3.github.io/minimap2/minimap2.html#10
426
- [doi]: https://doi.org/10.1093/bioinformatics/bty191
427
- [doi2]: https://doi.org/10.1093/bioinformatics/btab705
428
- [simde]: https://github.com/nemequ/simde
429
- [unimap]: https://github.com/lh3/unimap
@@ -1,30 +0,0 @@
1
- ## Contributor Code of Conduct
2
-
3
- As contributors and maintainers of this project, we pledge to respect all
4
- people who contribute through reporting issues, posting feature requests,
5
- updating documentation, submitting pull requests or patches, and other
6
- activities.
7
-
8
- We are committed to making participation in this project a harassment-free
9
- experience for everyone, regardless of level of experience, gender, gender
10
- identity and expression, sexual orientation, disability, personal appearance,
11
- body size, race, age, or religion.
12
-
13
- Examples of unacceptable behavior by participants include the use of sexual
14
- language or imagery, derogatory comments or personal attacks, trolling, public
15
- or private harassment, insults, or other unprofessional conduct.
16
-
17
- Project maintainers have the right and responsibility to remove, edit, or
18
- reject comments, commits, code, wiki edits, issues, and other contributions
19
- that are not aligned to this Code of Conduct. Project maintainers or
20
- contributors who do not follow the Code of Conduct may be removed from the
21
- project team.
22
-
23
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
24
- reported by opening an issue or contacting the maintainer via email.
25
-
26
- This Code of Conduct is adapted from the [Contributor Covenant][cc], [version
27
- 1.0.0][v1].
28
-
29
- [cc]: http://contributor-covenant.org/
30
- [v1]: http://contributor-covenant.org/version/1/0/0/