-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathMANUAL
1505 lines (1136 loc) · 60 KB
/
MANUAL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
What is Bowtie?
===============
[Bowtie] is an ultrafast, memory-efficient short read aligner geared
toward quickly aligning large sets of short DNA sequences (reads) to
large genomes. It aligns 35-base-pair reads to the human genome at a
rate of 25 million reads per hour on a typical workstation. Bowtie
indexes the genome with a [Burrows-Wheeler] index to keep its memory
footprint small: for the human genome, the index is typically about
2.2 GB (for unpaired alignment) or 2.9 GB (for paired-end alignment).
Multiple processors can be used simultaneously to achieve
greater alignment speed. Bowtie can also output alignments in the
standard [SAM] format, allowing Bowtie to interoperate with other tools
supporting SAM, including the [SAMtools] consensus, SNP, and indel
callers. Bowtie runs on the command line under Windows, Mac OS X,
Linux, and Solaris.
[Bowtie] also forms the basis for other tools, including [TopHat]: a
fast splice junction mapper for RNA-seq reads, [Cufflinks]: a tool for
transcriptome assembly and isoform quantitiation from RNA-seq reads,
[Crossbow]: a cloud-computing software tool for large-scale
resequencing data,and [Myrna]: a cloud computing tool for calculating
differential gene expression in large RNA-seq datasets.
If you use [Bowtie] for your published research, please cite the
[Bowtie paper].
[Bowtie]: http://bowtie-bio.sf.net
[Burrows-Wheeler]: http://en.wikipedia.org/wiki/Burrows-Wheeler_transform
[SAM]: http://samtools.sourceforge.net/SAM1.pdf
[SAMtools]: http://samtools.sourceforge.net/
[TopHat]: http://tophat.cbcb.umd.edu/
[Cufflinks]: http://cufflinks.cbcb.umd.edu/
[Crossbow]: http://bowtie-bio.sf.net/crossbow
[Myrna]: http://bowtie-bio.sf.net/myrna
[Bowtie paper]: http://genomebiology.com/2009/10/3/R25
What isn't Bowtie?
==================
Bowtie is not a general-purpose alignment tool like [MUMmer], [BLAST]
or [Vmatch]. Bowtie works best when aligning short reads to large
genomes, though it supports arbitrarily small reference sequences (e.g.
amplicons) and reads as long as 1024 bases. Bowtie is designed to be
extremely fast for sets of short reads where (a) many of the reads have
at least one good, valid alignment, (b) many of the reads are
relatively high-quality, and (c) the number of alignments reported per
read is small (close to 1).
Bowtie does not yet report gapped alignments; this is future work.
[MUMmer]: http://mummer.sourceforge.net/
[BLAST]: http://blast.ncbi.nlm.nih.gov/Blast.cgi
[Vmatch]: http://www.vmatch.de/
Obtaining Bowtie
================
You may download either Bowtie sources or binaries for your platform
from the [Download] section of the Sourceforge project site. Binaries
are currently available for 64-bit Intel architectures running Linux,
Windows, and Mac OS X.
Building from source
--------------------
Building Bowtie from source requires a GNU-like environment that
includes GCC, GNU Make and other basics. It should be possible to
build Bowtie on a vanilla Linux or Mac installation. Bowtie can also
be built on Windows using [MinGW]. We recommend
[TDM's MinGW Build]. You also must also have [MSYS] installed.
To build Bowtie, extract the sources, change to the extracted
directory, and run GNU `make` (usually with the command `make`, but
sometimes with `gmake`) with no arguments. If building with [MinGW],
run `make` from the [MSYS] command line.
[MinGW]: http://www.mingw.org/
[TDM's MinGW Build]: http://www.tdragon.net/recentgcc/
[MSYS]: http://www.mingw.org/wiki/msys
[Download]: https://sourceforge.net/projects/bowtie-bio/files/bowtie/
The `bowtie` aligner
====================
`bowtie` takes an index and a set of reads as input and outputs a list
of alignments. Alignments are selected according to a combination of
the `-v`/`-n`/`-e`/`-l` options (plus the `-I`/`-X`/`--fr`/`--rf`/
`--ff` options for paired-end alignment), which define which alignments
are legal, and the `-k`/`-a`/`-m`/`-M`/`--best`/`--strata` options
which define which and how many legal alignments should be reported.
By default, Bowtie enforces an alignment policy similar to [Maq]'s
default quality-aware policy (`-n` 2 `-l` 28 `-e` 70). See [the -n
alignment mode] section of the manual for details about this mode. But
Bowtie can also enforce a simpler end-to-end k-difference policy (e.g.
with `-v` 2). See [the -v alignment mode] section of the manual for
details about that mode. [The -n alignment mode] and [the -v alignment
mode] are mutually exclusive.
Bowtie works best when aligning short reads to large genomes (e.g.
human or mouse), though it supports arbitrarily small reference
sequences and reads as long as 1024 bases. Bowtie is designed to be
very fast for sets of short reads where a) many reads have at least one
good, valid alignment, b) many reads are relatively high-quality, c)
the number of alignments reported per read is small (close to 1).
These criteria are generally satisfied in the context of modern
short-read analyses such as RNA-seq, ChIP-seq, other types of -seq, and
mammalian resequencing. You may observe longer running times in other
research contexts.
If `bowtie` is too slow for your application, try some of the
performance-tuning hints described in the [Performance Tuning] section
below.
Alignments involving one or more ambiguous reference characters (`N`,
`-`, `R`, `Y`, etc.) are considered invalid by Bowtie. This is true
only for ambiguous characters in the reference; alignments involving
ambiguous characters in the read are legal, subject to the alignment
policy. Ambiguous characters in the read mismatch all other
characters. Alignments that "fall off" the reference sequence are not
considered valid.
The process by which `bowtie` chooses an alignment to report is
randomized in order to avoid "mapping bias" - the phenomenon whereby
an aligner systematically fails to report a particular class of good
alignments, causing spurious "holes" in the comparative assembly.
Whenever `bowtie` reports a subset of the valid alignments that exist,
it makes an effort to sample them randomly. This randomness flows
from a simple seeded pseudo-random number generator and is
deterministic in the sense that Bowtie will always produce the same
results for the same read when run with the same initial "seed" value
(see `--seed` option).
In the default mode, `bowtie` can exhibit strand bias. Strand bias
occurs when input reference and reads are such that (a) some reads
align equally well to sites on the forward and reverse strands of the
reference, and (b) the number of such sites on one strand is different
from the number on the other strand. When this happens for a given
read, `bowtie` effectively chooses one strand or the other with 50%
probability, then reports a randomly-selected alignment for that read
from among the sites on the selected strand. This tends to over assign
alignments to the sites on the strand with fewer sites and under assign
to sites on the strand with more sites. The effect is mitigated,
though it may not be eliminated, when reads are longer or when
paired-end reads are used. Running Bowtie in `--best` mode
eliminates strand bias by forcing Bowtie to select one strand or the
other with a probability that is proportional to the number of best
sites on the strand.
Gapped alignments are not currently supported in Bowtie, but they are
supported in [Bowtie 2].
[Maq]: http://maq.sf.net
[Bowtie 2]: http://bowtie-bio.sourceforge.net/bowtie2
The `-n` alignment mode
-----------------------
When the `-n` option is specified (which is the default), `bowtie`
determines which alignments are valid according to the following
policy, which is similar to [Maq]'s default policy.
1. Alignments may have no more than `N` mismatches (where `N` is a
number 0-3, set with `-n`) in the first `L` bases (where `L` is a
number 5 or greater, set with `-l`) on the high-quality (left) end
of the read. The first `L` bases are called the "seed".
2. The sum of the [Phred quality] values at *all* mismatched positions
(not just in the seed) may not exceed `E` (set with `-e`). Where
qualities are unavailable (e.g. if the reads are from a FASTA
file), the [Phred quality] defaults to 40.
The `-n` option is mutually exclusive with the `-v` option.
If there are many possible alignments satisfying these criteria, Bowtie
gives preference to alignments with fewer mismatches and where the sum
from criterion 2 is smaller. When the `--best` option is specified,
Bowtie guarantees the reported alignment(s) are "best" in terms of
these criteria (criterion 1 has priority), and that the alignments are
reported in best-to-worst order. Bowtie is somewhat slower when
`--best` is specified.
Note that [Maq] internally rounds base qualities to the nearest 10 and
rounds qualities greater than 30 to 30. To maintain compatibility,
Bowtie does the same. Rounding can be suppressed with the
`--nomaqround` option.
Bowtie is not fully sensitive in `-n` 2 and `-n` 3 modes by default.
In these modes Bowtie imposes a "backtracking limit" to limit effort
spent trying to find valid alignments for low-quality reads unlikely to
have any. This may cause Bowtie to miss some legal 2- and 3-mismatch
alignments. The limit is set to a reasonable default (125 without
`--best`, 800 with `--best`), but the user may decrease or increase the
limit using the `--maxbts` and/or `-y` options. `-y` mode is
relatively slow but guarantees full sensitivity.
[Maq]: http://maq.sf.net
[Phred quality]: http://en.wikipedia.org/wiki/FASTQ_format#Variations
The `-v` alignment mode
-----------------------
In `-v` mode, alignments may have no more than `V` mismatches, where
`V` may be a number from 0 through 3 set using the `-v` option.
Quality values are ignored. The `-v` option is mutually exclusive with
the `-n` option.
If there are many legal alignments, Bowtie gives preference to
alignments with fewer mismatches. When the `--best` option is
specified, Bowtie guarantees the reported alignment(s) are "best" in
terms of the number of mismatches, and that the alignments are reported
in best-to-worst order. Bowtie is somewhat slower when `--best` is
specified.
Strata
------
In [the -n alignment mode], an alignment's "stratum" is defined as the
number of mismatches in the "seed" region, i.e. the leftmost `L` bases,
where `L` is set with the `-l` option. In [the -v alignment mode], an
alignment's stratum is defined as the total number of mismatches in the
entire alignment. Some of Bowtie's options (e.g. `--strata` and `-m`
use the notion of "stratum" to limit or expand the scope of reportable
alignments.
Reporting Modes
---------------
With the `-k`, `-a`, `-m`, `-M`, `--best` and `--strata` options, the
user can flexibly select which alignments are reported. Below we
demonstrate a few ways in which these options can be combined. All
examples are using the `e_coli` index packaged with Bowtie. The
`--suppress` option is used to keep the output concise and some
output is elided for clarity.
Example 1: `-a`
$ ./bowtie -a -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT
- gi|110640213|ref|NC_008253.1| 148810 10:A>G,13:C>G
- gi|110640213|ref|NC_008253.1| 2852852 8:T>A
- gi|110640213|ref|NC_008253.1| 4930433 4:G>T,6:C>G
- gi|110640213|ref|NC_008253.1| 905664 6:A>G,7:G>T
+ gi|110640213|ref|NC_008253.1| 1093035 2:T>G,15:A>T
Specifying `-a` instructs Bowtie to report *all* valid alignments,
subject to the alignment policy: `-v` 2. In this case, Bowtie finds
5 inexact hits in the E. coli genome; 1 hit (the 2nd one listed)
has 1 mismatch, and the other 4 hits have 2 mismatches. Four are on
the reverse reference strand and one is on the forward strand. Note
that they are not listed in best-to-worst order.
Example 2: `-k 3`
$ ./bowtie -k 3 -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT
- gi|110640213|ref|NC_008253.1| 148810 10:A>G,13:C>G
- gi|110640213|ref|NC_008253.1| 2852852 8:T>A
- gi|110640213|ref|NC_008253.1| 4930433 4:G>T,6:C>G
Specifying `-k` 3 instructs Bowtie to report up to 3 valid
alignments. In this case, a total of 5 valid alignments exist (see
[Example 1]); `bowtie` reports 3 out of those 5. `-k` can be set to
any integer greater than 0.
Example 3: `-k 6`
$ ./bowtie -k 6 -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT
- gi|110640213|ref|NC_008253.1| 148810 10:A>G,13:C>G
- gi|110640213|ref|NC_008253.1| 2852852 8:T>A
- gi|110640213|ref|NC_008253.1| 4930433 4:G>T,6:C>G
- gi|110640213|ref|NC_008253.1| 905664 6:A>G,7:G>T
+ gi|110640213|ref|NC_008253.1| 1093035 2:T>G,15:A>T
Specifying `-k` 6 instructs Bowtie to report up to 6 valid
alignments. In this case, a total of 5 valid alignments exist, so
`bowtie` reports all 5.
Example 4: default (`-k 1`)
$ ./bowtie -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT
- gi|110640213|ref|NC_008253.1| 148810 10:A>G,13:C>G
Leaving the reporting options at their defaults causes `bowtie` to
report the first valid alignment it encounters. Because `--best` was
not specified, we are not guaranteed that Bowtie will report the best
alignment, and in this case it does not (the 1-mismatch alignment from
the previous example would have been better). The default reporting
mode is equivalent to `-k` 1.
Example 5: `-a --best`
$ ./bowtie -a --best -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT
- gi|110640213|ref|NC_008253.1| 2852852 8:T>A
+ gi|110640213|ref|NC_008253.1| 1093035 2:T>G,15:A>T
- gi|110640213|ref|NC_008253.1| 905664 6:A>G,7:G>T
- gi|110640213|ref|NC_008253.1| 148810 10:A>G,13:C>G
- gi|110640213|ref|NC_008253.1| 4930433 4:G>T,6:C>G
Specifying `-a` `--best` results in the same alignments being printed
as if just `-a` had been specified, but they are guaranteed to be
reported in best-to-worst order.
Example 6: `-a --best --strata`
$ ./bowtie -a --best --strata -v 2 --suppress 1,5,6,7 e_coli -c ATGCATCATGCGCCAT
- gi|110640213|ref|NC_008253.1| 2852852 8:T>A
Specifying `--strata` in addition to `-a` and `--best` causes
`bowtie` to report only those alignments in the best alignment
"stratum". The alignments in the best stratum are those having the
least number of mismatches (or mismatches just in the "seed" portion of
the alignment in the case of `-n` mode). Note that if `--strata`
is specified, `--best` must also be specified.
Example 7: `-a -m 3`
$ ./bowtie -a -m 3 -v 2 e_coli -c ATGCATCATGCGCCAT
No alignments
Specifying `-m` 3 instructs bowtie to refrain from reporting any
alignments for reads having more than 3 reportable alignments. The
`-m` option is useful when the user would like to guarantee that
reported alignments are "unique", for some definition of unique.
Example 1 showed that the read has 5 reportable alignments when `-a`
and `-v` 2 are specified, so the `-m` 3 limit causes bowtie to
output no alignments.
Example 8: `-a -m 5`
$ ./bowtie -a -m 5 -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT
- gi|110640213|ref|NC_008253.1| 148810 10:A>G,13:C>G
- gi|110640213|ref|NC_008253.1| 2852852 8:T>A
- gi|110640213|ref|NC_008253.1| 4930433 4:G>T,6:C>G
- gi|110640213|ref|NC_008253.1| 905664 6:A>G,7:G>T
+ gi|110640213|ref|NC_008253.1| 1093035 2:T>G,15:A>T
Specifying `-m` 5 instructs bowtie to refrain from reporting any
alignments for reads having more than 5 reportable alignments. Since
the read has exactly 5 reportable alignments, the `-m` 5 limit allows
`bowtie` to print them as usual.
Example 9: `-a -m 3 --best --strata`
$ ./bowtie -a -m 3 --best --strata -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT
- gi|110640213|ref|NC_008253.1| 2852852 8:T>A
Specifying `-m` 3 instructs bowtie to refrain from reporting any
alignments for reads having more than 3 reportable alignments. As we
saw in Example 6, the read has only 1 reportable alignment when `-a`,
`--best` and `--strata` are specified, so the `-m` 3 limit allows
`bowtie` to print that alignment as usual.
Intuitively, the `-m` option, when combined with the `--best` and
`--strata` options, guarantees a principled, though weaker form of
"uniqueness." A stronger form of uniqueness is enforced when `-m` is
specified but `--best` and `--strata` are not.
Paired-end Alignment
--------------------
`bowtie` can align paired-end reads when properly paired read files are
specified using the `-1` and `-2` options (for pairs of raw, FASTA, or
FASTQ read files), the `--12` option (for Tab-delimited read
files), or using the `--interleaved` (for interleaved FASTQ).
A valid paired-end alignment satisfies these criteria:
1. Both mates have a valid alignment according to the alignment policy
defined by the `-v`/`-n`/`-e`/`-l` options.
2. The relative orientation and position of the mates satisfy the
constraints defined by the `-I`/`-X`/`--fr`/`--rf`/`--ff`
options.
Policies governing which paired-end alignments are reported for a
given read are specified using the `-k`, `-a` and `-m` options as
usual. The `--strata` and `--best` options do not apply in
paired-end mode.
A paired-end alignment is reported as a pair of mate alignments, both
on a separate line, where the alignment for each mate is formatted the
same as an unpaired (singleton) alignment. The alignment for the mate
that occurs closest to the beginning of the reference sequence (the
"upstream" mate) is always printed before the alignment for the
downstream mate. Reads files containing paired-end reads will
sometimes name the reads according to whether they are the #1 or #2
mates by appending a `/1` or `/2` suffix to the read name. If no such
suffix is present in Bowtie's input, the suffix will be added when
Bowtie prints read names in alignments (except in `-S` "SAM" mode,
where mate information is encoded in the `FLAGS` field instead).
Finding a valid paired-end alignment where both mates align to
repetitive regions of the reference can be very time-consuming. By
default, Bowtie avoids much of this cost by imposing a limit on the
number of "tries" it makes to match an alignment for one mate with a
nearby alignment for the other. The default limit is 100. This causes
`bowtie` to miss some valid paired-end alignments where both mates lie
in repetitive regions, but the user may use the `--pairtries` or
`-y` options to increase Bowtie's sensitivity as desired.
Paired-end alignments where one mate's alignment is entirely contained
within the other's are considered invalid.
Because Bowtie uses an in-memory representation of the original
reference string when finding paired-end alignments, its memory
footprint is larger when aligning paired-end reads. For example, the
human index has a memory footprint of about 2.2 GB in single-end mode
and 2.9 GB in paired-end mode.
Wrapper scripts
---------------
The `bowtie`, `bowtie-build` and `bowtie-inspect` executables are
actually wrapper scripts that call binary programs as appropriate. The
wrappers shield users from having to distinguish between "small" and
"large" index formats, discussed briefly in the following section. The
appropriate index type is selected based on the input size.
It is recommended that you always run the bowtie wrappers and not run
the binaries directly.
Small and large indexes
-----------------------
`bowtie-build` can index reference genomes of any size. For genomes less
than about 4 billion nucleotides in length, `bowtie-build` builds a
"small" index using 32-bit numbers in various parts of the index. When
the genome is longer, `bowtie-build` builds a "large" index using 64-bit
numbers. Small indexes are stored in files with the `.ebwt` extension,
and large indexes are stored in files with the `.ebwtl` extension. The
user need not worry about whether a particular index is small or large;
the wrapper scripts will automatically build and use the appropriate
index.
Performance Tuning
------------------
1. If your computer has multiple processors/cores, use `--threads`
`--threads` option causes Bowtie to launch a specified number of
parallel threads. Each thread runs on a different processor/core.
For alignment, this increases alignment throughput by approximately a
multiple of the number of threads (though in practice, it is somewhat
worse than linear). For index building, using multiple threads
decreases building time.
2. If reporting many alignments per read, try tweaking
`bowtie-build --offrate`
If you are using the `-k`, `-a` or `-m` options and Bowtie is
reporting many alignments per read (an average of more than about
10 per read) and you have some memory to spare, using an index with
a denser SA sample can speed things up considerably.
To do this, specify a smaller-than-default `-o`/`--offrate` value
when running `bowtie-build`. A denser SA sample yields a larger
index, but is also particularly effective at speeding up alignment
when many alignments are reported per read. For example,
decreasing the index's `-o`/`--offrate` by 1 could as much as
double alignment performance, and decreasing by 2 could quadruple
alignment performance, etc.
On the other hand, decreasing `-o`/`--offrate` increases the size
of the Bowtie index, both on disk and in memory when aligning
reads. At the default `-o`/`--offrate` of 5, the SA sample for the
human genome occupies about 375 MB of memory when aligning reads.
Decreasing the `-o`/`--offrate` by 1 doubles the memory taken by
the SA sample, and decreasing by 2 quadruples the memory taken,
etc.
3. If bowtie "thrashes", try increasing `bowtie --offrate`
If `bowtie` runs very slow on a low-memory machine (with less than
about 4 GB of memory), then try setting `bowtie` `-o`/`--offrate`
to a *larger* value. `bowtie-build`'s default `-o`/`--offrate`
is 5 and all pre-built indexes available from the Bowtie website
are built with `-o`/`--offrate` 5; so if `bowtie` thrashes when
querying such an index, try using `bowtie` `--offrate` 6. If
`bowtie` still thrashes, try `bowtie` `--offrate` 7, etc. A higher
`-o`/`--offrate` causes `bowtie` to use a sparser sample of the
suffix array than is stored in the index; this saves memory but
makes alignment reporting slower (which is especially slow when
using `-a` or large `-k` or `-m`).
Command Line
------------
Usage:
bowtie [options]* -x <ebwt> {-1 <m1> -2 <m2> | --12 <r> | --interleaved <i> | <s>} [<hit>]
Main arguments
-x <ebwt>
The basename of the Bowtie, or Bowtie 2, index to be searched. The
basename is the name of any of the index files up to but not including
the final `.1.ebwt` / `.rev.1.ebwt` / `1.bt2` / etc. `bowtie` looks
for the specified index first in the current directory, then in the
`indexes` subdirectory under the directory where the `bowtie`
executable is located, then looks in the directory specified in the
`BOWTIE_INDEXES` environment variable. If a Bowtie and Bowtie 2
index are located in the same directory and share the same basename,
`bowtie` will use the Bowtie 2 index.
<m1>
Comma-separated list of files containing the #1 mates (filename usually
includes `_1`), or, if `-c` is specified, the mate sequences
themselves. E.g., this might be `flyA_1.fq,flyB_1.fq`, or, if `-c`
is specified, this might be `GGTCATCCT,ACGGGTCGT`. Sequences specified
with this option must correspond file-for-file and read-for-read with
those specified in `<m2>`. Reads may be a mix of different lengths.
If `-` is specified, `bowtie` will read the #1 mates from the "standard
in" filehandle.
<m2>
Comma-separated list of files containing the #2 mates (filename usually
includes `_2`), or, if `-c` is specified, the mate sequences
themselves. E.g., this might be `flyA_2.fq,flyB_2.fq`, or, if `-c`
is specified, this might be `GGTCATCCT,ACGGGTCGT`. Sequences specified
with this option must correspond file-for-file and read-for-read with
those specified in `<m1>`. Reads may be a mix of different lengths.
If `-` is specified, `bowtie` will read the #2 mates from the "standard
in" filehandle.
<r>
Comma-separated list of files containing a mix of unpaired and
paired-end reads in Tab-delimited format. Tab-delimited format is a
1-read-per-line format where unpaired reads consist of a read name,
sequence and quality string each separated by tabs. A paired-end read
consists of a read name, sequence of the #1 mate, quality values of the
#1 mate, sequence of the #2 mate, and quality values of the #2 mate
separated by tabs. Quality values can be expressed using any of the
scales supported in FASTQ files. Reads may be a mix of different
lengths and paired-end and unpaired reads may be intermingled in the
same file. If `-` is specified, `bowtie` will read the Tab-delimited
reads from the "standard in" filehandle.
<i>
A comma-separated list of interleaved paired-end FASTQ files, where
the records for the mate #1s are interleaved with the records for the
mate #2s. Reads may be a mix of different lengths. If `-` is
specified, Bowtie reads from the "standard in" filehandle.
<s>
A comma-separated list of files containing unpaired reads to be
aligned, or, if `-c` is specified, the unpaired read sequences
themselves. E.g., this might be
`lane1.fq,lane2.fq,lane3.fq,lane4.fq`, or, if `-c` is specified, this
might be `GGTCATCCT,ACGGGTCGT`. Reads may be a mix of different
lengths. If `-` is specified, Bowtie gets the reads from the "standard
in" filehandle.
<hit>
File to write alignments to. By default, alignments are written to the
"standard out" filehandle (i.e. the console).
Options
Input
-q
The query input files (specified either as `<m1>` and `<m2>`, or as
`<s>`) are FASTQ files (usually having extension `.fq` or `.fastq`).
This is the default. See also: `--solexa-quals` and
`--integer-quals`.
-f
The query input files (specified either as `<m1>` and `<m2>`, or as
`<s>`) are FASTA files (usually having extension `.fa`, `.mfa`, `.fna`
or similar). All quality values are assumed to be 40 on the [Phred
quality] scale.
-F
Reads are substrings (k-mers) extracted from a FASTA file `s`.
Specifically, for every reference sequence in FASTA file `s`, Bowtie
2 aligns the k-mers at offsets 1, 1+i, 1+2i, ... until reaching the
end of the reference. Each k-mer is aligned as a separate read.
Quality values are set to all Is (40 on Phred scale). Each k-mer
(read) is given a name like `sequence`_`offset`, where `sequence`
is the name of the FASTA sequence it was drawn from and `offset`
is its 0-based offset of origin with respect to the sequence. Only
single k-mers, i.e. unpaired reads, can be aligned in this way.
-r
The query input files (specified either as `<m1>` and `<m2>`, or as
`<s>`) are Raw files: one sequence per line, without quality values or
names. All quality values are assumed to be 40 on the [Phred quality]
scale.
-c
The query sequences are given on command line. I.e. `<m1>`, `<m2>` and
`<singles>` are comma-separated lists of reads rather than lists of
read files.
-s/--skip <int>
Skip (i.e. do not align) the first `<int>` reads or pairs in the input.
-u/--qupto <int>
Only align the first `<int>` reads or read pairs from the input (after
the `-s`/`--skip` reads or pairs have been skipped). Default: no
limit.
-5/--trim5 <int>
Trim `<int>` bases from high-quality (left) end of each read before
alignment (default: 0).
-3/--trim3 <int>
Trim `<int>` bases from low-quality (right) end of each read before
alignment (default: 0).
--phred33-quals
Input qualities are ASCII chars equal to the [Phred quality] plus 33.
Default: on.
--phred64-quals
Input qualities are ASCII chars equal to the [Phred quality] plus 64.
Default: off.
--solexa-quals
Convert input qualities from [Solexa][Phred quality] (which can be
negative) to [Phred][Phred quality] (which can't). This is usually the
right option for use with (unconverted) reads emitted by GA Pipeline
versions prior to 1.3. Default: off.
--solexa1.3-quals
Same as `--phred64-quals`. This is usually the right option for use
with (unconverted) reads emitted by GA Pipeline version 1.3 or later.
Default: off.
--integer-quals
Quality values are represented in the read input file as
space-separated ASCII integers, e.g., `40 40 30 40`..., rather than
ASCII characters, e.g., `II?I`.... Integers are treated as being on
the [Phred quality] scale unless `--solexa-quals` is also specified.
Default: off.
--large-index
Force usage of a 'large' index (those ending in '.ebwtl'), even if a
small one is present. Default: off.
Alignment
-v <int>
Report alignments with at most `<int>` mismatches. `-e` and `-l`
options are ignored and quality values have no effect on what
alignments are valid. `-v` is mutually exclusive with `-n`.
-n/--seedmms <int>
Maximum number of mismatches permitted in the "seed", i.e. the first
`L` base pairs of the read (where `L` is set with `-l`/`--seedlen`).
This may be 0, 1, 2 or 3 and the default is 2. This option is mutually
exclusive with the `-v` option.
-e/--maqerr <int>
Maximum permitted total of quality values at *all* mismatched read
positions throughout the entire alignment, not just in the "seed". The
default is 70. Like [Maq], `bowtie` rounds quality values to the
nearest 10 and saturates at 30; rounding can be disabled with
`--nomaqround`.
-l/--seedlen <int>
The "seed length"; i.e., the number of bases on the high-quality end of
the read to which the `-n` ceiling applies. The lowest permitted
setting is 5 and the default is 28. `bowtie` is faster for larger
values of `-l`.
--nomaqround
[Maq] accepts quality values in the [Phred quality] scale, but
internally rounds values to the nearest 10, with a maximum of 30. By
default, `bowtie` also rounds this way. `--nomaqround` prevents this
rounding in `bowtie`.
-I/--minins <int>
The minimum insert size for valid paired-end alignments. E.g. if `-I
60` is specified and a paired-end alignment consists of two 20-bp
alignments in the appropriate orientation with a 20-bp gap between
them, that alignment is considered valid (as long as `-X` is also
satisfied). A 19-bp gap would not be valid in that case. If trimming
options `-3` or `-5` are also used, the `-I` constraint is
applied with respect to the untrimmed mates. Default: 0.
-X/--maxins <int>
The maximum insert size for valid paired-end alignments. E.g. if `-X
100` is specified and a paired-end alignment consists of two 20-bp
alignments in the proper orientation with a 60-bp gap between them,
that alignment is considered valid (as long as `-I` is also
satisfied). A 61-bp gap would not be valid in that case. If trimming
options `-3` or `-5` are also used, the `-X` constraint is applied
with respect to the untrimmed mates, not the trimmed mates. Default:
250.
--fr/--rf/--ff
The upstream/downstream mate orientations for a valid paired-end
alignment against the forward reference strand. E.g., if `--fr` is
specified and there is a candidate paired-end alignment where mate1
appears upstream of the reverse complement of mate2 and the insert
length constraints are met, that alignment is valid. Also, if mate2
appears upstream of the reverse complement of mate1 and all other
constraints are met, that too is valid. `--rf` likewise requires that
an upstream mate1 be reverse-complemented and a downstream mate2 be
forward-oriented. ` --ff` requires both an upstream mate1 and a
downstream mate2 to be forward-oriented.
--allow-contain
Normally, Bowtie will not reported a paired-end alignment for a pair
when the two ends overlap exactly the same reference interval, or if
the alignment interval for one is contained within the other. This
option causes Bowtie to report such cases as normal paired-end
alignments.
--nofw/--norc
If `--nofw` is specified, `bowtie` will not attempt to align against
the forward reference strand. If `--norc` is specified, `bowtie` will
not attempt to align against the reverse-complement reference strand.
For paired-end reads using `--fr` or `--rf` modes, `--nofw` and
`--norc` apply to the forward and reverse-complement pair orientations.
I.e. specifying `--nofw` and `--fr` will only find reads in the R/F
orientation where mate 2 occurs upstream of mate 1 with respect to the
forward reference strand.
--maxbts
The maximum number of backtracks permitted when aligning a read in
`-n` 2 or `-n` 3 mode (default: 125 without `--best`, 800 with
`--best`). A "backtrack" is the introduction of a speculative
substitution into the alignment. Without this limit, the default
parameters will sometimes require that `bowtie` try 100s or 1,000s of
backtracks to align a read, especially if the read has many low-quality
bases and/or has no valid alignments, slowing bowtie down
significantly. However, this limit may cause some valid alignments to
be missed. Higher limits yield greater sensitivity at the expensive of
longer running times. See also: `-y`/`--tryhard`.
--pairtries <int>
For paired-end alignment, this is the maximum number of attempts
`bowtie` will make to match an alignment for one mate up with an
alignment for the opposite mate. Most paired-end alignments require
only a few such attempts, but pairs where both mates occur in highly
repetitive regions of the reference can require significantly more.
Setting this to a higher number allows `bowtie` to find more paired-
end alignments for repetitive pairs at the expense of speed. The
default is 100. See also: `-y`/`--tryhard`.
-y/--tryhard
Try as hard as possible to find valid alignments when they exist,
including paired-end alignments. This is equivalent to specifying very
high values for the `--maxbts` and `--pairtries` options. This
mode is generally much slower than the default settings, but can be
useful for certain problems. This mode is slower when (a) the
reference is very repetitive, (b) the reads are low quality, or (c) not
many reads have valid alignments.
--chunkmbs <int>
The number of megabytes of memory a given thread is given to store path
descriptors in `--best` mode. Best-first search must keep track of
many paths at once to ensure it is always extending the path with the
lowest cumulative cost. Bowtie tries to minimize the memory impact of
the descriptors, but they can still grow very large in some cases. If
you receive an error message saying that chunk memory has been
exhausted in `--best` mode, try adjusting this parameter up to
dedicate more memory to the descriptors. Default: 64.
--reads-per-batch <int>
Part of bowtie's batch parsing and used to specify the number of
reads that bowtie will consume from the input file at once. Default:
16
Reporting
-k <int>
Report up to `<int>` valid alignments per read or pair (default: 1).
Validity of alignments is determined by the alignment policy (combined
effects of `-n`, `-v`, `-l`, and `-e`). If more than one valid
alignment exists and the `--best` and `--strata` options are
specified, then only those alignments belonging to the best alignment
"stratum" will be reported. Bowtie is designed to be very fast for
small `-k` but bowtie can become significantly slower as `-k`
increases. If you would like to use Bowtie for larger values of
`-k`, consider building an index with a denser suffix-array sample,
i.e. specify a smaller `-o`/`--offrate` when invoking `bowtie-build`
for the relevant index (see the [Performance tuning] section for
details).
-a/--all
Report all valid alignments per read or pair (default: off). Validity
of alignments is determined by the alignment policy (combined effects
of `-n`, `-v`, `-l`, and `-e`). If more than one valid alignment
exists and the `--best` and `--strata` options are specified, then only
those alignments belonging to the best alignment "stratum" will be
reported. Bowtie is designed to be very fast for small `-k` but bowtie
can become significantly slower if `-a`/`--all` is specified. If you
would like to use Bowtie with `-a`, consider building an index with a
denser suffix-array sample, i.e. specify a smaller `-o`/`--offrate`
when invoking `bowtie-build` for the relevant index (see the
[Performance tuning] section for details).
-m <int>
Suppress all alignments for a particular read or pair if more than
`<int>` reportable alignments exist for it. Reportable alignments are
those that would be reported given the `-n`, `-v`, `-l`, `-e`, `-k`,
`-a`, `--best`, and `--strata` options. Default: no limit. Bowtie is
designed to be very fast for small `-m` but bowtie can become
significantly slower for larger values of `-m`. If you would like to
use Bowtie for larger values of `-k`, consider building an index with a
denser suffix-array sample, i.e. specify a smaller `-o`/`--offrate` when
invoking `bowtie-build` for the relevant index (see the [Performance
tuning] section for details).
-M <int>
Behaves like `-m` except that if a read has more than `<int>`
reportable alignments, one is reported at random. In [default
output mode], the selected alignment's 7th column is set to `<int>`+1 to
indicate the read has at least `<int>`+1 valid alignments. In
`-S`/`--sam` mode, the selected alignment is given a `MAPQ` (mapping
quality) of 0 and the `XM:I` field is set to `<int>`+1. This option
requires `--best`; if specified without `--best`, `--best` is enabled
automatically.
--best
Make Bowtie guarantee that reported singleton alignments are "best" in
terms of stratum (i.e. number of mismatches, or mismatches in the seed
in the case of `-n` mode) and in terms of the quality values at the
mismatched position(s). Stratum always trumps quality; e.g. a
1-mismatch alignment where the mismatched position has [Phred quality]
40 is preferred over a 2-mismatch alignment where the mismatched
positions both have [Phred quality] 10. When `--best` is not
specified, Bowtie may report alignments that are sub-optimal in terms
of stratum and/or quality (though an effort is made to report the best
alignment). `--best` mode also removes all strand bias. Note that
`--best` does not affect which alignments are considered "valid" by
`bowtie`, only which valid alignments are reported by `bowtie`. When
`--best` is specified and multiple hits are allowed (via `-k` or
`-a`), the alignments for a given read are guaranteed to appear in
best-to-worst order in `bowtie`'s output. `bowtie` is somewhat slower
when `--best` is specified.
--strata
If many valid alignments exist and are reportable (e.g. are not
disallowed via the `-k` option) and they fall into more than one
alignment "stratum", report only those alignments that fall into the
best stratum. By default, Bowtie reports all reportable alignments
regardless of whether they fall into multiple strata. When
`--strata` is specified, `--best` must also be specified.
Output
-t/--time
Print the amount of wall-clock time taken by each phase.
-B/--offbase <int>
When outputting alignments in Bowtie format, consider the first base of
a reference sequence to have offset `<int>`. This option has no effect
in `-S`/`--sam` mode, since SAM mandates 1-based offsets. Default: 0.
--quiet
Print nothing besides alignments.
--refidx
When a reference sequence is referred to in a reported alignment, refer
to it by 0-based index (its offset into the list of references that
were indexed) rather than by name.
--al <filename>
Write all reads for which at least one alignment was reported to a file
with name `<filename>`. Written reads will appear as they did in the
input, without any of the trimming or translation of quality values
that may have taken place within `bowtie`. Paired-end reads will be
written to two parallel files with `_1` and `_2` inserted in the
filename, e.g., if `<filename>` is `aligned.fq`, the #1 and #2 mates
that align at least once will be written to `aligned_1.fq` and
`aligned_2.fq` respectively.
--un <filename>
Write all reads that could not be aligned to a file with name
`<filename>`. Written reads will appear as they did in the input,
without any of the trimming or translation of quality values that may
have taken place within Bowtie. Paired-end reads will be written to
two parallel files with `_1` and `_2` inserted in the filename, e.g.,
if `<filename>` is `unaligned.fq`, the #1 and #2 mates that fail to
align will be written to `unaligned_1.fq` and `unaligned_2.fq`
respectively. Unless `--max` is also specified, reads with a number
of valid alignments exceeding the limit set with the `-m` option are
also written to `<filename>`.
--max <filename>
Write all reads with a number of valid alignments exceeding the limit
set with the `-m` option to a file with name `<filename>`. Written
reads will appear as they did in the input, without any of the trimming
or translation of quality values that may have taken place within
`bowtie`. Paired-end reads will be written to two parallel files with
`_1` and `_2` inserted in the filename, e.g., if `<filename>` is
`max.fq`, the #1 and #2 mates that exceed the `-m` limit will be
written to `max_1.fq` and `max_2.fq` respectively. These reads are not
written to the file specified with `--un`.
--suppress <cols>
Suppress columns of output in the [default output mode]. E.g. if
`--suppress 1,5,6` is specified, the read name, read sequence, and read
quality fields will be omitted. See [Default Bowtie output] for field
descriptions. This option is ignored if the output mode is
`-S`/`--sam`.
--fullref
Print the full reference sequence name, including whitespace, in
alignment output. By default `bowtie` prints everything up to but not
including the first whitespace.
SAM
-S/--sam
Print alignments in [SAM] format. See the [SAM output] section of the
manual for details. To suppress all SAM headers, use `--sam-nohead`
in addition to `-S/--sam`. To suppress just the `@SQ` headers (e.g. if
the alignment is against a very large number of reference sequences),
use `--sam-nosq` in addition to `-S/--sam`. `bowtie` does not write
BAM files directly, but SAM output can be converted to BAM on the fly
by piping `bowtie`'s output to `samtools view`.
--mapq <int>
If an alignment is non-repetitive (according to `-m`, `--strata` and
other options) set the `MAPQ` (mapping quality) field to this value.
See the [SAM Spec][SAM] for details about the `MAPQ` field Default: 255.
--sam-nohead
Suppress header lines (starting with `@`) when output is `-S`/`--sam`.
This must be specified *in addition to* `-S`/`--sam`. `--sam-nohead`
is ignored unless `-S`/`--sam` is also specified.
--sam-nosq
Suppress `@SQ` header lines when output is `-S`/`--sam`. This must be
specified *in addition to* `-S`/`--sam`. `--sam-nosq` is ignored
unless `-S`/`--sam` is also specified.
--sam-RG <text>
Add `<text>` (usually of the form `TAG:VAL`, e.g. `ID:IL7LANE2`) as a
field on the `@RG` header line. Specify `--sam-RG` multiple times to
set multiple fields. See the [SAM Spec][SAM] for details about what fields
are legal. Note that, if any `@RG` fields are set using this option,
the `ID` and `SM` fields must both be among them to make the `@RG` line
legal according to the [SAM Spec][SAM]. `--sam-RG` is ignored unless
`-S`/`--sam` is also specified.
--no-unal