This file is indexed.

/usr/share/doc/bowtie/manual.html is in bowtie 1.1.2-6.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title>Bowtie Manual - </title>
  <style type="text/css">code{white-space: pre;}</style>
  <link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<h1>Table of Contents</h1>
<div id="TOC">
<ul>
<li><a href="#what-is-bowtie">What is Bowtie?</a></li>
<li><a href="#what-isnt-bowtie">What isn't Bowtie?</a></li>
<li><a href="#obtaining-bowtie">Obtaining Bowtie</a><ul>
<li><a href="#building-from-source">Building from source</a></li>
</ul></li>
<li><a href="#the-bowtie-aligner">The <code>bowtie</code> aligner</a><ul>
<li><a href="#the--n-alignment-mode">The <code>-n</code> alignment mode</a></li>
<li><a href="#the--v-alignment-mode">The <code>-v</code> alignment mode</a></li>
<li><a href="#strata">Strata</a></li>
<li><a href="#reporting-modes">Reporting Modes</a><ul>
<li><a href="#example-1--a">Example 1: <code>-a</code></a></li>
<li><a href="#example-2--k-3">Example 2: <code>-k 3</code></a></li>
<li><a href="#example-3--k-6">Example 3: <code>-k 6</code></a></li>
<li><a href="#example-4-default--k-1">Example 4: default (<code>-k 1</code>)</a></li>
<li><a href="#example-5--a---best">Example 5: <code>-a --best</code></a></li>
<li><a href="#example-6--a---best---strata">Example 6: <code>-a --best --strata</code></a></li>
<li><a href="#example-7--a--m-3">Example 7: <code>-a -m 3</code></a></li>
<li><a href="#example-8--a--m-5">Example 8: <code>-a -m 5</code></a></li>
<li><a href="#example-9--a--m-3---best---strata">Example 9: <code>-a -m 3 --best --strata</code></a></li>
</ul></li>
<li><a href="#paired-end-alignment">Paired-end Alignment</a></li>
<li><a href="#colorspace-alignment">Colorspace Alignment</a><ul>
<li><a href="#colorspace-reads">Colorspace reads</a></li>
<li><a href="#building-a-colorspace-index">Building a colorspace index</a></li>
<li><a href="#decoding-colorspace-alignments">Decoding colorspace alignments</a></li>
<li><a href="#paired-end-colorspace-alignment">Paired-end colorspace alignment</a></li>
</ul></li>
<li><a href="#wrapper-scripts">Wrapper scripts</a></li>
<li><a href="#small-and-large-indexes">Small and large indexes</a></li>
<li><a href="#performance-tuning">Performance Tuning</a></li>
<li><a href="#command-line">Command Line</a><ul>
<li><a href="#main-arguments">Main arguments</a></li>
<li><a href="#options">Options</a></li>
</ul></li>
<li><a href="#default-bowtie-output">Default <code>bowtie</code> output</a></li>
<li><a href="#sam-bowtie-output">SAM <code>bowtie</code> output</a></li>
</ul></li>
<li><a href="#the-bowtie-build-indexer">The <code>bowtie-build</code> indexer</a><ul>
<li><a href="#command-line-1">Command Line</a><ul>
<li><a href="#main-arguments-1">Main arguments</a></li>
<li><a href="#options-1">Options</a></li>
</ul></li>
</ul></li>
<li><a href="#the-bowtie-inspect-index-inspector">The <code>bowtie-inspect</code> index inspector</a><ul>
<li><a href="#command-line-2">Command Line</a><ul>
<li><a href="#main-arguments-2">Main arguments</a></li>
<li><a href="#options-2">Options</a></li>
</ul></li>
</ul></li>
</ul>
</div>
<!--
 ! This manual is written in "markdown" format and thus contains some
 ! distracting clutter encoding information about how to convert to
 ! HTML.  See 'MANUAL' for a clearer version of this document.
  -->

<h1 id="what-is-bowtie">What is Bowtie?</h1>
<p><a href="http://bowtie-bio.sf.net">Bowtie</a> 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 <a href="http://en.wikipedia.org/wiki/Burrows-Wheeler_transform">Burrows-Wheeler</a> 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 or colorspace alignment). Multiple processors can be used simultaneously to achieve greater alignment speed. Bowtie can also output alignments in the standard <a href="http://samtools.sourceforge.net/SAM1.pdf">SAM</a> format, allowing Bowtie to interoperate with other tools supporting SAM, including the <a href="http://samtools.sourceforge.net/">SAMtools</a> consensus, SNP, and indel callers. Bowtie runs on the command line under Windows, Mac OS X, Linux, and Solaris.</p>
<p><a href="http://bowtie-bio.sf.net">Bowtie</a> also forms the basis for other tools, including <a href="http://tophat.cbcb.umd.edu/">TopHat</a>: a fast splice junction mapper for RNA-seq reads, <a href="http://cufflinks.cbcb.umd.edu/">Cufflinks</a>: a tool for transcriptome assembly and isoform quantitiation from RNA-seq reads, <a href="http://bowtie-bio.sf.net/crossbow">Crossbow</a>: a cloud-computing software tool for large-scale resequencing data,and <a href="http://bowtie-bio.sf.net/myrna">Myrna</a>: a cloud computing tool for calculating differential gene expression in large RNA-seq datasets.</p>
<p>If you use <a href="http://bowtie-bio.sf.net">Bowtie</a> for your published research, please cite the <a href="http://genomebiology.com/2009/10/3/R25">Bowtie paper</a>.</p>
<h1 id="what-isnt-bowtie">What isn't Bowtie?</h1>
<p>Bowtie is not a general-purpose alignment tool like <a href="http://mummer.sourceforge.net/">MUMmer</a>, <a href="http://blast.ncbi.nlm.nih.gov/Blast.cgi">BLAST</a> or <a href="http://www.vmatch.de/">Vmatch</a>. 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).</p>
<p>Bowtie does not yet report gapped alignments; this is future work.</p>
<h1 id="obtaining-bowtie">Obtaining Bowtie</h1>
<p>You may download either Bowtie sources or binaries for your platform from the <a href="https://sourceforge.net/projects/bowtie-bio/files/bowtie/">Download</a> section of the Sourceforge project site. Binaries are currently available for 64-bit Intel architectures running Linux, Windows, and Mac OS X.</p>
<h2 id="building-from-source">Building from source</h2>
<p>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 <a href="http://www.mingw.org/">MinGW</a>. We recommend <a href="http://www.tdragon.net/recentgcc/">TDM's MinGW Build</a>. You also must also have <a href="http://www.mingw.org/wiki/msys">MSYS</a> installed.</p>
<p>To build Bowtie, extract the sources, change to the extracted directory, and run GNU <code>make</code> (usually with the command <code>make</code>, but sometimes with <code>gmake</code>) with no arguments. If building with <a href="http://www.mingw.org/">MinGW</a>, run <code>make</code> from the <a href="http://www.mingw.org/wiki/msys">MSYS</a> command line.</p>
<p>To build Bowtie including support for the <a href="#bowtie-options-p"><code>-p</code></a> (multithreading) option, we recommend that you first install the <a href="https://www.threadingbuildingblocks.org">Thread Building Blocks library</a>, also known as TBB, and build using <code>make WITH_TBB=1</code>. TBB is installed by default on many operating systems.</p>
<p>If TBB is not available, then omit the <code>WITH_TBB=1</code> option. On Linux or Mac OS X, this requires the pthreads library, which is installed by default. On Windows, native Windows threads will be used, which require no special libraries.</p>
<p>For threading synchronization Bowtie uses by default a spinlocking mechanism. This can be disabled (leading to a more heavyweight locking mechanism) by specifying <code>EXTRA_FLAGS=-DNO_SPINLOCK</code> when building.</p>
<h1 id="the-bowtie-aligner">The <code>bowtie</code> aligner</h1>
<p><code>bowtie</code> 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 <a href="#bowtie-options-v"><code>-v</code></a>/<a href="#bowtie-options-n"><code>-n</code></a>/<a href="#bowtie-options-e"><code>-e</code></a>/<a href="#bowtie-options-l"><code>-l</code></a> options (plus the <a href="#bowtie-options-I"><code>-I</code></a>/<a href="#bowtie-options-X"><code>-X</code></a>/<a href="#bowtie-options-fr"><code>--fr</code></a>/<a href="#bowtie-options-fr"><code>--rf</code></a>/ <a href="#bowtie-options-fr"><code>--ff</code></a> options for paired-end alignment), which define which alignments are legal, and the <a href="#bowtie-options-k"><code>-k</code></a>/<a href="#bowtie-options-a"><code>-a</code></a>/<a href="#bowtie-options-m"><code>-m</code></a>/<a href="#bowtie-options-m"><code>-M</code></a>/<a href="#bowtie-options-best"><code>--best</code></a>/<a href="#bowtie-options-strata"><code>--strata</code></a> options which define which and how many legal alignments should be reported.</p>
<p>By default, Bowtie enforces an alignment policy similar to <a href="http://maq.sf.net">Maq</a>'s default quality-aware policy (<a href="#bowtie-options-n"><code>-n</code></a> 2 <a href="#bowtie-options-l"><code>-l</code></a> 28 <a href="#bowtie-options-e"><code>-e</code></a> 70). See <a href="#the--n-alignment-mode">the -n alignment mode</a> 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 <a href="#bowtie-options-v"><code>-v</code></a> 2). See <a href="#the--v-alignment-mode">the -v alignment mode</a> section of the manual for details about that mode. <a href="#the--n-alignment-mode">The -n alignment mode</a> and <a href="#the--v-alignment-mode">the -v alignment mode</a> are mutually exclusive.</p>
<p>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.</p>
<p>If <code>bowtie</code> is too slow for your application, try some of the performance-tuning hints described in the <a href="#performance-tuning">Performance Tuning</a> section below.</p>
<p>Alignments involving one or more ambiguous reference characters (<code>N</code>, <code>-</code>, <code>R</code>, <code>Y</code>, 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 &quot;fall off&quot; the reference sequence are not considered valid.</p>
<p>The process by which <code>bowtie</code> chooses an alignment to report is randomized in order to avoid &quot;mapping bias&quot; - the phenomenon whereby an aligner systematically fails to report a particular class of good alignments, causing spurious &quot;holes&quot; in the comparative assembly. Whenever <code>bowtie</code> 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 &quot;seed&quot; value (see <a href="#bowtie-options-seed"><code>--seed</code></a> option).</p>
<p>In the default mode, <code>bowtie</code> 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, <code>bowtie</code> 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 overassign alignments to the sites on the strand with fewer sites and underassign 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 <a href="#bowtie-options-best"><code>--best</code></a> 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.</p>
<p>Gapped alignments are not currently supported in Bowtie, but they are supported in <a href="http://bowtie-bio.sourceforge.net/bowtie2">Bowtie 2</a>.</p>
<h2 id="the--n-alignment-mode">The <code>-n</code> alignment mode</h2>
<p>When the <a href="#bowtie-options-n"><code>-n</code></a> option is specified (which is the default), <code>bowtie</code> determines which alignments are valid according to the following policy, which is similar to <a href="http://maq.sf.net">Maq</a>'s default policy.</p>
<ol style="list-style-type: decimal">
<li><p>Alignments may have no more than <code>N</code> mismatches (where <code>N</code> is a number 0-3, set with <a href="#bowtie-options-n"><code>-n</code></a>) in the first <code>L</code> bases (where <code>L</code> is a number 5 or greater, set with <a href="#bowtie-options-l"><code>-l</code></a>) on the high-quality (left) end of the read. The first <code>L</code> bases are called the &quot;seed&quot;.</p></li>
<li><p>The sum of the <a href="http://en.wikipedia.org/wiki/FASTQ_format#Variations">Phred quality</a> values at <em>all</em> mismatched positions (not just in the seed) may not exceed <code>E</code> (set with <a href="#bowtie-options-e"><code>-e</code></a>). Where qualities are unavailable (e.g. if the reads are from a FASTA file), the <a href="http://en.wikipedia.org/wiki/FASTQ_format#Variations">Phred quality</a> defaults to 40.</p></li>
</ol>
<p>The <a href="#bowtie-options-n"><code>-n</code></a> option is mutually exclusive with the <a href="#bowtie-options-v"><code>-v</code></a> option.</p>
<p>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 <a href="#bowtie-options-best"><code>--best</code></a> option is specified, Bowtie guarantees the reported alignment(s) are &quot;best&quot; 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 <a href="#bowtie-options-best"><code>--best</code></a> is specified.</p>
<p>Note that <a href="http://maq.sf.net">Maq</a> 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 <a href="#bowtie-options-nomaqround"><code>--nomaqround</code></a> option.</p>
<p>Bowtie is not fully sensitive in <a href="#bowtie-options-n"><code>-n</code></a> 2 and <a href="#bowtie-options-n"><code>-n</code></a> 3 modes by default. In these modes Bowtie imposes a &quot;backtracking limit&quot; 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 <a href="#bowtie-options-best"><code>--best</code></a>, 800 with <a href="#bowtie-options-best"><code>--best</code></a>), but the user may decrease or increase the limit using the <a href="#bowtie-options-maxbts"><code>--maxbts</code></a> and/or <a href="#bowtie-options-y"><code>-y</code></a> options. <a href="#bowtie-options-y"><code>-y</code></a> mode is relatively slow but guarantees full sensitivity.</p>
<h2 id="the--v-alignment-mode">The <code>-v</code> alignment mode</h2>
<p>In <a href="#bowtie-options-v"><code>-v</code></a> mode, alignments may have no more than <code>V</code> mismatches, where <code>V</code> may be a number from 0 through 3 set using the <a href="#bowtie-options-v"><code>-v</code></a> option. Quality values are ignored. The <a href="#bowtie-options-v"><code>-v</code></a> option is mutually exclusive with the <a href="#bowtie-options-n"><code>-n</code></a> option.</p>
<p>If there are many legal alignments, Bowtie gives preference to alignments with fewer mismatches. When the <a href="#bowtie-options-best"><code>--best</code></a> option is specified, Bowtie guarantees the reported alignment(s) are &quot;best&quot; in terms of the number of mismatches, and that the alignments are reported in best-to-worst order. Bowtie is somewhat slower when <a href="#bowtie-options-best"><code>--best</code></a> is specified.</p>
<h2 id="strata">Strata</h2>
<p>In <a href="#the--n-alignment-mode">the -n alignment mode</a>, an alignment's &quot;stratum&quot; is defined as the number of mismatches in the &quot;seed&quot; region, i.e. the leftmost <code>L</code> bases, where <code>L</code> is set with the <a href="#bowtie-options-l"><code>-l</code></a> option. In <a href="#the--v-alignment-mode">the -v alignment mode</a>, an alignment's stratum is defined as the total number of mismatches in the entire alignment. Some of Bowtie's options (e.g. <a href="#bowtie-options-strata"><code>--strata</code></a> and <a href="#bowtie-options-m"><code>-m</code></a> use the notion of &quot;stratum&quot; to limit or expand the scope of reportable alignments.</p>
<h2 id="reporting-modes">Reporting Modes</h2>
<p>With the <a href="#bowtie-options-k"><code>-k</code></a>, <a href="#bowtie-options-a"><code>-a</code></a>, <a href="#bowtie-options-m"><code>-m</code></a>, <a href="#bowtie-options-m"><code>-M</code></a>, <a href="#bowtie-options-best"><code>--best</code></a> and <a href="#bowtie-options-strata"><code>--strata</code></a> options, the user can flexibily select which alignments are reported. Below we demonstrate a few ways in which these options can be combined. All examples are using the <code>e_coli</code> index packaged with Bowtie. The <a href="#bowtie-options-suppress"><code>--suppress</code></a> option is used to keep the output concise and some output is elided for clarity.</p>
<h3 id="example-1--a">Example 1: <code>-a</code></h3>
<pre><code>$ ./bowtie -a -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT
-   gi|110640213|ref|NC_008253.1|   148810  10:A&gt;G,13:C&gt;G
-   gi|110640213|ref|NC_008253.1|   2852852 8:T&gt;A
-   gi|110640213|ref|NC_008253.1|   4930433 4:G&gt;T,6:C&gt;G
-   gi|110640213|ref|NC_008253.1|   905664  6:A&gt;G,7:G&gt;T
+   gi|110640213|ref|NC_008253.1|   1093035 2:T&gt;G,15:A&gt;T</code></pre>
<p>Specifying <a href="#bowtie-options-a"><code>-a</code></a> instructs bowtie to report <em>all</em> valid alignments, subject to the alignment policy: <a href="#bowtie-options-v"><code>-v</code></a> 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.</p>
<h3 id="example-2--k-3">Example 2: <code>-k 3</code></h3>
<pre><code>$ ./bowtie -k 3 -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT
-   gi|110640213|ref|NC_008253.1|   148810  10:A&gt;G,13:C&gt;G
-   gi|110640213|ref|NC_008253.1|   2852852 8:T&gt;A
-   gi|110640213|ref|NC_008253.1|   4930433 4:G&gt;T,6:C&gt;G</code></pre>
<p>Specifying <a href="#bowtie-options-k"><code>-k</code></a> 3 instructs bowtie to report up to 3 valid alignments. In this case, a total of 5 valid alignments exist (see <a href="#example-1">Example 1</a>); <code>bowtie</code> reports 3 out of those 5. <a href="#bowtie-options-k"><code>-k</code></a> can be set to any integer greater than 0.</p>
<h3 id="example-3--k-6">Example 3: <code>-k 6</code></h3>
<pre><code>$ ./bowtie -k 6 -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT
-   gi|110640213|ref|NC_008253.1|   148810  10:A&gt;G,13:C&gt;G
-   gi|110640213|ref|NC_008253.1|   2852852 8:T&gt;A
-   gi|110640213|ref|NC_008253.1|   4930433 4:G&gt;T,6:C&gt;G
-   gi|110640213|ref|NC_008253.1|   905664  6:A&gt;G,7:G&gt;T
+   gi|110640213|ref|NC_008253.1|   1093035 2:T&gt;G,15:A&gt;T</code></pre>
<p>Specifying <a href="#bowtie-options-k"><code>-k</code></a> 6 instructs bowtie to report up to 6 valid alignments. In this case, a total of 5 valid alignments exist, so <code>bowtie</code> reports all 5.</p>
<h3 id="example-4-default--k-1">Example 4: default (<code>-k 1</code>)</h3>
<pre><code>$ ./bowtie -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT
-   gi|110640213|ref|NC_008253.1|   148810  10:A&gt;G,13:C&gt;G</code></pre>
<p>Leaving the reporting options at their defaults causes <code>bowtie</code> to report the first valid alignment it encounters. Because <a href="#bowtie-options-best"><code>--best</code></a> 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 <a href="#bowtie-options-k"><code>-k</code></a> 1.</p>
<h3 id="example-5--a---best">Example 5: <code>-a --best</code></h3>
<pre><code>$ ./bowtie -a --best -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT
-   gi|110640213|ref|NC_008253.1|   2852852 8:T&gt;A
+   gi|110640213|ref|NC_008253.1|   1093035 2:T&gt;G,15:A&gt;T
-   gi|110640213|ref|NC_008253.1|   905664  6:A&gt;G,7:G&gt;T
-   gi|110640213|ref|NC_008253.1|   148810  10:A&gt;G,13:C&gt;G
-   gi|110640213|ref|NC_008253.1|   4930433 4:G&gt;T,6:C&gt;G</code></pre>
<p>Specifying <a href="#bowtie-options-best"><code>-a</code></a> results in the same alignments being printed as if just <a href="#bowtie-options-a"><code>-a</code></a> had been specified, but they are guaranteed to be reported in best-to-worst order.</p>
<h3 id="example-6--a---best---strata">Example 6: <code>-a --best --strata</code></h3>
<pre><code>$ ./bowtie -a --best --strata -v 2 --suppress 1,5,6,7 e_coli -c ATGCATCATGCGCCAT
-   gi|110640213|ref|NC_008253.1|   2852852 8:T&gt;A</code></pre>
<p>Specifying <a href="#bowtie-options-strata"><code>--strata</code></a> in addition to <a href="#bowtie-options-a"><code>-a</code></a> and <a href="#bowtie-options-best"><code>--best</code></a> causes <code>bowtie</code> to report only those alignments in the best alignment &quot;stratum&quot;. The alignments in the best stratum are those having the least number of mismatches (or mismatches just in the &quot;seed&quot; portion of the alignment in the case of <a href="#bowtie-options-n"><code>-n</code></a> mode). Note that if <a href="#bowtie-options-strata"><code>--strata</code></a> is specified, <a href="#bowtie-options-best"><code>--best</code></a> must also be specified.</p>
<h3 id="example-7--a--m-3">Example 7: <code>-a -m 3</code></h3>
<pre><code>$ ./bowtie -a -m 3 -v 2 e_coli -c ATGCATCATGCGCCAT
No alignments</code></pre>
<p>Specifying <a href="#bowtie-options-m"><code>-m</code></a> 3 instructs bowtie to refrain from reporting any alignments for reads having more than 3 reportable alignments. The <a href="#bowtie-options-m"><code>-m</code></a> option is useful when the user would like to guarantee that reported alignments are &quot;unique&quot;, for some definition of unique.</p>
<p>Example 1 showed that the read has 5 reportable alignments when <a href="#bowtie-options-a"><code>-a</code></a> and <a href="#bowtie-options-v"><code>-v</code></a> 2 are specified, so the <a href="#bowtie-options-m"><code>-m</code></a> 3 limit causes bowtie to output no alignments.</p>
<h3 id="example-8--a--m-5">Example 8: <code>-a -m 5</code></h3>
<pre><code>$ ./bowtie -a -m 5 -v 2 e_coli --suppress 1,5,6,7 -c ATGCATCATGCGCCAT
-   gi|110640213|ref|NC_008253.1|   148810  10:A&gt;G,13:C&gt;G
-   gi|110640213|ref|NC_008253.1|   2852852 8:T&gt;A
-   gi|110640213|ref|NC_008253.1|   4930433 4:G&gt;T,6:C&gt;G
-   gi|110640213|ref|NC_008253.1|   905664  6:A&gt;G,7:G&gt;T
+   gi|110640213|ref|NC_008253.1|   1093035 2:T&gt;G,15:A&gt;T</code></pre>
<p>Specifying <a href="#bowtie-options-m"><code>-m</code></a> 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 <a href="#bowtie-options-m"><code>-m</code></a> 5 limit allows <code>bowtie</code> to print them as usual.</p>
<h3 id="example-9--a--m-3---best---strata">Example 9: <code>-a -m 3 --best --strata</code></h3>
<pre><code>$ ./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&gt;A</code></pre>
<p>Specifying <a href="#bowtie-options-m"><code>-m</code></a> 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 href="#bowtie-options-a"><code>-a</code></a>, <a href="#bowtie-options-best"><code>--best</code></a> and <a href="#bowtie-options-strata"><code>--strata</code></a> are specified, so the <a href="#bowtie-options-m"><code>-m</code></a> 3 limit allows <code>bowtie</code> to print that alignment as usual.</p>
<p>Intuitively, the <a href="#bowtie-options-m"><code>-m</code></a> option, when combined with the <a href="#bowtie-options-best"><code>--best</code></a> and <a href="#bowtie-options-strata"><code>--strata</code></a> options, guarantees a principled, though weaker form of &quot;uniqueness.&quot; A stronger form of uniqueness is enforced when <a href="#bowtie-options-m"><code>-m</code></a> is specified but <a href="#bowtie-options-best"><code>--best</code></a> and <a href="#bowtie-options-strata"><code>--strata</code></a> are not.</p>
<h2 id="paired-end-alignment">Paired-end Alignment</h2>
<p><code>bowtie</code> can align paired-end reads when properly paired read files are specified using the <a href="#command-line"><code>-1</code></a> and <a href="#command-line"><code>-2</code></a> options (for pairs of raw, FASTA, or FASTQ read files), or using the <a href="#command-line"><code>--12</code></a> option (for Tab-delimited read files). A valid paired-end alignment satisfies these criteria:</p>
<ol style="list-style-type: decimal">
<li>Both mates have a valid alignment according to the alignment policy defined by the <a href="#bowtie-options-v"><code>-v</code></a>/<a href="#bowtie-options-n"><code>-n</code></a>/<a href="#bowtie-options-e"><code>-e</code></a>/<a href="#bowtie-options-l"><code>-l</code></a> options.</li>
<li>The relative orientation and position of the mates satisfy the constraints defined by the <a href="#bowtie-options-I"><code>-I</code></a>/<a href="#bowtie-options-X"><code>-X</code></a>/<a href="#bowtie-options-fr"><code>--fr</code></a>/<a href="#bowtie-options-fr"><code>--rf</code></a>/<a href="#bowtie-options-fr"><code>--ff</code></a> options.</li>
</ol>
<p>Policies governing which paired-end alignments are reported for a given read are specified using the <a href="#bowtie-options-k"><code>-k</code></a>, <a href="#bowtie-options-a"><code>-a</code></a> and <a href="#bowtie-options-m"><code>-m</code></a> options as usual. The <a href="#bowtie-options-strata"><code>--strata</code></a> and <a href="#bowtie-options-best"><code>--best</code></a> options do not apply in paired-end mode.</p>
<p>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 &quot;upstream&quot; 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 <code>/1</code> or <code>/2</code> 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 <a href="#bowtie-options-S"><code>-S</code></a> &quot;SAM&quot; mode, where mate information is encoded in the <code>FLAGS</code> field instead).</p>
<p>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 &quot;tries&quot; it makes to match an alignment for one mate with a nearby alignment for the other. The default limit is 100. This causes <code>bowtie</code> to miss some valid paired-end alignments where both mates lie in repetitive regions, but the user may use the <a href="#bowtie-options-pairtries"><code>--pairtries</code></a> or <a href="#bowtie-options-y"><code>-y</code></a> options to increase Bowtie's sensitivity as desired.</p>
<p>Paired-end alignments where one mate's alignment is entirely contained within the other's are considered invalid.</p>
<p>When colospace alignment is enabled via <a href="#bowtie-options-C"><code>-C</code></a>, the default setting for paired-end orientation is <a href="#bowtie-options-fr"><code>--ff</code></a>. This is because most SOLiD datasets have that orientation. When colorspace alignment is not enabled (default), the default setting for orientation is <a href="#bowtie-options-fr"><code>--fr</code></a>, since most Illumina datasets have this orientation. The default can be overriden in either case.</p>
<p>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. Note that paired-end and unpaired alignment incur the same memory footprint in colorspace (e.g. human incurs about 2.9 GB)</p>
<h2 id="colorspace-alignment">Colorspace Alignment</h2>
<p>As of version 0.12.0, <code>bowtie</code> can align colorspace reads against a colorspace index when <a href="#bowtie-options-C"><code>-C</code></a> is specified. Colorspace is the characteristic output format of Applied Biosystems' SOLiD system. In a colorspace read, each character is a color rather than a nucleotide, where a color encodes a class of dinucleotides. E.g. the color blue encodes any of the dinucleotides: AA, CC, GG, TT. Colorspace has the advantage of (often) being able to distinguish sequencing errors from SNPs once the read has been aligned. See ABI's <a href="http://tinyurl.com/ygnb2gn">Principles of Di-Base Sequencing</a> document for details.</p>
<h3 id="colorspace-reads">Colorspace reads</h3>
<p>All input formats (FASTA <a href="#bowtie-options-f"><code>-f</code></a>, FASTQ <a href="#bowtie-options-Q"><code>-q</code></a>, raw <a href="#bowtie-options-r"><code>-r</code></a>, tab-delimited <a href="#command-line"><code>--12</code></a>, command-line <a href="#bowtie-options-C"><code>-c</code></a>) are compatible with colorspace (<a href="#bowtie-options-C"><code>-C</code></a>). When <a href="#bowtie-options-C"><code>-C</code></a> is specified, read sequences are treated as colors. Colors may be encoded either as numbers (<code>0</code>=blue, <code>1</code>=green, <code>2</code>=orange, <code>3</code>=red) or as characters <code>A/C/G/T</code> (<code>A</code>=blue, <code>C</code>=green, <code>G</code>=orange, <code>T</code>=red).</p>
<p>Some reads include a primer base as the first character; e.g.:</p>
<pre><code>&gt;1_53_33_F3
T2213120002010301233221223311331
&gt;1_53_70_F3
T2302111203131231130300111123220
...</code></pre>
<p>Here, <code>T</code> is the primer base. <code>bowtie</code> detects and handles primer bases properly (i.e., the primer base and the adjacent color are both trimmed away prior to alignment) as long as the rest of the read is encoded as numbers.</p>
<p><code>bowtie</code> also handles input in the form of parallel <code>.csfasta</code> and <code>_QV.qual</code> files. Use <a href="#bowtie-options-f"><code>-f</code></a> to specify the <code>.csfasta</code> files and <a href="#bowtie-options-Q"><code>-Q</code></a> (for unpaired reads) or <a href="#bowtie-options-Q1"><code>--Q1</code></a>/<a href="#bowtie-options-Q2"><code>--Q2</code></a> (for paired-end reads) to specify the corresponding <code>_QV.qual</code> files. It is not necessary to first convert to FASTQ, though <code>bowtie</code> also handles FASTQ-formatted colorspace reads (with <a href="#bowtie-options-Q"><code>-q</code></a>, the default).</p>
<h3 id="building-a-colorspace-index">Building a colorspace index</h3>
<p>A colorspace index is built in the same way as a normal index except that <a href="#bowtie-build-options-C"><code>-C</code></a> must be specified when running <code>bowtie-build</code>. If the user attempts to use <code>bowtie</code> without <a href="#bowtie-options-C"><code>-C</code></a> to align against an index that was built with <a href="#bowtie-options-C"><code>-C</code></a> (or vice versa), <code>bowtie</code> prints an error message and quits.</p>
<h3 id="decoding-colorspace-alignments">Decoding colorspace alignments</h3>
<p>Once a colorspace read is aligned, Bowtie decodes the alignment into nucleotides and reports the decoded nucleotide sequence. A principled decoding scheme is necessary because many different possible decodings are usually possible. Finding the true decoding with 100% certainty requires knowing all variants (e.g. SNPs) in the subject's genome beforehand, which is usually not possible. Instead, <code>bowtie</code> employs the approximate decoding scheme described in the <a href="http://bioinformatics.oxfordjournals.org/cgi/content/abstract/25/14/1754">BWA paper</a>. This scheme attempts to distinguish variants from sequencing errors according to their relative likelihood under a model that considers the quality values of the colors and the (configurable) global likelihood of a SNP.</p>
<p>Quality values are also &quot;decoded&quot; so that each reported quality value is a function of the two color qualities overlapping it. Bowtie again adopts the scheme described in the <a href="http://bioinformatics.oxfordjournals.org/cgi/content/abstract/25/14/1754">BWA paper</a>, i.e., the decoded nucleotide quality is either the sum of the overlapping color qualities (when both overlapping colors correspond to bases that match in the alignment), the quality of the matching color minus the quality of the mismatching color, or 0 (when both overlapping colors correspond to mismatches).</p>
<p>For accurate decoding, <a href="#bowtie-options-snpphred"><code>--snpphred</code></a>/<a href="#bowtie-options-snpfrac"><code>--snpfrac</code></a> should be set according to the user's best guess of the SNP frequency in the subject. The <a href="#bowtie-options-snpphred"><code>--snpphred</code></a> parameter sets the SNP penalty directly (on the <a href="http://en.wikipedia.org/wiki/FASTQ_format#Variations">Phred quality</a> scale), whereas <a href="#bowtie-options-snpfrac"><code>--snpfrac</code></a> allows the user to specify the fraction of sites expected to be SNPs; the fraction is then converted to a <a href="http://en.wikipedia.org/wiki/FASTQ_format#Variations">Phred quality</a> internally. For the purpose of decoding, the SNP fraction is defined in terms of SNPs per <em>haplotype</em> base. Thus, if the genome is diploid, heterozygous SNPs have half the weight of homozygous SNPs</p>
<p>Note that in <a href="#bowtie-options-S"><code>-S</code>/<code>--sam</code></a> mode, the decoded nucleotide sequence is printed for alignments, but the original color sequence (with <code>A</code>=blue, <code>C</code>=green, <code>G</code>=orange, <code>T</code>=red) is printed for unaligned reads without any reported alignments. As always, the <a href="#bowtie-options-un"><code>--un</code></a>, <a href="#bowtie-options-max"><code>--max</code></a> and <a href="#bowtie-options-al"><code>--al</code></a> parameters print reads exactly as they appeared in the input file.</p>
<h3 id="paired-end-colorspace-alignment">Paired-end colorspace alignment</h3>
<p>Like other platforms, SOLiD supports generation of paired-end reads. When colorspace alignment is enabled, the default paired-end orientation setting is <a href="#bowtie-options-fr"><code>--ff</code></a>. This is because most SOLiD datasets have that orientation.</p>
<p>Note that SOLiD-generated read files can have &quot;orphaned&quot; mates; i.e. mates without a correpsondingly-named mate in the other file. To avoid problems due to orphaned mates, SOLiD paired-end output should first be converted to <code>.csfastq</code> files with unpaired mates omitted. This can be accomplished using, for example, [Galaxy]'s conversion tool (click &quot;NGS: QC and manipulation&quot;, then &quot;SOLiD-to-FASTQ&quot; in the left-hand sidebar).</p>
<h2 id="wrapper-scripts">Wrapper scripts</h2>
<p>The <code>bowtie</code>, <code>bowtie-build</code> and <code>bowtie-inspect</code> executables are actually wrapper scripts that call binary programs as appropriate. The wrappers shield users from having to distinguish between &quot;small&quot; and &quot;large&quot; index formats, discussed briefly in the following section. The appropriate index type is selected based on the input size.</p>
<p>It is recommended that you always run the bowtie wrappers and not run the binaries directly.</p>
<h2 id="small-and-large-indexes">Small and large indexes</h2>
<p><code>bowtie-build</code> can index reference genomes of any size. For genomes less than about 4 billion nucleotides in length, <code>bowtie-build</code> builds a &quot;small&quot; index using 32-bit numbers in various parts of the index. When the genome is longer, <code>bowtie-build</code> builds a &quot;large&quot; index using 64-bit numbers. Small indexes are stored in files with the <code>.ebwt</code> extension, and large indexes are stored in files with the <code>.ebwtl</code> 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.</p>
<h2 id="performance-tuning">Performance Tuning</h2>
<ol style="list-style-type: decimal">
<li><p>If your computer has multiple processors/cores, use <code>-p</code></p>
<p>The <a href="#bowtie-options-p"><code>-p</code></a> option causes Bowtie to launch a specified number of parallel search threads. Each thread runs on a different processor/core and all threads find alignments in parallel, increasing alignment throughput by approximately a multiple of the number of threads (though in practice, speedup is somewhat worse than linear).</p></li>
<li><p>If using <code>-p</code>, use the Threading Building Blocks library if possible</p>
<p>In our experiments, we find the Threading Building Blocks (TBB) library gives the best thread scaling. TBB is disabled by default but it can be enabled by building from source using <code>make WITH_TBB=1</code>.</p></li>
<li><p>If reporting many alignments per read, try tweaking <code>bowtie-build --offrate</code></p>
<p>If you are using the <a href="#bowtie-options-k"><code>-k</code></a>, <a href="#bowtie-options-a"><code>-a</code></a> or <a href="#bowtie-options-m"><code>-m</code></a> 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.</p>
<p>To do this, specify a smaller-than-default <a href="#bowtie-build-options-o"><code>-o</code>/<code>--offrate</code></a> value when running <code>bowtie-build</code>. 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 <a href="#bowtie-build-options-o"><code>-o</code>/<code>--offrate</code></a> by 1 could as much as double alignment performance, and decreasing by 2 could quadruple alignment performance, etc.</p>
<p>On the other hand, decreasing <a href="#bowtie-build-options-o"><code>-o</code>/<code>--offrate</code></a> increases the size of the Bowtie index, both on disk and in memory when aligning reads. At the default <a href="#bowtie-build-options-o"><code>-o</code>/<code>--offrate</code></a> of 5, the SA sample for the human genome occupies about 375 MB of memory when aligning reads. Decreasing the <a href="#bowtie-build-options-o"><code>-o</code>/<code>--offrate</code></a> by 1 doubles the memory taken by the SA sample, and decreasing by 2 quadruples the memory taken, etc.</p></li>
<li><p>If bowtie &quot;thrashes&quot;, try increasing <code>bowtie --offrate</code></p>
<p>If <code>bowtie</code> runs very slow on a relatively low-memory machine (having less than about 4 GB of memory), then try setting <code>bowtie</code> <a href="#bowtie-options-o"><code>-o</code>/<code>--offrate</code></a> to a <em>larger</em> value than the value used to build the index. For example, <code>bowtie-build</code>'s default <a href="#bowtie-build-options-o"><code>-o</code>/<code>--offrate</code></a> is 5 and all pre-built indexes available from the Bowtie website are built with <a href="#bowtie-build-options-o"><code>-o</code>/<code>--offrate</code></a> 5; so if <code>bowtie</code> thrashes when querying such an index, try using <code>bowtie</code> <a href="#bowtie-options-o"><code>--offrate</code></a> 6. If <code>bowtie</code> still thrashes, try <code>bowtie</code> <a href="#bowtie-options-o"><code>--offrate</code></a> 7, etc. A higher <a href="#bowtie-options-o"><code>-o</code>/<code>--offrate</code></a> causes <code>bowtie</code> 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 href="#bowtie-options-a"><code>-a</code></a> or large <a href="#bowtie-options-k"><code>-k</code></a> or <a href="#bowtie-options-m"><code>-m</code></a>).</p></li>
</ol>
<h2 id="command-line">Command Line</h2>
<p>Usage:</p>
<pre><code>bowtie [options]* &lt;ebwt&gt; {-1 &lt;m1&gt; -2 &lt;m2&gt; | --12 &lt;r&gt; | &lt;s&gt;} [&lt;hit&gt;]</code></pre>
<h3 id="main-arguments">Main arguments</h3>
<table><tr><td>

<pre><code>&lt;ebwt&gt;</code></pre>
</td><td>

<p>The basename of the index to be searched. The basename is the name of any of the index files up to but not including the final <code>.1.ebwt</code> / <code>.rev.1.ebwt</code> / etc. <code>bowtie</code> looks for the specified index first in the current directory, then in the <code>indexes</code> subdirectory under the directory where the <code>bowtie</code> executable is located, then looks in the directory specified in the <code>BOWTIE_INDEXES</code> environment variable.</p>
</td></tr><tr><td>

<pre><code>&lt;m1&gt;</code></pre>
</td><td>

<p>Comma-separated list of files containing the #1 mates (filename usually includes <code>_1</code>), or, if <a href="#bowtie-options-C"><code>-c</code></a> is specified, the mate sequences themselves. E.g., this might be <code>flyA_1.fq,flyB_1.fq</code>, or, if <a href="#bowtie-options-C"><code>-c</code></a> is specified, this might be <code>GGTCATCCT,ACGGGTCGT</code>. Sequences specified with this option must correspond file-for-file and read-for-read with those specified in <code>&lt;m2&gt;</code>. Reads may be a mix of different lengths. If <code>-</code> is specified, <code>bowtie</code> will read the #1 mates from the &quot;standard in&quot; filehandle.</p>
</td></tr><tr><td>

<pre><code>&lt;m2&gt;</code></pre>
</td><td>

<p>Comma-separated list of files containing the #2 mates (filename usually includes <code>_2</code>), or, if <a href="#bowtie-options-C"><code>-c</code></a> is specified, the mate sequences themselves. E.g., this might be <code>flyA_2.fq,flyB_2.fq</code>, or, if <a href="#bowtie-options-C"><code>-c</code></a> is specified, this might be <code>GGTCATCCT,ACGGGTCGT</code>. Sequences specified with this option must correspond file-for-file and read-for-read with those specified in <code>&lt;m1&gt;</code>. Reads may be a mix of different lengths. If <code>-</code> is specified, <code>bowtie</code> will read the #2 mates from the &quot;standard in&quot; filehandle.</p>
</td></tr><tr><td>

<pre><code>&lt;r&gt;</code></pre>
</td><td>

<p>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, sequnce 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 <code>-</code> is specified, <code>bowtie</code> will read the Tab-delimited reads from the &quot;standard in&quot; filehandle.</p>
</td></tr><tr><td>

<pre><code>&lt;s&gt;</code></pre>
</td><td>

<p>A comma-separated list of files containing unpaired reads to be aligned, or, if <a href="#bowtie-options-C"><code>-c</code></a> is specified, the unpaired read sequences themselves. E.g., this might be <code>lane1.fq,lane2.fq,lane3.fq,lane4.fq</code>, or, if <a href="#bowtie-options-C"><code>-c</code></a> is specified, this might be <code>GGTCATCCT,ACGGGTCGT</code>. Reads may be a mix of different lengths. If <code>-</code> is specified, Bowtie gets the reads from the &quot;standard in&quot; filehandle.</p>
</td></tr><tr><td>

<pre><code>&lt;hit&gt;</code></pre>
</td><td>

<p>File to write alignments to. By default, alignments are written to the &quot;standard out&quot; filehandle (i.e. the console).</p>
</td></tr></table>

<h3 id="options">Options</h3>
<h4 id="input">Input</h4>
<table>
<tr><td id="bowtie-options-q">

<pre><code>-q</code></pre>
</td><td>

<p>The query input files (specified either as <code>&lt;m1&gt;</code> and <code>&lt;m2&gt;</code>, or as <code>&lt;s&gt;</code>) are FASTQ files (usually having extension <code>.fq</code> or <code>.fastq</code>). This is the default. See also: <a href="#bowtie-options-solexa-quals"><code>--solexa-quals</code></a> and <a href="#bowtie-options-integer-quals"><code>--integer-quals</code></a>.</p>
</td></tr><tr><td id="bowtie-options-f">

<pre><code>-f</code></pre>
</td><td>

<p>The query input files (specified either as <code>&lt;m1&gt;</code> and <code>&lt;m2&gt;</code>, or as <code>&lt;s&gt;</code>) are FASTA files (usually having extension <code>.fa</code>, <code>.mfa</code>, <code>.fna</code> or similar). All quality values are assumed to be 40 on the <a href="http://en.wikipedia.org/wiki/FASTQ_format#Variations">Phred quality</a> scale.</p>
</td></tr><tr><td id="bowtie-options-r">

<pre><code>-r</code></pre>
</td><td>

<p>The query input files (specified either as <code>&lt;m1&gt;</code> and <code>&lt;m2&gt;</code>, or as <code>&lt;s&gt;</code>) are Raw files: one sequence per line, without quality values or names. All quality values are assumed to be 40 on the <a href="http://en.wikipedia.org/wiki/FASTQ_format#Variations">Phred quality</a> scale.</p>
</td></tr><tr><td id="bowtie-options-c">

<pre><code>-c</code></pre>
</td><td>

<p>The query sequences are given on command line. I.e. <code>&lt;m1&gt;</code>, <code>&lt;m2&gt;</code> and <code>&lt;singles&gt;</code> are comma-separated lists of reads rather than lists of read files.</p>
</td></tr><tr><td id="bowtie-options-C">

<pre><code>-C/--color</code></pre>
</td><td>

<p>Align in colorspace. Read characters are interpreted as colors. The index specified must be a colorspace index (i.e. built with <code>bowtie-build</code> <a href="#bowtie-build-options-C"><code>-C</code></a>, or <code>bowtie</code> will print an error message and quit. See <a href="#colorspace-alignment">Colorspace alignment</a> for more details.</p>
</td></tr><tr><td id="bowtie-options-Q">

<pre><code>-Q/--quals &lt;files&gt;</code></pre>
</td><td>

<p>Comma-separated list of files containing quality values for corresponding unpaired CSFASTA reads. Use in combination with <a href="#bowtie-options-C"><code>-C</code></a> and <a href="#bowtie-options-f"><code>-f</code></a>. <a href="#bowtie-options-integer-quals"><code>--integer-quals</code></a> is set automatically when <code>-Q</code>/<code>--quals</code> is specified.</p>
</td></tr><tr><td id="bowtie-options-Q1">

<pre><code>--Q1 &lt;files&gt;</code></pre>
</td><td>

<p>Comma-separated list of files containing quality values for corresponding CSFASTA #1 mates. Use in combination with <a href="#bowtie-options-C"><code>-C</code></a>, <a href="#bowtie-options-f"><code>-f</code></a>, and <a href="#command-line"><code>-1</code></a>. <a href="#bowtie-options-integer-quals"><code>--integer-quals</code></a> is set automatically when <code>--Q1</code> is specified.</p>
</td></tr><tr><td id="bowtie-options-Q2">

<pre><code>--Q2 &lt;files&gt;</code></pre>
</td><td>

<p>Comma-separated list of files containing quality values for corresponding CSFASTA #2 mates. Use in combination with <a href="#bowtie-options-C"><code>-C</code></a>, <a href="#bowtie-options-f"><code>-f</code></a>, and <a href="#command-line"><code>-2</code></a>. <a href="#bowtie-options-integer-quals"><code>--integer-quals</code></a> is set automatically when <code>--Q2</code> is specified.</p>
</td></tr><tr><td id="bowtie-options-s">

<pre><code>-s/--skip &lt;int&gt;</code></pre>
</td><td>

<p>Skip (i.e. do not align) the first <code>&lt;int&gt;</code> reads or pairs in the input.</p>
</td></tr><tr><td id="bowtie-options-u">

<pre><code>-u/--qupto &lt;int&gt;</code></pre>
</td><td>

<p>Only align the first <code>&lt;int&gt;</code> reads or read pairs from the input (after the <a href="#bowtie-options-s"><code>-s</code>/<code>--skip</code></a> reads or pairs have been skipped). Default: no limit.</p>
</td></tr><tr><td id="bowtie-options-5">

<pre><code>-5/--trim5 &lt;int&gt;</code></pre>
</td><td>

<p>Trim <code>&lt;int&gt;</code> bases from high-quality (left) end of each read before alignment (default: 0).</p>
</td></tr><tr><td id="bowtie-options-3">

<pre><code>-3/--trim3 &lt;int&gt;</code></pre>
</td><td>

<p>Trim <code>&lt;int&gt;</code> bases from low-quality (right) end of each read before alignment (default: 0).</p>
</td></tr><tr><td id="bowtie-options-phred33-quals">

<pre><code>--phred33-quals</code></pre>
</td><td>

<p>Input qualities are ASCII chars equal to the <a href="http://en.wikipedia.org/wiki/FASTQ_format#Variations">Phred quality</a> plus 33. Default: on.</p>
</td></tr><tr><td id="bowtie-options-phred64-quals">

<pre><code>--phred64-quals</code></pre>
</td><td>

<p>Input qualities are ASCII chars equal to the <a href="http://en.wikipedia.org/wiki/FASTQ_format#Variations">Phred quality</a> plus 64. Default: off.</p>
</td></tr><tr><td id="bowtie-options-solexa-quals">

<pre><code>--solexa-quals</code></pre>
</td><td>

<p>Convert input qualities from <a href="http://en.wikipedia.org/wiki/FASTQ_format#Variations">Solexa</a> (which can be negative) to <a href="http://en.wikipedia.org/wiki/FASTQ_format#Variations">Phred</a> (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.</p>
</td></tr><tr><td id="bowtie-options-solexa1.3-quals">

<pre><code>--solexa1.3-quals</code></pre>
</td><td>

<p>Same as <a href="#bowtie-options-phred64-quals"><code>--phred64-quals</code></a>. This is usually the right option for use with (unconverted) reads emitted by GA Pipeline version 1.3 or later. Default: off.</p>
</td></tr><tr><td id="bowtie-options-integer-quals">

<pre><code>--integer-quals</code></pre>
</td><td>

<p>Quality values are represented in the read input file as space-separated ASCII integers, e.g., <code>40 40 30 40</code>..., rather than ASCII characters, e.g., <code>II?I</code>.... Integers are treated as being on the <a href="http://en.wikipedia.org/wiki/FASTQ_format#Variations">Phred quality</a> scale unless <a href="#bowtie-options-solexa-quals"><code>--solexa-quals</code></a> is also specified. Default: off.</p>
</td></tr><tr><td id="bowtie-options-large-index">

<pre><code>--large-index</code></pre>
</td><td>

<p>Force usage of a 'large' index (those ending in '.ebwtl'), even if a small one is present. Default: off.</p>
</td></tr></table>

<h4 id="alignment">Alignment</h4>
<table>

<tr><td id="bowtie-options-v">

<pre><code>-v &lt;int&gt;</code></pre>
</td><td>

<p>Report alignments with at most <code>&lt;int&gt;</code> mismatches. <a href="#bowtie-options-e"><code>-e</code></a> and <a href="#bowtie-options-l"><code>-l</code></a> options are ignored and quality values have no effect on what alignments are valid. <a href="#bowtie-options-v"><code>-v</code></a> is mutually exclusive with <a href="#bowtie-options-n"><code>-n</code></a>.</p>
</td></tr><tr><td id="bowtie-options-n">

<pre><code>-n/--seedmms &lt;int&gt;</code></pre>
</td><td>

<p>Maximum number of mismatches permitted in the &quot;seed&quot;, i.e. the first <code>L</code> base pairs of the read (where <code>L</code> is set with <a href="#bowtie-options-l"><code>-l</code>/<code>--seedlen</code></a>). This may be 0, 1, 2 or 3 and the default is 2. This option is mutually exclusive with the <a href="#bowtie-options-v"><code>-v</code></a> option.</p>
</td></tr><tr><td id="bowtie-options-e">

<pre><code>-e/--maqerr &lt;int&gt;</code></pre>
</td><td>

<p>Maximum permitted total of quality values at <em>all</em> mismatched read positions throughout the entire alignment, not just in the &quot;seed&quot;. The default is 70. Like <a href="http://maq.sf.net">Maq</a>, <code>bowtie</code> rounds quality values to the nearest 10 and saturates at 30; rounding can be disabled with <a href="#bowtie-options-nomaqround"><code>--nomaqround</code></a>.</p>
</td></tr><tr><td id="bowtie-options-l">

<pre><code>-l/--seedlen &lt;int&gt;</code></pre>
</td><td>

<p>The &quot;seed length&quot;; i.e., the number of bases on the high-quality end of the read to which the <a href="#bowtie-options-n"><code>-n</code></a> ceiling applies. The lowest permitted setting is 5 and the default is 28. <code>bowtie</code> is faster for larger values of <a href="#bowtie-options-l"><code>-l</code></a>.</p>
</td></tr><tr><td id="bowtie-options-nomaqround">

<pre><code>--nomaqround</code></pre>
</td><td>

<p><a href="http://maq.sf.net">Maq</a> accepts quality values in the <a href="http://en.wikipedia.org/wiki/FASTQ_format#Variations">Phred quality</a> scale, but internally rounds values to the nearest 10, with a maximum of 30. By default, <code>bowtie</code> also rounds this way. <a href="#bowtie-options-nomaqround"><code>--nomaqround</code></a> prevents this rounding in <code>bowtie</code>.</p>
</td></tr><tr><td id="bowtie-options-I">

<pre><code>-I/--minins &lt;int&gt;</code></pre>
</td><td>

<p>The minimum insert size for valid paired-end alignments. E.g. if <code>-I 60</code> 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 <a href="#bowtie-options-X"><code>-X</code></a> is also satisfied). A 19-bp gap would not be valid in that case. If trimming options <a href="#bowtie-options-3"><code>-3</code></a> or <a href="#bowtie-options-5"><code>-5</code></a> are also used, the <a href="#bowtie-options-I"><code>-I</code></a> constraint is applied with respect to the untrimmed mates. Default: 0.</p>
</td></tr><tr><td id="bowtie-options-X">

<pre><code>-X/--maxins &lt;int&gt;</code></pre>
</td><td>

<p>The maximum insert size for valid paired-end alignments. E.g. if <code>-X 100</code> 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 <a href="#bowtie-options-I"><code>-I</code></a> is also satisfied). A 61-bp gap would not be valid in that case. If trimming options <a href="#bowtie-options-3"><code>-3</code></a> or <a href="#bowtie-options-5"><code>-5</code></a> are also used, the <code>-X</code> constraint is applied with respect to the untrimmed mates, not the trimmed mates. Default: 250.</p>
</td></tr><tr><td id="bowtie-options-fr">

<pre><code>--fr/--rf/--ff</code></pre>
</td><td>

<p>The upstream/downstream mate orientations for a valid paired-end alignment against the forward reference strand. E.g., if <code>--fr</code> 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. <code>--rf</code> likewise requires that an upstream mate1 be reverse-complemented and a downstream mate2 be forward-oriented. <code>--ff</code> requires both an upstream mate1 and a downstream mate2 to be forward-oriented. Default: <code>--fr</code> when <a href="#bowtie-options-C"><code>-C</code></a> (colorspace alignment) is not specified, <code>--ff</code> when <a href="#bowtie-options-C"><code>-C</code></a> is specified.</p>
</td></tr><tr><td id="bowtie-options-nofw">

<pre><code>--nofw/--norc</code></pre>
</td><td>

<p>If <code>--nofw</code> is specified, <code>bowtie</code> will not attempt to align against the forward reference strand. If <code>--norc</code> is specified, <code>bowtie</code> will not attempt to align against the reverse-complement reference strand. For paired-end reads using <a href="#bowtie-options-fr"><code>--fr</code></a> or <a href="#bowtie-options-fr"><code>--rf</code></a> modes, <code>--nofw</code> and <code>--norc</code> apply to the forward and reverse-complement pair orientations. I.e. specifying <code>--nofw</code> and <a href="#bowtie-options-fr"><code>--fr</code></a> will only find reads in the R/F orientation where mate 2 occurs upstream of mate 1 with respect to the forward reference strand.</p>
</td></tr><tr><td id="bowtie-options-maxbts">

<pre><code>--maxbts</code></pre>
</td><td>

<p>The maximum number of backtracks permitted when aligning a read in <a href="#bowtie-options-n"><code>-n</code></a> 2 or <a href="#bowtie-options-n"><code>-n</code></a> 3 mode (default: 125 without <a href="#bowtie-options-best"><code>--best</code></a>, 800 with <a href="#bowtie-options-best"><code>--best</code></a>). A &quot;backtrack&quot; is the introduction of a speculative substitution into the alignment. Without this limit, the default parameters will sometimes require that <code>bowtie</code> 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: <a href="#bowtie-options-y"><code>-y</code>/<code>--tryhard</code></a>.</p>
</td></tr><tr><td id="bowtie-options-pairtries">

<pre><code>--pairtries &lt;int&gt;</code></pre>
</td><td>

<p>For paired-end alignment, this is the maximum number of attempts <code>bowtie</code> 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 <code>bowtie</code> to find more paired- end alignments for repetitive pairs at the expense of speed. The default is 100. See also: <a href="#bowtie-options-y"><code>-y</code>/<code>--tryhard</code></a>.</p>
</td></tr><tr><td id="bowtie-options-y">

<pre><code>-y/--tryhard</code></pre>
</td><td>

<p>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 <a href="#bowtie-options-maxbts"><code>--maxbts</code></a> and <a href="#bowtie-options-pairtries"><code>--pairtries</code></a> 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.</p>
</td></tr><tr><td id="bowtie-options-chunkmbs">

<pre><code>--chunkmbs &lt;int&gt;</code></pre>
</td><td>

<p>The number of megabytes of memory a given thread is given to store path descriptors in <a href="#bowtie-options-best"><code>--best</code></a> 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 <a href="#bowtie-options-best"><code>--best</code></a> mode, try adjusting this parameter up to dedicate more memory to the descriptors. Default: 64.</p>
</td></tr></table>

<h4 id="reporting">Reporting</h4>
<table><tr><td id="bowtie-options-k">

<pre><code>-k &lt;int&gt;</code></pre>
</td><td>

<p>Report up to <code>&lt;int&gt;</code> valid alignments per read or pair (default: 1). Validity of alignments is determined by the alignment policy (combined effects of <a href="#bowtie-options-n"><code>-n</code></a>, <a href="#bowtie-options-v"><code>-v</code></a>, <a href="#bowtie-options-l"><code>-l</code></a>, and <a href="#bowtie-options-e"><code>-e</code></a>). If more than one valid alignment exists and the <a href="#bowtie-options-best"><code>--best</code></a> and <a href="#bowtie-options-strata"><code>--strata</code></a> options are specified, then only those alignments belonging to the best alignment &quot;stratum&quot; will be reported. Bowtie is designed to be very fast for small <a href="#bowtie-options-k"><code>-k</code></a> but bowtie can become significantly slower as <a href="#bowtie-options-k"><code>-k</code></a> increases. If you would like to use Bowtie for larger values of <a href="#bowtie-options-k"><code>-k</code></a>, consider building an index with a denser suffix-array sample, i.e. specify a smaller <a href="#bowtie-build-options-o"><code>-o</code>/<code>--offrate</code></a> when invoking <code>bowtie-build</code> for the relevant index (see the <a href="#performance-tuning">Performance tuning</a> section for details).</p>
</td></tr><tr><td id="bowtie-options-a">

<pre><code>-a/--all</code></pre>
</td><td>

<p>Report all valid alignments per read or pair (default: off). Validity of alignments is determined by the alignment policy (combined effects of <a href="#bowtie-options-n"><code>-n</code></a>, <a href="#bowtie-options-v"><code>-v</code></a>, <a href="#bowtie-options-l"><code>-l</code></a>, and <a href="#bowtie-options-e"><code>-e</code></a>). If more than one valid alignment exists and the <a href="#bowtie-options-best"><code>--best</code></a> and <a href="#bowtie-options-strata"><code>--strata</code></a> options are specified, then only those alignments belonging to the best alignment &quot;stratum&quot; will be reported. Bowtie is designed to be very fast for small <a href="#bowtie-options-k"><code>-k</code></a> but bowtie can become significantly slower if <a href="#bowtie-options-a"><code>-a</code>/<code>--all</code></a> is specified. If you would like to use Bowtie with <a href="#bowtie-options-a"><code>-a</code></a>, consider building an index with a denser suffix-array sample, i.e. specify a smaller <a href="#bowtie-build-options-o"><code>-o</code>/<code>--offrate</code></a> when invoking <code>bowtie-build</code> for the relevant index (see the <a href="#performance-tuning">Performance tuning</a> section for details).</p>
</td></tr><tr><td id="bowtie-options-m">

<pre><code>-m &lt;int&gt;</code></pre>
</td><td>

<p>Suppress all alignments for a particular read or pair if more than <code>&lt;int&gt;</code> reportable alignments exist for it. Reportable alignments are those that would be reported given the <a href="#bowtie-options-n"><code>-n</code></a>, <a href="#bowtie-options-v"><code>-v</code></a>, <a href="#bowtie-options-l"><code>-l</code></a>, <a href="#bowtie-options-e"><code>-e</code></a>, <a href="#bowtie-options-k"><code>-k</code></a>, <a href="#bowtie-options-a"><code>-a</code></a>, <a href="#bowtie-options-best"><code>--best</code></a>, and <a href="#bowtie-options-strata"><code>--strata</code></a> options. Default: no limit. Bowtie is designed to be very fast for small <a href="#bowtie-options-m"><code>-m</code></a> but bowtie can become significantly slower for larger values of <a href="#bowtie-options-m"><code>-m</code></a>. If you would like to use Bowtie for larger values of <a href="#bowtie-options-k"><code>-k</code></a>, consider building an index with a denser suffix-array sample, i.e. specify a smaller <a href="#bowtie-build-options-o"><code>-o</code>/<code>--offrate</code></a> when invoking <code>bowtie-build</code> for the relevant index (see the <a href="#performance-tuning">Performance tuning</a> section for details).</p>
</td></tr><tr><td id="bowtie-options-M">

<pre><code>-M &lt;int&gt;</code></pre>
</td><td>

<p>Behaves like <a href="#bowtie-options-m"><code>-m</code></a> except that if a read has more than <code>&lt;int&gt;</code> reportable alignments, one is reported at random. In <a href="#default-bowtie-output">default output mode</a>, the selected alignment's 7th column is set to <code>&lt;int&gt;</code>+1 to indicate the read has at least <code>&lt;int&gt;</code>+1 valid alignments. In <a href="#bowtie-options-S"><code>-S</code>/<code>--sam</code></a> mode, the selected alignment is given a <code>MAPQ</code> (mapping quality) of 0 and the <code>XM:I</code> field is set to <code>&lt;int&gt;</code>+1. This option requires <a href="#bowtie-options-best"><code>--best</code></a>; if specified without <a href="#bowtie-options-best"><code>--best</code></a>, <a href="#bowtie-options-best"><code>--best</code></a> is enabled automatically.</p>
</td></tr><tr><td id="bowtie-options-best">

<pre><code>--best</code></pre>
</td><td>

<p>Make Bowtie guarantee that reported singleton alignments are &quot;best&quot; in terms of stratum (i.e. number of mismatches, or mismatches in the seed in the case of <a href="#bowtie-options-n"><code>-n</code></a> 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 <a href="http://en.wikipedia.org/wiki/FASTQ_format#Variations">Phred quality</a> 40 is preferred over a 2-mismatch alignment where the mismatched positions both have <a href="http://en.wikipedia.org/wiki/FASTQ_format#Variations">Phred quality</a> 10. When <a href="#bowtie-options-best"><code>--best</code></a> 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). <a href="#bowtie-options-best"><code>--best</code></a> mode also removes all strand bias. Note that <a href="#bowtie-options-best"><code>--best</code></a> does not affect which alignments are considered &quot;valid&quot; by <code>bowtie</code>, only which valid alignments are reported by <code>bowtie</code>. When <a href="#bowtie-options-best"><code>--best</code></a> is specified and multiple hits are allowed (via <a href="#bowtie-options-k"><code>-k</code></a> or <a href="#bowtie-options-a"><code>-a</code></a>), the alignments for a given read are guaranteed to appear in best-to-worst order in <code>bowtie</code>'s output. <code>bowtie</code> is somewhat slower when <a href="#bowtie-options-best"><code>--best</code></a> is specified.</p>
</td></tr><tr><td id="bowtie-options-strata">

<pre><code>--strata</code></pre>
</td><td>

<p>If many valid alignments exist and are reportable (e.g. are not disallowed via the <a href="#bowtie-options-k"><code>-k</code></a> option) and they fall into more than one alignment &quot;stratum&quot;, 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 <a href="#bowtie-options-strata"><code>--strata</code></a> is specified, <a href="#bowtie-options-best"><code>--best</code></a> must also be specified.</p>
</td></tr>
</table>

<h4 id="output">Output</h4>
<table>

<tr><td id="bowtie-options-t">

<pre><code>-t/--time</code></pre>
</td><td>

<p>Print the amount of wall-clock time taken by each phase.</p>
</td></tr><tr><td  id="bowtie-options-B">

<pre><code>-B/--offbase &lt;int&gt;</code></pre>
</td><td>

<p>When outputting alignments in Bowtie format, consider the first base of a reference sequence to have offset <code>&lt;int&gt;</code>. This option has no effect in <a href="#bowtie-options-S"><code>-S</code>/<code>--sam</code></a> mode, since SAM mandates 1-based offsets. Default: 0.</p>
</td></tr><tr><td id="bowtie-options-quiet">

<pre><code>--quiet</code></pre>
</td><td>

<p>Print nothing besides alignments.</p>
</td></tr><tr><td id="bowtie-options-refout">

<pre><code>--refout</code></pre>
</td><td>

<p>Write alignments to a set of files named <code>refXXXXX.map</code>, where <code>XXXXX</code> is the 0-padded index of the reference sequence aligned to. This can be a useful way to break up work for downstream analyses when dealing with, for example, large numbers of reads aligned to the assembled human genome. If <code>&lt;hits&gt;</code> is also specified, it will be ignored.</p>
</td></tr><tr><td id="bowtie-options-refidx">

<pre><code>--refidx</code></pre>
</td><td>

<p>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.</p>
</td></tr><tr><td id="bowtie-options-al">

<pre><code>--al &lt;filename&gt;</code></pre>
</td><td>

<p>Write all reads for which at least one alignment was reported to a file with name <code>&lt;filename&gt;</code>. 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 <code>bowtie</code>. Paired-end reads will be written to two parallel files with <code>_1</code> and <code>_2</code> inserted in the filename, e.g., if <code>&lt;filename&gt;</code> is <code>aligned.fq</code>, the #1 and #2 mates that align at least once will be written to <code>aligned_1.fq</code> and <code>aligned_2.fq</code> respectively.</p>
</td></tr><tr><td id="bowtie-options-un">

<pre><code>--un &lt;filename&gt;</code></pre>
</td><td>

<p>Write all reads that could not be aligned to a file with name <code>&lt;filename&gt;</code>. 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 <code>_1</code> and <code>_2</code> inserted in the filename, e.g., if <code>&lt;filename&gt;</code> is <code>unaligned.fq</code>, the #1 and #2 mates that fail to align will be written to <code>unaligned_1.fq</code> and <code>unaligned_2.fq</code> respectively. Unless <a href="#bowtie-options-max"><code>--max</code></a> is also specified, reads with a number of valid alignments exceeding the limit set with the <a href="#bowtie-options-m"><code>-m</code></a> option are also written to <code>&lt;filename&gt;</code>.</p>
</td></tr><tr><td id="bowtie-options-max">

<pre><code>--max &lt;filename&gt;</code></pre>
</td><td>

<p>Write all reads with a number of valid alignments exceeding the limit set with the <a href="#bowtie-options-m"><code>-m</code></a> option to a file with name <code>&lt;filename&gt;</code>. 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 <code>bowtie</code>. Paired-end reads will be written to two parallel files with <code>_1</code> and <code>_2</code> inserted in the filename, e.g., if <code>&lt;filename&gt;</code> is <code>max.fq</code>, the #1 and #2 mates that exceed the <a href="#bowtie-options-m"><code>-m</code></a> limit will be written to <code>max_1.fq</code> and <code>max_2.fq</code> respectively. These reads are not written to the file specified with <a href="#bowtie-options-un"><code>--un</code></a>.</p>
</td></tr><tr><td id="bowtie-options-suppress">

<pre><code>--suppress &lt;cols&gt;</code></pre>
</td><td>

<p>Suppress columns of output in the <a href="#default-bowtie-output">default output mode</a>. E.g. if <code>--suppress 1,5,6</code> is specified, the read name, read sequence, and read quality fields will be omitted. See <a href="#default-bowtie-output">Default Bowtie output</a> for field descriptions. This option is ignored if the output mode is <a href="#bowtie-options-S"><code>-S</code>/<code>--sam</code></a>.</p>
</td></tr>
<tr><td id="bowtie-options-fullref">

<pre><code>--fullref</code></pre>
</td><td>

<p>Print the full refernce sequence name, including whitespace, in alignment output. By default <code>bowtie</code> prints everything up to but not including the first whitespace.</p>
</td></tr></table>

<h4 id="colorspace">Colorspace</h4>
<table>
<tr><td id="bowtie-options-snpphred">

<pre><code>--snpphred &lt;int&gt;</code></pre>
</td><td>

<p>When decoding colorspace alignments, use <code>&lt;int&gt;</code> as the SNP penalty. This should be set to the user's best guess of the true ratio of SNPs per base in the subject genome, converted to the <a href="http://en.wikipedia.org/wiki/FASTQ_format#Variations">Phred quality</a> scale. E.g., if the user expects about 1 SNP every 1,000 positions, <code>--snpphred</code> should be set to 30 (which is also the default). To specify the fraction directly, use <a href="#bowtie-options-snpfrac"><code>--snpfrac</code></a>.</p>
</td></tr>
<tr><td id="bowtie-options-snpfrac">

<pre><code>--snpfrac &lt;dec&gt;</code></pre>
</td><td>

<p>When decoding colorspace alignments, use <code>&lt;dec&gt;</code> as the estimated ratio of SNPs per base. For best decoding results, this should be set to the user's best guess of the true ratio. <code>bowtie</code> internally converts the ratio to a <a href="http://en.wikipedia.org/wiki/FASTQ_format#Variations">Phred quality</a>, and behaves as if that quality had been set via the <a href="#bowtie-options-snpphred"><code>--snpphred</code></a> option. Default: 0.001.</p>
</td></tr>
<tr><td id="bowtie-options-col-cseq">

<pre><code>--col-cseq</code></pre>
</td><td>

<p>If reads are in colorspace and the <a href="#default-bowtie-output">default output mode</a> is active, <code>--col-cseq</code> causes the reads' color sequence to appear in the read-sequence column (column 5) instead of the decoded nucleotide sequence. See the <a href="#decoding-colorspace-alignments">Decoding colorspace alignments</a> section for details about decoding. This option is ignored in <a href="#bowtie-options-S"><code>-S</code>/<code>--sam</code></a> mode.</p>
</td></tr>
<tr><td id="bowtie-options-col-cqual">

<pre><code>--col-cqual</code></pre>
</td><td>

<p>If reads are in colorspace and the <a href="#default-bowtie-output">default output mode</a> is active, <code>--col-cqual</code> causes the reads' original (color) quality sequence to appear in the quality column (column 6) instead of the decoded qualities. See the <a href="#colorspace-alignment">Colorspace alignment</a> section for details about decoding. This option is ignored in <a href="#bowtie-options-S"><code>-S</code>/<code>--sam</code></a> mode.</p>
</td></tr>
<tr><td id="bowtie-options-col-keepends">

<pre><code>--col-keepends</code></pre>
</td><td>

<p>When decoding colorpsace alignments, <code>bowtie</code> trims off a nucleotide and quality from the left and right edges of the alignment. This is because those nucleotides are supported by only one color, in contrast to the middle nucleotides which are supported by two. Specify <code>--col-keepends</code> to keep the extreme-end nucleotides and qualities.</p>
</td></tr>
</table>

<h4 id="sam">SAM</h4>
<table>

<tr><td id="bowtie-options-S">

<pre><code>-S/--sam</code></pre>
</td><td>

<p>Print alignments in <a href="http://samtools.sourceforge.net/SAM1.pdf">SAM</a> format. See the <a href="#sam-bowtie-output">SAM output</a> section of the manual for details. To suppress all SAM headers, use <a href="#bowtie-options-sam-nohead"><code>--sam-nohead</code></a> in addition to <code>-S/--sam</code>. To suppress just the <code>@SQ</code> headers (e.g. if the alignment is against a very large number of reference sequences), use <a href="#bowtie-options-sam-nosq"><code>--sam-nosq</code></a> in addition to <code>-S/--sam</code>. <code>bowtie</code> does not write BAM files directly, but SAM output can be converted to BAM on the fly by piping <code>bowtie</code>'s output to <code>samtools view</code>. <a href="#bowtie-options-S"><code>-S</code>/<code>--sam</code></a> is not compatible with <a href="#bowtie-options-refout"><code>--refout</code></a>.</p>
</td></tr><tr><td id="bowtie-options-mapq">

<pre><code>--mapq &lt;int&gt;</code></pre>
</td><td>

<p>If an alignment is non-repetitive (according to <a href="#bowtie-options-m"><code>-m</code></a>, <a href="#bowtie-options-strata"><code>--strata</code></a> and other options) set the <code>MAPQ</code> (mapping quality) field to this value. See the <a href="http://samtools.sourceforge.net/SAM1.pdf">SAM Spec</a> for details about the <code>MAPQ</code> field Default: 255.</p>
</td></tr><tr><td id="bowtie-options-sam-nohead">

<pre><code>--sam-nohead</code></pre>
</td><td>

<p>Suppress header lines (starting with <code>@</code>) when output is <a href="#bowtie-options-S"><code>-S</code>/<code>--sam</code></a>. This must be specified <em>in addition to</em> <a href="#bowtie-options-S"><code>-S</code>/<code>--sam</code></a>. <code>--sam-nohead</code> is ignored unless <a href="#bowtie-options-S"><code>-S</code>/<code>--sam</code></a> is also specified.</p>
</td></tr><tr><td id="bowtie-options-sam-nosq">

<pre><code>--sam-nosq</code></pre>
</td><td>

<p>Suppress <code>@SQ</code> header lines when output is <a href="#bowtie-options-S"><code>-S</code>/<code>--sam</code></a>. This must be specified <em>in addition to</em> <a href="#bowtie-options-S"><code>-S</code>/<code>--sam</code></a>. <code>--sam-nosq</code> is ignored unless <a href="#bowtie-options-S"><code>-S</code>/<code>--sam</code></a> is also specified.</p>
</td></tr><tr><td id="bowtie-options-sam-RG">

<pre><code>--sam-RG &lt;text&gt;</code></pre>
</td><td>

<p>Add <code>&lt;text&gt;</code> (usually of the form <code>TAG:VAL</code>, e.g. <code>ID:IL7LANE2</code>) as a field on the <code>@RG</code> header line. Specify <code>--sam-RG</code> multiple times to set multiple fields. See the <a href="http://samtools.sourceforge.net/SAM1.pdf">SAM Spec</a> for details about what fields are legal. Note that, if any <code>@RG</code> fields are set using this option, the <code>ID</code> and <code>SM</code> fields must both be among them to make the <code>@RG</code> line legal according to the <a href="http://samtools.sourceforge.net/SAM1.pdf">SAM Spec</a>. <code>--sam-RG</code> is ignored unless <a href="#bowtie-options-S"><code>-S</code>/<code>--sam</code></a> is also specified.</p>
</td></tr></table>

<h4 id="performance">Performance</h4>
<table><tr>

<td id="bowtie-options-o">

<pre><code>-o/--offrate &lt;int&gt;</code></pre>
</td><td>

<p>Override the offrate of the index with <code>&lt;int&gt;</code>. If <code>&lt;int&gt;</code> is greater than the offrate used to build the index, then some row markings are discarded when the index is read into memory. This reduces the memory footprint of the aligner but requires more time to calculate text offsets. <code>&lt;int&gt;</code> must be greater than the value used to build the index.</p>
</td></tr><tr><td id="bowtie-options-p">

<pre><code>-p/--threads &lt;int&gt;</code></pre>
</td><td>

<p>Launch <code>&lt;int&gt;</code> parallel search threads (default: 1). Threads will run on separate processors/cores and synchronize when parsing reads and outputting alignments. Searching for alignments is highly parallel, and speedup is fairly close to linear. This option is only available if <code>bowtie</code> is linked with the <code>pthreads</code> library (i.e. if <code>BOWTIE_PTHREADS=0</code> is not specified at build time).</p>
</td></tr><tr><td id="bowtie-options-mm">

<pre><code>--mm</code></pre>
</td><td>

<p>Use memory-mapped I/O to load the index, rather than normal C file I/O. Memory-mapping the index allows many concurrent <code>bowtie</code> processes on the same computer to share the same memory image of the index (i.e. you pay the memory overhead just once). This facilitates memory-efficient parallelization of <code>bowtie</code> in situations where using <a href="#bowtie-options-p"><code>-p</code></a> is not possible.</p>
</td></tr><tr><td id="bowtie-options-shmem">

<pre><code>--shmem</code></pre>
</td><td>

<p>Use shared memory to load the index, rather than normal C file I/O. Using shared memory allows many concurrent bowtie processes on the same computer to share the same memory image of the index (i.e. you pay the memory overhead just once). This facilitates memory-efficient parallelization of <code>bowtie</code> in situations where using <a href="#bowtie-options-p"><code>-p</code></a> is not desirable. Unlike <a href="#bowtie-options-mm"><code>--mm</code></a>, <code>--shmem</code> installs the index into shared memory permanently, or until the user deletes the shared memory chunks manually. See your operating system documentation for details on how to manually list and remove shared memory chunks (on Linux and Mac OS X, these commands are <code>ipcs</code> and <code>ipcrm</code>). You may also need to increase your OS's maximum shared-memory chunk size to accomodate larger indexes; see your OS documentation.</p>
</td></tr></table>

<h4 id="other">Other</h4>
<table><tr><td id="bowtie-options-seed">

<pre><code>--seed &lt;int&gt;</code></pre>
</td><td>

<p>Use <code>&lt;int&gt;</code> as the seed for pseudo-random number generator.</p>
</td></tr><tr><td id="bowtie-options-verbose">

<pre><code>--verbose</code></pre>
</td><td>

<p>Print verbose output (for debugging).</p>
</td></tr><tr><td id="bowtie-options-version">

<pre><code>--version</code></pre>
</td><td>

<p>Print version information and quit.</p>
</td></tr><tr><td id="bowtie-options-h">

<pre><code>-h/--help</code></pre>
</td><td>

<p>Print usage information and quit.</p>
</td></tr></table>

<h2 id="default-bowtie-output">Default <code>bowtie</code> output</h2>
<p><code>bowtie</code> outputs one alignment per line. Each line is a collection of 8 fields separated by tabs; from left to right, the fields are:</p>
<ol style="list-style-type: decimal">
<li><p>Name of read that aligned.</p>
<p>Note that the [SAM specification] disallows whitespace in the read name. If the read name contains any whitespace characters, Bowtie 2 will truncate the name at the first whitespace character. This is similar to the behavior of other tools.</p></li>
<li><p>Reference strand aligned to, <code>+</code> for forward strand, <code>-</code> for reverse</p></li>
<li><p>Name of reference sequence where alignment occurs, or numeric ID if no name was provided</p></li>
<li><p>0-based offset into the forward reference strand where leftmost character of the alignment occurs</p></li>
<li><p>Read sequence (reverse-complemented if orientation is <code>-</code>).</p>
<p>If the read was in colorspace, then the sequence shown in this column is the sequence of <em>decoded nucleotides</em>, not the original colors. See the <a href="#colorspace-alignment">Colorspace alignment</a> section for details about decoding. To display colors instead, use the <a href="#bowtie-options-col-cseq"><code>--col-cseq</code></a> option.</p></li>
<li><p>ASCII-encoded read qualities (reversed if orientation is <code>-</code>). The encoded quality values are on the Phred scale and the encoding is ASCII-offset by 33 (ASCII char <code>!</code>).</p>
<p>If the read was in colorspace, then the qualities shown in this column are the <em>decoded qualities</em>, not the original qualities. See the <a href="#colorspace-alignment">Colorspace alignment</a> section for details about decoding. To display colors instead, use the <a href="#bowtie-options-col-cqual"><code>--col-cqual</code></a> option.</p></li>
<li><p>If <a href="#bowtie-options-m"><code>-M</code></a> was specified and the prescribed ceiling was exceeded for this read, this column contains the value of the ceiling, indicating that at least that many valid alignments were found in addition to the one reported.</p>
<p>Otherwise, this column contains the number of other instances where the same sequence aligned against the same reference characters as were aligned against in the reported alignment. This is <em>not</em> the number of other places the read aligns with the same number of mismatches. The number in this column is generally not a good proxy for that number (e.g., the number in this column may be '0' while the number of other alignments with the same number of mismatches might be large).</p></li>
<li><p>Comma-separated list of mismatch descriptors. If there are no mismatches in the alignment, this field is empty. A single descriptor has the format offset:reference-base&gt;read-base. The offset is expressed as a 0-based offset from the high-quality (5') end of the read.</p></li>
</ol>
<h2 id="sam-bowtie-output">SAM <code>bowtie</code> output</h2>
<p>Following is a brief description of the <a href="http://samtools.sourceforge.net/SAM1.pdf">SAM</a> format as output by <code>bowtie</code> when the <a href="#bowtie-options-S"><code>-S</code>/<code>--sam</code></a> option is specified. For more details, see the <a href="http://samtools.sourceforge.net/SAM1.pdf">SAM format specification</a>.</p>
<p>When <a href="#bowtie-options-S"><code>-S</code>/<code>--sam</code></a> is specified, <code>bowtie</code> prints a SAM header with <code>@HD</code>, <code>@SQ</code> and <code>@PG</code> lines. When one or more <a href="#bowtie-options-sam-RG"><code>--sam-RG</code></a> arguments are specified, <code>bowtie</code> will also print an <code>@RG</code> line that includes all user-specified <a href="#bowtie-options-sam-RG"><code>--sam-RG</code></a> tokens separated by tabs.</p>
<p>Each subsequnt line corresponds to a read or an alignment. Each line is a collection of at least 12 fields separated by tabs; from left to right, the fields are:</p>
<ol style="list-style-type: decimal">
<li><p>Name of read that aligned</p></li>
<li><p>Sum of all applicable flags. Flags relevant to Bowtie are:</p>
<table><tr><td>

<pre><code>1</code></pre>
</td><td>

<p>The read is one of a pair</p>
</td></tr><tr><td>

<pre><code>2</code></pre>
</td><td>

<p>The alignment is one end of a proper paired-end alignment</p>
</td></tr><tr><td>

<pre><code>4</code></pre>
</td><td>

<p>The read has no reported alignments</p>
</td></tr><tr><td>

<pre><code>8</code></pre>
</td><td>

<p>The read is one of a pair and has no reported alignments</p>
</td></tr><tr><td>

<pre><code>16</code></pre>
</td><td>

<p>The alignment is to the reverse reference strand</p>
</td></tr><tr><td>

<pre><code>32</code></pre>
</td><td>

<p>The other mate in the paired-end alignment is aligned to the reverse reference strand</p>
</td></tr><tr><td>

<pre><code>64</code></pre>
</td><td>

<p>The read is the first (#1) mate in a pair</p>
</td></tr><tr><td>

<pre><code>128</code></pre>
</td><td>

<p>The read is the second (#2) mate in a pair</p>
</td></tr></table>

<p>Thus, an unpaired read that aligns to the reverse reference strand will have flag 16. A paired-end read that aligns and is the first mate in the pair will have flag 83 (= 64 + 16 + 2 + 1).</p></li>
<li><p>Name of reference sequence where alignment occurs, or ordinal ID if no name was provided</p></li>
<li><p>1-based offset into the forward reference strand where leftmost character of the alignment occurs</p></li>
<li><p>Mapping quality</p></li>
<li><p>CIGAR string representation of alignment</p></li>
<li><p>Name of reference sequence where mate's alignment occurs. Set to <code>=</code> if the mate's reference sequence is the same as this alignment's, or <code>*</code> if there is no mate.</p></li>
<li><p>1-based offset into the forward reference strand where leftmost character of the mate's alignment occurs. Offset is 0 if there is no mate.</p></li>
<li><p>Inferred insert size. Size is negative if the mate's alignment occurs upstream of this alignment. Size is 0 if there is no mate.</p></li>
<li><p>Read sequence (reverse-complemented if aligned to the reverse strand)</p></li>
<li><p>ASCII-encoded read qualities (reverse-complemented if the read aligned to the reverse strand). The encoded quality values are on the <a href="http://en.wikipedia.org/wiki/FASTQ_format#Variations">Phred quality</a> scale and the encoding is ASCII-offset by 33 (ASCII char <code>!</code>), similarly to a <a href="http://en.wikipedia.org/wiki/FASTQ_format">FASTQ</a> file.</p></li>
<li><p>Optional fields. Fields are tab-separated. For descriptions of all possible optional fields, see the SAM format specification. <code>bowtie</code> outputs some of these optional fields for each alignment, depending on the type of the alignment:</p>
<table><tr><td>

<pre><code>NM:i:&lt;N&gt;</code></pre>
</td><td>

<p>Aligned read has an edit distance of <code>&lt;N&gt;</code>.</p>
</td></tr><tr><td>

<pre><code>CM:i:&lt;N&gt;</code></pre>
</td><td>

<p>Aligned read has an edit distance of <code>&lt;N&gt;</code> in colorspace. This field is present in addition to the <code>NM</code> field in <a href="#bowtie-options-C"><code>-C</code>/<code>--color</code></a> mode, but is omitted otherwise.</p>
</td></tr><tr><td>

<pre><code>MD:Z:&lt;S&gt;</code></pre>
</td><td>

<p>For aligned reads, <code>&lt;S&gt;</code> is a string representation of the mismatched reference bases in the alignment. See <a href="http://samtools.sourceforge.net/SAM1.pdf">SAM</a> format specification for details. For colorspace alignments, <code>&lt;S&gt;</code> describes the decoded <em>nucleotide</em> alignment, not the colorspace alignment.</p>
</td></tr><tr><td>

<pre><code>XA:i:&lt;N&gt;</code></pre>
</td><td>

<p>Aligned read belongs to stratum <code>&lt;N&gt;</code>. See <a href="#strata">Strata</a> for definition.</p></li>
</ol>
<pre><code>&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;

    XM:i:&lt;N&gt;

&lt;/td&gt;&lt;td&gt;

For a read with no reported alignments, `&lt;N&gt;` is 0 if the read had
no alignments.  If [`-m`] was specified and the read&#39;s alignments
were supressed because the [`-m`] ceiling was exceeded, `&lt;N&gt;` equals
the [`-m`] ceiling + 1, to indicate that there were at least that
many valid alignments (but all were suppressed).  In [`-M`] mode, if
the alignment was randomly selected because the [`-M`] ceiling was
exceeded, `&lt;N&gt;` equals the [`-M`] ceiling + 1, to indicate that there
were at least that many valid alignments (of which one was reported
at random).

&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</code></pre>
<h1 id="the-bowtie-build-indexer">The <code>bowtie-build</code> indexer</h1>
<p><code>bowtie-build</code> builds a Bowtie index from a set of DNA sequences. <code>bowtie-build</code> outputs a set of 6 files with suffixes <code>.1.ebwt</code>, <code>.2.ebwt</code>, <code>.3.ebwt</code>, <code>.4.ebwt</code>, <code>.rev.1.ebwt</code>, and <code>.rev.2.ebwt</code>. (If the total length of all the input sequences is greater than about 4 billion, then the index files will end in <code>ebwtl</code> instead of <code>ebwt</code>.) These files together constitute the index: they are all that is needed to align reads to that reference. The original sequence files are no longer used by Bowtie once the index is built.</p>
<p>Use of Karkkainen's <a href="http://portal.acm.org/citation.cfm?id=1314852">blockwise algorithm</a> allows <code>bowtie-build</code> to trade off between running time and memory usage. <code>bowtie-build</code> has three options governing how it makes this trade: <a href="#bowtie-build-options-p"><code>-p</code>/<code>--packed</code></a>, <a href="#bowtie-build-options-bmax"><code>--bmax</code></a>/<a href="#bowtie-build-options-bmaxdivn"><code>--bmaxdivn</code></a>, and <a href="#bowtie-build-options-dcv"><code>--dcv</code></a>. By default, <code>bowtie-build</code> will automatically search for the settings that yield the best running time without exhausting memory. This behavior can be disabled using the <a href="#bowtie-build-options-a"><code>-a</code>/<code>--noauto</code></a> option.</p>
<p>The indexer provides options pertaining to the &quot;shape&quot; of the index, e.g. <a href="#bowtie-build-options-o"><code>--offrate</code></a> governs the fraction of <a href="http://en.wikipedia.org/wiki/Burrows-Wheeler_transform">Burrows-Wheeler</a> rows that are &quot;marked&quot; (i.e., the density of the suffix-array sample; see the original <a href="http://portal.acm.org/citation.cfm?id=796543">FM Index</a> paper for details). All of these options are potentially profitable trade-offs depending on the application. They have been set to defaults that are reasonable for most cases according to our experiments. See <a href="#performance-tuning">Performance Tuning</a> for details.</p>
<p>The Bowtie index is based on the <a href="http://portal.acm.org/citation.cfm?id=796543">FM Index</a> of Ferragina and Manzini, which in turn is based on the <a href="http://en.wikipedia.org/wiki/Burrows-Wheeler_transform">Burrows-Wheeler</a> transform. The algorithm used to build the index is based on the <a href="http://portal.acm.org/citation.cfm?id=1314852">blockwise algorithm</a> of Karkkainen.</p>
<h2 id="command-line-1">Command Line</h2>
<p>Usage:</p>
<pre><code>bowtie-build [options]* &lt;reference_in&gt; &lt;ebwt_base&gt;</code></pre>
<h3 id="main-arguments-1">Main arguments</h3>
<table><tr><td>

<pre><code>&lt;reference_in&gt;</code></pre>
</td><td>

<p>A comma-separated list of FASTA files containing the reference sequences to be aligned to, or, if <a href="#bowtie-build-options-c"><code>-c</code></a> is specified, the sequences themselves. E.g., <code>&lt;reference_in&gt;</code> might be <code>chr1.fa,chr2.fa,chrX.fa,chrY.fa</code>, or, if <a href="#bowtie-build-options-c"><code>-c</code></a> is specified, this might be <code>GGTCATCCT,ACGGGTCGT,CCGTTCTATGCGGCTTA</code>.</p>
</td></tr><tr><td>

<pre><code>&lt;ebwt_base&gt;</code></pre>
</td><td>

<p>The basename of the index files to write. By default, <code>bowtie-build</code> writes files named <code>NAME.1.ebwt</code>, <code>NAME.2.ebwt</code>, <code>NAME.3.ebwt</code>, <code>NAME.4.ebwt</code>, <code>NAME.rev.1.ebwt</code>, and <code>NAME.rev.2.ebwt</code>, where <code>NAME</code> is <code>&lt;ebwt_base&gt;</code>.</p>
</td></tr></table>

<h3 id="options-1">Options</h3>
<table><tr><td>

<pre><code>-f</code></pre>
</td><td>

<p>The reference input files (specified as <code>&lt;reference_in&gt;</code>) are FASTA files (usually having extension <code>.fa</code>, <code>.mfa</code>, <code>.fna</code> or similar).</p>
</td></tr><tr><td id="bowtie-build-options-c">

<pre><code>-c</code></pre>
</td><td>

<p>The reference sequences are given on the command line. I.e. <code>&lt;reference_in&gt;</code> is a comma-separated list of sequences rather than a list of FASTA files.</p>
</td></tr><tr><td id="bowtie-build-options-C">

<pre><code>-C/--color</code></pre>
</td><td>

<p>Build a colorspace index, to be queried using <code>bowtie</code> <a href="#bowtie-options-C"><code>-C</code></a>.</p>
</td></tr><tr><td id="bowtie-build-options-a">

<pre><code>-a/--noauto</code></pre>
</td><td>

<p>Disable the default behavior whereby <code>bowtie-build</code> automatically selects values for the <a href="#bowtie-build-options-bmax"><code>--bmax</code></a>, <a href="#bowtie-build-options-dcv"><code>--dcv</code></a> and <a href="#bowtie-build-options-p"><code>--packed</code></a> parameters according to available memory. Instead, user may specify values for those parameters. If memory is exhausted during indexing, an error message will be printed; it is up to the user to try new parameters.</p>
</td></tr><tr><td id="bowtie-build-options-p">

<pre><code>-p/--packed</code></pre>
</td><td>

<p>Use a packed (2-bits-per-nucleotide) representation for DNA strings. This saves memory but makes indexing 2-3 times slower. Default: off. This is configured automatically by default; use <a href="#bowtie-build-options-a"><code>-a</code>/<code>--noauto</code></a> to configure manually.</p>
</td></tr><tr><td id="bowtie-build-options-bmax">

<pre><code>--bmax &lt;int&gt;</code></pre>
</td><td>

<p>The maximum number of suffixes allowed in a block. Allowing more suffixes per block makes indexing faster, but increases peak memory usage. Setting this option overrides any previous setting for <a href="#bowtie-build-options-bmax"><code>--bmax</code></a>, or <a href="#bowtie-build-options-bmaxdivn"><code>--bmaxdivn</code></a>. Default (in terms of the <a href="#bowtie-build-options-bmaxdivn"><code>--bmaxdivn</code></a> parameter) is <a href="#bowtie-build-options-bmaxdivn"><code>--bmaxdivn</code></a> 4. This is configured automatically by default; use <a href="#bowtie-build-options-a"><code>-a</code>/<code>--noauto</code></a> to configure manually.</p>
</td></tr><tr><td id="bowtie-build-options-bmaxdivn">

<pre><code>--bmaxdivn &lt;int&gt;</code></pre>
</td><td>

<p>The maximum number of suffixes allowed in a block, expressed as a fraction of the length of the reference. Setting this option overrides any previous setting for <a href="#bowtie-build-options-bmax"><code>--bmax</code></a>, or <a href="#bowtie-build-options-bmaxdivn"><code>--bmaxdivn</code></a>. Default: <a href="#bowtie-build-options-bmaxdivn"><code>--bmaxdivn</code></a> 4. This is configured automatically by default; use <a href="#bowtie-build-options-a"><code>-a</code>/<code>--noauto</code></a> to configure manually.</p>
</td></tr><tr><td id="bowtie-build-options-dcv">

<pre><code>--dcv &lt;int&gt;</code></pre>
</td><td>

<p>Use <code>&lt;int&gt;</code> as the period for the difference-cover sample. A larger period yields less memory overhead, but may make suffix sorting slower, especially if repeats are present. Must be a power of 2 no greater than 4096. Default: 1024. This is configured automatically by default; use <a href="#bowtie-build-options-a"><code>-a</code>/<code>--noauto</code></a> to configure manually.</p>
</td></tr><tr><td id="bowtie-build-options-nodc">

<pre><code>--nodc</code></pre>
</td><td>

<p>Disable use of the difference-cover sample. Suffix sorting becomes quadratic-time in the worst case (where the worst case is an extremely repetitive reference). Default: off.</p>
</td></tr><tr><td>

<pre><code>-r/--noref</code></pre>
</td><td>

<p>Do not build the <code>NAME.3.ebwt</code> and <code>NAME.4.ebwt</code> portions of the index, which contain a bitpacked version of the reference sequences and are used for paired-end alignment.</p>
</td></tr><tr><td>

<pre><code>-3/--justref</code></pre>
</td><td>

<p>Build <em>only</em> the <code>NAME.3.ebwt</code> and <code>NAME.4.ebwt</code> portions of the index, which contain a bitpacked version of the reference sequences and are used for paired-end alignment.</p>
</td></tr><tr><td id="bowtie-build-options-o">

<pre><code>-o/--offrate &lt;int&gt;</code></pre>
</td><td>

<p>To map alignments back to positions on the reference sequences, it's necessary to annotate (&quot;mark&quot;) some or all of the <a href="http://en.wikipedia.org/wiki/Burrows-Wheeler_transform">Burrows-Wheeler</a> rows with their corresponding location on the genome. <a href="#bowtie-build-options-o"><code>-o</code>/<code>--offrate</code></a> governs how many rows get marked: the indexer will mark every 2^<code>&lt;int&gt;</code> rows. Marking more rows makes reference-position lookups faster, but requires more memory to hold the annotations at runtime. The default is 5 (every 32nd row is marked; for human genome, annotations occupy about 340 megabytes).</p>
</td></tr><tr><td>

<pre><code>-t/--ftabchars &lt;int&gt;</code></pre>
</td><td>

<p>The ftab is the lookup table used to calculate an initial <a href="http://en.wikipedia.org/wiki/Burrows-Wheeler_transform">Burrows-Wheeler</a> range with respect to the first <code>&lt;int&gt;</code> characters of the query. A larger <code>&lt;int&gt;</code> yields a larger lookup table but faster query times. The ftab has size 4^(<code>&lt;int&gt;</code>+1) bytes. The default setting is 10 (ftab is 4MB).</p>
</td></tr><tr><td id="bowtie-build-options-ntoa">

<pre><code>--ntoa</code></pre>
</td><td>

<p>Convert Ns in the reference sequence to As before building the index. By default, Ns are simply excluded from the index and <code>bowtie</code> will not report alignments that overlap them.</p>
</td></tr><tr><td id="bowtie-build-options-big-little">

<pre><code>--big --little</code></pre>
</td><td>

<p>Endianness to use when serializing integers to the index file. Default: little-endian (recommended for Intel- and AMD-based architectures).</p>
</td></tr><tr><td id="bowtie-build-options-seed">

<pre><code>--seed &lt;int&gt;</code></pre>
</td><td>

<p>Use <code>&lt;int&gt;</code> as the seed for pseudo-random number generator.</p>
</td></tr><tr><td>

<pre><code>-q/--quiet</code></pre>
</td><td>

<p><code>bowtie-build</code> is verbose by default. With this option <code>bowtie-build</code> will print only error messages.</p>
</td></tr><tr><td>

<pre><code>-h/--help</code></pre>
</td><td>

<p>Print usage information and quit.</p>
</td></tr><tr><td>

<pre><code>--version</code></pre>
</td><td>

<p>Print version information and quit.</p>
</td></tr></table>

<h1 id="the-bowtie-inspect-index-inspector">The <code>bowtie-inspect</code> index inspector</h1>
<p><code>bowtie-inspect</code> extracts information from a Bowtie index about what kind of index it is and what reference sequences were used to build it. When run without any options, the tool will output a FASTA file containing the sequences of the original references (with all non-<code>A</code>/<code>C</code>/<code>G</code>/<code>T</code> characters converted to <code>N</code>s). It can also be used to extract just the reference sequence names using the <a href="#bowtie-build-options-n"><code>-n</code>/<code>--names</code></a> option or a more verbose summary using the <a href="#bowtie-inspect-options-s"><code>-s</code>/<code>--summary</code></a> option.</p>
<h2 id="command-line-2">Command Line</h2>
<p>Usage:</p>
<pre><code>bowtie-inspect [options]* &lt;ebwt_base&gt;</code></pre>
<h3 id="main-arguments-2">Main arguments</h3>
<table><tr><td>

<pre><code>&lt;ebwt_base&gt;</code></pre>
</td><td>

<p>The basename of the index to be inspected. The basename is name of any of the index files but with the <code>.X.ebwt</code> or <code>.rev.X.ebwt</code> suffix omitted. <code>bowtie-inspect</code> first looks in the current directory for the index files, then looks in the <code>indexes</code> subdirectory under the directory where the currently-running <code>bowtie</code> executable is located, then looks in the directory specified in the <code>BOWTIE_INDEXES</code> environment variable.</p>
</td></tr></table>

<h3 id="options-2">Options</h3>
<table><tr><td>

<pre><code>-a/--across &lt;int&gt;</code></pre>
</td><td>

<p>When printing FASTA output, output a newline character every <code>&lt;int&gt;</code> bases (default: 60).</p>
</td></tr><tr><td id="bowtie-build-options-n">

<pre><code>-n/--names</code></pre>
</td><td>

<p>Print reference sequence names, one per line, and quit.</p>
</td></tr><tr><td id="bowtie-inspect-options-s">

<pre><code>-s/--summary</code></pre>
</td><td>

<p>Print a summary that includes information about index settings, as well as the names and lengths of the input sequences. The summary has this format:</p>
<pre><code>Colorspace  &lt;0 or 1&gt;
SA-Sample   1 in &lt;sample&gt;
FTab-Chars  &lt;chars&gt;
Sequence-1  &lt;name&gt;  &lt;len&gt;
Sequence-2  &lt;name&gt;  &lt;len&gt;
...
Sequence-N  &lt;name&gt;  &lt;len&gt;</code></pre>
<p>Fields are separated by tabs.</p>
</td></tr><tr><td id="bowtie-inspect-options-e">

<pre><code>-e/--ebwt-ref</code></pre>
</td><td>

<p>By default, when <code>bowtie-inspect</code> is run without <a href="#bowtie-options-S"><code>-s</code></a> or <a href="#bowtie-options-n"><code>-n</code></a>, it recreates the reference nucleotide sequences using the bit-encoded reference nucleotides kept in the <code>.3.ebwt</code> and <code>.4.ebwt</code> index files. When <code>-e/--ebwt-ref</code> is specified, <code>bowtie-inspect</code> recreates the reference sequences from the Burrows-Wheeler-transformed reference sequence in the <code>.1.ebwt</code> file instead. The reference recreation process is much slower when <code>-e/--ebwt-ref</code> is specified. Also, when <code>-e/--ebwt-ref</code> is specified and the index is in colorspace, the reference is printed in colors (A=blue, C=green, G=orange, T=red).</p>
</td></tr><tr><td>

<pre><code>-v/--verbose</code></pre>
</td><td>

<p>Print verbose output (for debugging).</p>
</td></tr><tr><td>

<pre><code>--version</code></pre>
</td><td>

<p>Print version information and quit.</p>
</td></tr><tr><td>

<pre><code>-h/--help</code></pre>
</td><td>

<p>Print usage information and quit.</p>
</td></tr></table>
</body>
</html>