New upstream version 2.3.4.2

parent 2805c806
cmake_minimum_required(VERSION 2.8)
cmake_policy(SET CMP0048 NEW)
cmake_policy(SET CMP0005 NEW)
project(bowtie2 LANGUAGES CXX VERSION "2.3.4.2")
enable_testing()
include(CTest)
include(ProcessorCount)
include(CheckSymbolExists)
ProcessorCount(NUM_CORES)
option(BOWTIE_MM "enable bowtie2 memory mapping" ON)
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(WITH_THREAD_PROFILING ${WITH_THREAD_PROFILING})
set(POPCNT_CAPABILITY ${POPCNT_CAPABILITY})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64 -g3 -Wall -msse2")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -funroll-loops")
set(INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
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)
endif(MINGW)
if (APPLE)
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym")
endif(APPLE)
set(BOWTIE2_BIN_LIST
bowtie2-build-s
bowtie2-build-l
bowtie2-align-s
bowtie2-align-l
bowtie2-inspect-s
bowtie2-inspect-l
)
set(SHARED_CPPS
ccnt_lut.cpp
ref_read.cpp
alphabet.cpp
shmem.cpp
edit.cpp
bt2_idx.cpp
bt2_io.cpp
bt2_util.cpp
reference.cpp
ds.cpp
multikey_qsort.cpp
limit.cpp
random_source.cpp
)
set(SEARCH_CPPS
qual.cpp pat.cpp sam.cpp
read_qseq.cpp aligner_seed_policy.cpp
aligner_seed.cpp
aligner_seed2.cpp
aligner_sw.cpp
aligner_sw_driver.cpp aligner_cache.cpp
aligner_result.cpp ref_coord.cpp mask.cpp
pe.cpp aln_sink.cpp dp_framer.cpp
scoring.cpp presets.cpp unique.cpp
simple_func.cpp
random_util.cpp
aligner_bt.cpp sse_util.cpp
aligner_swsse.cpp outq.cpp
aligner_swsse_loc_i16.cpp
aligner_swsse_ee_i16.cpp
aligner_swsse_loc_u8.cpp
aligner_swsse_ee_u8.cpp
aligner_driver.cpp
bowtie_main.cpp
bt2_search.cpp
)
set(BUILD_CPPS
bt2_build.cpp
diff_sample.cpp
bowtie_build_main.cpp)
set(INSPECT_CPPS
bt2_inspect.cpp
)
string(TIMESTAMP BUILD_DATE)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -v OUTPUT_VARIABLE COMPILER_VERSION)
add_definitions(
-DBOWTIE2
-DBUILD_HOST="${CMAKE_HOST_SYSTEM}"
-DBUILD_TIME="${BUILD_DATE}"
-DCOMPILER_VERSION="${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_VERSION}"
-DBOWTIE2_VERSION="${PROJECT_VERSION}"
-D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64
-D_GNU_SOURCE
)
if (WITH_AFFINITY)
add_definitions(-DWITH_AFFINITY=1)
endif()
if (NO_SPINLOCK)
add_definitions(-DNO_SPINLOCK)
endif()
if (POPCNT_CAPABILITY)
add_definitions(-DPOPCNT_CAPABILITY)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -I third_party")
endif()
if (WITH_THREAD_PROFILING)
add_definitions(-DPER_THREAD_TIMING=1)
endif()
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)
link_libraries(Threads::Threads)
endif()
if (NOT TBB_LIBRARY_PATH)
set(SHARED_CPPS ${SHARED_CPPS} tinythread.cpp)
else()
if (NOT NO_QUEUELOCK)
add_definitions(-DWITH_TBB -DWITH_QUEUELOCK=1 -DNO_SPINLOCK)
endif()
include_directories(${TBB_INCLUDE_PATH})
link_libraries(${TBB_LIBRARY_PATH} ${TBB_MALLOC_LIBRARY_PATH})
endif()
include_directories(${PROJECT_SOURCE_DIR})
get_directory_property(COMPILER_DEFS COMPILE_DEFINITIONS)
add_definitions(-DCOMPILER_OPTIONS="${CMAKE_CXX_FLAGS}")
add_executable(bowtie2-align-s ${SEARCH_CPPS} ${SHARED_CPPS})
add_executable(bowtie2-align-l ${SEARCH_CPPS} ${SHARED_CPPS})
add_executable(bowtie2-build-s ${BUILD_CPPS} ${SHARED_CPPS})
add_executable(bowtie2-build-l ${BUILD_CPPS} ${SHARED_CPPS})
add_executable(bowtie2-inspect-s ${INSPECT_CPPS} ${SHARED_CPPS})
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")
add_test(NAME simple-align COMMAND ${PROJECT_SOURCE_DIR}/bowtie2 -x example/index/lambda_virus example/reads/longreads.fq)
......@@ -3,33 +3,35 @@
INTRODUCTION
What is Bowtie 2?
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 to
relatively long (e.g. mammalian) genomes. Bowtie 2 indexes the genome
with an FM Index (based on the Burrows-Wheeler Transform or BWT) to keep
its memory footprint small: for the human genome, its memory footprint
is typically around 3.2 gigabytes of RAM. Bowtie 2 supports gapped,
local, and paired-end alignment modes. Multiple processors can be used
simultaneously to achieve greater alignment speed. Cufflinks: a tool for
transcriptome assembly and isoform quantitiation from Bowtie 2 outputs
alignments in SAM format, enabling interoperation with 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.
aligning reads of about 50 up to 100s of characters to relatively long
(e.g. mammalian) genomes. Bowtie 2 indexes the genome with an FM Index
(based on the Burrows-Wheeler Transform or BWT) to keep its memory
footprint small: for the human genome, its memory footprint is typically
around 3.2 gigabytes of RAM. Bowtie 2 supports gapped, local, and
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
2 is distributed under the GPLv3 license, and it runs on the command
line under Windows, Mac OS X and Linux.
Bowtie 2 is often the first step in pipelines for comparative genomics,
including for variation calling, ChIP-seq, RNA-seq, BS-seq. Bowtie 2 and
Bowtie (also called “Bowtie 1” here) are also tightly integrated into
some tools, including TopHat: a fast splice junction mapper for RNA-seq
reads, RNA-seq reads, Crossbow: a cloud-enabled software tool for
analyzing resequencing data, and Myrna: a cloud-enabled software tool
for aligning RNA-seq reads and measuring differential gene expression.
many other tools, some of which are listed here.
If you use Bowtie 2 for your published research, please cite our work.
Papers describing Bowtie 2 are:
If you use Bowtie 2 for your published research, please cite the Bowtie
paper. Thank you!
- Langmead B, Wilks C, Antonescu V, Charles R. Scaling read aligners
to hundreds of threads on general-purpose processors.
_Bioinformatics_. 2018 Jul 18. doi: 10.1093/bioinformatics/bty648.
- Langmead B, Salzberg SL. Fast gapped-read alignment with Bowtie 2.
_Nature Methods_. 2012 Mar 4;9(4):357-9. doi: 10.1038/nmeth.1923.
How is Bowtie 2 different from Bowtie 1?
......@@ -86,38 +88,30 @@ Bowtie 1’s.
What isn’t Bowtie 2?
Bowtie 1 and Bowtie 2 are not general-purpose alignment tools like
MUMmer, BLAST or Vmatch. Bowtie 2 works best when aligning to large
genomes, though it supports arbitrarily small reference sequences
(e.g. amplicons). It handles very long reads (i.e. upwards of 10s or
100s of kilobases), but it is optimized for the read lengths and error
modes yielded by recent sequencers, such as the Illumina HiSeq 2000,
Roche 454, and Ion Torrent instruments.
If your goal is to align two very large sequences (e.g. two genomes),
consider using MUMmer. If your goal is very sensitive alignment to a
relatively short reference sequence (e.g. a bacterial genome), this can
be done with Bowtie 2 but you may want to consider using tools like
NUCmer, BLAT, or BLAST. These tools can be extremely slow when the
reference genome is long, but are often adequate when the reference is
short.
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
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.
Bowtie 2 does not support alignment of colorspace reads.
Bowtie 2 does not support alignment of colorspace reads. (Bowtie 1
does.)
What does it mean that some older Bowtie 2 versions are “beta”?
We said those Bowtie 2 versions were in “beta” to convey that it was not
as polished as a tool that had been around for a while, and was still in
flux. Since version 2.0.1, we declared Bowtie 2 was no longer “beta”.
OBTAINING BOWTIE 2
OBTAINING BOWTIE 2
Bowtie 2 is available from various package managers, notably Bioconda.
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).
Download Bowtie 2 sources and binaries from the Download section of the
Sourceforge site. Binaries are available for the Intel x86_64
You can also download Bowtie 2 sources and binaries from the Download
section of the Sourceforge site. Binaries are available for the x86_64
architecture running Linux, Mac OS X, and Windows. If you plan to
compile Bowtie 2 yourself, make sure to get the source package, i.e.,
the filename that ends in “-source.zip”.
......@@ -145,8 +139,64 @@ 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
tbb/mutex.h: No such file or directory), you can install it yourself
(see Threading Building Blocks library) or build Bowtie 2 with
make NO_TBB=1 to use pthreads or Windows native multithreading instead.
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
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
portsnap fetch update
make search name=tbb
cd /usr/ports/devel/tbb && make install && make clean
The Bowtie 2 Makefile also includes recipes for basic automatic
dependency management. Running make static-libs && make STATIC_BUILD=1
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.
Adding to PATH
......@@ -923,6 +973,13 @@ Trim <int> bases from 5’ (left) end of each read before alignment
Trim <int> bases from 3’ (right) end of each read before alignment
(default: 0).
--trim-to [3:|5:]<int>
Trim reads exceeding <int> bases. Bases will be trimmed from either the
3’ (right) or 5’ (left) end of the read. If the read end if not
specified, bowtie 2 will default to trimming from the 3’ (right) end of
the read. --trim-to and -3/-5 are mutually exclusive.
--phred33
Input qualities are ASCII chars equal to the Phred quality plus 33. This
......@@ -1416,7 +1473,8 @@ print an asterisk in those fields instead.
--soft-clipped-unmapped-tlen
Consider soft-clipped bases unmapped when calculating TLEN.
Consider soft-clipped bases unmapped when calculating TLEN. Only
available in --local mode.
--sam-no-qname-trunc
......
This diff is collapsed.
......@@ -36,9 +36,9 @@ HEADERS := $(wildcard *.h)
BOWTIE_MM := 1
BOWTIE_SHARED_MEM :=
ifdef RELEASE_BUILD
LDFLAGS += -L$(CURDIR)/.lib
CPPFLAGS += -I$(CURDIR)/.include
ifdef STATIC_BUILD
LDFLAGS += -L$(CURDIR)/.tmp/lib
CPPFLAGS += -I$(CURDIR)/.tmp/include
endif
# Detect Cygwin or MinGW
......@@ -58,7 +58,7 @@ ifneq (,$(findstring Darwin,$(shell uname)))
ifeq (1,$(shell uname -r | awk -F. '{ if ($$1 > 12 && $$1 < 16) print 1; }'))
CXXFLAGS += -stdlib=libstdc++
endif
ifdef RELEASE_BUILD
ifdef STATIC_BUILD
CXXFLAGS += -mmacosx-version-min=10.9
endif
endif
......@@ -102,7 +102,7 @@ endif
#default is to use Intel TBB
ifneq (1,$(NO_TBB))
LDLIBS += $(PTHREAD_LIB) -ltbb
ifdef RELEASE_BUILD
ifdef STATIC_BUILD
LDLIBS += -ltbbmalloc
else
LDLIBS += -ltbbmalloc_proxy
......@@ -443,8 +443,8 @@ bowtie2-inspect.bat:
echo "@echo off" > bowtie2-inspect.bat
echo "python %~dp0/bowtie2-inspect %*" >> bowtie2-inspect.bat
.PHONY: bowtie2-src
bowtie2-src: $(SRC_PKG_LIST)
.PHONY: bowtie2-src-pkg
bowtie2-src-pkg: $(SRC_PKG_LIST)
chmod a+x scripts/*.sh scripts/*.pl
mkdir .src.tmp
mkdir .src.tmp/bowtie2-$(VERSION)
......@@ -455,9 +455,9 @@ bowtie2-src: $(SRC_PKG_LIST)
cp .src.tmp/bowtie2-$(VERSION)-source.zip .
rm -rf .src.tmp
.PHONY: bowtie2-pkg
bowtie2-pkg: PKG_DIR := bowtie2-$(VERSION)-$(if $(MACOS),macos,$(if $(MINGW),mingw,linux))-x86_64
bowtie2-pkg: static-libs $(BIN_PKG_LIST) $(BOWTIE2_BIN_LIST) $(BOWTIE2_BIN_LIST_DBG)
.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)
chmod a+x scripts/*.sh scripts/*.pl
rm -rf .bin.tmp
mkdir -p .bin.tmp/$(PKG_DIR)
......@@ -487,8 +487,9 @@ doc: doc/manual.html MANUAL
doc/manual.html: MANUAL.markdown
echo "<h1>Table of Contents</h1>" > .tmp.head
pandoc -T "Bowtie 2 Manual" -B .tmp.head \
--css style.css -o $@ \
pandoc -B .tmp.head \
--metadata title:"Bowtie 2 Manual"\
--css doc/style.css -o $@ \
--from markdown --to HTML \
--table-of-contents $^
rm -f .tmp.head
......@@ -505,41 +506,42 @@ install: all
.PHONY: simple-test
simple-test: perl-deps both both-debug both-sanitized
eval `perl -I $(CURDIR)/.perllib.tmp/lib/perl5 -Mlocal::lib=$(CURDIR)/.perllib.tmp` ; \
eval `perl -I $(CURDIR)/.tmp/lib/perl5 -Mlocal::lib=$(CURDIR)/.tmp` ; \
sh ./scripts/test/simple_tests.sh
.PHONY: random-test
random-test: all perl-deps
eval `perl -I $(CURDIR)/.perllib.tmp/lib/perl5 -Mlocal::lib=$(CURDIR)/.perllib.tmp` ; \
eval `perl -I $(CURDIR)/.tmp/lib/perl5 -Mlocal::lib=$(CURDIR)/.tmp` ; \
sh ./scripts/sim/run.sh $(if $(NUM_CORES), $(NUM_CORES), 2)
.PHONY: perl-deps
perl-deps:
if [ ! -e .perllib.tmp ]; then \
if [ ! -e .tmp ]; then \
DL=$$([ `which wget` ] && echo "wget --no-check-certificate -O-" || echo "curl -L") ; \
mkdir .perllib.tmp ; \
$$DL http://cpanmin.us | perl - -l $(CURDIR)/.perllib.tmp App::cpanminus local::lib ; \
eval `perl -I $(CURDIR)/.perllib.tmp/lib/perl5 -Mlocal::lib=$(CURDIR)/.perllib.tmp` ; \
$(CURDIR)/.perllib.tmp/bin/cpanm --force Math::Random Clone Test::Deep Sys::Info ; \
mkdir .tmp ; \
$$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
.PHONY: static-libs
static-libs:
if [[ ! -d $(CURDIR)/.lib || ! -d $(CURDIR)/.inc ]]; then \
mkdir $(CURDIR)/.lib $(CURDIR)/.include ; \
if [[ ! -d $(CURDIR)/.tmp/lib || ! -d $(CURDIR)/.tmp/include ]]; then \
mkdir -p $(CURDIR)/.tmp/lib $(CURDIR)/.tmp/include ; \
fi ; \
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") ; \
cd /tmp ; \
mkdir .tmp ; \
cd .tmp ; \
$$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)/.lib && cp zconf.h zlib.h $(CURDIR)/.include ; \
$(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 compiler=gcc arch=ia64 runtime=mingw, make) extra_inc=big_iron.inc -j4 \
&& cp -r include/tbb $(CURDIR)/.include && cp build/*_release/*.a $(CURDIR)/.lib
&& cp -r include/tbb $(CURDIR)/.tmp/include && cp build/*_release/*.a $(CURDIR)/.tmp/lib
.PHONY: test
test: simple-test random-test
......@@ -548,8 +550,7 @@ test: simple-test random-test
clean:
rm -f $(BOWTIE2_BIN_LIST) $(BOWTIE2_BIN_LIST_DBG) $(BOWTIE2_BIN_LIST_SAN) \
$(addsuffix .exe,$(BOWTIE2_BIN_LIST) $(BOWTIE2_BIN_LIST_DBG)) \
bowtie2-src.zip bowtie2-bin.zip
bowtie2-*.zip
rm -f core.* .tmp.head
rm -rf *.dSYM
rm -rf .perllib.tmp
rm -rf .include .lib
rm -rf .tmp
......@@ -19,10 +19,39 @@ Please report any issues to the Bowtie 2 Github page or using the Sourceforge bu
Version Release History
=======================
Version 2.3.4.2 - Aug 7, 2018
* Fixed issue causing `bowtie2` to fail in `--fast-local` mode.
* Fixed issue causing `--soft-clipped-unmapped-tlen` to be a positional argument.
* New option `--trim-to N` causes `bowtie2` to trim reads longer
than `N` bases to exactly `N` bases. Can trim from either 3'
or 5' end, e.g. `--trim-to 5:30` trims reads to 30 bases,
truncating at the 5' end.
* Updated "Building from source" manual section with additional
instructions on installing TBB.
* Several other updates to manual, including new mentions of
[Bioconda](http://bioconda.github.io) and
[Biocontainers](https://biocontainers.pro).
* Fixed an issue preventing `bowtie2` from processing more than
one pattern source when running single threaded.
* Fixed an issue causing `bowtie2` and `bowtie2-inspect` to crash if
the index contains a gap-only segment.
* Added experimental BAM input mode `-b`. Works only with unpaired
input reads and BAM files that are sorted by read name (`samtools
sort -n`). BAM input mode also supports the following options:
o `--preserve-sam-tags`: Preserve any optional fields present in BAM record
o `--align-paired-reads`: Paired-end mode for BAM files
* Added experimental cmake support
Thread-scaling paper appears - July 19, 2018
* Our latest work on Bowtie's core thread scaling capabilities
[just appeared Open Access in the journal Bioinformatics](href="https://academic.oup.com/bioinformatics/advance-article/doi/10.1093/bioinformatics/bty648/5055585)
Version 2.3.4.1 - Feb 3, 2018
* Fixed an issue with `--reorder` that caused bowtie2 to crash
while reordering SAM output
while reordering SAM output
Version 2.3.4 - Dec 29, 2017
......
......@@ -2110,6 +2110,7 @@ void AlnSinkSam::appendMate(
prm, // per-read metrics
sc); // scoring scheme
}
samc_.printPreservedOptFlags(o, rd);
o.append('\n');
}
......
......@@ -80,7 +80,7 @@ def main():
argv.appendleft('--wrapper')
argv.appendleft(build_bin_spec)
logging.info('Command: %s' % ' '.join(argv))
subprocess.call(argv)
sys.exit(subprocess.call(argv))
if __name__ == '__main__':
main()
......@@ -77,7 +77,7 @@ def main():
argv.appendleft('--wrapper')
argv.appendleft(inspect_bin_spec)
logging.info('Command: %s' % ' '.join(argv))
subprocess.call(argv)
sys.exit(subprocess.call(argv))
if __name__ == '__main__':
main()
......@@ -2530,6 +2530,9 @@ TStr Ebwt::join(EList<FileBuf*>& l,
while(!l[i]->eof()) {
RefRecord rec = fastaRefReadAppend(*l[i], first, ret, dstoff, rpcp);
first = false;
if(rec.first && rec.len == 0) {
continue;
}
TIndexOffU bases = rec.len;
assert_eq(rec.off, szs[szsi].off);
assert_eq(rec.len, szs[szsi].len);
......@@ -2596,7 +2599,7 @@ void Ebwt::joinToDisk(
writeU<TIndexOffU>(out1, this->plen()[npat], this->toBe());
}
this->plen()[++npat] = (szs[i].len + szs[i].off);
} else {
} else if(!szs[i].first) {
// edge case, but we could get here with npat == -1
// e.g. when building from a reference of all Ns
if (npat < 0) npat = 0;
......@@ -2639,6 +2642,9 @@ void Ebwt::joinToDisk(
//assert_eq(0, _refnames.back().length());
_refnames.pop_back();
}
if(rec.first && rec.len == 0) {
continue;
}
assert_lt(szsi, szs.size());
assert_eq(rec.off, szs[szsi].off);
assert_eq(rec.len, szs[szsi].len);
......@@ -2646,7 +2652,7 @@ void Ebwt::joinToDisk(
assert(rec.first || rec.off > 0);
ASSERT_ONLY(szsi++);
// Increment seqsRead if this is the first fragment
if(rec.first && rec.len > 0) seqsRead++;
if(rec.first) seqsRead++;
if(bases == 0) continue;
assert_leq(bases, this->plen()[seqsRead-1]);
// Reset the patoff if this is the first fragment
......
......@@ -97,6 +97,7 @@ static int ipause; // pause before maching?
static uint32_t qUpto; // max # of queries to read
static int gTrim5; // amount to trim from 5' end
static int gTrim3; // amount to trim from 3' end
static pair<short, size_t> trimTo; // trim reads exceeding given length from either 3' or 5'-end
static int offRate; // keep default offRate
static bool solexaQuals; // quality strings are solexa quals, not phred, and subtract 64 (not 33)
static bool phred64Quals; // quality chars are phred, but must subtract 64 (not 33)
......@@ -176,6 +177,8 @@ 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 align_paired_reads; // Process only the paired reads in BAM file
static bool bwaSwLike;
static bool gSeedLenIsSet;
static float bwaSwLikeC;
......@@ -288,6 +291,7 @@ static void resetOptions() {
qUpto = 0xffffffff; // max # of queries to read
gTrim5 = 0; // amount to trim from 5' end
gTrim3 = 0; // amount to trim from 3' end
trimTo = pair<short, size_t>(5, 0); // default: don't do any trimming
offRate = -1; // keep default offRate
solexaQuals = false; // quality strings are solexa quals, not phred, and subtract 64 (not 33)
phred64Quals = false; // quality chars are phred, but must subtract 64 (not 33)
......@@ -369,6 +373,8 @@ static void resetOptions() {
sam_print_zp = false;
sam_print_zu = false;
sam_print_zt = false;
preserve_sam_tags = false;
align_paired_reads = false;
bwaSwLike = false;
gSeedLenIsSet = false;
bwaSwLikeC = 5.5f;
......@@ -455,7 +461,7 @@ static void resetOptions() {
logDpsOpp.clear(); // log mate-search dynamic programming problems
}
static const char *short_options = "fF: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:";
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:";
static struct option long_options[] = {
{(char*)"verbose", no_argument, 0, ARG_VERBOSE},
......@@ -643,6 +649,9 @@ static struct option long_options[] = {
{(char*)"xeq", no_argument, 0, ARG_XEQ},
{(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*)"align-paired-reads", no_argument, 0, ARG_ALIGN_PAIRED_READS},
{(char*)0, 0, 0, 0} // terminator
};
......@@ -736,6 +745,8 @@ static void printUsage(ostream& out) {
<< " -u/--upto <int> stop after first <int> reads/pairs (no limit)" << endl
<< " -5/--trim5 <int> trim <int> bases from 5'/left end of reads (0)" << endl
<< " -3/--trim3 <int> trim <int> bases from 3'/right end of reads (0)" << endl
<< " --trim-to [3:|5:]<int> trim reads exceeding <int> bases from either 3' or 5' end" << endl
<< " If the read end is not specified then it defaults to 3 (0)" << endl
<< " --phred33 qualities are Phred+33 (default)" << endl
<< " --phred64 qualities are Phred+64" << endl
<< " --int-quals qualities encoded as space-delimited integers" << endl
......@@ -944,6 +955,12 @@ static string applyPreset(const string& sorig, Presets& presets) {
static bool saw_M;
static bool saw_a;
static bool saw_k;
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_align_paired_reads;
static EList<string> presetList;
/**
......@@ -983,6 +1000,11 @@ static void parseOption(int next_option, const char *arg) {
case ARG_TAB5: tokenize(arg, ",", mates12); format = TAB_MATE5; break;
case ARG_TAB6: tokenize(arg, ",", mates12); format = TAB_MATE6; break;
case ARG_INTERLEAVED_FASTQ: tokenize(arg, ",", mates12); format = INTERLEAVED; break;
case 'b': {
format = BAM;
saw_bam = true;
break;
}
case 'f': format = FASTA; break;
case 'F': {
format = FASTA_CONT;
......@@ -1026,6 +1048,16 @@ 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;
break;
}
case ARG_ALIGN_PAIRED_READS: {
align_paired_reads = true;
saw_align_paired_reads = true;
break;
}
case ARG_MM: {
#ifdef BOWTIE_MM
useMm = true;
......@@ -1101,6 +1133,26 @@ static void parseOption(int next_option, const char *arg) {
break;
case '3': gTrim3 = parseInt(0, "-3/--trim3 arg must be at least 0", arg); break;
case '5': gTrim5 = parseInt(0, "-5/--trim5 arg must be at least 0", arg); break;
case ARG_TRIM_TO: {
if (strlen(arg) > 1 && arg[1] != ':') {
trimTo.first = 3;
trimTo.second = parseInt(0, "--trim-to: the number of bases to trim must be at least 0", arg);
break;
}
pair<int, int> res = parsePair<int>(arg, ':');
if (res.first != 3 && res.first != 5) {
cerr << "--trim-to: trim position must be either 3 or 5" << endl;
printUsage(cerr);
throw 1;
}
if(res.second < 0) {
cerr << "--trim-to: the number bases to trim must be at least 0" << endl;
printUsage(cerr);
throw 1;
}
trimTo = static_cast<pair<short, size_t> >(res);
break;
}
case 'h': printUsage(cout); throw 0; break;
case ARG_USAGE: printUsage(cout); throw 0; break;
//
......@@ -1468,12 +1520,6 @@ static void parseOption(int next_option, const char *arg) {
printUsage(cerr);
throw 1;
}
if (!localAlign && scUnMapped) {
scUnMapped = false;
cerr << "WARNING: --soft-clipped-unmapped-tlen can only be set for "
<< "local alignment... ignoring" << endl;
}
}
/**
......@@ -1485,6 +1531,12 @@ static void parseOptions(int argc, const char **argv) {
saw_M = false;
saw_a = false;
saw_k = false;
saw_trim3 = false;
saw_trim5 = false;
saw_trim_to = false;
saw_bam = false;