Skip to content
Commits on Source (6)
[submodule "third_party/simde"]
path = third_party/simde
url = https://github.com/nemequ/simde.git
......@@ -3,11 +3,12 @@ cmake_minimum_required(VERSION 2.8)
cmake_policy(SET CMP0048 NEW)
cmake_policy(SET CMP0005 NEW)
project(bowtie2 LANGUAGES CXX VERSION "2.3.4.3")
project(bowtie2 LANGUAGES CXX VERSION "2.3.5.1")
enable_testing()
include(CTest)
include(ExternalProject)
include(ProcessorCount)
include(CheckSymbolExists)
......@@ -18,7 +19,8 @@ option(BOWITE_SHARED_MM "enable shared memory mapping" ON)
set(CMAKE_CXX_STANDARD 98)
set(NO_TBB ${NO_TBB})
set(NO_SPINLOCK, ${NO_SPINLOCK})
set(NO_SPINLOCK ${NO_SPINLOCK})
set(USE_SRA 0)
set(WITH_THREAD_PROFILING ${WITH_THREAD_PROFILING})
set(POPCNT_CAPABILITY ${POPCNT_CAPABILITY})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -g3 -Wall -msse2")
......@@ -28,6 +30,7 @@ set(INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory
set(CMAKE_EXPORT_COMPILE_COMMANDS on)
if (MINGW)
option(BOWTIE_MM "Memory mapped files not supported on Windows" OFF)
option(BOWTIE_SHARED_MEM "Shared memory not supported on Windows" OFF)
......@@ -35,6 +38,7 @@ endif(MINGW)
if (APPLE)
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
endif(APPLE)
set(BOWTIE2_BIN_LIST
......@@ -121,6 +125,67 @@ if (POPCNT_CAPABILITY)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I third_party")
endif()
if (USE_SRA)
set(NGS_VER 2.9.2)
set(NCBI_VDB_VER 2.9.2-1)
find_package(Java COMPONENTS Development REQUIRED)
find_package(PythonInterp REQUIRED)
find_package(Perl REQUIRED)
find_program(MAKE_EXE NAMES gmake nmake make)
ExternalProject_add(ngs_project
URL https://github.com/ncbi/ngs/archive/${NGS_VER}.tar.gz
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/ngs-${NGS_VER}
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ./configure --prefix=install
BUILD_COMMAND ${MAKE_EXE}
INSTALL_COMMAND ${MAKE_EXE} install
)
ExternalProject_Get_Property(ngs_project SOURCE_DIR)
set(NGS_INSTALL_DIR ${SOURCE_DIR}/ngs-sdk/install)
link_directories(${NGS_INSTALL_DIR}/lib64)
include_directories(${NGS_INSTALL_DIR}/include)
add_library(ngs-c++-static STATIC IMPORTED)
add_dependencies(ngs-c++-static ngs_project)
find_library(LIBNGS_CPP ngs-c++-static PATHS ${NGS_INSTALL_DIR}/lib64 NO_DEFAULT_PATH)
set_property(TARGET ngs-c++-static PROPERTY IMPORTED_LOCATION ${LIBNGS_CPP})
link_libraries(ngs-c++-static)
ExternalProject_add(ncbi_vdb_project
URL https://github.com/ncbi/ncbi-vdb/archive/${NCBI_VDB_VER}.tar.gz
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/ncbi-vdb-${NCBI_VDB_VER}
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ./configure --prefix=install --with-ngs-sdk=${NGS_INSTALL_DIR}
BUILD_COMMAND ${MAKE_EXE}
INSTALL_COMMAND ${MAKE_EXE} install
DEPENDS ngs_project
)
ExternalProject_Get_Property(ncbi_vdb_project SOURCE_DIR)
set(NCBI_VDB_INSTALL_DIR ${SOURCE_DIR}/install)
link_directories(${NCBI_VDB_INSTALL_DIR}/lib64)
include_directories(${NCBI_VDB_INSTALL_DIR}/include)
add_library(ncbi-ngs-c++-static STATIC IMPORTED)
add_dependencies(ncbi-ngs-c++-static ncbi_vdb_project)
find_library(LIBNCBI_NGS_CPP ncbi-ngs-c++-static PATHS ${NCBI_VDB_INSTALL_DIR}/lib64 NO_DEFAULT_ATH)
set_property(TARGET ncbi-ngs-c++-static PROPERTY IMPORTED_LOCATION ${LIBNCBI_NGS_CPP})
add_library(ncbi-vdb-static STATIC IMPORTED)
add_dependencies(ncbi-vdb-static ncbi_vdb_project)
find_library(LIBNCBI_VDB ncbi-vdb-static PATHS ${NCBI_VDB_INSTALL_DIR}/lib64 NO_DEFAULT_PATH)
set_property(TARGET ncbi-vdb-static PROPERTY IMPORTED_LOCATION ${LIBNCBI_VDB})
link_libraries(ncbi-ngs-c++-static ncbi-vdb-static)
add_definitions(-DUSE_SRA)
endif()
if (WITH_THREAD_PROFILING)
add_definitions(-DPER_THREAD_TIMING=1)
endif()
......@@ -129,29 +194,84 @@ if (CMAKE_BUILD_TYPE STREQUAL "Release")
add_definitions(-DNDEBUG)
endif()
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
find_path(TBB_INCLUDE_PATH tbb)
find_library(TBB_LIBRARY_PATH tbb)
find_library(TBB_MALLOC_LIBRARY_PATH tbbmalloc)
if (ZLIB_FOUND)
link_libraries(${ZLIB_LIBRARIES})
include_directories(${ZLIB_INCLUDE_DIRS})
endif()
if (Threads_FOUND)
find_package(Threads REQUIRED)
link_libraries(Threads::Threads)
endif()
if (NOT TBB_LIBRARY_PATH)
if (NO_TBB)
set(SHARED_CPPS ${SHARED_CPPS} tinythread.cpp)
else()
if (NOT NO_QUEUELOCK)
add_definitions(-DWITH_TBB -DWITH_QUEUELOCK=1 -DNO_SPINLOCK)
find_library(TBB_LIB_PATH tbb)
if (TBB_LIB_PATH)
find_path(TBB_INCLUDE_PATH tbb)
link_libraries(${TBB_LIB_PATH})
find_library(TBBMALLOC_PROXY_LIB_PATH tbbmalloc_proxy)
if (NOT TBBMALLOC_PROXY_LIB_PATH)
find_library(TBBMALLOC_LIB_PATH tbbmalloc)
link_libraries(${TBBMALLOC_LIB_PATH})
else()
link_libraries(${TBBMALLOC_PROXY_LIB_PATH})
endif()
include_directories(${TBB_INCLUDE_PATH})
link_libraries(${TBB_LIBRARY_PATH} ${TBB_MALLOC_LIBRARY_PATH})
else()
set(TBB_VER 2019_U4)
if (CMAKE_SYSTEM_NAME STREQUAL Linux)
set(tbb_os linux)
elseif (CMAKE_SYSTEM_NAME STREQUAL Darwin)
set(tbb_os macos)
elseif (CMAKE_SYSTEM_NAME STREQUAL Windows)
set(tbb_os windows)
else()
set(tbb_os ${CMAKE_SYSTEM_NAME})
endif()
find_program(MAKE_EXE NAMES gmake nmake make)
ExternalProject_Add(tbb_project
URL https://github.com/01org/tbb/archive/2019_U4.tar.gz
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/tbb-${TBB_VER}
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ""
BUILD_COMMAND ${MAKE_EXE} tbb_build_prefix=${TBB_VER} tbb_os=${tbb_os}
INSTALL_COMMAND ""
PREFIX=${CMAKE_CURRENT_BINARY_DIR}/tbb_project
)
ExternalProject_Get_Property(tbb_project SOURCE_DIR)
set(TBB_SOURCE_DIR ${SOURCE_DIR})
set(TBB_RELEASE_DIR ${TBB_SOURCE_DIR}/build/${TBB_VER}_release)
include_directories(${TBB_SOURCE_DIR}/include)
link_directories(${TBB_RELEASE_DIR})
add_library(tbb SHARED IMPORTED)
add_dependencies(tbb tbb_project)
find_library(LIBTBB tbb PATHS ${TBB_RELEASE_DIR} NO_DEFAULT_PATH)
set_property(TARGET tbb PROPERTY IMPORTED_LOCATION ${LIBTBB})
add_library(tbbmalloc_proxy SHARED IMPORTED)
add_dependencies(tbbmalloc_proxy tbb_project)
find_library(LIBTBBMALLOC_PROXY tbbmalloc_proxy PATHS ${TBB_RELEASE_DIR} NO_DEFAULT_PATH)
if (NOT LIBTBBMALLOC_PROXY)
add_library(tbbmalloc SHARED IMPORTED)
add_dependencies(tbbmalloc tbb_project)
find_library(LIBTBBMALLOC tbbmalloc PATHS ${TBB_RELEASE_DIR} NO_DEFAULT_PATH)
set_property(TARGET tbbmalloc PROPERTY IMPORTED_LOCATION ${LIBTBBMALLOC})
link_libraries(tbb tbbmalloc)
else()
set_property(TARGET tbbmalloc_proxy PROPERTY IMPORTED_LOCATION ${LIBTBBMALLOC_PROXY})
link_libraries(tbb tbbmalloc_proxy)
endif()
endif()
add_definitions(-DWITH_TBB -DWITH_QUEUELOCK=1 -DNO_SPINLOCK)
endif()
if (ZLIB_FOUND)
link_libraries(${ZLIB_LIBRARIES})
include_directories(${ZLIB_INCLUDE_DIRS})
endif()
include_directories(${PROJECT_SOURCE_DIR})
......@@ -167,6 +287,6 @@ add_executable(bowtie2-inspect-l ${INSPECT_CPPS} ${SHARED_CPPS})
set_target_properties(bowtie2-align-l bowtie2-build-l bowtie2-inspect-l PROPERTIES COMPILE_FLAGS "-DBOWTIE2_64BIT_INDEX")
set_target_properties(bowtie2-inspect-s bowtie2-inspect-l PROPERTIES COMPILE_FLAGS "-DBOWTIE_INSPECT_MAIN")
set_target_properties(${BOWTIE2_BIN_LIST} PROPERTIES DEBUG_POSTFIX "-debug")
set_target_properties(${BOWTIE2_BIN_LIST} PROPERTIES DEBUG_POSTFIX -debug)
add_test(NAME simple-align COMMAND ${PROJECT_SOURCE_DIR}/bowtie2 -x example/index/lambda_virus example/reads/longreads.fq)
FROM multiarch/ubuntu-debootstrap:arm64-bionic
WORKDIR /build
COPY . .
RUN uname -a
RUN apt-get update -qq && \
apt-get install -yq --no-install-suggests --no-install-recommends \
build-essential \
ca-certificates \
gcc \
git \
g++ \
make \
software-properties-common \
zlib1g-dev
RUN add-apt-repository -y universe && \
apt-get install -yq \
libtbb-dev
CMD bash
......@@ -14,7 +14,7 @@ paired-end alignment modes. Multiple processors can be used
simultaneously to achieve greater alignment speed.
Bowtie 2 outputs alignments in SAM format, enabling interoperation with
a large number of other tools (e.g. SAMtools, GATK) that use SAM. Bowtie
a large number of other tools (e.g. SAMtools, GATK) that use SAM. Bowtie
2 is distributed under the GPLv3 license, and it runs on the command
line under Windows, Mac OS X and Linux.
......@@ -46,7 +46,7 @@ The chief differences between Bowtie 1 and Bowtie 2 are:
1. For reads longer than about 50 bp Bowtie 2 is generally faster, more
sensitive, and uses less memory than Bowtie 1. For relatively short
reads ( e.g. less than 50 bp) Bowtie 1 is sometimes faster and/or
reads (e.g. less than 50 bp) Bowtie 1 is sometimes faster and/or
more sensitive.
2. Bowtie 2 supports gapped alignment with affine gap penalties. Number
......@@ -63,7 +63,7 @@ The chief differences between Bowtie 1 and Bowtie 2 are:
4. There is no upper limit on read length in Bowtie 2. Bowtie 1 had an
upper limit of around 1000 bp.
5. Bowtie 2 allows alignments to overlap ambiguous characters (e.g. Ns)
5. Bowtie 2 allows alignments to overlap ambiguous characters (e.g. Ns)
in the reference. Bowtie 1 does not.
6. Bowtie 2 does away with Bowtie 1’s notion of alignment “stratum”,
......@@ -90,7 +90,7 @@ What isn’t Bowtie 2?
Bowtie 2 is geared toward aligning relatively short sequencing reads to
long genomes. That said, it handles arbitrarily small reference
sequences ( e.g. amplicons) and very long reads (i.e. upwards of 10s or
sequences (e.g. amplicons) and very long reads (i.e. upwards of 10s or
100s of kilobases), though it is slower in those settings. It is
optimized for the read lengths and error modes yielded by typical
Illumina sequencers.
......@@ -108,7 +108,7 @@ With Bioconda installed, you should be able to install Bowtie 2 with
conda install bowtie2.
Containerized versions of Bowtie 2 are also available via the
Biocontainers project (e.g. via Docker Hub).
Biocontainers project (e.g. via Docker Hub).
You can also download Bowtie 2 sources and binaries from the Download
section of the Sourceforge site. Binaries are available for the x86_64
......@@ -137,57 +137,35 @@ make from the MSYS environment.
Bowtie 2 can be run on many threads. By default, Bowtie 2 uses the
Threading Building Blocks library (TBB) for this. If TBB is not
available on your system (e.g. make prints an error like
available on your system (e.g. make prints an error like
tbb/mutex.h: No such file or directory), you can install it yourself
from source (see Threading Building Blocks library) or install it using
your operating system’s preferred package manager. The table below list
some of the commands for a few of the more popular operating systems.
OS
Sync Package List
Search
Install
Ubuntu, Mint, Debian
apt-get update
-----------------------------------------------------------------------
Operating System Sync Package Search Install
List
---------------- -------------- ---------------- ----------------------
Ubuntu, Mint, apt-get update apt-cache search apt-get install
Debian tbb libtbb-dev
apt-cache search tbb
Fedora, CentOS yum yum search tbb yum install
check-update tbb-devel.x86_64
apt-get install libtbb-dev
Arch packman -Sy pacman -Ss tbb pacman -S
extra/intel-tbb
Fedora, CentOS
yum check-update
Gentoo emerge –sync emerge –search emerge dev-cpp/tbb
tbb
yum search tbb
macOS brew update brew search tbb brew install tbb
yum install tbb-devel.x86_64
FreeBSD pkg update pkg search tbb pkg install tbb-2019.1
-----------------------------------------------------------------------
Arch
packman -Sy
pacman -Ss tbb
pacman -S extra/intel-tbb
Gentoo
emerge --sync
emerge --search tbb
emerge dev-cpp/tbb
MacOS
brew update
brew search tbb
brew install tbb
FreeBSD
portsnap fetch update
make search name=tbb
cd /usr/ports/devel/tbb && make install && make clean
If all fails Bowtie 2 can be built with make NO_TBB=1 to use pthreads or
Windows native multithreading instead.
The Bowtie 2 Makefile also includes recipes for basic automatic
dependency management. Running make static-libs && make STATIC_BUILD=1
......@@ -195,8 +173,11 @@ will issue a series of commands that will: 1. download TBB and zlib 2.
compile them as static libraries 3. link the resulting libraries to the
compiled Bowtie 2 binaries
If all fails Bowtie 2 can be built with make NO_TBB=1 to use pthreads or
Windows native multithreading instead.
As of version 2.3.5 bowtie2 now supports aligning SRA reads. Prepackaged
builds will include a package that supports SRA. If you’re building
bowtie2 from source please make sure that the Java runtime is available
on your system. You can then proceed with the build by running
make sra-deps && make USE_SRA=1.
Adding to PATH
......@@ -328,7 +309,7 @@ the read and the reference.
Valid alignments meet or exceed the minimum score threshold
For an alignment to be considered “valid” (i.e. “good enough”) by Bowtie
For an alignment to be considered “valid” (i.e. “good enough”) by Bowtie
2, it must have an alignment score no less than the minimum score
threshold. The threshold is configurable and is expressed as a function
of the read length. In end-to-end alignment mode, the default minimum
......@@ -846,7 +827,7 @@ alignment to be considered valid, and x is the read length.
Usage
bowtie2 [options]* -x <bt2-idx> {-1 <m1> -2 <m2> | -U <r> | --interleaved <i>} -S [<sam>]
bowtie2 [options]* -x <bt2-idx> {-1 <m1> -2 <m2> | -U <r> | --interleaved <i> | --sra-acc <acc> | b <bam>} -S [<sam>]
Main arguments
......@@ -861,7 +842,7 @@ BOWTIE2_INDEXES environment variable.
-1 <m1>
Comma-separated list of files containing mate 1s (filename usually
includes _1), e.g. -1 flyA_1.fq,flyB_1.fq. Sequences specified with this
includes _1), e.g. -1 flyA_1.fq,flyB_1.fq. Sequences specified with this
option must correspond file-for-file and read-for-read with those
specified in <m2>. Reads may be a mix of different lengths. If - is
specified, bowtie2 will read the mate 1s from the “standard in” or
......@@ -870,7 +851,7 @@ specified, bowtie2 will read the mate 1s from the “standard in” or
-2 <m2>
Comma-separated list of files containing mate 2s (filename usually
includes _2), e.g. -2 flyA_2.fq,flyB_2.fq. Sequences specified with this
includes _2), e.g. -2 flyA_2.fq,flyB_2.fq. Sequences specified with this
option must correspond file-for-file and read-for-read with those
specified in <m1>. Reads may be a mix of different lengths. If - is
specified, bowtie2 will read the mate 2s from the “standard in” or
......@@ -883,6 +864,27 @@ e.g. lane1.fq,lane2.fq,lane3.fq,lane4.fq. Reads may be a mix of
different lengths. If - is specified, bowtie2 gets the reads from the
“standard in” or “stdin” filehandle.
--interleaved
Reads interleaved FASTQ files where the first two records (8 lines)
represent a mate pair.
--sra-acc
Reads are SRA accessions. If the accession provided cannot be found in
local storage it will be fetched from the NCBI database. If you find
that SRA alignments are long running please rerun your command with the
-p/--threads parameter set to desired number of threads.
NB: this option is only available if bowtie 2 is compiled with the
necessary SRA libraries. See Obtaining Bowtie 2 for details.
-b <bam>
Reads are unaligned BAM records sorted by read name. The
--align-paired-reads and --preserve-tags options affect the way Bowtie 2
processes records.
-S <sam>
File to write SAM alignments to. By default, alignments are written to
......@@ -898,11 +900,6 @@ Reads (specified with <m1>, <m2>, <s>) are FASTQ files. FASTQ files
usually have extension .fq or .fastq. FASTQ is the default format. See
also: --solexa-quals and --int-quals.
--interleaved
Reads interleaved FASTQ files where the first two records (8 lines)
represent a mate pair.
--tab5
Each read or pair is on a single line. An unpaired read line is
......@@ -1016,7 +1013,8 @@ Same as: -D 10 -R 2 -N 0 -L 22 -i S,0,2.50
--sensitive
Same as: -D 15 -R 2 -L 22 -i S,1,1.15 (default in --end-to-end mode)
Same as: -D 15 -R 2 -N 0 -L 22 -i S,1,1.15 (default in --end-to-end
mode)
--very-sensitive
......@@ -1053,8 +1051,8 @@ alignment slower (often much slower) but increases sensitivity. Default:
Sets the length of the seed substrings to align during multiseed
alignment. Smaller values make alignment slower but more sensitive.
Default: the --sensitive preset is used by default, which sets -L to 20
both in --end-to-end mode and in --local mode.
Default: the --sensitive preset is used by default, which sets -L to 22
and 20 in --end-to-end mode and in --local mode.
-i <func>
......@@ -1151,9 +1149,9 @@ one end to the other. Rather, some characters may be omitted (“soft
clipped”) from the ends in order to achieve the greatest possible
alignment score. The match bonus --ma is used in this mode, and the best
possible alignment score is equal to the match bonus (--ma) times the
length of the read. Specifying --local and one of the presets (e.g.
--local --very-fast) is equivalent to specifying the local version of
the preset (--very-fast-local). This is mutually exclusive with
length of the read. Specifying --local and one of the presets
(e.g. --local --very-fast) is equivalent to specifying the local version
of the preset (--very-fast-local). This is mutually exclusive with
--end-to-end. --end-to-end is the default mode.
Scoring options
......@@ -1341,6 +1339,18 @@ If one mate alignment overlaps the other at all, consider that to be
non-concordant. See also: Mates can overlap, contain or dovetail each
other. Default: mates can overlap in a concordant alignment.
BAM options
--align-paired-reads
Bowtie 2 will, by default, attempt to align unpaired BAM reads. Use this
option to align paired-end reads instead.
--preserve-tags
Preserve tags from the original BAM record by appending them to the end
of the corresponding Bowtie 2 SAM output.
Output options
-t/--time
......@@ -1459,7 +1469,7 @@ record, with value set to <text>.
--rg <text>
Add <text> (usually of the form TAG:VAL, e.g. SM:Pool1) as a field on
Add <text> (usually of the form TAG:VAL, e.g. SM:Pool1) as a field on
the @RG header line. Note: in order for the @RG line to appear, --rg-id
must also be specified. This is because the ID tag is required by the
SAM Spec. Specify --rg multiple times to set multiple fields. See the
......@@ -2043,7 +2053,7 @@ You will see something like this:
@HD VN:1.0 SO:unsorted
@SQ SN:gi|9626243|ref|NC_001416.1| LN:48502
@PG ID:bowtie2 PN:bowtie2 VN:2.0.1
r1 0 gi|9626243|ref|NC_001416.1| 18401 42 122M * 0 0 TGAATGCGAACTCCGGGACGCTCAGTAATGTGACGATAGCTGAAAACTGTACGATAAACNGTACGCTGAGGGCAGAAAAAATCGTCGGGGACATTNTAAAGGCGGCGAGCGCGGCTTTTCCG +"@6<:27(F&5)9)"B:%B+A-%5A?2$HCB0B+0=D<7E/<.03#!.F77@6B==?C"7>;))%;,3-$.A06+<-1/@@?,26">=?*@'0;$:;??G+:#+(A?9+10!8!?()?7C> AS:i:-5 XN:i:0 XM:i:3 XO:i:0 XG:i:0 NM:i:3 MD:Z:59G13G21G26 YT:Z:UU
r1 0 gi|9626243|ref|NC_001416.1| 18401 42 122M * 0 0 TGAATGCGAACTCCGGGACGCTCAGTAATGTGACGATAGCTGAAAACTGTACGATAAACNGTACGCTGAGGGCAGAAAAAATCGTCGGGGACATTNTAAAGGCGGCGAGCGCGGCTTTTCCG +"@6<:27(F&5)9"B):%B+A-%5A?2$HCB0B+0=D<7E/<.03#!.F77@6B==?C"7>;))%;,3-$.A06+<-1/@@?,26">=?*@'0;$:;??G+:#+(A?9+10!8!?()?7C> AS:i:-5 XN:i:0 XM:i:3 XO:i:0 XG:i:0 NM:i:3 MD:Z:59G13G21G26 YT:Z:UU
r2 0 gi|9626243|ref|NC_001416.1| 8886 42 275M * 0 0 NTTNTGATGCGGGCTTGTGGAGTTCAGCCGATCTGACTTATGTCATTACCTATGAAATGTGAGGACGCTATGCCTGTACCAAATCCTACAATGCCGGTGAAAGGTGCCGGGATCACCCTGTGGGTTTATAAGGGGATCGGTGACCCCTACGCGAATCCGCTTTCAGACGTTGACTGGTCGCGTCTGGCAAAAGTTAAAGACCTGACGCCCGGCGAACTGACCGCTGAGNCCTATGACGACAGCTATCTCGATGATGAAGATGCAGACTGGACTGC (#!!'+!$""%+(+)'%)%!+!(&++)''"#"#&#"!'!("%'""("+&%$%*%%#$%#%#!)*'(#")(($&$'&%+&#%*)*#*%*')(%+!%%*"$%"#+)$&&+)&)*+!"*)!*!("&&"*#+"&"'(%)*("'!$*!!%$&&&$!!&&"(*"$&"#&!$%'%"#)$#+%*+)!&*)+(""#!)!%*#"*)*')&")($+*%%)!*)!('(%""+%"$##"#+(('!*(($*'!"*('"+)&%#&$+('**$$&+*&!#%)')'(+(!%+ AS:i:-14 XN:i:0 XM:i:8 XO:i:0 XG:i:0 NM:i:8 MD:Z:0A0C0G0A108C23G9T81T46 YT:Z:UU
r3 16 gi|9626243|ref|NC_001416.1| 11599 42 338M * 0 0 GGGCGCGTTACTGGGATGATCGTGAAAAGGCCCGTCTTGCGCTTGAAGCCGCCCGAAAGAAGGCTGAGCAGCAGACTCAAGAGGAGAAAAATGCGCAGCAGCGGAGCGATACCGAAGCGTCACGGCTGAAATATACCGAAGAGGCGCAGAAGGCTNACGAACGGCTGCAGACGCCGCTGCAGAAATATACCGCCCGTCAGGAAGAACTGANCAAGGCACNGAAAGACGGGAAAATCCTGCAGGCGGATTACAACACGCTGATGGCGGCGGCGAAAAAGGATTATGAAGCGACGCTGTAAAAGCCGAAACAGTCCAGCGTGAAGGTGTCTGCGGGCGAT 7F$%6=$:9B@/F'>=?!D?@0(:A*)7/>9C>6#1<6:C(.CC;#.;>;2'$4D:?&B!>689?(0(G7+0=@37F)GG=>?958.D2E04C<E,*AD%G0.%$+A:'H;?8<72:88?E6((CF)6DF#.)=>B>D-="C'B080E'5BH"77':"@70#4%A5=6.2/1>;9"&-H6)=$/0;5E:<8G!@::1?2DC7C*;@*#.1C0.D>H/20,!"C-#,6@%<+<D(AG-).?&#0.00'@)/F8?B!&"170,)>:?<A7#1(A@0E#&A.*DC.E")AH"+.,5,2>5"2?:G,F"D0B8D-6$65D<D!A/38860.*4;4B<*31?6 AS:i:-22 XN:i:0 XM:i:8 XO:i:0 XG:i:0 NM:i:8 MD:Z:80C4C16A52T23G30A8T76A41 YT:Z:UU
r4 0 gi|9626243|ref|NC_001416.1| 40075 42 184M * 0 0 GGGCCAATGCGCTTACTGATGCGGAATTACGCCGTAAGGCCGCAGATGAGCTTGTCCATATGACTGCGAGAATTAACNGTGGTGAGGCGATCCCTGAACCAGTAAAACAACTTCCTGTCATGGGCGGTAGACCTCTAAATCGTGCACAGGCTCTGGCGAAGATCGCAGAAATCAAAGCTAAGT(=8B)GD04*G%&4F,1'A>.C&7=F$,+#6!))43C,5/5+)?-/0>/D3=-,2/+.1?@->;)00!'3!7BH$G)HG+ADC'#-9F)7<7"$?&.>0)@5;4,!0-#C!15CF8&HB+B==H>7,/)C5)5*+(F5A%D,EA<(>G9E0>7&/E?4%;#'92)<5+@7:A.(BG@BG86@.G AS:i:-1 XN:i:0 XM:i:1 XO:i:0 XG:i:0 NM:i:1 MD:Z:77C106 YT:Z:UU
......
......@@ -139,103 +139,17 @@ or install it using your operating system's preferred package manager.
The table below list some of the commands for a few of the more popular
operating systems.
<table>
<tr><th>OS</th><th>Sync Package List</th><th>Search</th><th>Install</th></tr>
<tr><td>Ubuntu, Mint, Debian</td>
<td>
apt-get update
</td>
<td>
apt-cache search tbb
</td>
<td>
apt-get install libtbb-dev
</td></tr>
<tr><td>Fedora, CentOS</td>
<td>
yum check-update
</td>
<td>
yum search tbb
</td>
<td>
yum install tbb-devel.x86_64
</td></tr>
<tr><td>Arch</td>
<td>
packman -Sy
</td>
<td>
pacman -Ss tbb
</td>
<td>
pacman -S extra/intel-tbb
</td></tr>
<tr><td>Gentoo</td>
<td>
emerge --sync
</td>
<td>
emerge --search tbb
</td>
<td>
emerge dev-cpp/tbb
| Operating System | Sync Package List | Search | Install |
|:---------------------|:------------------|:---------------------|:-----------------------------|
| Ubuntu, Mint, Debian | apt-get update | apt-cache search tbb | apt-get install libtbb-dev |
| Fedora, CentOS | yum check-update | yum search tbb | yum install tbb-devel.x86_64 |
| Arch | packman -Sy | pacman -Ss tbb | pacman -S extra/intel-tbb |
| Gentoo | emerge --sync | emerge --search tbb | emerge dev-cpp/tbb |
| macOS | brew update | brew search tbb | brew install tbb |
| FreeBSD | pkg update | pkg search tbb | pkg install tbb-2019.1 |
</td>
<tr><td>MacOS</td>
<td>
brew update
</td>
<td>
brew search tbb
</td>
<td>
brew install tbb
</td></tr>
<tr><td>FreeBSD</td>
<td>
portsnap fetch update
</td>
<td>
make search name=tbb
</td>
<td>
cd /usr/ports/devel/tbb && make install && make clean
</table>
If all fails Bowtie 2 can be built with `make NO_TBB=1` to use pthreads
or Windows native multithreading instead.
The Bowtie 2 Makefile also includes recipes for basic automatic dependency
management. Running `make static-libs && make STATIC_BUILD=1` will issue
......@@ -244,8 +158,10 @@ a series of commands that will:
2. compile them as static libraries
3. link the resulting libraries to the compiled Bowtie 2 binaries
If all fails Bowtie 2 can be built with `make NO_TBB=1` to use pthreads
or Windows native multithreading instead.
As of version 2.3.5 bowtie2 now supports aligning SRA reads. Prepackaged
builds will include a package that supports SRA. If you're building bowtie2
from source please make sure that the Java runtime is available on your system.
You can then proceed with the build by running `make sra-deps && make USE_SRA=1`.
Adding to PATH
--------------
......@@ -875,11 +791,11 @@ considered valid, and `x` is the read length.
### Usage
bowtie2 [options]* -x <bt2-idx> {-1 <m1> -2 <m2> | -U <r> | --interleaved <i>} -S [<sam>]
bowtie2 [options]* -x <bt2-idx> {-1 <m1> -2 <m2> | -U <r> | --interleaved <i> | --sra-acc <acc> | b <bam>} -S [<sam>]
### Main arguments
<table><tr><td>
<table><tr><td id="bowtie2-options-x">
-x <bt2-idx>
......@@ -890,7 +806,8 @@ any of the index files up to but not including the final `.1.bt2` / `.rev.1.bt2`
/ etc. `bowtie2` looks for the specified index first in the current directory,
then in the directory specified in the `BOWTIE2_INDEXES` environment variable.
</td></tr><tr><td>
</td></tr>
<tr><td id="bowtie2-options-1">
-1 <m1>
......@@ -902,7 +819,8 @@ correspond file-for-file and read-for-read with those specified in `<m2>`. Reads
may be a mix of different lengths. If `-` is specified, `bowtie2` will read the
mate 1s from the "standard in" or "stdin" filehandle.
</td></tr><tr><td>
</td></tr>
<tr><td id="bowtie2-options-2">
-2 <m2>
......@@ -914,7 +832,8 @@ correspond file-for-file and read-for-read with those specified in `<m1>`. Reads
may be a mix of different lengths. If `-` is specified, `bowtie2` will read the
mate 2s from the "standard in" or "stdin" filehandle.
</td></tr><tr><td>
</td></tr>
<tr><td id="bowtie2-options-U">
-U <r>
......@@ -925,7 +844,44 @@ Comma-separated list of files containing unpaired reads to be aligned, e.g.
If `-` is specified, `bowtie2` gets the reads from the "standard in" or "stdin"
filehandle.
</td></tr><tr><td>
</td></tr>
<tr><td id="bowtie2-options-interleaved">
--interleaved
</td><td>
Reads interleaved FASTQ files where the first two records (8 lines)
represent a mate pair.
</td></tr>
<tr><td id="bowtie2-options-sra-acc">
--sra-acc
</td><td>
Reads are SRA accessions. If the accession provided cannot be found in
local storage it will be fetched from the NCBI database. If you find that
SRA alignments are long running please rerun your command with the
[`-p`/`--threads`] parameter set to desired number of threads.
NB: this option is only available if bowtie 2 is compiled with the necessary
SRA libraries. See [Obtaining Bowtie 2][obtain Bowtie 2] for details.
</td></tr>
<tr><td id="bowtie2-options-b">
-b <bam>
</td><td>
Reads are unaligned BAM records sorted by read name.
The [`--align-paired-reads`] and [`--preserve-tags`] options
affect the way Bowtie 2 processes records.
</td></tr>
<tr><td id="bowtie2-options-S">
-S <sam>
......@@ -951,16 +907,6 @@ Reads (specified with `<m1>`, `<m2>`, `<s>`) are FASTQ files. FASTQ files
usually have extension `.fq` or `.fastq`. FASTQ is the default format. See
also: [`--solexa-quals`] and [`--int-quals`].
</td></tr>
<tr><td id="bowtie2-options-interleaved">
--interleaved
</td><td>
Reads interleaved FASTQ files where the first two records (8 lines)
represent a mate pair.
</td></tr>
<tr><td id="bowtie2-options-tab5">
......@@ -1166,7 +1112,7 @@ Same as: `-D 10 -R 2 -N 0 -L 22 -i S,0,2.50`
</td><td>
Same as: `-D 15 -R 2 -L 22 -i S,1,1.15` (default in [`--end-to-end`] mode)
Same as: `-D 15 -R 2 -N 0 -L 22 -i S,1,1.15` (default in [`--end-to-end`] mode)
</td></tr>
<tr><td id="bowtie2-options-very-sensitive">
......@@ -1244,8 +1190,8 @@ alignment]. Can be set to 0 or 1. Setting this higher makes alignment slower
Sets the length of the seed substrings to align during [multiseed alignment].
Smaller values make alignment slower but more sensitive. Default: the
[`--sensitive`] preset is used by default, which sets `-L` to 20 both in
[`--end-to-end`] mode and in [`--local`] mode.
[`--sensitive`] preset is used by default, which sets `-L` to 22 and
20 in [`--end-to-end`] mode and in [`--local`] mode.
</td></tr>
<tr><td id="bowtie2-options-i">
......@@ -1670,6 +1616,31 @@ Default: mates can overlap in a concordant alignment.
</td></tr></table>
#### BAM options
<table>
<tr><td id="bowtie2-options-align-paired-reads">
--align-paired-reads
</td><td>
Bowtie 2 will, by default, attempt to align unpaired BAM reads.
Use this option to align paired-end reads instead.
</td></tr>
<tr><td id="bowtie2-options-preserve-tags">
--preserve-tags
</td><td>
Preserve tags from the original BAM record by appending them to the end
of the corresponding Bowtie 2 SAM output.
</td></tr></table>
#### Output options
<table>
......@@ -2703,7 +2674,7 @@ You will see something like this:
@HD VN:1.0 SO:unsorted
@SQ SN:gi|9626243|ref|NC_001416.1| LN:48502
@PG ID:bowtie2 PN:bowtie2 VN:2.0.1
r1 0 gi|9626243|ref|NC_001416.1| 18401 42 122M * 0 0 TGAATGCGAACTCCGGGACGCTCAGTAATGTGACGATAGCTGAAAACTGTACGATAAACNGTACGCTGAGGGCAGAAAAAATCGTCGGGGACATTNTAAAGGCGGCGAGCGCGGCTTTTCCG +"@6<:27(F&5)9)"B:%B+A-%5A?2$HCB0B+0=D<7E/<.03#!.F77@6B==?C"7>;))%;,3-$.A06+<-1/@@?,26">=?*@'0;$:;??G+:#+(A?9+10!8!?()?7C> AS:i:-5 XN:i:0 XM:i:3 XO:i:0 XG:i:0 NM:i:3 MD:Z:59G13G21G26 YT:Z:UU
r1 0 gi|9626243|ref|NC_001416.1| 18401 42 122M * 0 0 TGAATGCGAACTCCGGGACGCTCAGTAATGTGACGATAGCTGAAAACTGTACGATAAACNGTACGCTGAGGGCAGAAAAAATCGTCGGGGACATTNTAAAGGCGGCGAGCGCGGCTTTTCCG +"@6<:27(F&5)9"B):%B+A-%5A?2$HCB0B+0=D<7E/<.03#!.F77@6B==?C"7>;))%;,3-$.A06+<-1/@@?,26">=?*@'0;$:;??G+:#+(A?9+10!8!?()?7C> AS:i:-5 XN:i:0 XM:i:3 XO:i:0 XG:i:0 NM:i:3 MD:Z:59G13G21G26 YT:Z:UU
r2 0 gi|9626243|ref|NC_001416.1| 8886 42 275M * 0 0 NTTNTGATGCGGGCTTGTGGAGTTCAGCCGATCTGACTTATGTCATTACCTATGAAATGTGAGGACGCTATGCCTGTACCAAATCCTACAATGCCGGTGAAAGGTGCCGGGATCACCCTGTGGGTTTATAAGGGGATCGGTGACCCCTACGCGAATCCGCTTTCAGACGTTGACTGGTCGCGTCTGGCAAAAGTTAAAGACCTGACGCCCGGCGAACTGACCGCTGAGNCCTATGACGACAGCTATCTCGATGATGAAGATGCAGACTGGACTGC (#!!'+!$""%+(+)'%)%!+!(&++)''"#"#&#"!'!("%'""("+&%$%*%%#$%#%#!)*'(#")(($&$'&%+&#%*)*#*%*')(%+!%%*"$%"#+)$&&+)&)*+!"*)!*!("&&"*#+"&"'(%)*("'!$*!!%$&&&$!!&&"(*"$&"#&!$%'%"#)$#+%*+)!&*)+(""#!)!%*#"*)*')&")($+*%%)!*)!('(%""+%"$##"#+(('!*(($*'!"*('"+)&%#&$+('**$$&+*&!#%)')'(+(!%+ AS:i:-14 XN:i:0 XM:i:8 XO:i:0 XG:i:0 NM:i:8 MD:Z:0A0C0G0A108C23G9T81T46 YT:Z:UU
r3 16 gi|9626243|ref|NC_001416.1| 11599 42 338M * 0 0 GGGCGCGTTACTGGGATGATCGTGAAAAGGCCCGTCTTGCGCTTGAAGCCGCCCGAAAGAAGGCTGAGCAGCAGACTCAAGAGGAGAAAAATGCGCAGCAGCGGAGCGATACCGAAGCGTCACGGCTGAAATATACCGAAGAGGCGCAGAAGGCTNACGAACGGCTGCAGACGCCGCTGCAGAAATATACCGCCCGTCAGGAAGAACTGANCAAGGCACNGAAAGACGGGAAAATCCTGCAGGCGGATTACAACACGCTGATGGCGGCGGCGAAAAAGGATTATGAAGCGACGCTGTAAAAGCCGAAACAGTCCAGCGTGAAGGTGTCTGCGGGCGAT 7F$%6=$:9B@/F'>=?!D?@0(:A*)7/>9C>6#1<6:C(.CC;#.;>;2'$4D:?&B!>689?(0(G7+0=@37F)GG=>?958.D2E04C<E,*AD%G0.%$+A:'H;?8<72:88?E6((CF)6DF#.)=>B>D-="C'B080E'5BH"77':"@70#4%A5=6.2/1>;9"&-H6)=$/0;5E:<8G!@::1?2DC7C*;@*#.1C0.D>H/20,!"C-#,6@%<+<D(AG-).?&#0.00'@)/F8?B!&"170,)>:?<A7#1(A@0E#&A.*DC.E")AH"+.,5,2>5"2?:G,F"D0B8D-6$65D<D!A/38860.*4;4B<*31?6 AS:i:-22 XN:i:0 XM:i:8 XO:i:0 XG:i:0 NM:i:8 MD:Z:80C4C16A52T23G30A8T76A41 YT:Z:UU
r4 0 gi|9626243|ref|NC_001416.1| 40075 42 184M * 0 0 GGGCCAATGCGCTTACTGATGCGGAATTACGCCGTAAGGCCGCAGATGAGCTTGTCCATATGACTGCGAGAATTAACNGTGGTGAGGCGATCCCTGAACCAGTAAAACAACTTCCTGTCATGGGCGGTAGACCTCTAAATCGTGCACAGGCTCTGGCGAAGATCGCAGAAATCAAAGCTAAGT(=8B)GD04*G%&4F,1'A>.C&7=F$,+#6!))43C,5/5+)?-/0>/D3=-,2/+.1?@->;)00!'3!7BH$G)HG+ADC'#-9F)7<7"$?&.>0)@5;4,!0-#C!15CF8&HB+B==H>7,/)C5)5*+(F5A%D,EA<(>G9E0>7&/E?4%;#'92)<5+@7:A.(BG@BG86@.G AS:i:-1 XN:i:0 XM:i:1 XO:i:0 XG:i:0 NM:i:1 MD:Z:77C106 YT:Z:UU
......@@ -2846,6 +2817,7 @@ for more details and variations on this process.
[`--al-gz`]: #bowtie2-options-al
[`--al-lz4`]: #bowtie2-options-al
[`--al`]: #bowtie2-options-al
[`--align-paired-reads`]: #bowtie2-options-align-paired-reads
[`--bmax`]: #bowtie2-build-options-bmax
[`--bmaxdivn`]: #bowtie2-build-options-bmaxdivn
[`--dcv`]: #bowtie2-build-options-dcv
......@@ -2861,6 +2833,7 @@ for more details and variations on this process.
[`--ignore-quals`]: #bowtie2-options-ignore-quals
[`--int-quals`]: #bowtie2-options-int-quals
[`--interleaved`]: #bowtie2-options-interleaved
[`--sra-acc`]: #bowtie2-options-sra-acc
[`--large-index`]: #bowtie2-build-options-large-index
[`--local`]: #bowtie2-options-local
[`--ma`]: #bowtie2-options-ma
......@@ -2887,6 +2860,7 @@ for more details and variations on this process.
[`--packed`]: #bowtie2-build-options-p
[`--phred33`]: #bowtie2-options-phred33-quals
[`--phred64`]: #bowtie2-options-phred64-quals
[`--preserve-tags`]: #bowtie2-options-preserve-tags
[`--qc-filter`]: #bowtie2-options-qc-filter
[`--qseq`]: #bowtie2-options-qseq
[`--quiet`]: #bowtie2-options-quiet
......@@ -2933,6 +2907,7 @@ for more details and variations on this process.
<!-- fasta-continuous option does not exist but was added to prevent
warnings due to the case insensitive nature of markdown URLs -->
[`-F`/--fasta-continuous]: #bowtie2-options-F
[`-b`]: #bowtie2-options-b
[`-c`]: #bowtie2-options-c
[`-f`]: #bowtie2-options-f
[`-i`]: #bowtie2-options-i
......
......@@ -31,15 +31,17 @@ CC ?= $(GCC_PREFIX)/gcc$(GCC_SUFFIX)
CPP ?= $(GCC_PREFIX)/g++$(GCC_SUFFIX)
CXX ?= $(CPP)
CXXFLAGS += -std=c++98
ifeq (aarch64,$(shell uname -m))
CXXFLAGS += -fopenmp-simd
CPPFLAGS += -Ithird_party/simde
endif
HEADERS := $(wildcard *.h)
BOWTIE_MM := 1
BOWTIE_SHARED_MEM :=
ifdef STATIC_BUILD
LDFLAGS += -L$(CURDIR)/.tmp/lib
CPPFLAGS += -I$(CURDIR)/.tmp/include
endif
NGS_VER ?= 2.9.2
VDB_VER ?= 2.9.2-1
# Detect Cygwin or MinGW
WINDOWS :=
......@@ -63,6 +65,11 @@ ifneq (,$(findstring Darwin,$(shell uname)))
endif
endif
ifdef STATIC_BUILD
LDFLAGS += -L$(CURDIR)/.tmp/lib
CPPFLAGS += -I$(CURDIR)/.tmp/include
endif
POPCNT_CAPABILITY ?= 1
ifeq (1, $(POPCNT_CAPABILITY))
CXXFLAGS += -DPOPCNT_CAPABILITY
......@@ -104,6 +111,9 @@ ifneq (1,$(NO_TBB))
LDLIBS += $(PTHREAD_LIB) -ltbb
ifdef STATIC_BUILD
LDLIBS += -ltbbmalloc
ifndef MINGW
LDLIBS += -ldl
endif
else
LDLIBS += -ltbbmalloc_proxy
endif
......@@ -112,6 +122,26 @@ else
LDLIBS += $(PTHREAD_LIB)
endif
USE_SRA ?=
ifeq (1, $(USE_SRA))
ifdef MINGW
$(error "SRA binaries cannot be built on MINGW")
else
LDFLAGS += -L$(CURDIR)/.tmp/lib64
ifndef ($(STATIC_BUILD))
CPPFLAGS += -I$(CURDIR)/.tmp/include
endif
LDLIBS += -lncbi-ngs-c++-static
LDLIBS += -lngs-c++-static
LDLIBS += -lncbi-vdb-static
LDLIBS += -ldl
CXXFLAGS += -DUSE_SRA
endif
endif
ifeq (1,$(WITH_THREAD_PROFILING))
CXXFLAGS += -DPER_THREAD_TIMING=1
endif
......@@ -174,6 +204,9 @@ endif
ifeq (amd64,$(shell uname -m))
BITS := 64
endif
ifeq (aarch64,$(shell uname -m))
BITS := 64
endif
# msys will always be 32 bit so look at the cpu arch instead.
ifneq (,$(findstring AMD64,$(PROCESSOR_ARCHITEW6432)))
ifeq (1,$(MINGW))
......@@ -185,9 +218,14 @@ ifeq (32,$(BITS))
endif
SSE_FLAG := -msse2
M64_FLAG := -m64
ifeq (aarch64,$(shell uname -m))
SSE_FLAG =
M64_FLAG =
endif
DEBUG_FLAGS := -O0 -g3 -m64 $(SSE_FLAG)
RELEASE_FLAGS := -O3 -m64 $(SSE_FLAG) -funroll-loops -g3
DEBUG_FLAGS := -O0 -g3 $(M64_FLAG) $(SSE_FLAG)
RELEASE_FLAGS := -O3 $(M64_FLAG) $(SSE_FLAG) -funroll-loops -g3
NOASSERT_FLAGS := -DNDEBUG
FILE_FLAGS := -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
DEBUG_DEFS = -DCOMPILER_OPTIONS="\"$(DEBUG_FLAGS) $(CXXFLAGS)\""
......@@ -230,10 +268,12 @@ GENERAL_LIST := $(wildcard scripts/*.sh) \
$(wildcard scripts/*.pl) \
doc/manual.html \
doc/README \
Dockerfile-aarch64 \
doc/style.css \
$(wildcard example/index/*.bt2) \
$(wildcard example/reads/*.fq) \
$(wildcard example/reads/*.pl) \
example/reads/combined_reads.bam \
example/reference/lambda_virus.fa \
$(PTHREAD_PKG) \
bowtie2 \
......@@ -244,6 +284,7 @@ GENERAL_LIST := $(wildcard scripts/*.sh) \
NEWS \
MANUAL \
MANUAL.markdown \
README.md \
TUTORIAL \
VERSION
......@@ -266,6 +307,7 @@ SRC_PKG_LIST = $(wildcard *.h) \
$(wildcard *.cpp) \
$(wildcard third_party/*) \
Makefile \
CMakeLists.txt \
$(GENERAL_LIST)
ifeq (1,$(WINDOWS))
......@@ -284,8 +326,8 @@ both-sanitized: bowtie2-align-s-sanitized bowtie2-build-s-sanitized bowtie2-alig
DEFS := -fno-strict-aliasing \
-DBOWTIE2_VERSION="\"`cat VERSION`\"" \
-DBUILD_HOST="\"`hostname`\"" \
-DBUILD_TIME="\"`date`\"" \
-DBUILD_HOST="\"${HOSTNAME:-`hostname`}\"" \
-DBUILD_TIME="\"`date -u -r NEWS`\"" \
-DCOMPILER_VERSION="\"`$(CXX) -v 2>&1 | tail -1`\"" \
$(FILE_FLAGS) \
$(PREF_DEF) \
......@@ -456,8 +498,8 @@ bowtie2-src-pkg: $(SRC_PKG_LIST)
rm -rf .src.tmp
.PHONY: bowtie2-bin-pkg
bowtie2-bin-pkg: PKG_DIR := bowtie2-$(VERSION)-$(if $(MACOS),macos,$(if $(MINGW),mingw,linux))-x86_64
bowtie2-bin-pkg: static-libs $(BIN_PKG_LIST) $(BOWTIE2_BIN_LIST) $(BOWTIE2_BIN_LIST_DBG)
bowtie2-bin-pkg: PKG_DIR := bowtie2-$(VERSION)-$(if $(USE_SRA),sra-)$(if $(MACOS),macos,$(if $(MINGW),mingw,linux))-x86_64
bowtie2-bin-pkg: $(BIN_PKG_LIST) $(BOWTIE2_BIN_LIST) $(BOWTIE2_BIN_LIST_DBG)
chmod a+x scripts/*.sh scripts/*.pl
rm -rf .bin.tmp
mkdir -p .bin.tmp/$(PKG_DIR)
......@@ -516,32 +558,68 @@ random-test: all perl-deps
.PHONY: perl-deps
perl-deps:
if [ ! -e .tmp ]; then \
DL=$$([ `which wget` ] && echo "wget --no-check-certificate -O-" || echo "curl -L") ; \
mkdir .tmp ; \
if [ ! -d "$(CURDIR)/.tmp" ]; then \
mkdir -p $(CURDIR)/.tmp/include $(CURDIR)/.tmp/lib ; \
fi
DL=$$( ( which wget >/dev/null 2>&1 && echo "wget --no-check-certificate -O-" ) || echo "curl -L") ; \
$$DL http://cpanmin.us | perl - -l $(CURDIR)/.tmp App::cpanminus local::lib ; \
eval `perl -I $(CURDIR)/.tmp/lib/perl5 -Mlocal::lib=$(CURDIR)/.tmp` ; \
$(CURDIR)/.tmp/bin/cpanm --force Math::Random Clone Test::Deep Sys::Info ; \
fi
$(CURDIR)/.tmp/bin/cpanm --force File::Which Math::Random Clone Test::Deep Sys::Info ; \
.PHONY: static-libs
static-libs:
if [[ ! -d $(CURDIR)/.tmp/lib || ! -d $(CURDIR)/.tmp/include ]]; then \
mkdir -p $(CURDIR)/.tmp/lib $(CURDIR)/.tmp/include ; \
if [ ! -d "$(CURDIR)/.tmp" ] ; then \
mkdir -p $(CURDIR)/.tmp/include $(CURDIR)/.tmp/lib ; \
fi ; \
if [[ `uname` = "Darwin" ]]; then \
if [ `uname` = "Darwin" ]; then \
export CFLAGS=-mmacosx-version-min=10.9 ; \
export CXXFLAGS=-mmacosx-version-min=10.9 ; \
fi ; \
DL=$$([ `which wget` ] && echo "wget --no-check-certificate" || echo "curl -LOk") ; \
mkdir .tmp ; \
cd .tmp ; \
cd $(CURDIR)/.tmp ; \
DL=$$( ( which wget >/dev/null 2>&1 && echo "wget --no-check-certificate" ) || echo "curl -LOk") ; \
if [ ! -f "$(CURDIR)/.tmp/include/zlib.h" ] ; then \
$$DL https://zlib.net/zlib-1.2.11.tar.gz && tar xzf zlib-1.2.11.tar.gz && cd zlib-1.2.11 ; \
$(if $(MINGW), mingw32-make -f win32/Makefile.gcc, ./configure --static && make) && cp libz.a $(CURDIR)/.tmp/lib && cp zconf.h zlib.h $(CURDIR)/.tmp/include ; \
cd .. ; \
$$DL https://github.com/01org/tbb/archive/2017_U8.tar.gz && tar xzf 2017_U8.tar.gz && cd tbb-2017_U8; \
$(if $(MINGW), mingw32-make -f win32/Makefile.gcc, ./configure --static && make) ; \
cp zlib.h zconf.h $(CURDIR)/.tmp/include && cp libz.a $(CURDIR)/.tmp/lib ; \
rm -f zlib-1.2.11 ; \
fi ; \
if [ ! -d "$(CURDIR)/.tmp/include/tbb" ] ; then \
cd $(CURDIR)/.tmp ; \
$$DL https://github.com/01org/tbb/archive/2019_U4.tar.gz && tar xzf 2019_U4.tar.gz && cd tbb-2019_U4; \
$(if $(MINGW), mingw32-make compiler=gcc arch=ia64 runtime=mingw, make) extra_inc=big_iron.inc -j4 \
&& cp -r include/tbb $(CURDIR)/.tmp/include && cp build/*_release/*.a $(CURDIR)/.tmp/lib
&& cp -r include/tbb $(CURDIR)/.tmp/include && cp build/*_release/*.a $(CURDIR)/.tmp/lib ; \
rm -f 2019_U4.tar.gz ; \
fi
.PHONY: sra-deps
sra-deps:
DL=$$( ( which wget >/dev/null 2>&1 && echo "wget --no-check-certificate" ) || echo "curl -LOk") ; \
if [ ! -d "$(CURDIR)/.tmp" ] ; then \
mkdir -p $(CURDIR)/.tmp/include $(CURDIR)/.tmp/lib ; \
fi ; \
if [ `uname` = "Darwin" ]; then \
export CFLAGS=-mmacosx-version-min=10.9 ; \
export CXXFLAGS=-mmacosx-version-min=10.9 ; \
fi ; \
if [ ! -f "$(CURDIR)/.tmp/include/ngs/Alignment.hpp" ] ; then \
if [ ! -d "$(CURDIR)/.tmp/ngs-$(NGS_VER)/ngs-sdk" ] ; then \
cd $(CURDIR)/.tmp ; \
$$DL https://github.com/ncbi/ngs/archive/$(NGS_VER).tar.gz ; \
tar xzvf $(NGS_VER).tar.gz ; \
rm -f $(NGS_VER).tar.gz ; \
fi ; \
cd $(CURDIR)/.tmp/ngs-$(NGS_VER) && ./configure --prefix=$(CURDIR)/.tmp --build-prefix=`pwd`/build ; \
make && make install ; \
fi ; \
if [ ! -f "$(CURDIR)/.tmp/include/ncbi-vdb/NGS.hpp" ] ; then \
if [ ! -d "$(CURDIR)/.tmp/ncbi-vdb-$(VDB_VER)/vdb3" ] ; then \
cd $(CURDIR)/.tmp ; \
$$DL https://github.com/ncbi/ncbi-vdb/archive/$(VDB_VER).tar.gz ; \
tar zxvf $(VDB_VER).tar.gz ; \
rm -f $(VDB_VER).tar.gz ; \
fi ; \
cd $(CURDIR)/.tmp/ncbi-vdb-$(VDB_VER) && ./configure --prefix=$(CURDIR)/.tmp --build-prefix=`pwd`/build --with-ngs-sdk=$(CURDIR)/.tmp && make && make install ; \
fi ;
.PHONY: test
test: simple-test random-test
......
......@@ -4,7 +4,7 @@ Bowtie 2 NEWS
Bowtie 2 is available for download from the project website,
http://bowtie-bio.sf.net/bowtie2 and on Github,
https://github.com/BenLangmead/bowtie2/releases. 2.0.0-beta1 is
the first version released to the public and 2.3.3 is the latest
the first version released to the public and 2.3.5.1 is the latest
version. Bowtie 2 is licensed under the GPLv3 license. See `LICENSE'
file for details.
......@@ -19,6 +19,30 @@ Please report any issues to the Bowtie 2 Github page or using the Sourceforge bu
Version Release History
=======================
Version 2.3.5.1 - Apr 16, 2019
* Added official support for BAM input files
* Added official support for CMake build system
* Added changes to Makefile for creating Reproducible builds (via [210](https://github.com/BenLangmead/bowtie2/pull/210))
* Fix an issue whereby building on aarch64 would require patching sed commands (via [#243](https://github.com/BenLangmead/bowtie2/pull/243))
* Fix an issue whereby `bowtie2` would incorrectly throw an error while processing `--interleaved` input
Version 2.3.5 - Mar 16, 2019
* Added support for obtaining input reads directly from the Sequence Read Archive, via NCBI's [NGS language bindings](https://github.com/ncbi/ngs). This is activated via the [`--sra-acc`](manual.shtml#bowtie2-options-sra-acc) option. This implementation is based on Daehwan Kim's in [HISAT2](https://ccb.jhu.edu/software/hisat2). Supports both unpaired and paired-end inputs.
* Bowtie 2 now compiles on ARM architectures (via [#216](https://github.com/BenLangmead/bowtie2/pull/216))
* `--interleaved` can now be combined with FASTA inputs (worked only with FASTQ before)
* Fixed issue whereby large indexes were not successfully found in the `$BOWTIE2_INDEXES` directory
* Fixed input from FIFOs (e.g. via process substitution) to distinguish gzip-compressed versus uncompressed input
* Fixed issue whereby arguments containing `bz2` `lz4` were misinterpretted as files
* Fixed several compiler warnings
* Fixed issue whereby both ends of a paired-end read could have negative TLEN if they exactly coincided
* Fixed issue whereby `bowtie2-build` would hang on end-of-file (via [#228](https://github.com/BenLangmead/bowtie2/pull/228))
* Fixed issue whereby wrapper script would sometimes create zombie processes (via [#51](https://github.com/BenLangmead/bowtie2/pull/51))
* Fixed issue whereby `bowtie2-build` and `bowtie2-inspect` wrappers would fail on some versions of Python/PyPy
* Replaced old, unhelpful `README.md` in the project with a version that includes badges, links and some highlights from the manual
* Note: BAM input support and CMake build support both remain experimental, but we expect to finalize them in the next release
Version 2.3.4.3 - Sep 17, 2018
* Fixed an issue causing `bowtie2-build` and `bowtie2-inspect`
......
Bowtie 2: http://bowtie-bio.sf.net/bowtie2
- See AUTHORS for information about who wrote Bowtie 2 and its various
components.
- See LICENSE for license information.
- See MANUAL for detailed information on how to use Bowtie 2.
- See NEWS for information about changes in this and previous versions
of Bowtie 2.
<!-- badges: start -->
[![Generic badge](https://img.shields.io/badge/version-2.3.5.1-green.svg)](https://shields.io/)
[![Build Status](https://travis-ci.org/BenLangmead/bowtie2.svg?branch=master)](https://travis-ci.org/BenLangmead/bowtie2)
[![License: GPL v3](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
<!--badges: end -->
## Overview
*Bowtie 2* is an ultrafast and memory-efficient tool for aligning sequencing reads
to long reference sequences. It is particularly good at aligning reads of about 50
up to 100s or 1,000s of characters, and particularly good at aligning to relatively
long (e.g. mammalian) genomes. Bowtie 2 indexes the genome with an FM Index to keep
its memory footprint small: for the human genome, its memory footprint is typically
around 3.2 GB. Bowtie 2 supports gapped, local, and paired-end alignment modes.
## Obtaining Bowtie2
*Bowtie 2* is available from various package managers, notably
[Bioconda](https://anaconda.org/bioconda/bowtie2). With Bioconda installed, you
should be able to install Bowtie 2 with `conda install bowtie2`.
Containerized versions of Bowtie 2 are also available via the
[Biocontainers](https://biocontainers.pro/) project (e.g. via
[Docker Hub](https://hub.docker.com/r/biocontainers/bowtie2/)).
You can also download Bowtie 2 sources and binaries from the "releases" tab on this
page. Binaries are available for the x86_64 architecture running Linux, Mac OS X,
and Windows. We are planning on adding experimental support for ARM-64 in an
upcoming release. If you plan to compile Bowtie 2 yourself, make sure you have the
[TBB](https://www.threadingbuildingblocks.org/) and [zlib](https://www.zlib.net)
libraries installed. See the
[Building from source](http://bowtie-bio.sourceforge.net/bowtie2/manual.shtml#building-from-source)
section of the manual for details.
## Getting started
Looking to try out Bowtie 2? Check out the [Bowtie 2 UI](http://bit.ly/bt2ui-beta) (currently in beta).
### Alignment
`bowtie2` takes a Bowtie 2 index and a set of sequencing read files and outputs a
set of alignments in SAM format.
"Alignment" is the process by which we discover how and where the read sequences are
similar to the reference sequence. An “alignment” is a result from this process,
specifically: an alignment is a way of “lining up” some or all of the characters in
the read with some characters from the reference in a way that reveals how they’re
similar. For example:
```
Read: GACTGGGCGATCTCGACTTCG
||||| |||||||||| |||
Reference: GACTG--CGATCTCGACATCG
```
Where dash symbols represent gaps and vertical bars show where aligned characters match.
We use alignment to make an educated guess as to where a read originated with
respect to the reference genome. It’s not always possible to determine this with
certainty. For instance, if the reference genome contains several long stretches of
As (`AAAAAAAAA` etc.) and the read sequence is a short stretch of As (`AAAAAAA`), we
cannot know for certain exactly where in the sea of As the read originated.
**Examples**
```
# Aligning unpaired reads
bowtie2 -x example/index/lambda_virus -U example/reads/longreads.fq
# Aligning paired reads
bowtie2 -x example/index/lambda_virus -1 example/reads/reads_1.fq -2 example/reads/reads_2.fq
```
### Building an index
`bowtie2-build` builds a Bowtie index from a set of DNA sequences. `bowtie2-build`
outputs a set of 6 files with suffixes `.1.bt2`, `.2.bt2`, `.3.bt2`, `.4.bt2`,
`.rev.1.bt2`, and `.rev.2.bt2`. In the case of a large index these suffixes will
have a `bt2l` termination. These files together constitute the index: they are all
that is needed to align reads to that reference. The original sequence FASTA files
are no longer used by Bowtie 2 once the index is built.
Bowtie 2’s `.bt2` index format is different from Bowtie 1’s `.ebwt` format, and they
are not compatible with each other.
**Examples**
```
# Building a small index
bowtie2-build example/reference/lambda_virus.fa example/index/lambda_virus
# Building a large index
bowtie2-build --large-index example/reference/lambda_virus.fa example/index/lambda_virus
```
### Index inpection
`bowtie2-inspect` extracts information from a Bowtie 2 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-A/C/G/T characters converted to Ns). It can also be used to
extract just the reference sequence names using the `-n/--names` option or a more
verbose summary using the `-s/--summary` option.
**Examples**
```
# Inspecting a lambda_virus index (small index) and outputting the summary
bowtie2-inspect --summary example/index/lambda_virus
# Inspecting the entire lambda virus index (large index)
bowtie2-inspect --large-index example/index/lambda_virus
```
## Publications
### Bowtie 2 Papers
- Langmead B, Wilks C., Antonescu V., Charles R. __[Scaling read aligners to hundreds of threads on general-purpose processors](https://doi.org/10.1093/bioinformatics/bty648)__. [Bioinformatics](https://academic.oup.com/bioinformatics). bty648.
- Langmead B, Salzberg S. __[Fast gapped-read alignment with Bowtie 2](http://www.nature.com/nmeth/journal/v9/n4/full/nmeth.1923.html)__. [Nature Methods](http://www.nature.com/nmeth). 2012, 9:357-359.
- Langmead B, Trapnell C, Pop M, Salzberg SL. __[Ultrafast and memory-efficient alignment of short DNA sequences to the human genome](http://genomebiology.com/2009/10/3/R25)__. [Genome Biology](http://genomebiology.com/) 10:R25.
### Related Publications
- P. Ferragina, G. Manzini __[Opportunistic data structures with applications](https://ieeexplore.ieee.org/document/892127)__. [IEEE Xplore](http://genomebiology.com/) 10.1109/SFCS.2000.892127
## Related Work
Check out the [Bowtie 2 UI](http://bit.ly/bt2ui-beta), a [shiny](https://shiny.rstudio.com), frontend to the Bowtie 2 command line.
......@@ -1314,7 +1314,23 @@ public:
assert_eq(refid(), omate.refid());
getExtendedCoords(st, en, flags);
omate.getExtendedCoords(ost, oen, flags);
bool imUpstream = st.off() < ost.off();
bool imUpstream;
if (st.off() == ost.off()) {
// --ff case
if (st.fw() && ost.fw() && readMate1()) {
imUpstream = true;
} else if (st.fw() && !ost.fw()) {
imUpstream = true;
} else {
imUpstream = false;
}
} else if (st.off() < ost.off()) {
imUpstream = true;
} else {
imUpstream = false;
}
TRefOff up = std::min(st.off(), ost.off());
TRefOff dn = std::max(en.off(), oen.off());
assert_geq(dn, up);
......
......@@ -70,7 +70,7 @@
#include <iostream>
#include <limits>
#include "threading.h"
#include <emmintrin.h>
#include "sse_wrap.h"
#include "aligner_sw_common.h"
#include "aligner_sw_nuc.h"
#include "ds.h"
......
......@@ -61,10 +61,13 @@ my %signo = ();
my @signame = ();
sub quote_params {
my %params_2_quote = ('--rg' => 1, '--rg-id' => 1,
'-S' => 1, '-U' => 1,
my %params_2_quote = ('-S' => 1, '-U' => 1,
'-1' => 1, '-2' => 1,
'-x' => 1
'-x' => 1, '-b' => 1,
'--interleaved' => 1,
'--rg' => 1,'--rg-id' => 1,
'--tab5' => 1, '--tab6' => 1,
'--sam-acc' => 1, '--bam' => 1
);
my $param_list = shift;
my $quoting = 0;
......@@ -225,7 +228,7 @@ for(my $i = 0; $i < scalar(@bt2_args); $i++) {
last;
}
}
if ($arg =~ /(bz2|lz4)$/) {
if ($arg =~ /(\.bz2|\.lz4)$/) {
push @bt2w_args, ("-U", $arg);
$bt2_args[$i] = undef;
}
......@@ -257,6 +260,7 @@ my @unps = ();
my @mate1s = ();
my @mate2s = ();
my @to_delete = ();
my @to_kill = ();
my $temp_dir = "/tmp";
my $bam_out = 0;
my $ref_str = undef;
......@@ -354,7 +358,8 @@ sub Extract_IndexName_From {
my @idx_filenames = glob($idx_basename . "*.bt2{,l}");
unless (@idx_filenames) {
if (exists $ENV{"BOWTIE2_INDEXES"}) {
@idx_filenames = glob("$ENV{'BOWTIE2_INDEXES'}/$idx_basename" . "bt2{,l}");
@idx_filenames = glob("$ENV{'BOWTIE2_INDEXES'}/$idx_basename" . "*.bt2{,l}");
$idx_basename = $ENV{"BOWTIE2_INDEXES"} . "/" . $idx_basename;
}
if (!@idx_filenames) {
......@@ -384,7 +389,10 @@ if(wrapInput(\@unps, \@mate1s, \@mate2s)) {
mkfifo($m1fn, 0700) || Fail("mkfifo($m1fn) failed.\n");
}
my $pid = 0;
$pid = fork() unless $no_pipes;
unless ($no_pipes) {
$pid = fork();
push @to_kill, $pid if $pid;
}
if($pid == 0) {
# Open named pipe 1 for writing
open(my $ofh, ">$m1fn") || Fail("Can't open '$m1fn' for writing\n");
......@@ -401,7 +409,10 @@ if(wrapInput(\@unps, \@mate1s, \@mate2s)) {
mkfifo($m2fn, 0700) || Fail("mkfifo($m2fn) failed.\n");
}
$pid = 0;
$pid = fork() unless $no_pipes;
unless ($no_pipes) {
$pid = fork();
push @to_kill, $pid if $pid;
}
if($pid == 0) {
# Open named pipe 2 for writing
open(my $ofh, ">$m2fn") || Fail("Can't open '$m2fn' for writing.\n");
......@@ -423,7 +434,10 @@ if(wrapInput(\@unps, \@mate1s, \@mate2s)) {
mkfifo($ufn, 0700) || Fail("mkfifo($ufn) failed.\n");
}
my $pid = 0;
$pid = fork() unless $no_pipes;
unless ($no_pipes) {
$pid = fork();
push @to_kill, $pid if $pid;
}
if($pid == 0) {
# Open named pipe 2 for writing
open(my $ofh, ">$ufn") || Fail("Can't open '$ufn' for writing.\n");
......@@ -622,6 +636,7 @@ if(defined($cap_out)) {
$ret = system($cmd);
}
if(!$keep) { for(@to_delete) { unlink($_); } }
kill 'HUP', @to_kill;
if ($ret == -1) {
Error("Failed to execute bowtie2-align: $!\n");
......
......@@ -84,7 +84,7 @@ def main():
argv.appendleft('--wrapper')
argv.appendleft(build_bin_spec)
logging.info('Command: %s' % ' '.join(argv))
sys.exit(subprocess.call(argv))
sys.exit(subprocess.call(list(argv)))
if __name__ == '__main__':
main()
......@@ -45,8 +45,8 @@ def main():
inspect_bin_name = 'bowtie-inspect'
inspect_bin_s = 'bowtie2-inspect-s'
inspect_bin_l = 'bowtie2-inspect-l'
idx_ext_l = '.1.bt2l';
idx_ext_s = '.1.bt2';
idx_ext_l = '.1.bt2l'
idx_ext_s = '.1.bt2'
curr_script = os.path.realpath(inspect.getsourcefile(main))
ex_path = os.path.dirname(curr_script)
inspect_bin_spec = os.path.join(ex_path,inspect_bin_s)
......@@ -78,7 +78,7 @@ def main():
argv.appendleft('--wrapper')
argv.appendleft(inspect_bin_spec)
logging.info('Command: %s' % ' '.join(argv))
sys.exit(subprocess.call(argv))
sys.exit(subprocess.call(list(argv)))
if __name__ == '__main__':
main()
......@@ -366,6 +366,9 @@ void Ebwt::readIntoMemory(
cerr << "Error reading _ebwt[] array: " << r << ", "
<< bytesLeft << gLastIOErrMsg << endl;
throw 1;
} else if (r == 0) {
cerr << "Error reading _ebwt[] array: no more data" << endl;
throw 1;
}
pebwt += r;
bytesLeft -= r;
......@@ -598,6 +601,9 @@ void Ebwt::readIntoMemory(
cerr << "Error reading block of _offs[] array: "
<< r << ", " << bytesLeft << gLastIOErrMsg << endl;
throw 1;
} else if (r == 0) {
cerr << "Error reading block of _offs[] array: no more data" << endl;
throw 1;
}
offs += r;
bytesLeft -= r;
......
......@@ -178,7 +178,7 @@ static bool sam_print_zi;
static bool sam_print_zp;
static bool sam_print_zu;
static bool sam_print_zt;
static bool preserve_sam_tags; // Only applies when aligning BAM files
static bool preserve_tags; // Only applies when aligning BAM files
static bool align_paired_reads; // Process only the paired reads in BAM file
static bool bwaSwLike;
static bool gSeedLenIsSet;
......@@ -267,6 +267,10 @@ static string bt2index; // read Bowtie 2 index from files with this prefix
static EList<pair<int, string> > extra_opts;
static size_t extra_opts_cur;
#ifdef USE_SRA
static EList<string> sra_accs;
#endif
#define DMAX std::numeric_limits<double>::max()
static void resetOptions() {
......@@ -375,7 +379,7 @@ static void resetOptions() {
sam_print_zp = false;
sam_print_zu = false;
sam_print_zt = false;
preserve_sam_tags = false;
preserve_tags = false;
align_paired_reads = false;
bwaSwLike = false;
gSeedLenIsSet = false;
......@@ -461,6 +465,9 @@ static void resetOptions() {
bowtie2p5 = false;
logDps.clear(); // log seed-extend dynamic programming problems
logDpsOpp.clear(); // log mate-search dynamic programming problems
#ifdef USE_SRA
sra_accs.clear();
#endif
}
static const char *short_options = "bfF:qbzhcu:rv:s:aP:t3:5:w:p:k:M:1:2:I:X:CQ:N:i:L:U:x:S:g:O:D:R:";
......@@ -514,7 +521,7 @@ static struct option long_options[] = {
{(char*)"12", required_argument, 0, ARG_ONETWO},
{(char*)"tab5", required_argument, 0, ARG_TAB5},
{(char*)"tab6", required_argument, 0, ARG_TAB6},
{(char*)"interleaved", required_argument, 0, ARG_INTERLEAVED_FASTQ},
{(char*)"interleaved", required_argument, 0, ARG_INTERLEAVED},
{(char*)"phred33-quals", no_argument, 0, ARG_PHRED33},
{(char*)"phred64-quals", no_argument, 0, ARG_PHRED64},
{(char*)"phred33", no_argument, 0, ARG_PHRED33},
......@@ -652,8 +659,11 @@ static struct option long_options[] = {
{(char*)"thread-ceiling", required_argument, 0, ARG_THREAD_CEILING},
{(char*)"thread-piddir", required_argument, 0, ARG_THREAD_PIDDIR},
{(char*)"trim-to", required_argument, 0, ARG_TRIM_TO},
{(char*)"preserve-sam-tags", no_argument, 0, ARG_PRESERVE_SAM_TAGS},
{(char*)"preserve-tags", no_argument, 0, ARG_PRESERVE_TAGS},
{(char*)"align-paired-reads", no_argument, 0, ARG_ALIGN_PAIRED_READS},
#ifdef USE_SRA
{(char*)"sra-acc", required_argument, 0, ARG_SRA_ACC},
#endif
{(char*)0, 0, 0, 0} // terminator
};
......@@ -704,7 +714,11 @@ static void printUsage(ostream& out) {
tool_name = "bowtie2";
}
out << "Usage: " << endl
<< " " << tool_name.c_str() << " [options]* -x <bt2-idx> {-1 <m1> -2 <m2> | -U <r> | --interleaved <i>} [-S <sam>]" << endl
#ifdef USE_SRA
<< " " << tool_name.c_str() << " [options]* -x <bt2-idx> {-1 <m1> -2 <m2> | -U <r> | --interleaved <i> | --sra-acc <acc> | -b <bam>} [-S <sam>]" << endl
#else
<< " " << tool_name.c_str() << " [options]* -x <bt2-idx> {-1 <m1> -2 <m2> | -U <r> | --interleaved <i> | -b <bam>} [-S <sam>]" << endl
#endif
<< endl
<< " <bt2-idx> Index filename prefix (minus trailing .X." + gEbwt_ext + ")." << endl
<< " NOTE: Bowtie 1 and Bowtie 2 indexes are not compatible." << endl
......@@ -720,10 +734,15 @@ static void printUsage(ostream& out) {
if(wrapper == "basic-0") {
out << " Could be gzip'ed (extension: .gz) or bzip2'ed (extension: .bz2)." << endl;
}
out << " <i> Files with interleaved paired-end FASTQ reads" << endl;
out << " <i> Files with interleaved paired-end FASTQ/FASTA reads" << endl;
if(wrapper == "basic-0") {
out << " Could be gzip'ed (extension: .gz) or bzip2'ed (extension: .bz2)." << endl;
}
#ifdef USE_SRA
out << " <acc> Files are SRA accessions. Accessions not found in local storage will\n"
<< " be fetched from NCBI." << endl;
#endif
out << " <bam> Files are unaligned BAM sorted by read name." << endl;
out << " <sam> File for SAM output (default: stdout)" << endl
<< endl
<< " <m1>, <m2>, <r> can be comma-separated lists (no whitespace) and can be" << endl
......@@ -813,6 +832,12 @@ static void printUsage(ostream& out) {
<< " --no-contain not concordant when one mate alignment contains other" << endl
<< " --no-overlap not concordant when mates overlap at all" << endl
<< endl
<< " BAM:" << endl
<< " --align-paired-reads Bowtie2 will, by default, attempt to align unpaired BAM reads." << endl
<< " Use this option to align paired-end reads instead." << endl
<< " --preserve-tags Preserve tags from the original BAM record by" << endl
<< " appending them to the end of the corresponding SAM output." << endl
<< endl
<< " Output:" << endl;
//if(wrapper == "basic-0") {
// out << " --bam output directly to BAM (by piping through 'samtools view')" << endl;
......@@ -861,8 +886,7 @@ static void printUsage(ostream& out) {
<< " --non-deterministic seed rand. gen. arbitrarily instead of using read attributes" << endl
// << " --verbose verbose output for debugging" << endl
<< " --version print version information and quit" << endl
<< " -h/--help print this usage message" << endl
;
<< " -h/--help print this usage message" << endl;
if(wrapper.empty()) {
cerr << endl
<< "*** Warning ***" << endl
......@@ -961,7 +985,7 @@ static bool saw_trim3;
static bool saw_trim5;
static bool saw_trim_to;
static bool saw_bam;
static bool saw_preserve_sam_tags;
static bool saw_preserve_tags;
static bool saw_align_paired_reads;
static EList<string> presetList;
......@@ -1001,9 +1025,8 @@ static void parseOption(int next_option, const char *arg) {
case ARG_ONETWO: tokenize(arg, ",", mates12); format = TAB_MATE5; break;
case ARG_TAB5: tokenize(arg, ",", mates12); format = TAB_MATE5; break;
case ARG_TAB6: tokenize(arg, ",", mates12); format = TAB_MATE6; break;
case ARG_INTERLEAVED_FASTQ: {
case ARG_INTERLEAVED: {
tokenize(arg, ",", mates12);
format = FASTQ;
interleaved = true;
break;
}
......@@ -1055,9 +1078,9 @@ static void parseOption(int next_option, const char *arg) {
case ARG_SEED_SUMM: seedSumm = true; break;
case ARG_SC_UNMAPPED: scUnMapped = true; break;
case ARG_XEQ: xeq = true; break;
case ARG_PRESERVE_SAM_TAGS: {
preserve_sam_tags = true;
saw_preserve_sam_tags = true;
case ARG_PRESERVE_TAGS: {
preserve_tags = true;
saw_preserve_tags = true;
break;
}
case ARG_ALIGN_PAIRED_READS: {
......@@ -1522,6 +1545,13 @@ static void parseOption(int next_option, const char *arg) {
}
break;
}
#ifdef USE_SRA
case ARG_SRA_ACC: {
tokenize(arg, ",", sra_accs);
format = SRA_FASTA;
break;
}
#endif
case ARG_VERSION: showVersion = 1; break;
default:
printUsage(cerr);
......@@ -1542,7 +1572,7 @@ static void parseOptions(int argc, const char **argv) {
saw_trim5 = false;
saw_trim_to = false;
saw_bam = false;
saw_preserve_sam_tags = false;
saw_preserve_tags = false;
saw_align_paired_reads = false;
presetList.clear();
if(startVerbose) { cerr << "Parsing options: "; logTime(cerr, true); }
......@@ -1574,8 +1604,8 @@ static void parseOptions(int argc, const char **argv) {
exit(1);
}
if (!saw_bam && saw_preserve_sam_tags) {
cerr << "--preserve_sam_tag can only be used when aligning BAM reads." << endl;
if (!saw_bam && saw_preserve_tags) {
cerr << "--preserve_tags can only be used when aligning BAM reads." << endl;
exit(1);
}
......@@ -1649,6 +1679,10 @@ static void parseOptions(int argc, const char **argv) {
<< "sequences must be specified with -1 and -2." << endl;
throw 1;
}
if(interleaved && (format != FASTA && format != FASTQ)) {
cerr << "Error: --interleaved only works in combination with FASTA (-f) and FASTQ (-q) formats." << endl;
throw 1;
}
if(qualities.size() && format != FASTA) {
cerr << "Error: one or more quality files were specified with -Q but -f was not" << endl
<< "enabled. -Q works only in combination with -f and -C." << endl;
......@@ -4802,9 +4836,10 @@ static void driver(
fastaContLen, // length of sampled reads for FastaContinuous...
fastaContFreq, // frequency of sampled reads for FastaContinuous...
skipReads, // skip the first 'skip' patterns
qUpto, // max number of queries to read
nthreads, //number of threads for locking
outType != OUTPUT_SAM, // whether to fix mate names
preserve_sam_tags, // keep existing SAM tags when aligning BAM files
preserve_tags, // keep existing tags when aligning BAM files
align_paired_reads // Align only the paired reads in BAM file
);
if(gVerbose || startVerbose) {
......@@ -4818,6 +4853,9 @@ static void driver(
qualities, // qualities associated with singles
qualities1, // qualities associated with m1
qualities2, // qualities associated with m2
#ifdef USE_SRA
sra_accs, // SRA accessions
#endif
pp, // read read-in parameters
gVerbose || startVerbose); // be talkative
// Open hit output file
......@@ -5125,11 +5163,18 @@ int bowtie(int argc, const char **argv) {
// Get query filename
bool got_reads = !queries.empty() || !mates1.empty() || !mates12.empty();
#ifdef USE_SRA
got_reads = got_reads || !sra_accs.empty();
#endif
if(optind >= argc) {
if(!got_reads) {
printUsage(cerr);
cerr << "***" << endl
#ifdef USE_SRA
<< "Error: Must specify at least one read input with -U/-1/-2/--sra-acc" << endl;
#else
<< "Error: Must specify at least one read input with -U/-1/-2" << endl;
#endif
return 1;
}
} else if(!got_reads) {
......
bowtie2 (2.3.4.3-2) UNRELEASED; urgency=medium
bowtie2 (2.3.5.1-1) UNRELEASED; urgency=medium
* Team upload.
* Team upload
[ Michael R. Crusoe ]
* bowtie-examples: set Multi-Arch: foreign
* Standards-Version: 4.3.0
[ Steffen Moeller ]
* debhelper-compat 12
* Standards-Version: 4.4.0
* New upstream version - yet fails to build -> crash
-- Michael R. Crusoe <michael.crusoe@gmail.com> Mon, 24 Dec 2018 04:19:34 -0800
bowtie2 (2.3.4.3-1) unstable; urgency=medium
......
......@@ -4,7 +4,7 @@ Uploaders: Alexandre Mestiashvili <mestia@debian.org>,
Andreas Tille <tille@debian.org>
Section: science
Priority: optional
Build-Depends: debhelper (>= 11),
Build-Depends: debhelper-compat (= 12),
help2man,
libtbb-dev,
python,
......@@ -12,7 +12,7 @@ Build-Depends: debhelper (>= 11),
libtest-deep-perl,
libclone-perl,
zlib1g-dev
Standards-Version: 4.3.0
Standards-Version: 4.4.0
Vcs-Browser: https://salsa.debian.org/med-team/bowtie2
Vcs-Git: https://salsa.debian.org/med-team/bowtie2.git
Homepage: http://bowtie-bio.sourceforge.net/bowtie2
......