[med-svn] [seqan2] 01/01: New upstream version 2.3.0~0.20161011~73a5aaf+dfsg

Michael Crusoe misterc-guest at moszumanska.debian.org
Tue Oct 11 19:22:14 UTC 2016


This is an automated email from the git hooks/post-receive script.

misterc-guest pushed a commit to annotated tag upstream/2.3.0_0.20161011_73a5aaf+dfsg
in repository seqan2.

commit 6f07e3ea2ac92f758aa9ef81358a84c27ba02173
Author: Michael R. Crusoe <michael.crusoe at gmail.com>
Date:   Tue Oct 11 08:46:43 2016 -0700

    New upstream version 2.3.0~0.20161011~73a5aaf+dfsg
---
 CONTRIBUTING.rst                                   |   2 +-
 apps/bs_tools/tests/run_tests.py                   |   6 +-
 apps/fiona/index_qgram_parallel.h                  |  44 ++---
 apps/razers3/razers_match_filter.h                 |   8 +-
 include/seqan/align.h                              |   2 +-
 include/seqan/align/align_interface_wrapper.h      |   2 +-
 include/seqan/align/dp_align_simd_helper.h         |   2 +-
 .../align/global_alignment_myers_hirschberg_impl.h |   1 -
 include/seqan/arg_parse.h                          |   4 +
 include/seqan/arg_parse/arg_parse_doc.h            |  56 +++++-
 include/seqan/basic/basic_allocator.h              |   1 -
 include/seqan/basic/basic_simd_vector.h            |  48 +++--
 include/seqan/file/file_page.h                     |  42 ++---
 include/seqan/file/string_external.h               | 200 ++++++++++-----------
 include/seqan/graph_algorithms.h                   |   2 +
 .../seqan/graph_algorithms/depth_first_search.h    | 101 +++++++----
 .../strongly_connected_compnents.h                 |  29 +++
 include/seqan/graph_msa/graph_align_tcoffee_io.h   |   2 +-
 .../seqan/graph_msa/graph_align_tcoffee_library.h  |  71 ++++----
 include/seqan/index/index_bidirectional.h          |  41 ++---
 include/seqan/index/index_bidirectional_stree.h    | 153 +++++++++++++---
 include/seqan/index/index_bifm.h                   |   2 +
 include/seqan/index/index_bifm_stree.h             |   4 +-
 include/seqan/modifier/modifier_padding.h          |  12 ++
 include/seqan/parallel/parallel_lock.h             |   4 +-
 include/seqan/score.h                              |   2 +-
 include/seqan/stream/file_stream.h                 |  24 +--
 include/seqan/stream/formatted_file.h              |  20 +++
 include/seqan/stream/stream_base.h                 |   9 +-
 include/seqan/tabix_io/tabix_index_tbi.h           |   3 +
 include/seqan/version.h                            |   2 +-
 .../Infrastructure/Use/CustomBuildSystem.rst       |   4 +
 manual/source/Infrastructure/Use/Install.rst       |  44 ++---
 manual/source/index.rst                            |   2 +-
 tests/bam_io/test_bam_file.h                       |  42 +++++
 tests/bam_io/test_bam_io.cpp                       |   4 +
 tests/basic/test_basic_simd_vector.cpp             |   6 +-
 tests/basic/test_basic_simd_vector.h               |   7 +-
 tests/bed_io/test_bed_io.cpp                       |  42 +++++
 tests/gff_io/test_gff_io.cpp                       |   4 +
 tests/gff_io/test_gff_io.h                         |  38 ++++
 tests/graph_msa/test_graph_tcoffee.h               |   2 +-
 tests/index/test_index_bifm.cpp                    |  58 +++---
 tests/roi_io/test_roi_io.cpp                       |  42 +++++
 tests/seq_io/test_seq_io.cpp                       |   4 +
 tests/seq_io/test_sequence_file.h                  |  42 +++++
 tests/vcf_io/test_vcf_io.cpp                       |   3 +
 tests/vcf_io/test_vcf_io.h                         |  38 ++++
 util/cmake/FindSeqAn.cmake                         |  22 ++-
 49 files changed, 921 insertions(+), 382 deletions(-)

diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index cf8ed2c..d2c9aa1 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -7,7 +7,7 @@ If you submit any issues or pull requests to SeqAn it implies that you have read
 Copyright
 ---------
 
-SeqAn is an free and open source software library, released to the public under the terms described in the `license file <./COPYING.rst>`__, but to stay safe we require that all contributors `sign the contributor license agreement <https://www.clahub.com/agreements/seqan/seqan>`__. Really, it's just a few clicks.
+SeqAn is an free and open source software library, released to the public under the terms described in the `license file <./LICENSE>`__, but to stay safe we require that all contributors `sign the contributor license agreement <https://www.clahub.com/agreements/seqan/seqan>`__. Really, it's just a few clicks.
 
 Without signing the agreement, you cannot create pull requests.
 
diff --git a/apps/bs_tools/tests/run_tests.py b/apps/bs_tools/tests/run_tests.py
index 298a120..9c0ec16 100644
--- a/apps/bs_tools/tests/run_tests.py
+++ b/apps/bs_tools/tests/run_tests.py
@@ -12,6 +12,7 @@ Usage:  run_tests.py SOURCE_ROOT_PATH BINARY_ROOT_PATH
 import logging
 import os.path
 import sys
+import platform
 
 # Automagically add util/py_lib to PYTHONPATH environment variable.
 path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..',
@@ -209,7 +210,8 @@ def main(source_base, binary_base):
     # ============================================================
     # 0
 
-    if not (sys.platform.startswith('freebsd') or sys.platform.startswith('win')):
+    if platform.system() == 'Linux' and \
+        (platform.machine() == 'amd64' or platform.machine() == 'x86_64' or platform.machine() == 'i386'):
         conf = app_tests.TestConf(
             program=path_to_casbar,
             redir_stdout=ph.outFile('other.stdout'),
@@ -224,7 +226,7 @@ def main(source_base, binary_base):
                     ph.outFile('meths_pe_0.bed'))])
         conf_list.append(conf)
     else:
-        print "One test not executed on FreeBSD, because of lower math precision."
+        print "Some tests only run on Linux+x86/amd64 because of rounding differences."
 
 
     # ============================================================
diff --git a/apps/fiona/index_qgram_parallel.h b/apps/fiona/index_qgram_parallel.h
index 5040af5..ea899c7 100644
--- a/apps/fiona/index_qgram_parallel.h
+++ b/apps/fiona/index_qgram_parallel.h
@@ -103,9 +103,9 @@ inline typename Value<TSequence>::Type
 _sumIgnoreDisabled(TSequence const &seq, Tag<TParallelTag>)
 {
     typedef typename Value<TSequence>::Type TValue;
-    register typename Iterator<TSequence const>::Type it = begin(seq, Standard());
-    register typename Iterator<TSequence const>::Type itEnd = end(seq, Standard());
-    register TValue sum = 0;
+    typename Iterator<TSequence const>::Type it = begin(seq, Standard());
+    typename Iterator<TSequence const>::Type itEnd = end(seq, Standard());
+    TValue sum = 0;
     for (; it != itEnd; ++it)
         if (*it != (TValue)-1)
             sum += *it;
@@ -257,16 +257,16 @@ _qgramCummulativeSum(TDir &dir, TWithConstraints, TKeepDisabledBuckets, Unsigned
     SEQAN_OMP_PRAGMA(parallel for)
     for (int job = 0; job < (int)length(splitter); ++job)
     {
-        register TConstIterator itBegin = begin(dir, Standard()) + splitter[job];
-        register TIterator dstIt = begin(dir, Standard()) + splitter[job + 1];
-        register TValue sum = localSums[job];
+        TConstIterator itBegin = begin(dir, Standard()) + splitter[job];
+        TIterator dstIt = begin(dir, Standard()) + splitter[job + 1];
+        TValue sum = localSums[job];
 
         // read over our subinterval
         {
-            register TConstIterator it = begin(dir, Standard()) + splitter[job + 1] - SHIFT;
+            TConstIterator it = begin(dir, Standard()) + splitter[job + 1] - SHIFT;
             while (it != itBegin)
             {
-                register TValue counter = *(--it);
+                TValue counter = *(--it);
                 if (!TWithConstraints::VALUE || counter != (TValue)-1)
                     sum -= counter;
                 else
@@ -282,10 +282,10 @@ _qgramCummulativeSum(TDir &dir, TWithConstraints, TKeepDisabledBuckets, Unsigned
         // read suffix of the previous subinterval
         if (SHIFT != 0u)
         {
-            register TConstBufferIterator it = begin(prevCounts, Standard()) + (job + 1) * SHIFT;
+            TConstBufferIterator it = begin(prevCounts, Standard()) + (job + 1) * SHIFT;
             while (dstIt != itBegin)
             {
-                register TValue counter = *(--it);
+                TValue counter = *(--it);
                 if (!TWithConstraints::VALUE || counter != (TValue)-1)
                     sum -= counter;
                 else
@@ -348,13 +348,13 @@ _qgramFillSuffixArray(
             TIterator itText = begin(text, Standard()) + pos;
 
             // first hash
-            register TDirIterator const bktPtr = dirBegin1 + getBucket(bucketMap, hash(shape, itText));
+            TDirIterator const bktPtr = dirBegin1 + getBucket(bucketMap, hash(shape, itText));
             if (!TWithConstraints::VALUE || *bktPtr != (TSize)-1)       // ignore disabled buckets
                 sa[atomicPostInc(*bktPtr, parallelTag)] = pos;          
 
             for (++pos; pos != posEnd; ++pos)
             {
-                register TDirIterator const bktPtr = dirBegin1 + getBucket(bucketMap, hashNext(shape, ++itText));
+                TDirIterator const bktPtr = dirBegin1 + getBucket(bucketMap, hashNext(shape, ++itText));
                 if (!TWithConstraints::VALUE || *bktPtr != (TSize)-1)   // ignore disabled buckets
                     sa[atomicPostInc(*bktPtr, parallelTag)] = pos;
             }
@@ -371,7 +371,7 @@ _qgramFillSuffixArray(
 
             for (; pos != posEnd; pos += stepSize, itText += stepSize)
             {
-                register TDirIterator const bktPtr = dirBegin1 + getBucket(bucketMap, hash(shape, itText));
+                TDirIterator const bktPtr = dirBegin1 + getBucket(bucketMap, hash(shape, itText));
                 if (!TWithConstraints::VALUE || *bktPtr != (TSize)-1)   // ignore disabled buckets
                     sa[atomicPostInc(*bktPtr, parallelTag)] = pos;
             }
@@ -429,14 +429,14 @@ _qgramFillSuffixArray(
 				assignValueI2(localPos, 0);
 
                 // first hash
-                register TDirIterator const bktPtr = dirBegin1 + getBucket(bucketMap, hash(shape, itText));
+                TDirIterator const bktPtr = dirBegin1 + getBucket(bucketMap, hash(shape, itText));
                 if (!TWithConstraints::VALUE || *bktPtr != (TSize)-1)       // ignore disabled buckets
                     sa[atomicPostInc(*bktPtr, parallelTag)] = localPos;          
 
                 for (++itText; itText != itTextEnd; ++itText)
                 {
                     posInc(localPos);
-                    register TDirIterator const bktPtr = dirBegin1 + getBucket(bucketMap, hashNext(shape, itText));
+                    TDirIterator const bktPtr = dirBegin1 + getBucket(bucketMap, hashNext(shape, itText));
                     if (!TWithConstraints::VALUE || *bktPtr != (TSize)-1)   // ignore disabled buckets
                         sa[atomicPostInc(*bktPtr, parallelTag)] = localPos;
                 }
@@ -463,7 +463,7 @@ _qgramFillSuffixArray(
                 for (; itText != itTextEnd; ++itText)
                 {
                     posInc(localPos, stepSize);
-                    register TDirIterator const bktPtr = dirBegin1 + getBucket(bucketMap, hash(shape, itText));
+                    TDirIterator const bktPtr = dirBegin1 + getBucket(bucketMap, hash(shape, itText));
                     if (!TWithConstraints::VALUE || *bktPtr != (TSize)-1)   // ignore disabled buckets
                         sa[atomicPostInc(*bktPtr, parallelTag)] = localPos;
                 }
@@ -489,9 +489,9 @@ _qgramPostprocessBuckets(TDir &dir, Tag<TParallelTag> parallelTag)
     SEQAN_OMP_PRAGMA(parallel for)
     for (int job = 0; job < (int)length(splitter); ++job)
     {
-        register TDirIterator it = splitter[job];
-        register TDirIterator itEnd = splitter[job + 1];
-        register TSize prev = (job == 0)? 0: (TSize)-1;
+        TDirIterator it = splitter[job];
+        TDirIterator itEnd = splitter[job + 1];
+        TSize prev = (job == 0)? 0: (TSize)-1;
         for (; it != itEnd; ++it)
             if (*it == (TSize)-1)
                 *it = prev;
@@ -507,9 +507,9 @@ _qgramPostprocessBuckets(TDir &dir, Tag<TParallelTag> parallelTag)
     SEQAN_OMP_PRAGMA(parallel for)
     for (int job = 1; job < (int)length(splitter); ++job)
     {
-        register TDirIterator it = splitter[job];
-        register TDirIterator itEnd = splitter[job + 1];
-        register TSize prev = last[job - 1];
+        TDirIterator it = splitter[job];
+        TDirIterator itEnd = splitter[job + 1];
+        TSize prev = last[job - 1];
         for (; it != itEnd && *it == (TSize)-1; ++it)
             *it = prev;
     }
diff --git a/apps/razers3/razers_match_filter.h b/apps/razers3/razers_match_filter.h
index c1110aa..05bc4ef 100644
--- a/apps/razers3/razers_match_filter.h
+++ b/apps/razers3/razers_match_filter.h
@@ -99,7 +99,7 @@ _newLimit(TMatchFilter const & filter, unsigned histogramId)
     // TODO(holtgrew): This could be speeded up if using prefix sum data structures for histograms.
     typedef typename Iterator<String<unsigned> const, Standard>::Type TIter;
 
-    register int max = filter.options.maxHits;
+    int max = filter.options.maxHits;
     if (max == 0)
         return NO_NEW_LIMIT;
 
@@ -111,7 +111,7 @@ _newLimit(TMatchFilter const & filter, unsigned histogramId)
     TIter itBeg = begin(hist, Standard());
     TIter itEnd = end(hist, Standard());
 
-    for (register TIter it = itBeg; it != itEnd; ++it)
+    for (TIter it = itBeg; it != itEnd; ++it)
     {
         max -= *it;
         if (max <= 0)
@@ -129,10 +129,10 @@ _newLimitDistRange(TMatchFilter const & filter, unsigned histogramId)
 
     String<unsigned> const & hist = filter.histograms[histogramId];
 
-    register int max = filter.options.maxHits;
+    int max = filter.options.maxHits;
     TIter itBeg = begin(hist, Standard());
     TIter itEnd = end(hist, Standard());
-    register TIter it = itBeg;
+    TIter it = itBeg;
 
     if (max == 0)
     {
diff --git a/include/seqan/align.h b/include/seqan/align.h
index 6f64b07..8e5858e 100644
--- a/include/seqan/align.h
+++ b/include/seqan/align.h
@@ -155,7 +155,7 @@
 #include <seqan/align/dp_context.h>
 #include <seqan/align/dp_setup.h>
 
-#if SEQAN_SIMD_ENABLED
+#ifdef SEQAN_SIMD_ENABLED
 #include <seqan/align/dp_scout_simd.h>
 #include <seqan/align/dp_align_simd_helper.h>
 #endif  // SEQAN_SIMD_ENABLED
diff --git a/include/seqan/align/align_interface_wrapper.h b/include/seqan/align/align_interface_wrapper.h
index f384b1c..177d0ae 100644
--- a/include/seqan/align/align_interface_wrapper.h
+++ b/include/seqan/align/align_interface_wrapper.h
@@ -167,7 +167,7 @@ _alignWrapperSequential(StringSet<Gaps<TSequenceH, TGapsSpecH>, TSetSpecH> & gap
 template <typename... TArgs>
 inline auto _alignWrapper(TArgs && ...args)
 {
-#if SEQAN_SIMD_ENABLED
+#ifdef SEQAN_SIMD_ENABLED
     return _alignWrapperSimd(std::forward<TArgs>(args)...);
 #else
     return _alignWrapperSequential(std::forward<TArgs>(args)...);
diff --git a/include/seqan/align/dp_align_simd_helper.h b/include/seqan/align/dp_align_simd_helper.h
index b5c15e8..8fd634a 100644
--- a/include/seqan/align/dp_align_simd_helper.h
+++ b/include/seqan/align/dp_align_simd_helper.h
@@ -89,7 +89,7 @@ struct SimdAlignVariableLengthTraits
 // Function _createSimdRepImpl()
 // ----------------------------------------------------------------------------
 
-#define SEQAN_CREATE_SIMD_REP_IMPL_2(data, strPos, chrPos)    data[strPos + 1][chrPos], data[strPos][chrPos]
+#define SEQAN_CREATE_SIMD_REP_IMPL_2(data, strPos, chrPos)    getValue(data[strPos + 1], chrPos), getValue(data[strPos], chrPos)
 #define SEQAN_CREATE_SIMD_REP_IMPL_4(data, strPos, chrPos)    SEQAN_CREATE_SIMD_REP_IMPL_2(data, strPos + 2, chrPos),  SEQAN_CREATE_SIMD_REP_IMPL_2(data, strPos, chrPos)
 #define SEQAN_CREATE_SIMD_REP_IMPL_8(data, strPos, chrPos)    SEQAN_CREATE_SIMD_REP_IMPL_4(data, strPos + 4, chrPos),  SEQAN_CREATE_SIMD_REP_IMPL_4(data, strPos, chrPos)
 #define SEQAN_CREATE_SIMD_REP_IMPL_16(data, strPos, chrPos)   SEQAN_CREATE_SIMD_REP_IMPL_8(data, strPos + 8, chrPos),  SEQAN_CREATE_SIMD_REP_IMPL_8(data, strPos, chrPos)
diff --git a/include/seqan/align/global_alignment_myers_hirschberg_impl.h b/include/seqan/align/global_alignment_myers_hirschberg_impl.h
index e390eca..24e67ec 100644
--- a/include/seqan/align/global_alignment_myers_hirschberg_impl.h
+++ b/include/seqan/align/global_alignment_myers_hirschberg_impl.h
@@ -597,7 +597,6 @@ _globalAlignment(Gaps<TSequenceH, TGapsSpecH> & gapsH,
                          VP[currentBlock] = temp | ~(X | D0);
                     }
 
-                    _printBinary(std::cout, HP);
                     /* update score */
                     if (HP & fScoreMask)
                         score--;
diff --git a/include/seqan/arg_parse.h b/include/seqan/arg_parse.h
index 1cee957..1a7ea51 100644
--- a/include/seqan/arg_parse.h
+++ b/include/seqan/arg_parse.h
@@ -52,6 +52,10 @@
 #include <unistd.h>
 #endif
 
+#include <regex>
+#include <vector>
+#include <algorithm>
+
 // ===========================================================================
 // The ArgParse Headers.
 // ===========================================================================
diff --git a/include/seqan/arg_parse/arg_parse_doc.h b/include/seqan/arg_parse/arg_parse_doc.h
index 0609655..3ae3444 100644
--- a/include/seqan/arg_parse/arg_parse_doc.h
+++ b/include/seqan/arg_parse/arg_parse_doc.h
@@ -729,6 +729,44 @@ inline void _addDefaultValues(std::string & text, ArgParseOption const & opt)
 }
 
 // ----------------------------------------------------------------------------
+// Function _seperateExtensionsForPrettyPrinting()
+// ----------------------------------------------------------------------------
+
+inline void _seperateExtensionsForPrettyPrinting(std::vector<std::string> & file_ext,
+                                                 std::vector<std::string> & comp_ext,
+                                                 std::vector<std::string> const & validValues)
+{
+    // seperate file extensions and compression extensions
+    for (std::vector<std::string>::size_type i = 0; i < validValues.size(); ++i)
+    {
+        std::regex rgx("^(\\.)?([A-z]+)(\\.)?([A-z]+)?");
+        std::smatch result;
+
+        std::regex_search(validValues[i], result, rgx);
+
+        if (!result[4].str().empty())
+        {
+            comp_ext.push_back(result[4].str());
+            file_ext.push_back("." + result[2].str() + "[.*]");
+        }
+        else
+        {
+            file_ext.push_back("." + result[2].str());
+        }
+    }
+
+    std::sort(file_ext.rbegin(), file_ext.rend()); // sort extensions in reverse order such that '.fa[.x]'
+    std::sort(comp_ext.rbegin(), comp_ext.rend()); // comes before '.fa' and will be chosen by std::unique()
+
+    comp_ext.erase(std::unique(comp_ext.begin(), comp_ext.end()), comp_ext.end()); // remove duplicates
+    file_ext.erase(std::unique(file_ext.begin(), file_ext.end(),
+                    [&](auto& lhs, auto& rhs)
+                    {
+                        return lhs.substr(0, lhs.find('[')) == rhs.substr(0, rhs.find('['));
+                    }), file_ext.end());
+}
+
+// ----------------------------------------------------------------------------
 // Function _addValidValuesRestrictions()
 // ----------------------------------------------------------------------------
 
@@ -738,19 +776,33 @@ inline void _addValidValuesRestrictions(std::string & text, ArgParseOption const
     {
         if (isInputFileArgument(opt) || isOutputFileArgument(opt))
         {
+            std::vector<std::string> file_extensions;
+            std::vector<std::string> compresssion_extensions;
+
+            _seperateExtensionsForPrettyPrinting(file_extensions, compresssion_extensions, opt.validValues);
+
             append(text, " Valid filetype");
 
-            if (opt.validValues.size() > 1)
+            if (file_extensions.size() > 1)
                 append(text, "s are: ");
             else
                 append(text, " is: ");
+
+            _expandList(text, file_extensions);
+
+            if (compresssion_extensions.size() != 0)
+            {
+                append(text, ", where * is any of the following extensions: ");
+                _expandList(text, compresssion_extensions);
+                append(text, " for transparent (de)compression");
+            }
         }
         else
         {
             append(text, " One of ");
+            _expandList(text, opt.validValues);
         }
 
-        _expandList(text, opt.validValues);
         append(text, ".");
     }
 }
diff --git a/include/seqan/basic/basic_allocator.h b/include/seqan/basic/basic_allocator.h
index 5d76366..1a3f609 100644
--- a/include/seqan/basic/basic_allocator.h
+++ b/include/seqan/basic/basic_allocator.h
@@ -44,7 +44,6 @@
 #include <seqan/platform.h>
 #include <seqan/basic/basic_fundamental.h>
 #include <seqan/basic/basic_smart_pointer.h>
-#include <seqan/basic/basic_simd_vector.h>
 
 // --------------------------------------------------------------------------
 // Sub Module Headers
diff --git a/include/seqan/basic/basic_simd_vector.h b/include/seqan/basic/basic_simd_vector.h
index 532483e..40f6e56 100644
--- a/include/seqan/basic/basic_simd_vector.h
+++ b/include/seqan/basic/basic_simd_vector.h
@@ -41,17 +41,26 @@
 
 #include <utility>
 #include <tuple>
-//#include <seqan/basic/iterator_zip.h>
-
-#if defined(PLATFORM_WINDOWS_VS)
-  /* Microsoft C/C++-compatible compiler */
-  #include <intrin.h>
-#elif defined(PLATFORM_GCC) && (defined(__x86_64__) || defined(__i386__))
-  /* GCC-compatible compiler, targeting x86/x86-64 */
-  #include <x86intrin.h>
-#else
- #warning "No supported platform for SIMD vectorization!"
-#endif
+
+// Currently only support the following compilers
+#if defined(COMPILER_GCC) || defined(COMPILER_CLANG) || defined(COMPILER_LINTEL)
+    // Define global macro to check if simd instructions are enabled.
+    #define SEQAN_SIMD_ENABLED
+
+    // Define maximal size of vector in byte.
+    #if defined(__AVX2__)
+        #define SEQAN_SIZEOF_MAX_VECTOR 32
+    #elif defined(__SSE4_1__) && defined(__SSE4_2__)
+        #define SEQAN_SSE4
+        #define SEQAN_SIZEOF_MAX_VECTOR 16
+    #else  // defined(__AVX2__)
+        #undef SEQAN_SIMD_ENABLED  // Disable simd if instruction set is not supported.
+    #endif  // defined(__AVX2__)
+#endif  // defined(COMPILER_GCC) || defined(COMPILER_CLANG) || defined(COMPILER_LINTEL)
+
+#ifdef SEQAN_SIMD_ENABLED  // Include header with intrinsics.
+    #include <x86intrin.h>
+#endif  // SEQAN_SIMD_ENABLED
 
 namespace seqan {
 
@@ -64,7 +73,6 @@ namespace seqan {
 #define SEQAN_VECTOR_CAST_LVALUE_(T, v) reinterpret_cast<T>(v)
 #endif
 
-
 // ============================================================================
 // Forwards
 // ============================================================================
@@ -106,26 +114,12 @@ assignValue(TSimdVector &vector, TPosition pos, TValue2 value)
     vector[pos] = value;                                                                                \
 }
 
-// Define global macro to check if simd instructions are enabled.
-#define SEQAN_SIMD_ENABLED 1
-
-// Define maximal size of vector in byte.
-#if defined(__AVX2__)
-    #define SEQAN_SIZEOF_MAX_VECTOR 32
-#elif defined(__SSE4_1__) && defined(__SSE4_2__)
-    #define SEQAN_SSE4
-    #define SEQAN_SIZEOF_MAX_VECTOR 16
-#else
-    #undef SEQAN_SIMD_ENABLED
-    #define SEQAN_SIMD_ENABLED 0  // Disable simd instructions.
-#endif
-
 // define a concept and its models
 // they allow us to define generic vector functions
 SEQAN_CONCEPT(SimdVectorConcept, (T)) {};
 
 // Only include following code if simd instructions are enabled.
-#if SEQAN_SIMD_ENABLED
+#ifdef SEQAN_SIMD_ENABLED
 
 // ============================================================================
 // Tags, Classes, Enums
diff --git a/include/seqan/file/file_page.h b/include/seqan/file/file_page.h
index 21f5595..177f6c3 100644
--- a/include/seqan/file/file_page.h
+++ b/include/seqan/file/file_page.h
@@ -73,7 +73,7 @@ struct MMap;
 
     struct Dynamic;
 
-    template <size_t PAGESIZE>
+    template <size_t SEQAN_PAGESIZE>
     struct Fixed;
 
     template <typename TFile, typename TSpec = Dynamic>
@@ -160,11 +160,11 @@ struct MMap;
         return me.pageSize;
     }
 
-    template <typename TValue, typename TFile, size_t PAGESIZE>
-    inline typename Size<Buffer<TValue, PageFrame<TFile, Fixed<PAGESIZE> > > >::Type
-    capacity(Buffer<TValue, PageFrame<TFile, Fixed<PAGESIZE> > > const &)
+    template <typename TValue, typename TFile, size_t SEQAN_PAGESIZE>
+    inline typename Size<Buffer<TValue, PageFrame<TFile, Fixed<SEQAN_PAGESIZE> > > >::Type
+    capacity(Buffer<TValue, PageFrame<TFile, Fixed<SEQAN_PAGESIZE> > > const &)
     {
-        return PAGESIZE;
+        return SEQAN_PAGESIZE;
     }
 
     template <typename TValue, typename TSpec, typename TSize>
@@ -181,11 +181,11 @@ struct MMap;
         return me.end - me.begin;
     }
 
-    template <typename TValue, typename TFile, size_t PAGESIZE>
-    inline typename Size<Buffer<TValue, PageFrame<TFile, Fixed<PAGESIZE> > > >::Type
-    length(Buffer<TValue, PageFrame<TFile, Fixed<PAGESIZE> > > const &)
+    template <typename TValue, typename TFile, size_t SEQAN_PAGESIZE>
+    inline typename Size<Buffer<TValue, PageFrame<TFile, Fixed<SEQAN_PAGESIZE> > > >::Type
+    length(Buffer<TValue, PageFrame<TFile, Fixed<SEQAN_PAGESIZE> > > const &)
     {
-        return PAGESIZE;
+        return SEQAN_PAGESIZE;
     }
 
     template <typename TValue, typename TSpec, typename TSize>
@@ -397,14 +397,14 @@ struct MMap;
 
     template < typename TValue,
                typename TFile,
-               size_t PAGESIZE_ >
-    struct Buffer<TValue, PageFrame<TFile, Fixed<PAGESIZE_> > >
+               size_t SEQAN_PAGESIZE_ >
+    struct Buffer<TValue, PageFrame<TFile, Fixed<SEQAN_PAGESIZE_> > >
     {
         typedef TFile                                       File;
         typedef typename AsyncRequest<TFile>::Type          AsyncRequest;
         typedef    typename Iterator<Buffer, Standard>::Type   TIterator;
 
-        enum            { PAGESIZE = PAGESIZE_ };
+        enum            { SEQAN_PAGESIZE = SEQAN_PAGESIZE_ };
         enum DataStatus    { ON_DISK = -1, UNINITIALIZED = -2 };
         enum Priority    { NORMAL_LEVEL = 0, PREFETCH_LEVEL = 1, ITERATOR_LEVEL = 2, PERMANENT_LEVEL = 3 };
 
@@ -470,17 +470,17 @@ struct MMap;
 
     template < typename TValue,
                typename TFile,
-               size_t PAGESIZE_ >
-    struct HasMoveConstructor<Buffer<TValue, PageFrame<TFile, Fixed<PAGESIZE_> > > > : True {};
+               size_t SEQAN_PAGESIZE_ >
+    struct HasMoveConstructor<Buffer<TValue, PageFrame<TFile, Fixed<SEQAN_PAGESIZE_> > > > : True {};
 
 
     template < typename TValue,
                typename TFile,
-               size_t PAGESIZE_ >
+               size_t SEQAN_PAGESIZE_ >
     inline void
-    clear(Buffer<TValue, PageFrame<TFile, Fixed<PAGESIZE_> > > &me)
+    clear(Buffer<TValue, PageFrame<TFile, Fixed<SEQAN_PAGESIZE_> > > &me)
     {
-        typedef Buffer<TValue, PageFrame<TFile, Fixed<PAGESIZE_> > > TPageFrame;
+        typedef Buffer<TValue, PageFrame<TFile, Fixed<SEQAN_PAGESIZE_> > > TPageFrame;
         me.status = READY;
         me.dataStatus = TPageFrame::UNINITIALIZED;
         me.priority = TPageFrame::NORMAL_LEVEL;
@@ -513,14 +513,14 @@ struct MMap;
     //////////////////////////////////////////////////////////////////////////////
     // meta-function interface
 
-    template <typename TValue, typename TFile, size_t PAGESIZE>
-    struct Iterator<Buffer<TValue, PageFrame<TFile, Fixed<PAGESIZE> > >, Standard >
+    template <typename TValue, typename TFile, size_t SEQAN_PAGESIZE>
+    struct Iterator<Buffer<TValue, PageFrame<TFile, Fixed<SEQAN_PAGESIZE> > >, Standard >
     {
         typedef VolatilePtr<TValue> Type;
     };
 
-    template <typename TValue, typename TFile, size_t PAGESIZE>
-    struct Iterator<Buffer<TValue, PageFrame<TFile, Fixed<PAGESIZE> > > const, Standard >
+    template <typename TValue, typename TFile, size_t SEQAN_PAGESIZE>
+    struct Iterator<Buffer<TValue, PageFrame<TFile, Fixed<SEQAN_PAGESIZE> > > const, Standard >
     {
         typedef VolatilePtr<TValue> const Type;
     };
diff --git a/include/seqan/file/string_external.h b/include/seqan/file/string_external.h
index c7bbf47..19abcf4 100644
--- a/include/seqan/file/string_external.h
+++ b/include/seqan/file/string_external.h
@@ -59,11 +59,11 @@ namespace seqan
  * @headerfile <seqan/file.h>
  * @brief Standard configuration for the @link ExternalString @endlink.
  *
- * @signature template <[typename TFile[, unsigned PAGESIZE[, unsigned FRAMES]]>
+ * @signature template <[typename TFile[, unsigned SEQAN_PAGESIZE[, unsigned FRAMES]]>
  *            struct ExternalConfig;
  *
  * @tparam TFile     The @link File @endlink type to use. Default: <tt>File<></tt>.
- * @tparam PAGESIZE The number of values in one page. This should be a power of 2 to speed up transfer and
+ * @tparam SEQAN_PAGESIZE The number of values in one page. This should be a power of 2 to speed up transfer and
  *                   calculations. Default: 2<sup>20</sup>.
  * @tparam FRAMES    The number of pages that should reside in internal memory. To enable prefetching and automatic
  *                   swap-out, <tt>frames</tt> should be greater than 1. Default: 2.
@@ -81,11 +81,11 @@ namespace seqan
  * @headerfile <seqan/file.h>
  * @brief Large size type configuration for the @link ExternalString @endlink.
  *
- * @signature template <[typename TFile[, unsigned PAGESIZE[, unsigned FRAMES]]>
+ * @signature template <[typename TFile[, unsigned SEQAN_PAGESIZE[, unsigned FRAMES]]>
  *            struct ExternalConfigLarge;
  *
  * @tparam TFile     The @link File @endlink type to use. Default: <tt>File<></tt>.
- * @tparam PAGESIZE The number of values in one page. This should be a power of 2 to speed up transfer and
+ * @tparam SEQAN_PAGESIZE The number of values in one page. This should be a power of 2 to speed up transfer and
  *                   calculations. Default: 2<sup>20</sup>.
  * @tparam FRAMES    The number of pages that should reside in internal memory. To enable prefetching and automatic
  *                   swap-out, <tt>frames</tt> should be greater than 1. Default: 2.
@@ -106,12 +106,12 @@ namespace seqan
  * @headerfile <seqan/file.h>
  * @brief Arbitrary size type configuration for @link ExternalString @endlink.
  *
- * @signature template <typename TSize[, typename TFile[, unsigned PAGESIZE[, unsigned FRAMEs]]]>
+ * @signature template <typename TSize[, typename TFile[, unsigned SEQAN_PAGESIZE[, unsigned FRAMEs]]]>
  *            class ExternalConfigSize;
  *
  * @tparam TSize The size type of the ExternalString.
  * @tparam TFile Type of file the ExternalString will be based on. Defaults to <tt>File<></tt>.
- * @tparam PAGESIZE The number of values in one page. This should be a power of 2 to speed up transfer and
+ * @tparam SEQAN_PAGESIZE The number of values in one page. This should be a power of 2 to speed up transfer and
  *                   calculations. Default: 2<sup>20</sup>.
  * @tparam FRAMES    The number of pages that should reside in internal memory. To enable prefetching and automatic
  *                   swap-out, <tt>frames</tt> should be greater than 1. Default: 2.
@@ -156,13 +156,13 @@ namespace seqan
     // standard external string
     // size is uint32
     template < typename TFile_ = File<>,                                // default file type
-               unsigned PAGESIZE_ = _EXTERNAL_STRING_DEFAULT_PAGE_SIZE,
+               unsigned SEQAN_PAGESIZE_ = _EXTERNAL_STRING_DEFAULT_PAGE_SIZE,
                unsigned FRAMES_ = 2 >                                   // simultanous frames
     struct ExternalConfig {
 //IOREV _bug_ doc says default page size is 2^20, but it is 2^22
         typedef TFile_ TFile;
         typedef unsigned TSize;
-        enum { PAGESIZE = PAGESIZE_ };
+        enum { SEQAN_PAGESIZE = SEQAN_PAGESIZE_ };
         enum { FRAMES = FRAMES_ };
     };
 
@@ -173,26 +173,26 @@ namespace seqan
     // pipes use the size type
     // uint64 blows up your suffix arrays, lcp-tables, ...
     template < typename TFile_ = File<>,                                // default file type
-               unsigned PAGESIZE_ = _EXTERNAL_STRING_DEFAULT_PAGE_SIZE,
+               unsigned SEQAN_PAGESIZE_ = _EXTERNAL_STRING_DEFAULT_PAGE_SIZE,
                unsigned FRAMES_ = 2 >                                   // simultanous frames
     struct ExternalConfigLarge {
 //IOREV contains warning in code comments, need to investigate
         typedef TFile_ TFile;
         typedef typename MakeUnsigned<typename Size<TFile_>::Type>::Type TSize;
-        enum { PAGESIZE = PAGESIZE_ };
+        enum { SEQAN_PAGESIZE = SEQAN_PAGESIZE_ };
         enum { FRAMES = FRAMES_ };
     };
 
     // custom size type
     template < typename TSize_,
                typename TFile_ = File<>,                                // default file type
-               unsigned PAGESIZE_ = _EXTERNAL_STRING_DEFAULT_PAGE_SIZE,
+               unsigned SEQAN_PAGESIZE_ = _EXTERNAL_STRING_DEFAULT_PAGE_SIZE,
                unsigned FRAMES_ = 2 >                                   // simultanous frames
     struct ExternalConfigSize {
 //IOREV
         typedef TSize_ TSize;
         typedef TFile_ TFile;
-        enum { PAGESIZE = PAGESIZE_ };
+        enum { SEQAN_PAGESIZE = SEQAN_PAGESIZE_ };
         enum { FRAMES = FRAMES_ };
     };
 
@@ -215,7 +215,7 @@ namespace seqan
         typedef typename Difference<TExtString>::Type    TDifference;
         typedef typename TExtString::TVolatilePtr        TVolatilePtr;
 
-        enum { PAGESIZE = TExtString::PAGESIZE };
+        enum { SEQAN_PAGESIZE = TExtString::SEQAN_PAGESIZE };
 
         TSize        offset;
         TExtString    *extString;
@@ -319,7 +319,7 @@ namespace seqan
         typedef typename Difference<TExtString>::Type    TDifference;
         typedef typename TExtString::TVolatilePtr        TVolatilePtr;
 
-        enum { PAGESIZE = TExtString::PAGESIZE };
+        enum { SEQAN_PAGESIZE = TExtString::SEQAN_PAGESIZE };
 
         TSize        offset;
         TExtString    *extString;
@@ -423,7 +423,7 @@ namespace seqan
         typedef typename Difference<TExtString>::Type    TDifference;
         typedef typename TExtString::TVolatilePtr        TVolatilePtr;
 
-        enum { PAGESIZE = TExtString::PAGESIZE };
+        enum { SEQAN_PAGESIZE = TExtString::SEQAN_PAGESIZE };
 
 
         TExtString        *extString;
@@ -453,8 +453,8 @@ namespace seqan
         explicit ExtStringFwdIterator(TExtString *_extString, TSize _offset):
             extString(_extString),
             dirty(true),
-            pageNo(_offset / PAGESIZE),
-            pageOfs(_offset % PAGESIZE),
+            pageNo(_offset / SEQAN_PAGESIZE),
+            pageOfs(_offset % SEQAN_PAGESIZE),
             prefetch(0),
             begin(NULL) {}
 
@@ -476,22 +476,22 @@ namespace seqan
 
         ExtStringFwdIterator(const TStdIterator &I):
             extString(I.extString),
-            pageNo(I.offset / PAGESIZE),
-            pageOfs(I.offset % PAGESIZE),
+            pageNo(I.offset / SEQAN_PAGESIZE),
+            pageOfs(I.offset % SEQAN_PAGESIZE),
             prefetch(0),
             begin(NULL) {}
 
         inline TIterator& operator=(TStdIterator const & Right_) {
             invalidate();
-            pageNo = Right_.offset / PAGESIZE;
-            pageOfs = Right_.offset % PAGESIZE;
+            pageNo = Right_.offset / SEQAN_PAGESIZE;
+            pageOfs = Right_.offset % SEQAN_PAGESIZE;
             extString = Right_.extString;
             return *this;
         }
 
         inline TSize position() const
         {
-            return (TSize)pageNo * (TSize)PAGESIZE + pageOfs;
+            return (TSize)pageNo * (TSize)SEQAN_PAGESIZE + pageOfs;
         }
 
         inline operator TStdIterator() const {
@@ -520,20 +520,20 @@ namespace seqan
         }
 
         inline TIterator operator- (TDifference delta) const {
-            TDifference dPNo  = delta / PAGESIZE;
-            TDifference dPOfs = delta % PAGESIZE;
+            TDifference dPNo  = delta / SEQAN_PAGESIZE;
+            TDifference dPOfs = delta % SEQAN_PAGESIZE;
             if (static_cast<TDifference>(pageOfs) >= dPOfs)
                 return TIterator(extString, pageNo - dPNo, pageOfs - dPOfs);
             else
-                return TIterator(extString, pageNo - dPNo - 1, PAGESIZE + pageOfs - dPOfs);
+                return TIterator(extString, pageNo - dPNo - 1, SEQAN_PAGESIZE + pageOfs - dPOfs);
         }
 
         inline TIterator& operator-= (TDifference delta) {
-            TDifference dPNo  = delta / PAGESIZE;
-            TDifference dPOfs = delta % PAGESIZE;
+            TDifference dPNo  = delta / SEQAN_PAGESIZE;
+            TDifference dPOfs = delta % SEQAN_PAGESIZE;
             if (pageOfs < dPOfs) {
                 ++dPNo;
-                pageOfs = PAGESIZE + pageOfs - dPOfs;
+                pageOfs = SEQAN_PAGESIZE + pageOfs - dPOfs;
             } else
                 pageOfs -= dPOfs;
             if (dPNo) invalidate(0);
@@ -542,20 +542,20 @@ namespace seqan
         }
 
         inline TIterator operator+ (TDifference delta) const {
-            TDifference dPNo  = delta / PAGESIZE;
-            TDifference nPOfs = pageOfs + delta % PAGESIZE;
-            if (nPOfs < PAGESIZE)
+            TDifference dPNo  = delta / SEQAN_PAGESIZE;
+            TDifference nPOfs = pageOfs + delta % SEQAN_PAGESIZE;
+            if (nPOfs < SEQAN_PAGESIZE)
                 return TIterator(extString, pageNo + dPNo, nPOfs);
             else
-                return TIterator(extString, pageNo + dPNo + 1, nPOfs - PAGESIZE);
+                return TIterator(extString, pageNo + dPNo + 1, nPOfs - SEQAN_PAGESIZE);
         }
 
         inline TIterator& operator+= (TDifference delta) {
-            TDifference dPNo  = delta / PAGESIZE;
-            TDifference nPOfs = pageOfs + delta % PAGESIZE;
-            if (nPOfs >= PAGESIZE) {
+            TDifference dPNo  = delta / SEQAN_PAGESIZE;
+            TDifference nPOfs = pageOfs + delta % SEQAN_PAGESIZE;
+            if (nPOfs >= SEQAN_PAGESIZE) {
                 ++dPNo;
-                nPOfs -= PAGESIZE;
+                nPOfs -= SEQAN_PAGESIZE;
             }
             if (dPNo) invalidate(0);
             pageNo += dPNo;
@@ -597,7 +597,7 @@ namespace seqan
         }
 */
         inline TIterator& operator++ () {
-            if (++pageOfs == PAGESIZE) {
+            if (++pageOfs == SEQAN_PAGESIZE) {
                 invalidate(1);
                 pageOfs = 0;
                 ++pageNo;
@@ -607,7 +607,7 @@ namespace seqan
 
         inline TIterator operator++ (int) {
             TIterator before = *this;
-            if (++pageOfs == PAGESIZE) {
+            if (++pageOfs == SEQAN_PAGESIZE) {
                 invalidate(1);
                 pageOfs = 0;
                 ++pageNo;
@@ -620,7 +620,7 @@ namespace seqan
                 --pageOfs;
             else {
                 invalidate(-1);
-                pageOfs = PAGESIZE - 1;
+                pageOfs = SEQAN_PAGESIZE - 1;
                 --pageNo;
             }
             return *this;
@@ -632,7 +632,7 @@ namespace seqan
                 --pageOfs;
             else {
                 invalidate(-1);
-                pageOfs = PAGESIZE - 1;
+                pageOfs = SEQAN_PAGESIZE - 1;
                 --pageNo;
             }
             return before;
@@ -671,7 +671,7 @@ namespace seqan
         typedef typename Difference<TExtString>::Type    TDifference;
         typedef typename TExtString::TVolatilePtr        TVolatilePtr;
 
-        enum { PAGESIZE = TExtString::PAGESIZE };
+        enum { SEQAN_PAGESIZE = TExtString::SEQAN_PAGESIZE };
 
 
         TExtString        *extString;
@@ -709,8 +709,8 @@ namespace seqan
 
         ExtStringFwdConstIterator(TExtString *_extString, TSize _offset):
             extString(_extString),
-            pageNo(_offset / PAGESIZE),
-            pageOfs(_offset % PAGESIZE),
+            pageNo(_offset / SEQAN_PAGESIZE),
+            pageOfs(_offset % SEQAN_PAGESIZE),
             prefetch(0),
             begin(NULL) {}
 
@@ -726,37 +726,37 @@ namespace seqan
 
         ExtStringFwdConstIterator(TStdIterator &I):
             extString(I.extString),
-            pageNo(I.offset / PAGESIZE),
-            pageOfs(I.offset % PAGESIZE),
+            pageNo(I.offset / SEQAN_PAGESIZE),
+            pageOfs(I.offset % SEQAN_PAGESIZE),
             prefetch(0),
             begin(NULL) {}
 
         ExtStringFwdConstIterator(TStdConstIterator const &I):
             extString(I.extString),
-            pageNo(I.offset / PAGESIZE),
-            pageOfs(I.offset % PAGESIZE),
+            pageNo(I.offset / SEQAN_PAGESIZE),
+            pageOfs(I.offset % SEQAN_PAGESIZE),
             prefetch(0),
             begin(NULL) {}
 
         inline TIterator& operator=(TStdIterator const & Right_) {
             invalidate();
-            pageNo = Right_.offset / PAGESIZE;
-            pageOfs = Right_.offset % PAGESIZE;
+            pageNo = Right_.offset / SEQAN_PAGESIZE;
+            pageOfs = Right_.offset % SEQAN_PAGESIZE;
             extString = Right_.extString;
             return *this;
         }
 
         inline TIterator& operator=(TStdConstIterator const & Right_) {
             invalidate();
-            pageNo = Right_.offset / PAGESIZE;
-            pageOfs = Right_.offset % PAGESIZE;
+            pageNo = Right_.offset / SEQAN_PAGESIZE;
+            pageOfs = Right_.offset % SEQAN_PAGESIZE;
             extString = Right_.extString;
             return *this;
         }
 
         inline TSize position() const
         {
-            return (TSize)pageNo * (TSize)PAGESIZE + pageOfs;
+            return (TSize)pageNo * (TSize)SEQAN_PAGESIZE + pageOfs;
         }
 
         inline operator TStdConstIterator() const {
@@ -790,20 +790,20 @@ namespace seqan
         }
 
         inline TIterator operator- (TDifference delta) const {
-            TDifference dPNo  = delta / PAGESIZE;
-            TDifference dPOfs = delta % PAGESIZE;
+            TDifference dPNo  = delta / SEQAN_PAGESIZE;
+            TDifference dPOfs = delta % SEQAN_PAGESIZE;
             if (pageOfs >= dPOfs)
                 return TIterator(extString, pageNo - dPNo, pageOfs - dPOfs);
             else
-                return TIterator(extString, pageNo - dPNo - 1, PAGESIZE + pageOfs - dPOfs);
+                return TIterator(extString, pageNo - dPNo - 1, SEQAN_PAGESIZE + pageOfs - dPOfs);
         }
 
         inline TIterator& operator-= (TDifference delta) {
-            TDifference dPNo  = delta / PAGESIZE;
-            TDifference dPOfs = delta % PAGESIZE;
+            TDifference dPNo  = delta / SEQAN_PAGESIZE;
+            TDifference dPOfs = delta % SEQAN_PAGESIZE;
             if (pageOfs < dPOfs) {
                 ++dPNo;
-                pageOfs = PAGESIZE + pageOfs - dPOfs;
+                pageOfs = SEQAN_PAGESIZE + pageOfs - dPOfs;
             } else
                 pageOfs -= dPOfs;
             if (dPNo) invalidate(0);
@@ -812,20 +812,20 @@ namespace seqan
         }
 
         inline TIterator operator+ (TDifference delta) const {
-            TDifference dPNo  = delta / PAGESIZE;
-            TDifference nPOfs = pageOfs + delta % PAGESIZE;
-            if (nPOfs < PAGESIZE)
+            TDifference dPNo  = delta / SEQAN_PAGESIZE;
+            TDifference nPOfs = pageOfs + delta % SEQAN_PAGESIZE;
+            if (nPOfs < SEQAN_PAGESIZE)
                 return TIterator(extString, pageNo + dPNo, nPOfs);
             else
-                return TIterator(extString, pageNo + dPNo + 1, nPOfs - PAGESIZE);
+                return TIterator(extString, pageNo + dPNo + 1, nPOfs - SEQAN_PAGESIZE);
         }
 
         inline TIterator& operator+= (TDifference delta) {
-            TDifference dPNo  = delta / PAGESIZE;
-            TDifference nPOfs = pageOfs + delta % PAGESIZE;
-            if (nPOfs >= PAGESIZE) {
+            TDifference dPNo  = delta / SEQAN_PAGESIZE;
+            TDifference nPOfs = pageOfs + delta % SEQAN_PAGESIZE;
+            if (nPOfs >= SEQAN_PAGESIZE) {
                 ++dPNo;
-                nPOfs -= PAGESIZE;
+                nPOfs -= SEQAN_PAGESIZE;
             }
             if (dPNo) invalidate(0);
             pageNo += dPNo;
@@ -852,7 +852,7 @@ namespace seqan
         }
 
         inline TIterator& operator++ () {
-            if (++pageOfs == PAGESIZE) {
+            if (++pageOfs == SEQAN_PAGESIZE) {
                 invalidate(1);
                 pageOfs = 0;
                 ++pageNo;
@@ -862,7 +862,7 @@ namespace seqan
 
         inline TIterator operator++ (int) {
             TIterator before = *this;
-            if (++pageOfs == PAGESIZE) {
+            if (++pageOfs == SEQAN_PAGESIZE) {
                 invalidate(1);
                 pageOfs = 0;
                 ++pageNo;
@@ -875,7 +875,7 @@ namespace seqan
                 --pageOfs;
             else {
                 invalidate(-1);
-                pageOfs = PAGESIZE - 1;
+                pageOfs = SEQAN_PAGESIZE - 1;
                 --pageNo;
             }
             return *this;
@@ -887,7 +887,7 @@ namespace seqan
                 --pageOfs;
             else {
                 invalidate(-1);
-                pageOfs = PAGESIZE - 1;
+                pageOfs = SEQAN_PAGESIZE - 1;
                 --pageNo;
             }
             return before;
@@ -1077,23 +1077,23 @@ namespace seqan
     template <typename TExtString>
     inline bool    atEnd(ExtStringFwdIterator<TExtString> &it) {
 //IOREV
-        return TExtString::PAGESIZE * it.pageNo + it.pageOfs == it.extString->data_size;
+        return TExtString::SEQAN_PAGESIZE * it.pageNo + it.pageOfs == it.extString->data_size;
     }
     template <typename TExtString>
     inline bool    atEnd(ExtStringFwdIterator<TExtString> const &it) {
 //IOREV
-        return TExtString::PAGESIZE * it.pageNo + it.pageOfs == it.extString->data_size;
+        return TExtString::SEQAN_PAGESIZE * it.pageNo + it.pageOfs == it.extString->data_size;
     }
 
     template <typename TExtString>
     inline bool    atEnd(ExtStringFwdConstIterator<TExtString> &it) {
 //IOREV
-        return TExtString::PAGESIZE * it.pageNo + it.pageOfs == it.extString->data_size;
+        return TExtString::SEQAN_PAGESIZE * it.pageNo + it.pageOfs == it.extString->data_size;
     }
     template <typename TExtString>
     inline bool    atEnd(ExtStringFwdConstIterator<TExtString> const &it) {
 //IOREV
-        return TExtString::PAGESIZE * it.pageNo + it.pageOfs == it.extString->data_size;
+        return TExtString::SEQAN_PAGESIZE * it.pageNo + it.pageOfs == it.extString->data_size;
     }
 
 
@@ -1112,13 +1112,13 @@ namespace seqan
 //IOREV _doc_ contains TODOs by holtgrew
     public:
         enum { FRAMES    = TConfig::FRAMES,
-               PAGESIZE = TConfig::PAGESIZE };
+               SEQAN_PAGESIZE = TConfig::SEQAN_PAGESIZE };
 
         typedef typename TConfig::TFile                                 TFile;
         typedef typename TConfig::TSize                                 TSize;
 
         typedef String<int>                                             TPageTable;
-        typedef Buffer<TValue, PageFrame<TFile, Fixed<PAGESIZE> > >     TPageFrame;
+        typedef Buffer<TValue, PageFrame<TFile, Fixed<SEQAN_PAGESIZE> > >     TPageFrame;
         typedef PageContainer<TPageFrame, FRAMES>                       TCache;
         typedef VolatilePtr<TValue>                                     TVolatilePtr;
 
@@ -1128,7 +1128,7 @@ namespace seqan
         bool                _temporary, _ownFile;
         TSize                data_size;
         int                 lastDiskPage;       // the last page on disk and in mem
-        unsigned            lastDiskPageSize;   // can be smaller than PAGESIZE
+        unsigned            lastDiskPageSize;   // can be smaller than SEQAN_PAGESIZE
 
         String(TSize size = 0) :
             file(NULL), _temporary(true), _ownFile(false), data_size(0),
@@ -1199,13 +1199,13 @@ namespace seqan
         }
 
         inline TValue & operator[] (TSize offset) {
-            TPageFrame &pf = getPage(offset / PAGESIZE);
+            TPageFrame &pf = getPage(offset / SEQAN_PAGESIZE);
             pf.dirty = true;
-            return pf[offset % PAGESIZE];
+            return pf[offset % SEQAN_PAGESIZE];
         }
 
         inline TValue const & operator[] (TSize offset) const {
-            return const_cast<String*>(this)->getPage(offset / PAGESIZE)[offset % PAGESIZE];
+            return const_cast<String*>(this)->getPage(offset / SEQAN_PAGESIZE)[offset % SEQAN_PAGESIZE];
         }
 
         template <typename TSource>
@@ -1279,11 +1279,11 @@ namespace seqan
                     cache.upgrade(pf, TPageFrame::PREFETCH_LEVEL);
 
                 _ensureFileIsOpen();
-                if (pf.pageNo != (int)(data_size / (TSize)PAGESIZE))
+                if (pf.pageNo != (int)(data_size / (TSize)SEQAN_PAGESIZE))
                     writePage(pf, pf.pageNo, file);
                 else {
-                    lastDiskPage = data_size / PAGESIZE;
-                    lastDiskPageSize = data_size % PAGESIZE;
+                    lastDiskPage = data_size / SEQAN_PAGESIZE;
+                    lastDiskPageSize = data_size % SEQAN_PAGESIZE;
                     writeLastPage(pf, pf.pageNo, file, lastDiskPageSize);
                 }
                 pf.dataStatus = TPageFrame::ON_DISK;
@@ -1312,14 +1312,14 @@ namespace seqan
 
             if (pf.dirty) {                                 // write if dirty
                 _ensureFileIsOpen();
-                if (pf.pageNo != (int)(data_size / (TSize)PAGESIZE)) {
+                if (pf.pageNo != (int)(data_size / (TSize)SEQAN_PAGESIZE)) {
                     writePage(pf, pf.pageNo, file);
                     if (pf.pageNo >= lastDiskPage)
                         lastDiskPage = -1;                   // make lastDiskPage(Size) invalid because file size is aligned
                 } else {
-                    writeLastPage(pf, pf.pageNo, file, data_size % PAGESIZE);
-                    lastDiskPage = data_size / PAGESIZE;
-                    lastDiskPageSize = data_size % PAGESIZE;
+                    writeLastPage(pf, pf.pageNo, file, data_size % SEQAN_PAGESIZE);
+                    lastDiskPage = data_size / SEQAN_PAGESIZE;
+                    lastDiskPageSize = data_size % SEQAN_PAGESIZE;
                 }
                 pager[pf.pageNo] = TPageFrame::ON_DISK;        // page is marked to be on disk
                 bool waitResult = waitFor(pf);              // after finishing I/O transfer
@@ -1539,7 +1539,7 @@ namespace seqan
         {
             unsigned oldFrames = length(cache);
             if (data_size)
-                newFrames = _min(newFrames, (unsigned) enclosingBlocks(data_size, (unsigned)PAGESIZE));
+                newFrames = _min(newFrames, (unsigned) enclosingBlocks(data_size, (unsigned)SEQAN_PAGESIZE));
             if (newFrames < oldFrames) {
                 flush(*this);
                 for(unsigned i = newFrames; i < oldFrames; ++i) {
@@ -1806,12 +1806,12 @@ namespace seqan
             me.data_size = 0;
 
         resize(me.pager, enclosingBlocks(me.data_size,
-            (unsigned)me.PAGESIZE), (me.data_size)?
+            (unsigned)me.SEQAN_PAGESIZE), (me.data_size)?
                 TPageFrame::ON_DISK:
                 TPageFrame::UNINITIALIZED);
 
-        me.lastDiskPage = me.data_size / me.PAGESIZE;
-        me.lastDiskPageSize = me.data_size % me.PAGESIZE;
+        me.lastDiskPage = me.data_size / me.SEQAN_PAGESIZE;
+        me.lastDiskPageSize = me.data_size % me.SEQAN_PAGESIZE;
         return me._ownFile;
     }
 
@@ -1843,12 +1843,12 @@ namespace seqan
             me.data_size = 0;
 
         resize(me.pager, enclosingBlocks(me.data_size,
-            (unsigned)me.PAGESIZE), (me.data_size)?
+            (unsigned)me.SEQAN_PAGESIZE), (me.data_size)?
                 TPageFrame::ON_DISK:
                 TPageFrame::UNINITIALIZED);
 
-        me.lastDiskPage = me.data_size / me.PAGESIZE;
-        me.lastDiskPageSize = me.data_size % me.PAGESIZE;
+        me.lastDiskPage = me.data_size / me.SEQAN_PAGESIZE;
+        me.lastDiskPageSize = me.data_size % me.SEQAN_PAGESIZE;
         return me._file;
     }
 
@@ -1950,7 +1950,7 @@ namespace seqan
     {
 //IOREV
         typedef typename Size< String<TValue, External<TConfig> > >::Type TSize;
-        return (TSize)capacity(me.pager) * (TSize)me.PAGESIZE;
+        return (TSize)capacity(me.pager) * (TSize)me.SEQAN_PAGESIZE;
     }
 //____________________________________________________________________________
 
@@ -1968,7 +1968,7 @@ namespace seqan
         typedef typename TString::TCache                    TCache;
         typedef typename Iterator<TCache, Standard>::Type    TIter;
 
-        resize(me.pager, enclosingBlocks(new_length, (unsigned)me.PAGESIZE), TPageFrame::UNINITIALIZED, expand);
+        resize(me.pager, enclosingBlocks(new_length, (unsigned)me.SEQAN_PAGESIZE), TPageFrame::UNINITIALIZED, expand);
         if ((TSize)new_length < me.data_size)
         {
 
@@ -1976,7 +1976,7 @@ namespace seqan
             TIter fEnd = end(me.cache, Standard());
 
             // remove pages from cache that are behind our new file end
-            int new_pages = (new_length + me.PAGESIZE - 1) / me.PAGESIZE;
+            int new_pages = (new_length + me.SEQAN_PAGESIZE - 1) / me.SEQAN_PAGESIZE;
             for(; f != fEnd ; ++f)
                 if (f->begin && f->pageNo >= new_pages)
                 {
@@ -1986,8 +1986,8 @@ namespace seqan
                 }
 
             // before shrinking the file size
-            me.lastDiskPage = new_length / me.PAGESIZE;
-            me.lastDiskPageSize = new_length % me.PAGESIZE;
+            me.lastDiskPage = new_length / me.SEQAN_PAGESIZE;
+            me.lastDiskPageSize = new_length % me.SEQAN_PAGESIZE;
 
             if (me.file)
                 resize(me.file, (TSize)new_length * (TSize)sizeof(TValue));
@@ -2005,7 +2005,7 @@ namespace seqan
         Tag<TExpand> expand)
     {
 //IOREV
-        reserve(me.pager, enclosingBlocks(new_capacity, (unsigned)me.PAGESIZE), expand);
+        reserve(me.pager, enclosingBlocks(new_capacity, (unsigned)me.SEQAN_PAGESIZE), expand);
         return capacity(me);
     }
 //____________________________________________________________________________
diff --git a/include/seqan/graph_algorithms.h b/include/seqan/graph_algorithms.h
index 963e211..46f0659 100644
--- a/include/seqan/graph_algorithms.h
+++ b/include/seqan/graph_algorithms.h
@@ -36,6 +36,8 @@
 // External / STL
 #include <set>
 #include <queue>
+#include <vector>
+#include <utility>
 
 // Seqan
 #include <seqan/graph_types.h>
diff --git a/include/seqan/graph_algorithms/depth_first_search.h b/include/seqan/graph_algorithms/depth_first_search.h
index 9844d2a..10ef260 100644
--- a/include/seqan/graph_algorithms/depth_first_search.h
+++ b/include/seqan/graph_algorithms/depth_first_search.h
@@ -30,6 +30,7 @@
 //
 // ==========================================================================
 // Author: Tobias Raussch <rausch at embl.de>
+// Author: Ryan Wick <rrwick at gmail.com>
 // ==========================================================================
 // Implementation of Depth-First-Search algorithm.
 // ==========================================================================
@@ -58,34 +59,6 @@ namespace seqan {
 // ----------------------------------------------------------------------------
 // Function depthFirstSearch()
 // ----------------------------------------------------------------------------
-
-template <typename TSpec, typename TVertexDescriptor, typename TTokenMap, typename TPredecessorMap, typename TDiscoveryTimeMap, typename TFinishingTimeMap, typename TVal>
-void
-_dfsVisit(Graph<TSpec> const& g,
-           TVertexDescriptor const u,
-           TTokenMap& tokenMap,
-           TPredecessorMap& predecessor,
-           TDiscoveryTimeMap& disc,
-           TFinishingTimeMap& finish,
-           TVal& time)
-{
-    typedef typename Iterator<Graph<TSpec>, AdjacencyIterator>::Type TAdjacencyIterator;
-
-    assignProperty(tokenMap, u, true);
-    ++time;
-    assignProperty(disc, u, time);
-    TAdjacencyIterator itad(g,u);
-    for(;!atEnd(itad);goNext(itad)) {
-        TVertexDescriptor v = getValue(itad);
-        if (getProperty(tokenMap, v) == false) {
-            assignProperty(predecessor, v, u);
-            _dfsVisit(g, v, tokenMap, predecessor, disc, finish, time);
-        }
-    }
-    ++time;
-    assignProperty(finish, u, time);
-}
-
 /*!
  * @fn depthFirstSearch
  * @headerfile <seqan/graph_algorithms.h>
@@ -121,28 +94,80 @@ void depthFirstSearch(TPredecessorMap & predecessor,
     typedef typename Iterator<TGraph, VertexIterator>::Type TVertexIterator;
     typedef typename VertexDescriptor<TGraph>::Type TVertexDescriptor;
     typedef typename Value<TPredecessorMap>::Type TPredVal;
+    typedef typename Iterator<Graph<TSpec>, AdjacencyIterator>::Type TAdjacencyIterator;
+
+    enum class _DfsTask : uint8_t
+    {
+        EXPLORE,
+        FINISH
+    };
 
-    // Initialization
+    // Initialization - set each vertex as unvisited and with no predecessor.
     resizeVertexMap(predecessor, g);
     resizeVertexMap(disc, g);
     resizeVertexMap(finish, g);
-    TPredVal nilPred = getNil<TVertexDescriptor>();
-
+    TPredVal nil = getNil<TVertexDescriptor>();
     String<bool> tokenMap;
     resizeVertexMap(tokenMap, g);
     TVertexIterator it(g);
-    for(;!atEnd(it);goNext(it)) {
+    for(;!atEnd(it);goNext(it))
+    {
         assignProperty(tokenMap, getValue(it), false);
-        assignProperty(predecessor, getValue(it), nilPred);
+        assignProperty(predecessor, getValue(it), nil);
     }
-
     TSize time = 0;
 
+    // We do the DFS non-recursively using a stack. The stack holds two possible tasks:
+    //   EXPLORE, which means we must follow that vertex's edges
+    //   FINISH, which means the vertex just needs a finish time
+    std::vector<std::pair<TVertexDescriptor, _DfsTask> > vStack;
+
+    // The graph may not be connected, so start at every vertex.
     goBegin(it);
-    for(;!atEnd(it);goNext(it)) {
-        TVertexDescriptor u = getValue(it);
-        if (getProperty(tokenMap, u) == false) {
-            _dfsVisit(g, u, tokenMap, predecessor, disc, finish, time);
+    for(; !atEnd(it); goNext(it))
+    {
+        // If the vertex has already been visited, skip it.
+        TVertexDescriptor v = getValue(it);
+        if (getProperty(tokenMap, v))
+        {
+            continue;
+        }
+
+        vStack.clear();
+        vStack.emplace_back(v, _DfsTask::EXPLORE);
+        while (!vStack.empty())
+        {
+            // Get the vertex and task from the top of the stack.
+            auto stackItem = vStack.back();
+            vStack.pop_back();
+            TVertexDescriptor v = stackItem.first;
+
+            if (stackItem.second == _DfsTask::FINISH)
+            {
+                assignProperty(finish, v, ++time);
+            }
+            else if (!getProperty(tokenMap, v))       // If the task is EXPLORE and the vertex is not visited...
+            {
+                assignProperty(tokenMap, v, true);    // label as visited
+                assignProperty(disc, v, ++time);      // set discovery time
+                vStack.emplace_back(v, _DfsTask::FINISH); // add a task to the stack so the vertex will get a finish time
+
+                // Add EXPLORE tasks to the stack for each unvisited adjacent vertex. They are added in reverse order
+                // so the first adjacent vertex will be the first to come off the stack. This is to mimic the behaviour
+                // of the original recursive implementation of this function.
+                TAdjacencyIterator itad(g, v);
+                goEnd(itad);
+                while (!atBegin(itad))
+                {
+                    goPrevious(itad);
+                    TVertexDescriptor nextV = getValue(itad);
+                    if (!getProperty(tokenMap, nextV))
+                    {
+                        vStack.emplace_back(nextV, _DfsTask::EXPLORE);
+                        assignProperty(predecessor, nextV, v);
+                    }
+                }
+            }
         }
     }
 }
diff --git a/include/seqan/graph_algorithms/strongly_connected_compnents.h b/include/seqan/graph_algorithms/strongly_connected_compnents.h
index 119cd09..e61e6de 100644
--- a/include/seqan/graph_algorithms/strongly_connected_compnents.h
+++ b/include/seqan/graph_algorithms/strongly_connected_compnents.h
@@ -59,6 +59,35 @@ namespace seqan {
 // Function stronglyConnectedComponents()
 // ----------------------------------------------------------------------------
 
+template <typename TSpec, typename TVertexDescriptor, typename TTokenMap, typename TPredecessorMap, typename TDiscoveryTimeMap, typename TFinishingTimeMap, typename TVal>
+void
+_dfsVisit(Graph<TSpec> const& g,
+           TVertexDescriptor const u,
+           TTokenMap& tokenMap,
+           TPredecessorMap& predecessor,
+           TDiscoveryTimeMap& disc,
+           TFinishingTimeMap& finish,
+           TVal& time)
+{
+    typedef typename Iterator<Graph<TSpec>, AdjacencyIterator>::Type TAdjacencyIterator;
+
+    assignProperty(tokenMap, u, true);
+    ++time;
+    assignProperty(disc, u, time);
+    TAdjacencyIterator itad(g,u);
+    for(;!atEnd(itad);goNext(itad))
+    {
+        TVertexDescriptor v = getValue(itad);
+        if (getProperty(tokenMap, v) == false)
+        {
+            assignProperty(predecessor, v, u);
+            _dfsVisit(g, v, tokenMap, predecessor, disc, finish, time);
+        }
+    }
+    ++time;
+    assignProperty(finish, u, time);
+}
+
 /*!
  * @fn stronglyConnectedComponents
  * @headerfile <seqan/graph_algorithms.h>
diff --git a/include/seqan/graph_msa/graph_align_tcoffee_io.h b/include/seqan/graph_msa/graph_align_tcoffee_io.h
index c79d629..c10ce50 100644
--- a/include/seqan/graph_msa/graph_align_tcoffee_io.h
+++ b/include/seqan/graph_msa/graph_align_tcoffee_io.h
@@ -194,7 +194,7 @@ read(TFile & file,
             seq1 = value(posMap, seq1);
             seq2 = value(posMap, seq2);
         } else if (value(reader) == '!') {
-            skipUntil(reader, NotFunctor<IsWhitespace>());
+            skipLine(reader);
         } else {
             clear(buffer);
             readUntil(buffer, reader, IsWhitespace());
diff --git a/include/seqan/graph_msa/graph_align_tcoffee_library.h b/include/seqan/graph_msa/graph_align_tcoffee_library.h
index 12ec0bc..29524b2 100644
--- a/include/seqan/graph_msa/graph_align_tcoffee_library.h
+++ b/include/seqan/graph_msa/graph_align_tcoffee_library.h
@@ -521,7 +521,7 @@ getAlignmentStatistics(String<TFragment, TSpec1> const& matches,
                        TPos const from,
                        TPos const to,
                        TSize1& matchLength,    // Number of identical characters
-                       TSize1& overlapLength,    // Number of character in overlapping segments (with mismatches and gaps)
+                       TSize1& overlapLength,  // Number of character in overlapping segments (with mismatches and gaps)
                        TSize1& alignLength)    // Length of the alignment
 {
     typedef String<TFragment, TSpec1> const TFragmentMatches;
@@ -534,43 +534,54 @@ getAlignmentStatistics(String<TFragment, TSpec1> const& matches,
     TSize len1 = length(str[0]);
     TSize len2 = length(str[1]);
 
-
     TSize minId1 = len1 + len2;
     TSize minId2 = len1 + len2;
     TSize maxId1 = 0;
     TSize maxId2 = 0;
     TSize matchMismatch_length = 0;
 
-    TFragIter itFrag = begin(matches, Standard());
-    TFragIter itFragEnd = itFrag;
-    itFrag += from;
-    itFragEnd += to;
-    TId id1 = sequenceId(*itFrag, 0);
-    TId id2 = sequenceId(*itFrag, 1);
-    TSize fragLen = 0;
-    TSize beginI = 0;
-    TSize beginJ = 0;
-    for(;itFrag != itFragEnd; ++itFrag) {
-        fragLen = fragmentLength(*itFrag, id1);
-        beginI = fragmentBegin(*itFrag, id1);
-        beginJ = fragmentBegin(*itFrag, id2);
-        if (beginI < minId1) minId1 = beginI;
-        if (beginJ < minId2) minId2 = beginJ;
-        if (beginI + fragLen > maxId1) maxId1 = beginI + fragLen;
-        if (beginJ + fragLen > maxId2) maxId2 = beginJ + fragLen;
-        typedef typename Infix<TString>::Type TInfix;
-        typedef typename Iterator<TInfix, Standard>::Type TInfixIter;
-        TInfix inf1 = label(*itFrag, str, id1);
-        TInfix inf2 = label(*itFrag, str, id2);
-        TInfixIter sIt1 = begin(inf1, Standard());
-        TInfixIter sIt2 = begin(inf2, Standard());
-        TInfixIter sIt1End = end(inf1, Standard());
-        matchMismatch_length += fragLen;
-        for(;sIt1 != sIt1End; ++sIt1, ++sIt2)
-            if ( (TAlphabet) *sIt1  == (TAlphabet) *sIt2) ++matchLength;
+    if (length(matches) > 0)
+    {
+        TFragIter itFrag = begin(matches, Standard()) + from;
+        TFragIter itFragEnd = begin(matches, Standard()) + to;
+
+        TId id1 = sequenceId(*itFrag, 0);
+        TId id2 = sequenceId(*itFrag, 1);
+        TSize fragLen = 0;
+        TSize beginI = 0;
+        TSize beginJ = 0;
+
+        for(; itFrag != itFragEnd; ++itFrag)
+        {
+            fragLen = fragmentLength(*itFrag, id1);
+            beginI = fragmentBegin(*itFrag, id1);
+            beginJ = fragmentBegin(*itFrag, id2);
+            if (beginI < minId1)
+                minId1 = beginI;
+            if (beginJ < minId2)
+                minId2 = beginJ;
+            if (beginI + fragLen > maxId1)
+                maxId1 = beginI + fragLen;
+            if (beginJ + fragLen > maxId2)
+                maxId2 = beginJ + fragLen;
+
+            typedef typename Infix<TString>::Type TInfix;
+            typedef typename Iterator<TInfix, Standard>::Type TInfixIter;
+            TInfix inf1 = label(*itFrag, str, id1);
+            TInfix inf2 = label(*itFrag, str, id2);
+            TInfixIter sIt1 = begin(inf1, Standard());
+            TInfixIter sIt2 = begin(inf2, Standard());
+            TInfixIter sIt1End = end(inf1, Standard());
+            matchMismatch_length += fragLen;
+            for(; sIt1 != sIt1End; ++sIt1, ++sIt2)
+            {
+                if ( (TAlphabet) *sIt1 == (TAlphabet) *sIt2)
+                    ++matchLength;
+            }
+        }
     }
     alignLength = static_cast<TSize1>(matchMismatch_length + (len1 - matchMismatch_length) + (len2 - matchMismatch_length));
-    overlapLength = alignLength -  minId1 - minId2 - (len1 + len2 - maxId1 - maxId2);
+    overlapLength = alignLength - minId1 - minId2 - (len1 + len2 - maxId1 - maxId2);
 }
 
 //////////////////////////////////////////////////////////////////////////////
diff --git a/include/seqan/index/index_bidirectional.h b/include/seqan/index/index_bidirectional.h
index 872d9e8..80b6104 100644
--- a/include/seqan/index/index_bidirectional.h
+++ b/include/seqan/index/index_bidirectional.h
@@ -66,21 +66,9 @@ class BidirectionalIndex;
 template <typename TText>
 struct RevTextFibre
 {
-    typedef ModifiedString<TText, ModReverse> Type;
-};
-
-template <typename TText>
-struct RevTextFibre<ModifiedString<TText, ModReverse> >
-{
     typedef TText Type;
 };
 
-template <typename TText, typename TTextConfig>
-struct RevTextFibre<StringSet<TText, TTextConfig> >
-{
-    typedef StringSet<typename RevTextFibre<TText>::Type, TTextConfig> Type;
-};
-
 // ----------------------------------------------------------------------------
 // Class BidirectionalIndex
 // ----------------------------------------------------------------------------
@@ -120,7 +108,9 @@ class Index<TText, BidirectionalIndex<TIndexSpec> >
         revText(text),
         rev(revText),
         fwd(text)
-    {}
+    {
+        reverse(revText);
+    }
 };
 
 // ============================================================================
@@ -158,35 +148,41 @@ inline void clear(Index<TText, BidirectionalIndex<TIndexSpec> > & index)
 template <typename TText, typename TIndexSpec>
 inline bool empty(Index<TText, BidirectionalIndex<TIndexSpec> > const & index)
 {
-    return empty(index.fwd) || empty(index.rev);
+    return empty(index.fwd) && empty(index.rev);
 }
 
-// This function can be used to open a previously saved index.
+// ----------------------------------------------------------------------------
+// Function open()
+// ----------------------------------------------------------------------------
+
 template <typename TText, typename TIndexSpec>
-inline bool open(Index<TText, BidirectionalIndex<TIndexSpec> > & index, const char * fileName)
+inline bool open(Index<TText, BidirectionalIndex<TIndexSpec> > & index, const char * fileName, int openMode)
 {
     String<char> name;
 
     name = fileName;
-    if (open(index.fwd, toCString(name), DefaultOpenMode<Index<TText, TIndexSpec> >::VALUE))
+    if (open(index.fwd, toCString(name), openMode))
     {
         name = fileName;    append(name, ".rev");
-        return open(index.rev, toCString(name), DefaultOpenMode<Index<TText, TIndexSpec> >::VALUE);
+        return open(index.rev, toCString(name), openMode);
     }
     return false;
 }
 
-// This function can be used to save an index on disk.
+// ----------------------------------------------------------------------------
+// Function save()
+// ----------------------------------------------------------------------------
+
 template <typename TText, typename TIndexSpec>
-inline bool save(Index<TText, BidirectionalIndex<TIndexSpec> > const & index, const char * fileName)
+inline bool save(Index<TText, BidirectionalIndex<TIndexSpec> > const & index, const char * fileName, int openMode)
 {
     String<char> name;
 
     name = fileName;
-    if (save(index.fwd, toCString(name), DefaultOpenMode<Index<TText, TIndexSpec> >::VALUE))
+    if (save(index.fwd, toCString(name), openMode))
     {
         name = fileName;    append(name, ".rev");
-        return save(index.rev, toCString(name), DefaultOpenMode<Index<TText, TIndexSpec> >::VALUE);
+        return save(index.rev, toCString(name), openMode);
     }
     return false;
 }
@@ -201,6 +197,7 @@ inline typename Fibre<Index<TText, TSpec>, FibreText>::Type &
 getFibre(Index<TText, BidirectionalIndex<TSpec> > &index, FibreText) {
     return value(index.fwd.text);
 }
+
 template <typename TText, typename TSpec>
 inline typename Fibre<Index<TText, TSpec>, const FibreText>::Type &
 getFibre(Index<TText, BidirectionalIndex<TSpec> > const &index, FibreText) {
diff --git a/include/seqan/index/index_bidirectional_stree.h b/include/seqan/index/index_bidirectional_stree.h
index 5d23a10..8db53f4 100644
--- a/include/seqan/index/index_bidirectional_stree.h
+++ b/include/seqan/index/index_bidirectional_stree.h
@@ -43,8 +43,8 @@ struct BidirectionalDirection {};
 
 struct BidirectionalFwd_ : BidirectionalDirection {};
 struct BidirectionalRev_ : BidirectionalDirection {};
-typedef Tag<BidirectionalFwd_> const         Fwd;
-typedef Tag<BidirectionalRev_> const         Rev;
+typedef Tag<BidirectionalFwd_> Fwd;
+typedef Tag<BidirectionalRev_> Rev;
 
 // ==========================================================================
 // Classes
@@ -61,13 +61,11 @@ class Iter<Index<TText, BidirectionalIndex<TIndexSpec> >, VSTree<TopDown<TSpec>
 public:
     typedef Index<TText, BidirectionalIndex<TIndexSpec> > TBiIndex;
 
-    typedef typename RevTextFibre<TText>::Type                                                      TRevText;
-
-    typedef Index<TText, TIndexSpec>     TFwdIndex;
-    typedef Index<TRevText, TIndexSpec>  TRevIndex;
-
-    typedef Iter<TFwdIndex, VSTree<TopDown<TSpec> > >                                                   TFwdIndexIter;
-    typedef Iter<TRevIndex, VSTree<TopDown<TSpec> > >                                                   TRevIndexIter;
+    typedef typename RevTextFibre<TText>::Type          TRevText;
+    typedef Index<TText, TIndexSpec>                    TFwdIndex;
+    typedef Index<TRevText, TIndexSpec>                 TRevIndex;
+    typedef Iter<TFwdIndex, VSTree<TopDown<TSpec> > >   TFwdIndexIter;
+    typedef Iter<TRevIndex, VSTree<TopDown<TSpec> > >   TRevIndexIter;
 
     TFwdIndexIter    fwdIter;
     TRevIndexIter    revIter;
@@ -97,13 +95,11 @@ class Iter<Index<TText, BidirectionalIndex<TIndexSpec> >, VSTree<TopDown<ParentL
 public:
     typedef Index<TText, BidirectionalIndex<TIndexSpec> >  TBiIndex;
 
-    typedef typename RevTextFibre<TText>::Type                                                            TRevText;
-
-    typedef Index<TText, TIndexSpec>           TFwdIndex;
-    typedef Index<TRevText, TIndexSpec>        TRevIndex;
-
-    typedef Iter<TFwdIndex, VSTree<TopDown<ParentLinks<TSpec> > > >                                           TFwdIndexIter;
-    typedef Iter<TRevIndex, VSTree<TopDown<ParentLinks<TSpec> > > >                                           TRevIndexIter;
+    typedef typename RevTextFibre<TText>::Type                      TRevText;
+    typedef Index<TText, TIndexSpec>                                TFwdIndex;
+    typedef Index<TRevText, TIndexSpec>                             TRevIndex;
+    typedef Iter<TFwdIndex, VSTree<TopDown<ParentLinks<TSpec> > > > TFwdIndexIter;
+    typedef Iter<TRevIndex, VSTree<TopDown<ParentLinks<TSpec> > > > TRevIndexIter;
 
     TFwdIndexIter    fwdIter;
     TRevIndexIter    revIter;
@@ -155,26 +151,96 @@ inline Iter<Index<typename RevTextFibre<TText>::Type, TIndexSpec>, VSTree<TopDow
 }
 
 // ----------------------------------------------------------------------------
+// Function goDown() directional interface for unidirectional indexes[Iterator]
+// ----------------------------------------------------------------------------
+
+template <typename TText, typename TIndexSpec, typename TSpec>
+inline bool
+goDown(Iter<Index<TText, TIndexSpec>, VSTree<TopDown<TSpec> > > & it,
+       Fwd const &)
+{
+    return goDown(it);
+}
+
+template <typename TText, typename TIndexSpec, typename TSpec, typename TObject>
+inline bool
+goDown(Iter<Index<TText, TIndexSpec>, VSTree<TopDown<TSpec> > > & it,
+       TObject const & obj,
+       Fwd const &)
+{
+    return goDown(it, obj);
+}
+
+template <typename TText, typename TIndexSpec, typename TSpec, typename TString, typename TSize>
+inline bool
+goDown(Iter<Index<TText, TIndexSpec>, VSTree<TopDown<TSpec> > > & it,
+       TString const & pattern,
+       TSize & lcp,
+       Fwd const &)
+{
+    return _goDownString(it, pattern, lcp);
+}
+
+template <typename TText, typename TIndexSpec, typename TSpec>
+inline bool
+goDown(Iter<Index<TText, TIndexSpec>, VSTree<TopDown<TSpec> > > &,
+       Rev const &)
+{
+    SEQAN_ASSERT_MSG(false, "ERROR: Cannot goDown(it, Rev) on uni-directional index");
+    return false;
+}
+
+template <typename TText, typename TIndexSpec, typename TSpec, typename TObject>
+inline bool
+goDown(Iter<Index<TText, TIndexSpec>, VSTree<TopDown<TSpec> > > & it,
+       TObject const &,
+       Rev const &)
+{
+    return goDown(it, Rev()); // fail above
+}
+
+template <typename TText, typename TIndexSpec, typename TSpec, typename TString, typename TSize>
+inline bool
+goDown(Iter<Index<TText, TIndexSpec>, VSTree<TopDown<TSpec> > > & it,
+       TString const &,
+       TSize &,
+       Rev const &)
+{
+    return goDown(it, Rev()); // fail above
+}
+
+// ----------------------------------------------------------------------------
 // Function goDown()                                                 [Iterator]
 // ----------------------------------------------------------------------------
 
 template <typename TText, typename TIndexSpec, typename TSpec>
-inline bool goDown(Iter<Index<TText, BidirectionalIndex<TIndexSpec> >, VSTree<TopDown<TSpec> > > &it)
+inline bool goDown(Iter<Index<TText, BidirectionalIndex<TIndexSpec> >, VSTree<TopDown<TSpec> > > & it, Fwd const &)
 {
-    return goDown(it, Fwd());
+    if (goDown(_iter(it, Fwd())))
+    {
+        update(it, Fwd());
+        return true;
+    }
+    return false;
 }
 
-template <typename TText, typename TIndexSpec, typename TSpec, typename TDirection>
-inline bool goDown(Iter<Index<TText, BidirectionalIndex<TIndexSpec> >, VSTree<TopDown<TSpec> > > &it, Tag<TDirection>)
+template <typename TText, typename TIndexSpec, typename TSpec>
+inline bool goDown(Iter<Index<TText, BidirectionalIndex<TIndexSpec> >, VSTree<TopDown<TSpec> > > & it, Rev const &)
 {
-    if (goDown(_iter(it, Tag<TDirection>())))
+    if (goDown(_iter(it, Rev())))
     {
-        update(it, Tag<TDirection>());
+        update(it, Rev());
         return true;
     }
     return false;
 }
 
+template <typename TText, typename TIndexSpec, typename TSpec>
+inline bool goDown(Iter<Index<TText, BidirectionalIndex<TIndexSpec> >, VSTree<TopDown<TSpec> > > & it)
+{
+    return goDown(it, Fwd());
+}
+
 //------------------------------------------------------------------------------------
 
 template <typename TText, typename TIndexSpec, typename TSpec, typename TObject, typename TDirection>
@@ -206,7 +272,7 @@ _goDownObject(
 }
 
 template <typename TText, typename TIndexSpec, typename TSpec, typename TObject>
-inline bool
+inline std::enable_if_t<!(std::is_same<TObject, Fwd>::value || std::is_same<TObject, Rev>::value),  bool>
 goDown(
     Iter<Index<TText, BidirectionalIndex<TIndexSpec> >, VSTree<TopDown<TSpec> > > &it,
     TObject const &obj)
@@ -214,30 +280,40 @@ goDown(
     return goDown(it, obj, Fwd());
 }
 
-template <typename TText, typename TIndexSpec, typename TSpec, typename TObject, typename TDirection>
+template <typename TText, typename TIndexSpec, typename TSpec, typename TObject>
 inline bool
 goDown(
     Iter<Index<TText, BidirectionalIndex<TIndexSpec> >, VSTree<TopDown<TSpec> > > &it,
     TObject const &obj,
-    Tag<TDirection>)
+    Rev const &)
+{
+    return _goDownObject(it, obj, typename IsSequence<TObject>::Type(), Rev());
+}
+
+template <typename TText, typename TIndexSpec, typename TSpec, typename TObject>
+inline bool
+goDown(
+    Iter<Index<TText, BidirectionalIndex<TIndexSpec> >, VSTree<TopDown<TSpec> > > &it,
+    TObject const &obj,
+    Fwd const &)
 {
-    return _goDownObject(it, obj, typename IsSequence<TObject>::Type(), Tag<TDirection>());
+    return _goDownObject(it, obj, typename IsSequence<TObject>::Type(), Fwd());
 }
 
 //------------------------------------------------------------------------------------
 
 template <typename TText, typename TIndexSpec, typename TSpec, typename TString, typename TSize>
-inline bool
+inline std::enable_if_t<std::is_integral<TSize>::value,  bool>
 goDown(
     Iter<Index<TText, BidirectionalIndex<TIndexSpec> >, VSTree< TopDown<TSpec> > > &it,
     TString const &pattern,
-    TSize &lcp)
+    TSize const & lcp)
 {
     return _goDownString(it, pattern, lcp, Fwd());
 }
 
 template <typename TText, typename TIndexSpec, typename TSpec, typename TString, typename TSize, typename TDirection>
-inline bool
+inline std::enable_if_t<std::is_integral<TSize>::value,  bool>
 goDown(
     Iter<Index<TText, BidirectionalIndex<TIndexSpec> >, VSTree< TopDown<TSpec> > > &it,
     TString const &pattern,
@@ -387,6 +463,25 @@ countOccurrences(Iter<Index<TText, BidirectionalIndex<TIndexSpec> >, VSTree<TSpe
     return countOccurrences(it.fwdIter);
 }
 
+// ----------------------------------------------------------------------------
+// Function representative()                                         [Iterator]
+// ----------------------------------------------------------------------------
+
+template <typename TText, typename TIndexSpec, typename TSpec, typename TDirection>
+inline auto
+representative(Iter<Index<TText, BidirectionalIndex<TIndexSpec> >, VSTree<TopDown<TSpec> > > const & it,
+               Tag<TDirection> const &)
+{
+    return representative(_iter(it, Tag<TDirection>()));
+}
+
+template <typename TText, typename TIndexSpec, typename TSpec>
+inline auto
+representative(Iter<Index<TText, BidirectionalIndex<TIndexSpec> >, VSTree<TopDown<TSpec> > > const & it)
+{
+    return representative(it, Fwd());
+}
+
 }
 
 #endif /* INDEX_BIDIRECTIONAL_STREE_H_ */
diff --git a/include/seqan/index/index_bifm.h b/include/seqan/index/index_bifm.h
index 542fca1..b1ae559 100644
--- a/include/seqan/index/index_bifm.h
+++ b/include/seqan/index/index_bifm.h
@@ -56,6 +56,8 @@ SEQAN_CONCEPT_IMPL((Index<TText, BidirectionalIndex<FMIndex<TSpec, TConfig> > >
 template <typename TText, typename TSpec, typename TConfig>
 inline bool indexCreate(Index<TText, BidirectionalIndex<FMIndex<TSpec, TConfig> > > & index)
 {
+    indexText(index.rev) = indexText(index.fwd);
+    reverse(indexText(index.rev));
     return indexCreate(index.fwd, FibreSALF()) && indexCreate(index.rev, FibreSALF());
 }
 
diff --git a/include/seqan/index/index_bifm_stree.h b/include/seqan/index/index_bifm_stree.h
index 200911d..9fea578 100644
--- a/include/seqan/index/index_bifm_stree.h
+++ b/include/seqan/index/index_bifm_stree.h
@@ -65,7 +65,6 @@ inline void update(Iter<Index<TText, BidirectionalIndex<FMIndex<TOccSpec, TIndex
     value(oppDirIter).repLen = value(dirIter).repLen; // do not increment in case of goRight
 }
 
-
 template <typename TText, typename TOccSpec, typename TIndexSpec, typename TSpec, typename TString, typename TSize, typename TDirection>
 inline bool
 _goDownString(Iter<Index<TText, BidirectionalIndex<FMIndex<TOccSpec, TIndexSpec> > >, VSTree<TopDown<TSpec> > > &it,
@@ -96,7 +95,8 @@ _goDownString(Iter<Index<TText, BidirectionalIndex<FMIndex<TOccSpec, TIndexSpec>
         update(it, TDirection());
     }
 
-    value(_iter(it, TDirection())).repLen += lcp;
+    value(_iter(it, Fwd())).repLen += lcp;
+    value(_iter(it, Rev())).repLen += lcp;
 
     if (lcp) value(_iter(it, TDirection())).lastChar = value(stringIt - 1);
 
diff --git a/include/seqan/modifier/modifier_padding.h b/include/seqan/modifier/modifier_padding.h
index 38a72de..b02dbb7 100644
--- a/include/seqan/modifier/modifier_padding.h
+++ b/include/seqan/modifier/modifier_padding.h
@@ -218,6 +218,18 @@ value(ModifiedString<THost, ModPadding> const & me, TPosition const pos)
     return (SEQAN_LIKELY(pos < static_cast<TPosition>(length(host(me))))) ? value(host(me), pos) : cargo(me)._paddedValue;
 }
 
+// ----------------------------------------------------------------------------
+// Function getValue()
+// ----------------------------------------------------------------------------
+
+template <typename THost, typename TPosition>
+inline typename GetValue<THost>::Type
+getValue(ModifiedString<THost, ModPadding> const & me, TPosition const pos)
+{
+    SEQAN_ASSERT_LT(pos, static_cast<TPosition>(length(me)));
+    return (SEQAN_LIKELY(pos < static_cast<TPosition>(length(host(me))))) ? host(me)[pos] : cargo(me)._paddedValue;
+}
+
 // --------------------------------------------------------------------------
 // Function begin()                               [ModReverse ModifiedString]
 // --------------------------------------------------------------------------
diff --git a/include/seqan/parallel/parallel_lock.h b/include/seqan/parallel/parallel_lock.h
index d4be60b..028f95d 100644
--- a/include/seqan/parallel/parallel_lock.h
+++ b/include/seqan/parallel/parallel_lock.h
@@ -213,7 +213,9 @@ struct ScopedWriteLock<TLock, Serial>
 inline void
 yieldProcessor()
 {
-#if defined(STDLIB_VS)
+#if defined(__arm__) || defined(_M_ARM)
+    asm volatile ("yield" ::: "memory");
+#elif defined(STDLIB_VS)
     YieldProcessor();
 #elif defined(__SSE2__)
     _mm_pause();
diff --git a/include/seqan/score.h b/include/seqan/score.h
index 124657c..44327ff 100644
--- a/include/seqan/score.h
+++ b/include/seqan/score.h
@@ -49,7 +49,7 @@
 #include <seqan/score/score_matrix_dyn.h>
 #include <seqan/score/score_simple.h>
 
-#if SEQAN_SIMD_ENABLED
+#ifdef SEQAN_SIMD_ENABLED
 #include <seqan/score/score_simd_wrapper.h>
 #endif  // SEQAN_SIMD_ENABLED
 
diff --git a/include/seqan/stream/file_stream.h b/include/seqan/stream/file_stream.h
index acc21ae..8ca9fa3 100644
--- a/include/seqan/stream/file_stream.h
+++ b/include/seqan/stream/file_stream.h
@@ -178,10 +178,10 @@ clear(FilePage<TValue, TSpec> & me)
 // Class FilePager
 // ----------------------------------------------------------------------------
 
-template <unsigned PAGESIZE = 4 * 1024>
+template <unsigned SEQAN_PAGESIZE = 4 * 1024>
 struct FixedPagingScheme
 {
-    enum { pageSize = PAGESIZE };
+    enum { pageSize = SEQAN_PAGESIZE };
 
     static void * EMPTY;
     static void * ON_DISK;
@@ -189,11 +189,11 @@ struct FixedPagingScheme
     String<void *> frameStart;
 };
 
-template <unsigned PAGESIZE>
-void * FixedPagingScheme<PAGESIZE>::EMPTY = NULL;
+template <unsigned SEQAN_PAGESIZE>
+void * FixedPagingScheme<SEQAN_PAGESIZE>::EMPTY = NULL;
 
-template <unsigned PAGESIZE>
-void * FixedPagingScheme<PAGESIZE>::ON_DISK = (void *)-1;
+template <unsigned SEQAN_PAGESIZE>
+void * FixedPagingScheme<SEQAN_PAGESIZE>::ON_DISK = (void *)-1;
 
 
 template <typename TFilePageTable>
@@ -276,9 +276,9 @@ clear(FilePageTable<TValue, TDirection, TSpec> & pager)
 // Function _getPageOffsetAndLength()
 // ----------------------------------------------------------------------------
 
-template <unsigned PAGESIZE, typename TPos>
+template <unsigned SEQAN_PAGESIZE, typename TPos>
 inline Pair<int64_t, unsigned>
-_getPageOffsetAndLength(FixedPagingScheme<PAGESIZE> const & scheme, TPos pos)
+_getPageOffsetAndLength(FixedPagingScheme<SEQAN_PAGESIZE> const & scheme, TPos pos)
 {
     SEQAN_ASSERT_EQ(scheme.pageSize & (scheme.pageSize - 1), 0);  // pageSize must be a power of 2
     return Pair<int64_t, unsigned>((int64_t)pos & ~(int64_t)(scheme.pageSize - 1), scheme.pageSize);
@@ -288,9 +288,9 @@ _getPageOffsetAndLength(FixedPagingScheme<PAGESIZE> const & scheme, TPos pos)
 // Function _getFrameStart()
 // ----------------------------------------------------------------------------
 
-template <unsigned PAGESIZE, typename TFilePos, typename TSize>
+template <unsigned SEQAN_PAGESIZE, typename TFilePos, typename TSize>
 inline void *
-_getFrameStart(FixedPagingScheme<PAGESIZE> &table, TFilePos filePos, TSize)
+_getFrameStart(FixedPagingScheme<SEQAN_PAGESIZE> &table, TFilePos filePos, TSize)
 {
     unsigned pageNo = filePos / table.pageSize;
     if (SEQAN_LIKELY(pageNo < length(table.frameStart)))
@@ -303,9 +303,9 @@ _getFrameStart(FixedPagingScheme<PAGESIZE> &table, TFilePos filePos, TSize)
 // Function _setFrameStart()
 // ----------------------------------------------------------------------------
 
-template <unsigned PAGESIZE, typename TFilePos, typename TSize>
+template <unsigned SEQAN_PAGESIZE, typename TFilePos, typename TSize>
 inline void
-_setFrameStart(FixedPagingScheme<PAGESIZE> &table, TFilePos filePos, TSize, void * frameStart)
+_setFrameStart(FixedPagingScheme<SEQAN_PAGESIZE> &table, TFilePos filePos, TSize, void * frameStart)
 {
     unsigned pageNo = filePos / table.pageSize;
     if (length(table.frameStart) <= pageNo)
diff --git a/include/seqan/stream/formatted_file.h b/include/seqan/stream/formatted_file.h
index f798266..5421aad 100644
--- a/include/seqan/stream/formatted_file.h
+++ b/include/seqan/stream/formatted_file.h
@@ -716,6 +716,26 @@ inline bool open(FormattedFile<TFileFormat, TDirection, TSpec> & file,
 }
 
 // ----------------------------------------------------------------------------
+// Function isOpen()
+// ----------------------------------------------------------------------------
+
+/*!
+ * @fn FormattedFile#isOpen
+ * @brief Determines whether a FormattedFile is currently open.
+ *
+ * @signature bool isOpen(file);
+ *
+ * @param[in]     file The FormattedFile to check.
+ * @return bool <tt>true</tt> if file is currently open, <tt>false</tt> otherwise.
+ */
+
+template <typename TFileFormat, typename TDirection, typename TSpec>
+inline bool isOpen(FormattedFile<TFileFormat, TDirection, TSpec> const & file)
+{
+    return file.stream.file.is_open();
+}
+
+// ----------------------------------------------------------------------------
 // Function close()
 // ----------------------------------------------------------------------------
 
diff --git a/include/seqan/stream/stream_base.h b/include/seqan/stream/stream_base.h
index f5bbfbb..d07ce48 100644
--- a/include/seqan/stream/stream_base.h
+++ b/include/seqan/stream/stream_base.h
@@ -134,18 +134,17 @@ char const * FileExtensions<GZFile, T>::VALUE[1] =
 template <typename T>
 struct FileExtensions<BgzfFile, T>
 {
-    static char const * VALUE[4];
+    static char const * VALUE[5];
 };
 
 template <typename T>
-char const * FileExtensions<BgzfFile, T>::VALUE[4] =
+char const * FileExtensions<BgzfFile, T>::VALUE[5] =
 {
     ".bgzf",      // default output extension
     ".bam",       // BAM files are bgzf compressed
-    ".vcf.gz",    // Compressed and indexed VCF files are actually bgzf compressed
+    ".vcf.gz",    // Compressed and indexed VCF files are bgzf compressed
+    ".bed.gz",    // Compressed and indexed BED files are bgzf compressed
     ".tbi"        // Tabix index files are bgzf compressed
-
-    // if you add extensions here, extend getBasename() below
 };
 
 
diff --git a/include/seqan/tabix_io/tabix_index_tbi.h b/include/seqan/tabix_io/tabix_index_tbi.h
index 0a23f80..7e924b4 100644
--- a/include/seqan/tabix_io/tabix_index_tbi.h
+++ b/include/seqan/tabix_io/tabix_index_tbi.h
@@ -469,6 +469,9 @@ open(TabixIndex & index, char const * filename)
     CharString tmp;
     readRawPod(lNm, iter);
     read(tmp, iter, lNm);
+    // Trim last terminating '\0's as they confuse strSplit() below
+    while (!empty(tmp) && back(tmp) == '\0')
+        resize(tmp, length(tmp) - 1);
 
     // Split concatenated names at \0's.
     clear(index._nameStore);
diff --git a/include/seqan/version.h b/include/seqan/version.h
index 8885361..b4e1e12 100644
--- a/include/seqan/version.h
+++ b/include/seqan/version.h
@@ -39,7 +39,7 @@
 
 #define SEQAN_VERSION_MAJOR 2
 
-#define SEQAN_VERSION_MINOR 2
+#define SEQAN_VERSION_MINOR 3
 
 #define SEQAN_VERSION_PATCH 0
 
diff --git a/manual/source/Infrastructure/Use/CustomBuildSystem.rst b/manual/source/Infrastructure/Use/CustomBuildSystem.rst
index f73718a..07785ca 100644
--- a/manual/source/Infrastructure/Use/CustomBuildSystem.rst
+++ b/manual/source/Infrastructure/Use/CustomBuildSystem.rst
@@ -45,6 +45,10 @@ GNU/Linux
 
 Add ``-lrt -lpthread`` to the compiler call.
 
+Note static linking against pthread might cause issues on some linux distributions.
+In this case you need to explicitly link against the whole archive like: ``-Wl,--whole-archive -lpthread -Wl,--no-whole-archive``.
+You can read more about this issue `here <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52590>`_.
+
 BSD
 ^^^
 
diff --git a/manual/source/Infrastructure/Use/Install.rst b/manual/source/Infrastructure/Use/Install.rst
index b7108b9..85dadac 100644
--- a/manual/source/Infrastructure/Use/Install.rst
+++ b/manual/source/Infrastructure/Use/Install.rst
@@ -25,34 +25,34 @@ SeqAn is available natively on the following platforms.
 
 .. tip::
 
-    Before you install, please make sure that the version supplied is not completely out of date (a difference in the third digit is ok, but if the difference is bigger use the `Library Package`_ below).
+    Before you install, please make sure that the version supplied is not completely out of date (a difference of 0.1.* is okay, but if the difference is bigger use the `Library Package`_ below).
     The current version of SeqAn is always shown on the `SeqAn-Homepage <http://www.seqan.de/>`__ and the version available on your platform is usually displayed in the info-link below.
 
 .. |br| raw:: html
     
     <br/>
 
-+---------------------------+--------------+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-| Operating System          | Package Name | Command                                 | links                                                                                                                                  |
-+============+==============+==============+=========================================+========================================================================================================================================+
-| **G** |br| | Arch         |              |                                         | `AUR <https://aur.archlinux.org/packages/?O=0&K=seqan>`__                                                                              |
-| **N** |br| +--------------+--------------+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-| **U** |br| | Debian       | seqan-dev    | ``apt install seqan-dev``               | `info <https://packages.debian.org/stable/seqan-dev>`__ | `contact <mailto:debian-med-packaging()lists.alioth.debian.org>`__           |
-| / |br|     +--------------+--------------+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-| **L** |br| | Fedora       | seqan-devel  | ``yum install seqan-devel``             | `info <https://apps.fedoraproject.org/packages/seqan-devel>`__ | `contact <mailto:sagitter()fedoraproject.org>`__                      |
-| **I** |br| +--------------+--------------+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-| **N** |br| | Gentoo       | seqan        | ``emerge sci-biology/seqan``            | `info <https://packages.gentoo.org/packages/sci-biology/seqan>`__ | `contact <mailto:sci-biology at gentoo.org>`__                        |
-| **U** |br| +--------------+--------------+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-| **X** |br| | Ubuntu       | seqan-dev    | ``apt install seqan-dev``               | `info <http://packages.ubuntu.com/xenial/seqan-dev>`__ | `contact <mailto:ubuntu-motu()lists.ubuntu.com>`__                            |
-+------------+--------------+--------------+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-| **M** |br| | Homebrew     | seqan        | ``brew install homebrew/science/seqan`` | `info <http://braumeister.org/repos/Homebrew/homebrew-science/formula/seqan>`__ | `contact <mailto:tim()tim-smith.us>`__               |
-| **A** |br| +--------------+--------------+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-| **C** |br| | MacPorts     | seqan        | ``port install seqan``                  | `info <https://trac.macports.org/browser/trunk/dports/science/seqan/Portfile>`__ | `contact <mailto:rene.rahn()fu-berlin.de>`__        |
-+------------+--------------+--------------+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-| **B** |br| | FreeBSD      | seqan        | ``pkg install seqan``                   | `info <http://freshports.org/biology/seqan>`__ | `contact <mailto:h2+fbsdports()fsfe.org>`__                                           |
-| **S** |br| +--------------+--------------+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
-| **D** |br| | OpenBSD      | seqan        | ``pkg_add seqan``                       | `info <http://openports.se/biology/seqan>`__ | `contact <mailto:h2+fbsdports()fsfe.org>`__                                             |
-+------------+--------------+--------------+-----------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+
++---------------------------+--------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
+| Operating System          | Package Name       | Command                                      | links                                                                                                                                                        |
++============+==============+====================+==============================================+==============================================================================================================================================================+
+| **G** |br| | Arch         |                    |                                              | `AUR <https://aur.archlinux.org/packages/?O=0&K=seqan>`__                                                                                                    |
+| **N** |br| +--------------+--------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
+| **U** |br| | Debian       | libseqan2-dev      | ``apt install libseqan2-dev``                | `info <https://packages.debian.org/search?keywords=libseqan2-dev>`__ | `contact <mailto:debian-med-packaging()lists.alioth.debian.org>`__                    |
+| / |br|     +--------------+--------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
+| **L** |br| | Fedora       | seqan-devel        | ``yum install seqan-devel``                  | `info <https://apps.fedoraproject.org/packages/seqan-devel>`__ | `contact <mailto:sagitter()fedoraproject.org>`__                                            |
+| **I** |br| +--------------+--------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
+| **N** |br| | Gentoo       | seqan              | ``emerge sci-biology/seqan``                 | `info <https://packages.gentoo.org/packages/sci-biology/seqan>`__ | `contact <mailto:sci-biology at gentoo.org>`__                                              |
+| **U** |br| +--------------+--------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
+| **X** |br| | Ubuntu       | seqan-dev          | ``apt install seqan-dev``                    | `info <http://packages.ubuntu.com/xenial/seqan-dev>`__ | `contact <mailto:ubuntu-motu()lists.ubuntu.com>`__                                                  |
++------------+--------------+--------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
+| **M** |br| | Homebrew     | seqan              | ``brew install homebrew/science/seqan``      | `info <http://braumeister.org/repos/Homebrew/homebrew-science/formula/seqan>`__ | `contact <mailto:tim()tim-smith.us>`__                                     |
+| **A** |br| +--------------+--------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
+| **C** |br| | MacPorts     | seqan              | ``port install seqan``                       | `info <https://trac.macports.org/browser/trunk/dports/science/seqan/Portfile>`__ | `contact <mailto:rene.rahn()fu-berlin.de>`__                              |
++------------+--------------+--------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
+| **B** |br| | FreeBSD      | seqan              | ``pkg install seqan``                        | `info <http://freshports.org/biology/seqan>`__ | `contact <mailto:h2+fbsdports()fsfe.org>`__                                                                 |
+| **S** |br| +--------------+--------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
+| **D** |br| | OpenBSD      | seqan              | ``pkg_add seqan``                            | `info <http://openports.se/biology/seqan>`__ | `contact <mailto:h2+fbsdports()fsfe.org>`__                                                                   |
++------------+--------------+--------------------+----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
 
 You should execute the above commands in a terminal as the ``root`` user or prefix them with ``sudo``. If you have problems installing the package on your operating system, or it is outdated, please write to the contact shown above (and replace ``()`` in the e-mail-address with ``@``).
 
diff --git a/manual/source/index.rst b/manual/source/index.rst
index 8529c00..f47aae8 100644
--- a/manual/source/index.rst
+++ b/manual/source/index.rst
@@ -141,7 +141,7 @@ The API documentation can be found :dox:`mainpage here`.
 
     SeqAn Project <http://seqan.de>
     GitHub <http://github.com/seqan>
-    Twitter <http://twitter.com/seqan>
+    Twitter <http://twitter.com/SeqAnLib>
     RSS Feeds <http://www.seqan.de/feed/>
     SeqAn Mailinglist <https://lists.fu-berlin.de/listinfo/seqan-dev#subscribe>
 
diff --git a/tests/bam_io/test_bam_file.h b/tests/bam_io/test_bam_file.h
index cbbea22..54d41bd 100644
--- a/tests/bam_io/test_bam_file.h
+++ b/tests/bam_io/test_bam_file.h
@@ -511,4 +511,46 @@ SEQAN_DEFINE_TEST(test_bam_io_bam_file_bam_file_seek)
     }
 }
 
+// ---------------------------------------------------------------------------
+// Test isOpen() functionality.
+// ---------------------------------------------------------------------------
+
+SEQAN_DEFINE_TEST(test_bam_io_bam_file_isOpen_fileIn)
+{
+    // Build path to file.
+    seqan::CharString filePath = SEQAN_PATH_TO_ROOT();
+    append(filePath, "/tests/bam_io/small.sam");
+
+    // Create SequenceStream object.
+    seqan::BamFileIn bamI;
+    SEQAN_ASSERT(!isOpen(bamI));
+
+    // open file
+    open(bamI, toCString(filePath));
+    SEQAN_ASSERT(isOpen(bamI));
+
+    // close file
+    close(bamI);
+    SEQAN_ASSERT(!isOpen(bamI));
+}
+
+SEQAN_DEFINE_TEST(test_bam_io_bam_file_isOpen_fileOut)
+{
+    // Build path to file.
+    seqan::CharString filePath = SEQAN_TEMP_FILENAME();
+    append(filePath, ".sam");
+
+    // Create SequenceStream object.
+    seqan::BamFileOut  bamO;
+    SEQAN_ASSERT(!isOpen(bamO));
+
+    // open files
+    open(bamO, toCString(filePath));
+    SEQAN_ASSERT(isOpen(bamO));
+
+    // close files
+    close(bamO);
+    SEQAN_ASSERT(!isOpen(bamO));
+}
+
 #endif  // #ifndef TESTS_BAM_IO_TEST_EASY_BAM_IO_H_
diff --git a/tests/bam_io/test_bam_io.cpp b/tests/bam_io/test_bam_io.cpp
index 16c8b9b..7d97118 100644
--- a/tests/bam_io/test_bam_io.cpp
+++ b/tests/bam_io/test_bam_io.cpp
@@ -157,6 +157,10 @@ SEQAN_BEGIN_TESTSUITE(test_bam_io)
     SEQAN_CALL_TEST(test_bam_io_bam_write_header);
     SEQAN_CALL_TEST(test_bam_io_bam_write_alignment);
 
+    // Test isOpen.
+    SEQAN_CALL_TEST(test_bam_io_bam_file_isOpen_fileIn);
+    SEQAN_CALL_TEST(test_bam_io_bam_file_isOpen_fileOut);
+
 #if SEQAN_HAS_ZLIB
     // Test BamStream class.
     SEQAN_CALL_TEST(test_bam_io_bam_file_sam_file_size);
diff --git a/tests/basic/test_basic_simd_vector.cpp b/tests/basic/test_basic_simd_vector.cpp
index 28ca497..94b6979 100644
--- a/tests/basic/test_basic_simd_vector.cpp
+++ b/tests/basic/test_basic_simd_vector.cpp
@@ -39,7 +39,8 @@
 
 SEQAN_BEGIN_TESTSUITE(test_basic_simd_vector)
 {
-#ifdef __SSE4_1__
+#ifdef SEQAN_SIMD_ENABLED
+#ifdef SEQAN_SSE4
     SEQAN_CALL_TEST(test_basic_simd_shuffle);
     SEQAN_CALL_TEST(test_basic_simd_transpose_8x8);
     SEQAN_CALL_TEST(test_basic_simd_transpose_16x16);
@@ -47,7 +48,8 @@ SEQAN_BEGIN_TESTSUITE(test_basic_simd_vector)
     SEQAN_CALL_TEST(test_basic_simd_shuffle_avx);
     SEQAN_CALL_TEST(test_basic_simd_transpose_32x32);
 #endif  // #ifdef __AVX2__
-#endif  // #ifdef __SSE4_1__
+#endif  // #ifdef SEQAN_SSE4
+#endif
 }
 SEQAN_END_TESTSUITE
 
diff --git a/tests/basic/test_basic_simd_vector.h b/tests/basic/test_basic_simd_vector.h
index d435e09..3866a6c 100644
--- a/tests/basic/test_basic_simd_vector.h
+++ b/tests/basic/test_basic_simd_vector.h
@@ -37,14 +37,13 @@
 #ifndef SEQAN_CORE_TESTS_BASIC_TEST_BASIC_SIMD_VECTOR_H_
 #define SEQAN_CORE_TESTS_BASIC_TEST_BASIC_SIMD_VECTOR_H_
 
-#if SEQAN_SIMD_ENABLED
-
 #include <random>
 
 #include <seqan/sequence.h>
 #include <seqan/misc/bit_twiddling.h>
 #include <seqan/basic/basic_simd_vector.h>
 
+#if SEQAN_SIMD_ENABLED
 namespace seqan {
 
 template <int ROWS, typename TVector>
@@ -84,7 +83,7 @@ inline void test_matrix_transpose()
 
 }
 
-#ifdef __SSE4_1__
+#ifdef SEQAN_SSE4
 
 SEQAN_DEFINE_TEST(test_basic_simd_shuffle)
 {
@@ -150,7 +149,7 @@ SEQAN_DEFINE_TEST(test_basic_simd_transpose_32x32)
 }
 
 #endif  // #ifdef __AVX2__
-#endif  // #ifdef __SSE4_1__
+#endif  // #ifdef SEQAN_SSE4
 #endif  // SEQAN_SIMD_ENABLED
 
 #endif  // #ifndef SEQAN_CORE_TESTS_BASIC_TEST_BASIC_SIMD_VECTOR_H_
diff --git a/tests/bed_io/test_bed_io.cpp b/tests/bed_io/test_bed_io.cpp
index fc831f3..f2cde99 100644
--- a/tests/bed_io/test_bed_io.cpp
+++ b/tests/bed_io/test_bed_io.cpp
@@ -436,6 +436,44 @@ SEQAN_DEFINE_TEST(test_bed_bed_file_write)
     SEQAN_ASSERT(seqan::_compareTextFiles(toCString(tmpPath), toCString(goldPath)));
 }
 
+SEQAN_DEFINE_TEST(test_bed_io_isOpen_fileIn)
+{
+    // Build path to file.
+    seqan::CharString filePath = SEQAN_PATH_TO_ROOT();
+    append(filePath, "/tests/bed_io/example.bed");
+
+    // Create SequenceStream object.
+    seqan::BedFileIn bedI;
+    SEQAN_ASSERT(!isOpen(bedI));
+
+    // open file
+    open(bedI, toCString(filePath));
+    SEQAN_ASSERT(isOpen(bedI));
+
+    // close file
+    close(bedI);
+    SEQAN_ASSERT(!isOpen(bedI));
+}
+
+SEQAN_DEFINE_TEST(test_bed_io_isOpen_fileOut)
+{
+    // Build path to file.
+    seqan::CharString filePath = SEQAN_TEMP_FILENAME();
+    append(filePath, ".bed");
+
+    // Create SequenceStream object.
+    seqan::BedFileOut  bedO;
+    SEQAN_ASSERT(!isOpen(bedO));
+
+    // open files
+    open(bedO, toCString(filePath));
+    SEQAN_ASSERT(isOpen(bedO));
+
+    // close files
+    close(bedO);
+    SEQAN_ASSERT(!isOpen(bedO));
+}
+
 SEQAN_BEGIN_TESTSUITE(test_bed_io)
 {
     // Reading of BED records.
@@ -455,6 +493,10 @@ SEQAN_BEGIN_TESTSUITE(test_bed_io)
     // BED Stream
     SEQAN_CALL_TEST(test_bed_bed_file_read);
     SEQAN_CALL_TEST(test_bed_bed_file_write);
+
+    // isOpen
+    SEQAN_CALL_TEST(test_bed_io_isOpen_fileIn);
+    SEQAN_CALL_TEST(test_bed_io_isOpen_fileOut);
 }
 
 SEQAN_END_TESTSUITE
diff --git a/tests/gff_io/test_gff_io.cpp b/tests/gff_io/test_gff_io.cpp
index a5b9be0..7910abd 100644
--- a/tests/gff_io/test_gff_io.cpp
+++ b/tests/gff_io/test_gff_io.cpp
@@ -56,5 +56,9 @@ SEQAN_BEGIN_TESTSUITE(test_gff_io)
     SEQAN_CALL_TEST(test_store_io_gff_stream_read_record_gtf);
     SEQAN_CALL_TEST(test_store_io_gff_stream_write_record_gff);
     SEQAN_CALL_TEST(test_store_io_gff_stream_write_record_gtf);
+
+    // isOpen
+    SEQAN_CALL_TEST(test_gff_io_isOpen_fileIn);
+    SEQAN_CALL_TEST(test_gff_io_isOpen_fileOut);
 }
 SEQAN_END_TESTSUITE
diff --git a/tests/gff_io/test_gff_io.h b/tests/gff_io/test_gff_io.h
index 494b6e5..342840c 100644
--- a/tests/gff_io/test_gff_io.h
+++ b/tests/gff_io/test_gff_io.h
@@ -509,4 +509,42 @@ SEQAN_DEFINE_TEST(test_store_io_gff_stream_write_record_gtf)
     SEQAN_ASSERT(_compareTextFilesAlt(toCString(outPath), toCString(gtfPath)));
 }
 
+SEQAN_DEFINE_TEST(test_gff_io_isOpen_fileIn)
+{
+    // Build path to file.
+    seqan::CharString filePath = SEQAN_PATH_TO_ROOT();
+    append(filePath, "/tests/gff_io/example.gff");
+
+    // Create SequenceStream object.
+    GffFileIn gffI;
+    SEQAN_ASSERT(!isOpen(gffI));
+
+    // open file
+    open(gffI, toCString(filePath));
+    SEQAN_ASSERT(isOpen(gffI));
+
+    // close file
+    close(gffI);
+    SEQAN_ASSERT(!isOpen(gffI));
+}
+
+SEQAN_DEFINE_TEST(test_gff_io_isOpen_fileOut)
+{
+    // Build path to file.
+    seqan::CharString filePath = SEQAN_TEMP_FILENAME();
+    append(filePath, ".gff");
+
+    // Create SequenceStream object.
+    GffFileOut gffO;
+    SEQAN_ASSERT(!isOpen(gffO));
+
+    // open files
+    open(gffO, toCString(filePath));
+    SEQAN_ASSERT(isOpen(gffO));
+
+    // close files
+    close(gffO);
+    SEQAN_ASSERT(!isOpen(gffO));
+}
+
 #endif  // TESTS_GFF_IO_TEST_GFF_IO_H_
diff --git a/tests/graph_msa/test_graph_tcoffee.h b/tests/graph_msa/test_graph_tcoffee.h
index 184aed6..f7b75fb 100644
--- a/tests/graph_msa/test_graph_tcoffee.h
+++ b/tests/graph_msa/test_graph_tcoffee.h
@@ -201,7 +201,7 @@ void Test_ExternalLibraries() {
     strmRead.open(fileName.c_str(), std::ios_base::in | std::ios_base::binary);
     read(strmRead,seqSet,nameSet,TCoffeeLib());
     strmRead.close();
-    std::cout << g << std::endl;
+    //std::cout << g << std::endl;
 
 
     // Blast format
diff --git a/tests/index/test_index_bifm.cpp b/tests/index/test_index_bifm.cpp
index fb2fb92..dfd6b81 100644
--- a/tests/index/test_index_bifm.cpp
+++ b/tests/index/test_index_bifm.cpp
@@ -117,24 +117,37 @@ testBidirectionalIndex(TBiFMIndex & bifmIndex, TText & text, TText & revText, TP
     TFMIter itFwd(indexFwd);
     TFMIter itRev(indexRev);
 
-    TBiFMIter bifm1(bifmIndex);
-    TBiFMIter bifm2(bifmIndex);
+    TBiFMIter bifm(bifmIndex);
 
     bool res1 = goDown(itFwd, revPattern);
     bool res2 = goDown(itRev, pattern);
-    bool res3 = goDown(bifm1, pattern, Rev());
-    bool res4 = goDown(bifm2, revPattern, Fwd());
+
+    std::mt19937 rng(time(nullptr));
+    unsigned left = rng() % length(pattern);
+    unsigned right = left;
+
+    bool res3 = goDown(bifm, pattern[left]);
+    while (res3 && (0 < left || right < length(pattern) - 1))
+    {
+        if (rng() % 2 && 0 < left)
+        {
+            --left;
+            res3 = goDown(bifm, pattern[left], Fwd());
+        }
+        else if (right < length(pattern) - 1)
+        {
+            ++right;
+            res3 = goDown(bifm, pattern[right], Rev());
+        }
+    }
 
     SEQAN_ASSERT_EQ(res1, res2);
     SEQAN_ASSERT_EQ(res1, res3);
-    SEQAN_ASSERT_EQ(res1, res4);
 
-    if (res1) // if pattern was found in string
+    if (res1) // if pattern was found in index
     {
-        SEQAN_ASSERT(getOccurrences(itFwd) == getOccurrences(bifm1, Fwd()));
-        SEQAN_ASSERT(getOccurrences(itFwd) == getOccurrences(bifm2, Fwd()));
-        SEQAN_ASSERT(getOccurrences(itRev) == getOccurrences(bifm1, Rev()));
-        SEQAN_ASSERT(getOccurrences(itRev) == getOccurrences(bifm2, Rev()));
+        SEQAN_ASSERT(getOccurrences(itFwd) == getOccurrences(bifm, Fwd()));
+        SEQAN_ASSERT(getOccurrences(itRev) == getOccurrences(bifm, Rev()));
     }
 
     return 0;
@@ -154,7 +167,7 @@ SEQAN_TYPED_TEST(BidirectionalFMIndexTest, SearchInString)
 
     TIndex index(text);
 
-    for (unsigned int patternLength = 1; patternLength <= 20; ++patternLength)
+    for (unsigned patternLength = 1; patternLength <= 20; ++patternLength)
     {
         TText pattern;
         generateText(rng, pattern, patternLength);
@@ -173,26 +186,27 @@ SEQAN_TYPED_TEST(BidirectionalFMIndexTest, SearchInStringSet)
 
     std::mt19937 rng(time(nullptr));
 
+    unsigned textLength = 3947;
+
     TStringSet stringSet;
+    TStringSet revStringSet;
     for (unsigned stringSetSize = 1; stringSetSize <= 3; ++stringSetSize)
     {
         TText text;
-        generateText(rng, text, 3947);
-        appendValue(stringSet, text);
+        generateText(rng, text, textLength);
+        ModifiedString<TText, ModReverse> revText(text);
 
-        TStringSet revStringSet;
-        for (unsigned i = 0; i < stringSetSize; ++i)
-        {
-            TText revText(stringSet[stringSetSize - i - 1]);
-            reverse(revText);
-            appendValue(revStringSet, revText);
-        }
+        appendValue(stringSet, text);
+        appendValue(revStringSet, revText);
 
         TStringSetIndex index(stringSet);
-        for (unsigned int patternLength = 1; patternLength <= 10; ++patternLength)
+        for (unsigned patternLength = 1; patternLength <= 10; ++patternLength)
         {
             TText pattern;
-            generateText(rng, pattern, patternLength);
+            if (rng() % 2) // guaranteed hit
+                pattern = infixWithLength(text, rng() % (textLength - patternLength), patternLength);
+            else // likely to have no hits (for longer pattern and short texts)
+                generateText(rng, pattern, patternLength);
 
             testBidirectionalIndex(index, stringSet, revStringSet, pattern);
         }
diff --git a/tests/roi_io/test_roi_io.cpp b/tests/roi_io/test_roi_io.cpp
index 120de31..a671ffa 100644
--- a/tests/roi_io/test_roi_io.cpp
+++ b/tests/roi_io/test_roi_io.cpp
@@ -167,6 +167,44 @@ SEQAN_DEFINE_TEST(test_roi_roi_file_write)
     SEQAN_ASSERT(seqan::_compareTextFiles(toCString(tmpPath), toCString(goldPath)));
 }
 
+SEQAN_DEFINE_TEST(test_roi_io_isOpen_fileIn)
+{
+    // Build path to file.
+    seqan::CharString filePath = SEQAN_PATH_TO_ROOT();
+    append(filePath, "/tests/roi_io/example.roi");
+
+    // Create SequenceStream object.
+    seqan::RoiFileIn roiI;
+    SEQAN_ASSERT(!isOpen(roiI));
+
+    // open file
+    open(roiI, toCString(filePath));
+    SEQAN_ASSERT(isOpen(roiI));
+
+    // close file
+    close(roiI);
+    SEQAN_ASSERT(!isOpen(roiI));
+}
+
+SEQAN_DEFINE_TEST(test_roi_io_isOpen_fileOut)
+{
+    // Build path to file.
+    seqan::CharString filePath = SEQAN_TEMP_FILENAME();
+    append(filePath, ".roi");
+
+    // Create SequenceStream object.
+    seqan::RoiFileOut  roiO;
+    SEQAN_ASSERT(!isOpen(roiO));
+
+    // open files
+    open(roiO, toCString(filePath));
+    SEQAN_ASSERT(isOpen(roiO));
+
+    // close files
+    close(roiO);
+    SEQAN_ASSERT(!isOpen(roiO));
+}
+
 SEQAN_BEGIN_TESTSUITE(test_roi_io)
 {
     // Reading of ROI records.
@@ -178,5 +216,9 @@ SEQAN_BEGIN_TESTSUITE(test_roi_io)
     // RoiFile
     SEQAN_CALL_TEST(test_roi_roi_file_read);
     SEQAN_CALL_TEST(test_roi_roi_file_write);
+
+    // isOpen
+    SEQAN_CALL_TEST(test_roi_io_isOpen_fileIn);
+    SEQAN_CALL_TEST(test_roi_io_isOpen_fileOut);
 }
 SEQAN_END_TESTSUITE
diff --git a/tests/seq_io/test_seq_io.cpp b/tests/seq_io/test_seq_io.cpp
index 6998099..fe5089f 100644
--- a/tests/seq_io/test_seq_io.cpp
+++ b/tests/seq_io/test_seq_io.cpp
@@ -69,6 +69,10 @@ SEQAN_BEGIN_TESTSUITE(test_seq_io)
     SEQAN_CALL_TEST(test_seq_io_sequence_file_write_all_text_fastq_no_qual);
     SEQAN_CALL_TEST(test_seq_io_sequence_file_write_all_text_fastq_with_qual);
 
+    // Test isOpen functionality
+    SEQAN_CALL_TEST(test_seq_io_sequence_file_isOpen_fileIn);
+    SEQAN_CALL_TEST(test_seq_io_sequence_file_isOpen_fileOut);
+
     // Test parsing for GenomicRegion.
     SEQAN_CALL_TEST(test_seq_io_genomic_region_default_constructed);
     SEQAN_CALL_TEST(test_seq_io_genomic_region_from_string);
diff --git a/tests/seq_io/test_sequence_file.h b/tests/seq_io/test_sequence_file.h
index c856d8c..ccd0712 100644
--- a/tests/seq_io/test_sequence_file.h
+++ b/tests/seq_io/test_sequence_file.h
@@ -346,4 +346,46 @@ SEQAN_DEFINE_TEST(test_seq_io_sequence_file_write_all_text_fastq_with_qual)
     SEQAN_ASSERT_MSG(seqan::_compareTextFilesAlt(toCString(pathToExpected), toCString(filePath)), "Output should match example.");
 }
 
+// ---------------------------------------------------------------------------
+// Test isOpen() functionality.
+// ---------------------------------------------------------------------------
+
+SEQAN_DEFINE_TEST(test_seq_io_sequence_file_isOpen_fileIn)
+{
+    // Build path to file.
+    seqan::CharString filePath = SEQAN_PATH_TO_ROOT();
+    append(filePath, "/tests/seq_io/test_dna.fa");
+
+    // Create SequenceStream object.
+    SeqFileIn seqI;
+    SEQAN_ASSERT(!isOpen(seqI));
+
+    // open file
+    open(seqI, toCString(filePath));
+    SEQAN_ASSERT(isOpen(seqI));
+
+    // close file
+    close(seqI);
+    SEQAN_ASSERT(!isOpen(seqI));
+}
+
+SEQAN_DEFINE_TEST(test_seq_io_sequence_file_isOpen_fileOut)
+{
+    // Build path to file.
+    seqan::CharString filePath = SEQAN_TEMP_FILENAME();
+    append(filePath, ".fa");
+
+    // Create SequenceStream object.
+    SeqFileOut  seqO;
+    SEQAN_ASSERT(!isOpen(seqO));
+
+    // open files
+    open(seqO, toCString(filePath));
+    SEQAN_ASSERT(isOpen(seqO));
+
+    // close files
+    close(seqO);
+    SEQAN_ASSERT(!isOpen(seqO));
+}
+
 #endif  // TESTS_SEQ_IO_TEST_EASY_SEQ_IO_H_
diff --git a/tests/vcf_io/test_vcf_io.cpp b/tests/vcf_io/test_vcf_io.cpp
index a8b444b..9d6afe1 100644
--- a/tests/vcf_io/test_vcf_io.cpp
+++ b/tests/vcf_io/test_vcf_io.cpp
@@ -47,5 +47,8 @@ SEQAN_BEGIN_TESTSUITE(test_vcf_io)
     SEQAN_CALL_TEST(test_vcf_io_write_vcf_header);
     SEQAN_CALL_TEST(test_vcf_io_write_vcf_record);
     SEQAN_CALL_TEST(test_vcf_io_vcf_file_write_record);
+
+    SEQAN_CALL_TEST(test_vcf_io_isOpen_fileIn);
+    SEQAN_CALL_TEST(test_vcf_io_isOpen_fileOut);
 }
 SEQAN_END_TESTSUITE
diff --git a/tests/vcf_io/test_vcf_io.h b/tests/vcf_io/test_vcf_io.h
index 28fe238..33ab5db 100644
--- a/tests/vcf_io/test_vcf_io.h
+++ b/tests/vcf_io/test_vcf_io.h
@@ -467,4 +467,42 @@ SEQAN_DEFINE_TEST(test_vcf_io_vcf_file_write_record)
     SEQAN_ASSERT(seqan::_compareTextFilesAlt(tmpPath.c_str(), toCString(goldPath)));
 }
 
+SEQAN_DEFINE_TEST(test_vcf_io_isOpen_fileIn)
+{
+    // Build path to file.
+    seqan::CharString vcfPath = SEQAN_PATH_TO_ROOT();
+    append(vcfPath, "/tests/vcf_io/example.vcf");
+
+    // Create SequenceStream object.
+    seqan::VcfFileIn vcfI;
+    SEQAN_ASSERT(!isOpen(vcfI));
+
+    // open file
+    open(vcfI, toCString(vcfPath));
+    SEQAN_ASSERT(isOpen(vcfI));
+
+    // close file
+    close(vcfI);
+    SEQAN_ASSERT(!isOpen(vcfI));
+}
+
+SEQAN_DEFINE_TEST(test_vcf_io_isOpen_fileOut)
+{
+    // Build path to file.
+    seqan::CharString vcfPath = SEQAN_TEMP_FILENAME();
+    append(vcfPath, ".vcf");
+
+    // Create SequenceStream object.
+    seqan::VcfFileOut  vcfO;
+    SEQAN_ASSERT(!isOpen(vcfO));
+
+    // open files
+    open(vcfO, toCString(vcfPath));
+    SEQAN_ASSERT(isOpen(vcfO));
+
+    // close files
+    close(vcfO);
+    SEQAN_ASSERT(!isOpen(vcfO));
+}
+
 #endif  // SEQAN_TESTS_VCF_TEST_VCF_IO_H_
diff --git a/util/cmake/FindSeqAn.cmake b/util/cmake/FindSeqAn.cmake
index 078dad9..ce2f8db 100644
--- a/util/cmake/FindSeqAn.cmake
+++ b/util/cmake/FindSeqAn.cmake
@@ -107,6 +107,13 @@ endif ()
 # SEQAN_FIND_DEPENDENCIES IS DEPRECATED, just use find_package!
 
 # ----------------------------------------------------------------------------
+# Deactivate verbosity if package detection is quite
+# ----------------------------------------------------------------------------
+
+# deactivate messages in check_* if quiet
+set (CMAKE_REQUIRED_QUIET ${SeqAn_FIND_QUIETLY})
+
+# ----------------------------------------------------------------------------
 # Determine compiler.
 # ----------------------------------------------------------------------------
 
@@ -287,8 +294,13 @@ endif (SEQAN_USE_SEQAN_BUILD_SYSTEM)
 
 # librt, libpthread -- implicit, on Linux only
 
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
-  set (SEQAN_LIBRARIES ${SEQAN_LIBRARIES} rt pthread)
+if ((${CMAKE_SYSTEM_NAME} STREQUAL "Linux") OR (${CMAKE_SYSTEM_NAME} STREQUAL "kFreeBSD") OR (${CMAKE_SYSTEM_NAME} STREQUAL "GNU"))
+  set (SEQAN_LIBRARIES ${SEQAN_LIBRARIES} rt)
+  if ((CMAKE_CXX_FLAGS MATCHES "-static") OR (SEQAN_CXX_FLAGS MATCHES "-static") OR (CMAKE_EXE_LINKER_FLAGS MATCHES "-static"))
+    set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--whole-archive -lpthread -Wl,--no-whole-archive")
+  else ()
+    set (SEQAN_LIBRARIES ${SEQAN_LIBRARIES} pthread)
+  endif ()
 elseif ((${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD") OR (${CMAKE_SYSTEM_NAME} STREQUAL "OpenBSD"))
   set (SEQAN_LIBRARIES ${SEQAN_LIBRARIES} pthread)
   set (SEQAN_DEFINITIONS ${SEQAN_DEFINITIONS} "-D_GLIBCXX_USE_C99=1")
@@ -445,14 +457,16 @@ if (NOT DEFINED SEQAN_VERSION_STRING)
   set (SEQAN_VERSION_PATCH "${_SEQAN_VERSION_PATCH}" CACHE INTERNAL "SeqAn patch version.")
   set (SEQAN_VERSION_PRE_RELEASE "${_SEQAN_VERSION_PRE_RELEASE}" CACHE INTERNAL "Whether version is a pre-release version version.")
   set (SEQAN_VERSION_STRING "${_SEQAN_VERSION_STRING}" CACHE INTERNAL "SeqAn version string.")
-
-  message (STATUS "  Determined version is ${SEQAN_VERSION_STRING}")
 endif (NOT DEFINED SEQAN_VERSION_STRING)
 
 # ----------------------------------------------------------------------------
 # Print Variables
 # ----------------------------------------------------------------------------
 
+if (NOT SeqAn_FIND_QUIETLY)
+    message (STATUS "Found Seqan: ${SEQAN_INCLUDE_DIRS_MAIN} (found version \"${SEQAN_VERSION_STRING}\")")
+endif ()
+
 if (SEQAN_FIND_DEBUG)
   message("Result for ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt")
   message("")

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/seqan2.git



More information about the debian-med-commit mailing list