[med-svn] [lambda-align] 10/15: Imported Upstream version 1.9.0

Sascha Steinbiss satta at debian.org
Fri Aug 19 16:10:05 UTC 2016


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

satta pushed a commit to branch master
in repository lambda-align.

commit f5ebbcd01a0e20d1d63f79050d1b55c109666ac0
Author: Sascha Steinbiss <satta at debian.org>
Date:   Thu Aug 18 21:28:14 2016 +0000

    Imported Upstream version 1.9.0
---
 .gitmodules                                        |    3 +
 .travis.yml                                        |   88 +-
 CMakeLists.txt                                     |   50 +-
 COPYING.rst                                        |   27 -
 LICENSE-AGPL3.rst                                  |  671 ++++++++++
 include/seqan/LICENSE => LICENSE-BSD.rst           |   26 +-
 LICENSE-GPL3.rst                                   |  704 ----------
 LICENSE.rst                                        |   45 +
 README.rst                                         |  143 +-
 include/seqan/.travis.yml                          |   30 -
 include/seqan/util/cmake/CMakeFindJavaCommon.cmake |   40 -
 .../util/cmake/CMakeMacroParseArguments.cmake      |  138 --
 include/seqan/util/cmake/CTestConfig.cmake         |   13 -
 include/seqan/util/cmake/FeatureSummary.cmake      |  117 --
 include/seqan/util/cmake/FindBZip2.cmake           |   61 -
 include/seqan/util/cmake/FindCXX11.cmake           |   39 -
 include/seqan/util/cmake/FindCXX14.cmake           |   29 -
 include/seqan/util/cmake/FindGitInfo.cmake         |   64 -
 include/seqan/util/cmake/FindJava.cmake            |  228 ----
 include/seqan/util/cmake/FindOpenCL.cmake          |   79 --
 include/seqan/util/cmake/FindOpenMP.cmake          |  137 --
 .../util/cmake/FindPackageHandleStandardArgs.cmake |  261 ----
 include/seqan/util/cmake/FindSeqAn.cmake           |  480 -------
 include/seqan/util/cmake/FindSphinx.cmake          |  145 ---
 include/seqan/util/cmake/FindTBB/FindTBB.cmake     |  208 ---
 include/seqan/util/cmake/FindTBB/README            |    6 -
 include/seqan/util/cmake/FindZLIB.cmake            |  107 --
 include/seqan/util/cmake/GetCurrentDate.cmake      |   57 -
 include/seqan/util/cmake/GetCurrentDate.cpp        |   52 -
 include/seqan/util/cmake/LibFindMacros.cmake       |   99 --
 include/seqan/util/cmake/README                    |   84 --
 include/seqan/util/cmake/SeqAnBuildSystem.cmake    |  731 -----------
 include/seqan/util/cmake/SeqAnContribs.cmake       |  117 --
 include/seqan/util/cmake/SeqAnCtdSetup.cmake       |  242 ----
 .../seqan/util/cmake/SeqAnUsabilityAnalyzer.cmake  |   98 --
 include/seqan/util/cmake/SeqAnVersion.cpp          |   48 -
 include/seqan/util/cmake/SetCPackSystemName.cmake  |   51 -
 include/seqan/util/cmake/ctd/COPYRIGHT             |    2 -
 include/seqan/util/cmake/ctd/DESCRIPTION           |    7 -
 include/seqan/util/cmake/ctd/LICENSE               |   31 -
 .../cmake/ctd/configure_profile_properties.cmake   |   13 -
 include/seqan/util/cmake/ctd/icons/app.png         |  Bin 3931 -> 0 bytes
 include/seqan/util/cmake/ctd/icons/category.png    |  Bin 2978 -> 0 bytes
 include/seqan/util/cmake/ctd/icons/splash.png      |  Bin 9838 -> 0 bytes
 include/seqan/util/cmake/ctd/mime.types            |   37 -
 include/seqan/util/cmake/ctd/mimetypes.xml         |   23 -
 include/seqan/util/cmake/ctd/plugin.properties.in  |   15 -
 include/seqan/util/cmake/package.cmake             |   96 --
 include/seqan/util/colornvcc                       |  259 ----
 include/seqan/util/ctd2galaxy.py                   |  192 ---
 include/seqan/util/linux_binary_tests.sh           |  171 ---
 include/seqan/util/makefile_project/Makefile       |   15 -
 include/seqan/util/makefile_project/Makefile.rules |   17 -
 include/seqan/util/makefile_project/README         |    1 -
 include/seqan/util/makefile_project/debug/Makefile |    3 -
 .../seqan/util/makefile_project/release/Makefile   |    3 -
 include/seqan/util/makefile_project/src/main.cpp   |   11 -
 .../seqan/util/raw_cmake_project/CMakeLists.txt    |   11 -
 include/seqan/util/raw_cmake_project/README        |    2 -
 .../util/raw_cmake_project/src/CMakeLists.txt      |   12 -
 include/seqan/util/raw_cmake_project/src/main.cpp  |   12 -
 src/CMakeLists.txt                                 |  240 ++--
 src/alph.hpp                                       |  237 ----
 src/holders.hpp                                    |  316 ++---
 src/lambda.cpp                                     |  236 ++--
 src/lambda.hpp                                     | 1369 +++++++++++++++-----
 src/lambda_indexer.cpp                             |   47 +-
 src/lambda_indexer.hpp                             |  314 ++---
 src/lambda_indexer_misc.hpp                        |   19 +-
 src/match.hpp                                      |   87 +-
 src/misc.hpp                                       |   57 +-
 src/options.hpp                                    |  411 ++++--
 src/output.hpp                                     |  213 ++-
 src/radix_inplace.h                                |    2 +-
 tests/CMakeLists.txt                               |   21 +-
 tests/search_test_outfile.md5sums.gz               |  Bin 1082 -> 1082 bytes
 76 files changed, 3112 insertions(+), 6908 deletions(-)

diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..283c7f9
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "seqan"]
+	path = include/seqan
+	url = git://github.com/seqan/seqan.git
diff --git a/.travis.yml b/.travis.yml
index 93578e5..a73ebe4 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,44 +1,48 @@
 sudo: required
 dist: trusty
 language: cpp
+before_install:
+ - test $(uname) = "Linux" && sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test || true
+ - test $(uname) = "Linux" && sudo add-apt-repository -y ppa:george-edison55/cmake-3.x || true
+ - test $(uname) = "Linux" && sudo add-apt-repository -y 'deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.8 main' || true
+ - test $(uname) = "Linux" && sudo add-apt-repository -y 'deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-3.9 main' || true
+ - test $(uname) = "Linux" && wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add - || true
+ - test $(uname) = "Linux" && sudo apt-get update -y || true
+ - test $(uname) = "Linux" && sudo apt-get install -qq -y g++-4.9 g++-5 g++-6 clang-3.8 clang-3.9 cmake cmake-data zlib1g-dev libbz2-dev || true
+ - test $(uname) = "Darwin" && sudo brew update || true
+ - test $(uname) = "Darwin" && sudo brew tap homebrew/versions || true
+ - test $(uname) = "Darwin" && sudo brew install gcc5 || true
+ - test $(uname) = "Darwin" && sudo brew install gcc6 || true
 matrix:
   include:
     - os: linux
+      compiler: gcc-4.9
+      install: export CXX="g++-4.9"
+    - os: linux
       compiler: gcc-5
-      addons:
-        apt:
-          sources: ['ubuntu-toolchain-r-test']
-          packages: ['g++-5', 'cmake', 'zlib1g-dev', 'libbz2-dev']
-      install: ['export CXX="g++-5" CC="gcc-5"' ]
-      before_script:
-        - sudo dd if=/dev/zero of=/swapfile bs=64M count=32 # cheat us some extra MEM
-        - sudo mkswap /swapfile
-        - sudo swapon /swapfile
-      after_script:
-        - sudo swapoff /swapfile
-        - sudo rm /swapfile
-
+      install: export CXX="g++-5"
+      env: CMAKE_ARGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo"
     - os: linux
-      compiler: gcc-4.9
-      addons:
-        apt:
-          sources: ['ubuntu-toolchain-r-test']
-          packages: ['g++-4.9', 'cmake', 'zlib1g-dev', 'libbz2-dev']
-      install: ['export CXX="g++-4.9" CC="gcc-4.9"' ]
-      before_script:
-        - sudo dd if=/dev/zero of=/swapfile bs=64M count=32 # cheat us some extra MEM
-        - sudo mkswap /swapfile
-        - sudo swapon /swapfile
-      after_script:
-        - sudo swapoff /swapfile
-        - sudo rm /swapfile
-
+      compiler: gcc-6
+      install: export CXX="g++-6"
+    - os: linux
+      compiler: clang-3.8
+      install: export CXX="clang++-3.8"
     - os: linux
-      compiler: clang
-      addons:
-        apt:
-          sources: ['ubuntu-toolchain-r-test']
-          packages: ['clang', 'g++-4.9', 'cmake', 'zlib1g-dev', 'libbz2-dev'] # g++ required for newer libstdc++
+      compiler: clang-3.9
+      install: export CXX="clang++-3.9"
+    - os: osx
+      compiler: gcc-4.9
+      install: export CXX="g++-4.9"
+      env: CMAKE_ARGS="-DLAMBDA_FASTBUILD=1"
+    - os: osx
+      compiler: gcc-5
+      install: export CXX="g++-5"
+      env: CMAKE_ARGS="-DLAMBDA_FASTBUILD=1"
+    - os: osx
+      compiler: gcc-6
+      install: export CXX="g++-6"
+      env: CMAKE_ARGS="-DLAMBDA_FASTBUILD=1"
 
     #- os: osx
       #compiler: clang-3.6
@@ -46,7 +50,7 @@ matrix:
         #- sudo brew update
         #- sudo brew tap homebrew/versions
         #- sudo brew install llvm36
-      #install: ['export CXX="clang++-3.6" CC="clang-3.6"' ]
+      #install: ['export CXX="clang++-3.6"' ]
 
     #- os: osx
       #compiler: clang-3.7
@@ -54,11 +58,19 @@ matrix:
         #- sudo brew update
         #- sudo brew tap homebrew/versions
         #- sudo brew install llvm37
-      #install: ['export CXX="clang++-3.7" CC="clang-3.7"' ]
+      #install: ['export CXX="clang++-3.7"' ]
+
+    #- os: osx
+      #compiler: clang-3.8
+      #before_install:
+        #- sudo brew update
+        #- sudo brew tap homebrew/versions
+        #- sudo brew install llvm38
+      #install: export CXX="clang++-3.8" CMAKE_ARGS='-DLAMBDA_NATIVE_BUILD=0 -DLAMBDA_FASTBUILD=1 -DCMAKE_CXX_FLAGS="-L/usr/local/Cellar/llvm38/3.8.0/lib/llvm-3.8/lib"'
 
 script:
   - mkdir -p build && cd build
-  - cmake ..
-  - make lambda_indexer
-  - travis_wait make lambda # need to prefix with travis_wait because it might take > 10min
-  - ctest .
\ No newline at end of file
+  - cmake .. -DLAMBDA_NATIVE_BUILD=0 ${CMAKE_ARGS}
+  - make lambda_indexer VERBOSE=1
+  - travis_wait make lambda VERBOSE=1 # need to prefix with travis_wait because it might take > 10min
+  - ctest .
diff --git a/CMakeLists.txt b/CMakeLists.txt
index afe4c1c..49bcb36 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,35 +2,30 @@
 #                  Lambda
 # ===========================================================================
 
+cmake_minimum_required (VERSION 3.0.0)
+string(ASCII 27 Esc)
+set(ColourBold  "${Esc}[1m")
+set(ColourReset "${Esc}[m")
+message ("${ColourBold}Compiler Detection${ColourReset}")
+
+project (lambda CXX)
+
 # ----------------------------------------------------------------------------
-# Load SeqAn build system
+# Begin of dependency detection
 # ----------------------------------------------------------------------------
 
-project (seqan)
-cmake_minimum_required (VERSION 2.8.2)
-set (CMAKE_INCLUDE_PATH
-    ${CMAKE_CURRENT_SOURCE_DIR}/include/seqan/include
-    ${CMAKE_INCLUDE_PATH})
-set (CMAKE_MODULE_PATH
-    ${CMAKE_CURRENT_SOURCE_DIR}/include/seqan/util/cmake/FindTBB
-    ${CMAKE_CURRENT_SOURCE_DIR}/include/seqan/util/cmake
-    ${CMAKE_MODULE_PATH})
-include (SeqAnContribs)
-
-# Build in release mode by default
-if (CMAKE_BUILD_TYPE STREQUAL "")
-    set(CMAKE_BUILD_TYPE "Release")
-endif()
-
-set (SEQAN_USE_SEQAN_BUILD_SYSTEM TRUE CACHE INTERNAL "Use SeqAn build system." FORCE)
-include (SeqAnBuildSystem)
-set (SEQAN_ROOT_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/seqan/" CACHE INTERNAL "Root source directory." FORCE)
-# include(include/seqan/CMakeLists.txt)
-seqan_build_system_init ()
-seqan_get_repository_info ()
-seqan_setup_library ()
-include (package)
-include (SeqAnCtdSetup)
+message ("\n${ColourBold}Dependency detection${ColourReset}")
+
+if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/include/seqan/include/seqan/version.h")
+    set (CMAKE_INCLUDE_PATH
+        ${CMAKE_CURRENT_SOURCE_DIR}/include/seqan/include
+        ${CMAKE_INCLUDE_PATH})
+    set (CMAKE_MODULE_PATH
+        ${CMAKE_CURRENT_SOURCE_DIR}/include/seqan/util/cmake
+        ${CMAKE_MODULE_PATH})
+    message (STATUS "Found a local SeqAn library provided with the Lambda source code.")
+    message (    "   This will be preferred over system global headers.")
+endif ()
 
 # ----------------------------------------------------------------------------
 # Add Lambda targets
@@ -42,4 +37,5 @@ add_subdirectory(src)
 # Add Tests
 # ----------------------------------------------------------------------------
 
-add_subdirectory(tests)
\ No newline at end of file
+# message ("\n${ColourBold}Setting up unit tests${ColourReset}")
+# add_subdirectory(tests)
diff --git a/COPYING.rst b/COPYING.rst
deleted file mode 100644
index a1fe1fc..0000000
--- a/COPYING.rst
+++ /dev/null
@@ -1,27 +0,0 @@
-lambda copyright
-================
-Copyright (c) 2013-2015, Hannes Hauswedell, FU Berlin.
-All rights reserved.
-
-Lambda is *free software*: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-Lambda is distributed in the hope that it will be useful,
-but **without any warranty**; without even the implied warranty of
-**merchantability** or **fitness for a particular purpose**. See the
-GNU General Public License for more details.
-
-See the file `LICENSE-GPL3.rst <./LICENSE-GPL3.rst>`__ or
-http://www.gnu.org/licenses/ for a full text of the license and the
-rights and obligations implied.
-
-SeqAn copyright
-===============
-Lambda contains code of the SeqAn project in the folder
-`include/seqan <./include/seqan>`__. See
-`include/seqan/LICENSE <./include/seqan/LICENSE>`__  for the terms.
-Please note that due to technical reasons the repository contains
-other SeqAn applications, as well, that might be distributed under
-different terms.
\ No newline at end of file
diff --git a/LICENSE-AGPL3.rst b/LICENSE-AGPL3.rst
new file mode 100644
index 0000000..980af45
--- /dev/null
+++ b/LICENSE-AGPL3.rst
@@ -0,0 +1,671 @@
+GNU Affero General Public License
+=================================
+
+*Version 3, 19 November 2007*
+*Copyright © 2007 Free Software Foundation, In* <http://fsf.org>
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+Preamble
+--------
+
+The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works.  By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
+
+When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+Developers that use our General Public Licenses protect your rights
+with two steps: **(1)** assert copyright on the software, and **(2)** offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate.  Many developers of free software are heartened and
+encouraged by the resulting cooperation.  However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community.  It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server.  Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals.  This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+The precise terms and conditions for copying, distribution and
+modification follow.
+
+TERMS AND CONDITIONS
+--------------------
+
+0. Definitions
+~~~~~~~~~~~~~~
+
+"This License" refers to version 3 of the GNU Affero General Public License.
+
+"Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+"The Program" refers to any copyrightable work licensed under this
+License.  Each licensee is addressed as "you".  "Licensees" and
+"recipients" may be individuals or organizations.
+
+To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy.  The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy.  Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies.  Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that **(1)** displays an appropriate copyright notice, and **(2)**
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License.  If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+1. Source Code
+~~~~~~~~~~~~~~
+
+The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+The "System Libraries" of an executable work include anything, other
+than the work as a whole, that **(a)** is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and **(b)** serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form.  A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities.  However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work.  For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+The Corresponding Source for a work in source code form is that
+same work.
+
+2. Basic Permissions
+~~~~~~~~~~~~~~~~~~~~
+
+All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met.  This License explicitly affirms your unlimited
+permission to run the unmodified Program.  The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work.  This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force.  You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright.  Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+Conveying under any other circumstances is permitted solely under
+the conditions stated below.  Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+3. Protecting Users' Legal Rights From Anti-Circumvention Law
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+4. Conveying Verbatim Copies
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+### 5. Conveying Modified Source Versions
+
+You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+* **a)** The work must carry prominent notices stating that you modified
+  it, and giving a relevant date.
+* **b)** The work must carry prominent notices stating that it is
+  released under this License and any conditions added under section 7.
+  This requirement modifies the requirement in section 4 to
+  "keep intact all notices".
+* **c)** You must license the entire work, as a whole, under this
+  License to anyone who comes into possession of a copy.  This
+  License will therefore apply, along with any applicable section 7
+  additional terms, to the whole of the work, and all its parts,
+  regardless of how they are packaged.  This License gives no
+  permission to license the work in any other way, but it does not
+  invalidate such permission if you have separately received it.
+* **d)** If the work has interactive user interfaces, each must display
+  Appropriate Legal Notices; however, if the Program has interactive
+  interfaces that do not display Appropriate Legal Notices, your
+  work need not make them do so.
+
+A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit.  Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+6. Conveying Non-Source Forms
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+* **a)** Convey the object code in, or embodied in, a physical product
+  (including a physical distribution medium), accompanied by the
+  Corresponding Source fixed on a durable physical medium
+  customarily used for software interchange.
+* **b)** Convey the object code in, or embodied in, a physical product
+  (including a physical distribution medium), accompanied by a
+  written offer, valid for at least three years and valid for as
+  long as you offer spare parts or customer support for that product
+  model, to give anyone who possesses the object code either **(1)** a
+  copy of the Corresponding Source for all the software in the
+  product that is covered by this License, on a durable physical
+  medium customarily used for software interchange, for a price no
+  more than your reasonable cost of physically performing this
+  conveying of source, or **(2)** access to copy the
+  Corresponding Source from a network server at no charge.
+* **c)** Convey individual copies of the object code with a copy of the
+  written offer to provide the Corresponding Source.  This
+  alternative is allowed only occasionally and noncommercially, and
+  only if you received the object code with such an offer, in accord
+  with subsection 6b.
+* **d)** Convey the object code by offering access from a designated
+  place (gratis or for a charge), and offer equivalent access to the
+  Corresponding Source in the same way through the same place at no
+  further charge.  You need not require recipients to copy the
+  Corresponding Source along with the object code.  If the place to
+  copy the object code is a network server, the Corresponding Source
+  may be on a different server (operated by you or a third party)
+  that supports equivalent copying facilities, provided you maintain
+  clear directions next to the object code saying where to find the
+  Corresponding Source.  Regardless of what server hosts the
+  Corresponding Source, you remain obligated to ensure that it is
+  available for as long as needed to satisfy these requirements.
+* **e)** Convey the object code using peer-to-peer transmission, provided
+  you inform other peers where the object code and Corresponding
+  Source of the work are being offered to the general public at no
+  charge under subsection 6d.
+
+A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+A "User Product" is either **(1)** a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or **(2)** anything designed or sold for incorporation
+into a dwelling.  In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage.  For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product.  A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+"Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source.  The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information.  But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed.  Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+7. Additional Terms
+~~~~~~~~~~~~~~~~~~~
+
+"Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law.  If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it.  (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.)  You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+* **a)** Disclaiming warranty or limiting liability differently from the
+  terms of sections 15 and 16 of this License; or
+* **b)** Requiring preservation of specified reasonable legal notices or
+  author attributions in that material or in the Appropriate Legal
+  Notices displayed by works containing it; or
+* **c)** Prohibiting misrepresentation of the origin of that material, or
+  requiring that modified versions of such material be marked in
+  reasonable ways as different from the original version; or
+* **d)** Limiting the use for publicity purposes of names of licensors or
+  authors of the material; or
+* **e)** Declining to grant rights under trademark law for use of some
+  trade names, trademarks, or service marks; or
+* **f)** Requiring indemnification of licensors and authors of that
+  material by anyone who conveys the material (or modified versions of
+  it) with contractual assumptions of liability to the recipient, for
+  any liability that these contractual assumptions directly impose on
+  those licensors and authors.
+
+All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10.  If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term.  If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+8. Termination
+~~~~~~~~~~~~~~
+
+You may not propagate or modify a covered work except as expressly
+provided under this License.  Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated **(a)**
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and **(b)** permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License.  If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+9. Acceptance Not Required for Having Copies
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You are not required to accept this License in order to receive or
+run a copy of the Program.  Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance.  However,
+nothing other than this License grants you permission to propagate or
+modify any covered work.  These actions infringe copyright if you do
+not accept this License.  Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+10. Automatic Licensing of Downstream Recipients
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License.  You are not responsible
+for enforcing compliance by third parties with this License.
+
+An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations.  If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License.  For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+11. Patents
+~~~~~~~~~~~
+
+A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based.  The
+work thus licensed is called the contributor's "contributor version".
+
+A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version.  For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement).  To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either **(1)** cause the Corresponding Source to be so
+available, or **(2)** arrange to deprive yourself of the benefit of the
+patent license for this particular work, or **(3)** arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients.  "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License.  You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license **(a)** in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or **(b)** primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+12. No Surrender of Others' Freedom
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all.  For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+13. Remote Network Interaction; Use with the GNU General Public License
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software.  This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work.  The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+14. Revised Versions of this License
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time.  Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation.  If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+Later license versions may give you additional or different
+permissions.  However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+15. Disclaimer of Warranty
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. Limitation of Liability
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+17. Interpretation of Sections 15 and 16
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+*END OF TERMS AND CONDITIONS*
+
+How to Apply These Terms to Your New Programs
+---------------------------------------------
+
+If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+| <one line to give the program's name and a brief idea of what it does.>
+| Copyright (C) <year>  <name of author>
+|
+| This program is free software: you can redistribute it and/or modify
+| it under the terms of the GNU Affero General Public License as published by
+| the Free Software Foundation, either version 3 of the License, or
+| (at your option) any later version.
+|
+| This program is distributed in the hope that it will be useful,
+| but WITHOUT ANY WARRANTY; without even the implied warranty of
+| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+| GNU Affero General Public License for more details.
+|
+| You should have received a copy of the GNU Affero General Public License
+| along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source.  For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code.  There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+<http://www.gnu.org/licenses/>.
diff --git a/include/seqan/LICENSE b/LICENSE-BSD.rst
similarity index 56%
rename from include/seqan/LICENSE
rename to LICENSE-BSD.rst
index 7362ed0..8b5eb0d 100644
--- a/include/seqan/LICENSE
+++ b/LICENSE-BSD.rst
@@ -1,17 +1,20 @@
-Copyright (c) 2006-2015, Knut Reinert, FU Berlin
-All rights reserved.
+BSD-License (3-clause)
+======================
+
+ | Copyright (c) 2006-2016, Knut Reinert, Freie Universität Berlin
+ | All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
 
-    * Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-    * Neither the name of Knut Reinert or the FU Berlin nor the names of
-      its contributors may be used to endorse or promote products derived
-      from this software without specific prior written permission.
+* Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright
+  notice, this list of conditions and the following disclaimer in the
+  documentation and/or other materials provided with the distribution.
+* Neither the name of Knut Reinert or the FU Berlin nor the names of
+  its contributors may be used to endorse or promote products derived
+  from this software without specific prior written permission.
 
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -23,5 +26,4 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGE.
-
+DAMAGE.
\ No newline at end of file
diff --git a/LICENSE-GPL3.rst b/LICENSE-GPL3.rst
deleted file mode 100644
index b2cade9..0000000
--- a/LICENSE-GPL3.rst
+++ /dev/null
@@ -1,704 +0,0 @@
-GNU GENERAL PUBLIC LICENSE
-==========================
-
-Version 3, 29 June 2007
-
-Copyright (C) 2007 `Free Software Foundation, Inc. <http://fsf.org/>`_
-
-Everyone is permitted to copy and distribute verbatim copies of this
-license document, but changing it is not allowed.
-
-Preamble
---------
-
-The GNU General Public License is a free, copyleft license for software
-and other kinds of works.
-
-The licenses for most software and other practical works are designed to
-take away your freedom to share and change the works. By contrast, the
-GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
-When we speak of free software, we are referring to freedom, not price.
-Our General Public Licenses are designed to make sure that you have the
-freedom to distribute copies of free software (and charge for them if
-you wish), that you receive source code or can get it if you want it,
-that you can change the software or use pieces of it in new free
-programs, and that you know you can do these things.
-
-To protect your rights, we need to prevent others from denying you these
-rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
-For example, if you distribute copies of such a program, whether gratis
-or for a fee, you must pass on to the recipients the same freedoms that
-you received. You must make sure that they, too, receive or can get the
-source code. And you must show them these terms so they know their
-rights.
-
-Developers that use the GNU GPL protect your rights with two steps:
-
-1. assert copyright on the software, and
-2. offer you this License giving you legal permission to copy,
-   distribute and/or modify it.
-
-For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
-Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of protecting
-users' freedom to change the software. The systematic pattern of such
-abuse occurs in the area of products for individuals to use, which is
-precisely where it is most unacceptable. Therefore, we have designed
-this version of the GPL to prohibit the practice for those products. If
-such problems arise substantially in other domains, we stand ready to
-extend this provision to those domains in future versions of the GPL, as
-needed to protect the freedom of users.
-
-Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
-The precise terms and conditions for copying, distribution and
-modification follow.
-
-TERMS AND CONDITIONS
---------------------
-
-0. Definitions.
-~~~~~~~~~~~~~~~
-
-*This License* refers to version 3 of the GNU General Public License.
-
-*Copyright* also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
-*The Program* refers to any copyrightable work licensed under this
-License. Each licensee is addressed as *you*. *Licensees* and
-*recipients* may be individuals or organizations.
-
-To *modify* a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a *modified version* of the
-earlier work or a work *based on* the earlier work.
-
-A *covered work* means either the unmodified Program or a work based on
-the Program.
-
-To *propagate* a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
-To *convey* a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
-An interactive user interface displays *Appropriate Legal Notices* to
-the extent that it includes a convenient and prominently visible feature
-that
-
-1. displays an appropriate copyright notice, and
-2. tells the user that there is no warranty for the work (except to the
-   extent that warranties are provided), that licensees may convey the
-   work under this License, and how to view a copy of this License.
-
-If the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
-1. Source Code.
-~~~~~~~~~~~~~~~
-
-The *source code* for a work means the preferred form of the work for
-making modifications to it. *Object code* means any non-source form of a
-work.
-
-A *Standard Interface* means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that is
-widely used among developers working in that language.
-
-The *System Libraries* of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that Major
-Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A *Major
-Component*, in this context, means a major essential component (kernel,
-window system, and so on) of the specific operating system (if any) on
-which the executable work runs, or a compiler used to produce the work,
-or an object code interpreter used to run it.
-
-The *Corresponding Source* for a work in object code form means all the
-source code needed to generate, install, and (for an executable work)
-run the object code and to modify the work, including scripts to control
-those activities. However, it does not include the work's System
-Libraries, or general-purpose tools or generally available free programs
-which are used unmodified in performing those activities but which are
-not part of the work. For example, Corresponding Source includes
-interface definition files associated with source files for the work,
-and the source code for shared libraries and dynamically linked
-subprograms that the work is specifically designed to require, such as
-by intimate data communication or control flow between those subprograms
-and other parts of the work.
-
-The Corresponding Source need not include anything that users can
-regenerate automatically from other parts of the Corresponding Source.
-
-The Corresponding Source for a work in source code form is that same
-work.
-
-2. Basic Permissions.
-~~~~~~~~~~~~~~~~~~~~~
-
-All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
-You may make, run and propagate covered works that you do not convey,
-without conditions so long as your license otherwise remains in force.
-You may convey covered works to others for the sole purpose of having
-them make modifications exclusively for you, or provide you with
-facilities for running those works, provided that you comply with the
-terms of this License in conveying all material for which you do not
-control copyright. Those thus making or running the covered works for
-you must do so exclusively on your behalf, under your direction and
-control, on terms that prohibit them from making any copies of your
-copyrighted material outside their relationship with you.
-
-Conveying under any other circumstances is permitted solely under the
-conditions stated below. Sublicensing is not allowed; section 10 makes
-it unnecessary.
-
-3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article 11
-of the WIPO copyright treaty adopted on 20 December 1996, or similar
-laws prohibiting or restricting circumvention of such measures.
-
-When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to the
-covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
-4. Conveying Verbatim Copies.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice; keep
-intact all notices stating that this License and any non-permissive
-terms added in accord with section 7 apply to the code; keep intact all
-notices of the absence of any warranty; and give all recipients a copy
-of this License along with the Program.
-
-You may charge any price or no price for each copy that you convey, and
-you may offer support or warranty protection for a fee.
-
-5. Conveying Modified Source Versions.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the terms
-of section 4, provided that you also meet all of these conditions:
-
-- a) The work must carry prominent notices stating that you modified it,
-and giving a relevant date. - b) The work must carry prominent notices
-stating that it is released under this License and any conditions added
-under section 7. This requirement modifies the requirement in section 4
-to *keep intact all notices*. - c) You must license the entire work, as
-a whole, under this License to anyone who comes into possession of a
-copy. This License will therefore apply, along with any applicable
-section 7 additional terms, to the whole of the work, and all its parts,
-regardless of how they are packaged. This License gives no permission to
-license the work in any other way, but it does not invalidate such
-permission if you have separately received it. - d) If the work has
-interactive user interfaces, each must display Appropriate Legal
-Notices; however, if the Program has interactive interfaces that do not
-display Appropriate Legal Notices, your work need not make them do so.
-
-A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work, and
-which are not combined with it such as to form a larger program, in or
-on a volume of a storage or distribution medium, is called an
-*aggregate* if the compilation and its resulting copyright are not used
-to limit the access or legal rights of the compilation's users beyond
-what the individual works permit. Inclusion of a covered work in an
-aggregate does not cause this License to apply to the other parts of the
-aggregate.
-
-6. Conveying Non-Source Forms.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-You may convey a covered work in object code form under the terms of
-sections 4 and 5, provided that you also convey the machine-readable
-Corresponding Source under the terms of this License, in one of these
-ways:
-
-- a) Convey the object code in, or embodied in, a physical product
-(including a physical distribution medium), accompanied by the
-Corresponding Source fixed on a durable physical medium customarily used
-for software interchange. - b) Convey the object code in, or embodied
-in, a physical product (including a physical distribution medium),
-accompanied by a written offer, valid for at least three years and valid
-for as long as you offer spare parts or customer support for that
-product model, to give anyone who possesses the object code either
- 1. a copy of the Corresponding Source for all the software in the
-product that is covered by this License, on a durable physical medium
-customarily used for software interchange, for a price no more than your
-reasonable cost of physically performing this conveying of source, or 2.
-access to copy the Corresponding Source from a network server at no
-charge.
-
-- c) Convey individual copies of the object code with a copy of the
-written offer to provide the Corresponding Source. This alternative is
-allowed only occasionally and noncommercially, and only if you received
-the object code with such an offer, in accord with subsection 6b. - d)
-Convey the object code by offering access from a designated place
-(gratis or for a charge), and offer equivalent access to the
-Corresponding Source in the same way through the same place at no
-further charge. You need not require recipients to copy the
-Corresponding Source along with the object code. If the place to copy
-the object code is a network server, the Corresponding Source may be on
-a different server operated by you or a third party) that supports
-equivalent copying facilities, provided you maintain clear directions
-next to the object code saying where to find the Corresponding Source.
-Regardless of what server hosts the Corresponding Source, you remain
-obligated to ensure that it is available for as long as needed to
-satisfy these requirements. - e) Convey the object code using
-peer-to-peer transmission, provided you inform other peers where the
-object code and Corresponding Source of the work are being offered to
-the general public at no charge under subsection 6d.
-
-A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be included
-in conveying the object code work.
-
-A *User Product* is either
-
-1. a *consumer product*, which means any tangible personal property
-   which is normally used for personal, family, or household purposes,
-   or
-2. anything designed or sold for incorporation into a dwelling.
-
-In determining whether a product is a consumer product, doubtful cases
-shall be resolved in favor of coverage. For a particular product
-received by a particular user, *normally used* refers to a typical or
-common use of that class of product, regardless of the status of the
-particular user or of the way in which the particular user actually
-uses, or expects or is expected to use, the product. A product is a
-consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
-*Installation Information* for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product
-from a modified version of its Corresponding Source. The information
-must suffice to ensure that the continued functioning of the modified
-object code is in no case prevented or interfered with solely because
-modification has been made.
-
-If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied by
-the Installation Information. But this requirement does not apply if
-neither you nor any third party retains the ability to install modified
-object code on the User Product (for example, the work has been
-installed in ROM).
-
-The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
-Corresponding Source conveyed, and Installation Information provided, in
-accord with this section must be in a format that is publicly documented
-(and with an implementation available to the public in source code
-form), and must require no special password or key for unpacking,
-reading or copying.
-
-7. Additional Terms.
-~~~~~~~~~~~~~~~~~~~~
-
-*Additional permissions* are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by this
-License without regard to the additional permissions.
-
-When you convey a copy of a covered work, you may at your option remove
-any additional permissions from that copy, or from any part of it.
-(Additional permissions may be written to require their own removal in
-certain cases when you modify the work.) You may place additional
-permissions on material, added by you to a covered work, for which you
-have or can give appropriate copyright permission.
-
-Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders
-of that material) supplement the terms of this License with terms:
-
-a. Disclaiming warranty or limiting liability differently from the terms
-   of sections 15 and 16 of this License; or
-b. Requiring preservation of specified reasonable legal notices or
-   author attributions in that material or in the Appropriate Legal
-   Notices displayed by works containing it; or
-c. Prohibiting misrepresentation of the origin of that material, or
-   requiring that modified versions of such material be marked in
-   reasonable ways as different from the original version; or
-d. Limiting the use for publicity purposes of names of licensors or
-   authors of the material; or
-e. Declining to grant rights under trademark law for use of some trade
-   names, trademarks, or service marks; or
-f. Requiring indemnification of licensors and authors of that material
-   by anyone who conveys the material (or modified versions of it) with
-   contractual assumptions of liability to the recipient, for any
-   liability that these contractual assumptions directly impose on those
-   licensors and authors.
-
-All other non-permissive additional terms are considered *further
-restrictions* within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains a
-further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms of
-that license document, provided that the further restriction does not
-survive such relicensing or conveying.
-
-If you add terms to a covered work in accord with this section, you must
-place, in the relevant source files, a statement of the additional terms
-that apply to those files, or a notice indicating where to find the
-applicable terms.
-
-Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions; the above
-requirements apply either way.
-
-8. Termination.
-~~~~~~~~~~~~~~~
-
-You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
-However, if you cease all violation of this License, then your license
-from a particular copyright holder is reinstated
-
-a. provisionally, unless and until the copyright holder explicitly and
-   finally terminates your license, and
-b. permanently, if the copyright holder fails to notify you of the
-   violation by some reasonable means prior to 60 days after the
-   cessation.
-
-Moreover, your license from a particular copyright holder is reinstated
-permanently if the copyright holder notifies you of the violation by
-some reasonable means, this is the first time you have received notice
-of violation of this License (for any work) from that copyright holder,
-and you cure the violation prior to 30 days after your receipt of the
-notice.
-
-Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
-9. Acceptance Not Required for Having Copies.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-You are not required to accept this License in order to receive or run a
-copy of the Program. Ancillary propagation of a covered work occurring
-solely as a consequence of using peer-to-peer transmission to receive a
-copy likewise does not require acceptance. However, nothing other than
-this License grants you permission to propagate or modify any covered
-work. These actions infringe copyright if you do not accept this
-License. Therefore, by modifying or propagating a covered work, you
-indicate your acceptance of this License to do so.
-
-10. Automatic Licensing of Downstream Recipients.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
-An *entity transaction* is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered work
-results from an entity transaction, each party to that transaction who
-receives a copy of the work also receives whatever licenses to the work
-the party's predecessor in interest had or could give under the previous
-paragraph, plus a right to possession of the Corresponding Source of the
-work from the predecessor in interest, if the predecessor has it or can
-get it with reasonable efforts.
-
-You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may not
-impose a license fee, royalty, or other charge for exercise of rights
-granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that any
-patent claim is infringed by making, using, selling, offering for sale,
-or importing the Program or any portion of it.
-
-11. Patents.
-~~~~~~~~~~~~
-
-A *contributor* is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The work
-thus licensed is called the contributor's *contributor version*.
-
-A contributor's *essential patent claims* are all patent claims owned or
-controlled by the contributor, whether already acquired or hereafter
-acquired, that would be infringed by some manner, permitted by this
-License, of making, using, or selling its contributor version, but do
-not include claims that would be infringed only as a consequence of
-further modification of the contributor version. For purposes of this
-definition, *control* includes the right to grant patent sublicenses in
-a manner consistent with the requirements of this License.
-
-Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to make,
-use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
-In the following three paragraphs, a *patent license* is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To *grant* such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
-If you convey a covered work, knowingly relying on a patent license, and
-the Corresponding Source of the work is not available for anyone to
-copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either
-
-1. cause the Corresponding Source to be so available, or
-2. arrange to deprive yourself of the benefit of the patent license for
-   this particular work, or
-3. arrange, in a manner consistent with the requirements of this
-   License, to extend the patent license to downstream recipients.
-
-*Knowingly relying* means you have actual knowledge that, but for the
-patent license, your conveying the covered work in a country, or your
-recipient's use of the covered work in a country, would infringe one or
-more identifiable patents in that country that you have reason to
-believe are valid.
-
-If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify or
-convey a specific copy of the covered work, then the patent license you
-grant is automatically extended to all recipients of the covered work
-and works based on it.
-
-A patent license is *discriminatory* if it does not include within the
-scope of its coverage, prohibits the exercise of, or is conditioned on
-the non-exercise of one or more of the rights that are specifically
-granted under this License. You may not convey a covered work if you are
-a party to an arrangement with a third party that is in the business of
-distributing software, under which you make payment to the third party
-based on the extent of your activity of conveying the work, and under
-which the third party grants, to any of the parties who would receive
-the covered work from you, a discriminatory patent license
-
-a. in connection with copies of the covered work conveyed by you (or
-   copies made from those copies), or
-b. primarily for and in connection with specific products or
-   compilations that contain the covered work, unless you entered into
-   that arrangement, or that patent license was granted, prior to 28
-   March 2007.
-
-Nothing in this License shall be construed as excluding or limiting any
-implied license or other defenses to infringement that may otherwise be
-available to you under applicable patent law.
-
-12. No Surrender of Others' Freedom.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not convey it at all. For example, if you agree to terms that
-obligate you to collect a royalty for further conveying from those to
-whom you convey the Program, the only way you could satisfy both those
-terms and this License would be to refrain entirely from conveying the
-Program.
-
-13. Use with the GNU Affero General Public License.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Notwithstanding any other provision of this License, you have permission
-to link or combine any covered work with a work licensed under version 3
-of the GNU Affero General Public License into a single combined work,
-and to convey the resulting work. The terms of this License will
-continue to apply to the part which is the covered work, but the special
-requirements of the GNU Affero General Public License, section 13,
-concerning interaction through a network will apply to the combination
-as such.
-
-14. Revised Versions of this License.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Program
-specifies that a certain numbered version of the GNU General Public
-License *or any later version* applies to it, you have the option of
-following the terms and conditions either of that numbered version or of
-any later version published by the Free Software Foundation. If the
-Program does not specify a version number of the GNU General Public
-License, you may choose any version ever published by the Free Software
-Foundation.
-
-If the Program specifies that a proxy can decide which future versions
-of the GNU General Public License can be used, that proxy's public
-statement of acceptance of a version permanently authorizes you to
-choose that version for the Program.
-
-Later license versions may give you additional or different permissions.
-However, no additional obligations are imposed on any author or
-copyright holder as a result of your choosing to follow a later version.
-
-15. Disclaimer of Warranty.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM *AS IS* WITHOUT
-WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF
-THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-16. Limitation of Liability.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
-CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
-ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
-NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES
-SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE
-WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-17. Interpretation of Sections 15 and 16.
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-If the disclaimer of warranty and limitation of liability provided above
-cannot be given local legal effect according to their terms, reviewing
-courts shall apply local law that most closely approximates an absolute
-waiver of all civil liability in connection with the Program, unless a
-warranty or assumption of liability accompanies a copy of the Program in
-return for a fee.
-
-END OF TERMS AND CONDITIONS
----------------------------
-
-How to Apply These Terms to Your New Programs
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these
-terms.
-
-To do so, attach the following notices to the program. It is safest to
-attach them to the start of each source file to most effectively state
-the exclusion of warranty; and each file should have at least the
-*copyright* line and a pointer to where the full notice is found.
-
-::
-
-    <one line to give the program's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This program is free software: you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
-If the program does terminal interaction, make it output a short notice
-like this when it starts in an interactive mode:
-
-::
-
-    <program>  Copyright (C) <year>  <name of author>
-    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-    This is free software, and you are welcome to redistribute it
-    under certain conditions; type `show c' for details.
-
-The hypothetical commands ``show w`` and ``show c`` should show the
-appropriate parts of the General Public License. Of course, your
-program's commands might be different; for a GUI interface, you would
-use an *about box*.
-
-You should also get your employer (if you work as a programmer) or
-school, if any, to sign a *copyright disclaimer* for the program, if
-necessary. For more information on this, and how to apply and follow the
-GNU GPL, see
-`http://www.gnu.org/licenses/ <http://www.gnu.org/licenses/>`_.
-
-The GNU General Public License does not permit incorporating your
-program into proprietary programs. If your program is a subroutine
-library, you may consider it more useful to permit linking proprietary
-applications with the library. If this is what you want to do, use the
-GNU Lesser General Public License instead of this License. But first,
-please read
-`http://www.gnu.org/philosophy/why-not-lgpl.html <http://www.gnu.org/philosophy/why-not-lgpl.html>`_.
diff --git a/LICENSE.rst b/LICENSE.rst
new file mode 100644
index 0000000..2c47a5b
--- /dev/null
+++ b/LICENSE.rst
@@ -0,0 +1,45 @@
+lambda copyright
+================
+::
+
+  Copyright (c) 2013-2016, Hannes Hauswedell
+  All rights reserved.
+
+Lambda is *free software*: you can redistribute it and/or modify
+it under the terms of the GNU Affero General Public License as
+published by the Free Software Foundation, either version 3 of the
+License, or (at your option) any later version.
+
+Lambda is distributed in the hope that it will be useful,
+but **without any warranty**; without even the implied warranty of
+**merchantability** or **fitness for a particular purpose**.
+
+See the file `LICENSE-AGPL3.rst <./LICENSE-AGPL3.rst>`__ or
+http://www.gnu.org/licenses/ for a full text of the license and the
+rights and obligations implied.
+
+Some of the contributions to Lambda are alternatively or additionally
+::
+
+  Copyright (c) 2016, Knut Reinert and Freie Universität Berlin
+
+These are covered by the three clause BSD license as can be found in
+the file `LICENSE-BSD.rst <./LICENSE-BSD.rst>`__. In cases of doubt
+the terms of both licenses apply.
+
+submodules
+==========
+
+When Lambda is distributed in binary form or when Lambda is distributed
+in source form including its submodules the following additional
+license terms apply:
+
+SeqAn copyright
+---------------
+::
+
+  Copyright (c) 2006-2016, Knut Reinert and Freie Universität Berlin
+
+SeqAn is published under the terms of the three clause BSD license as can
+be found in the file `include/seqan/LICENSE <./include/seqan/LICENSE>`__
+or printed by the parameter ``--copyright``.
diff --git a/README.rst b/README.rst
index 3aab8a8..f319487 100644
--- a/README.rst
+++ b/README.rst
@@ -1,62 +1,89 @@
 Lambda: the Local Aligner for Massive Biological DatA
 -----------------------------------------------------
 
-.. image:: https://travis-ci.org/seqan/lambda.svg?branch=master
-    :alt: Travis CI build status
-    :target: https://travis-ci.org/seqan/lambda
+Lambda is a local aligner optimized for many query sequences and searches in protein space. It is...
 
-Lambda is a local aligner optimized for many query sequences and searches in protein space.
-It is compatible to BLAST, but much faster than BLAST and many other comparable tools.
+* highly compatible to BLAST (bitscore and e-value statistics, tab seperated and verbose output formats)
+* much faster than BLAST and many other comparable tools
+* supports many other input and output formats, including standards-conformant ``.sam`` and ``.bam`` and many compression types
 
-cite
-----------
-
-Please cite the following if you use Lambda anywhere in your academic work, also as part of pipelines
-or comparisons:
-
-*Lambda: the local aligner for massive biological data*;
-Hannes Hauswedell, Jochen Singer, Knut Reinert;
-`Bioinformatics 2014 30 (17): i349-i355 <http://bioinformatics.oxfordjournals.org/content/30/17/i349.abstract>`__;
-doi: 10.1093/bioinformatics/btu439
-
-download
+versions
 --------
 
-The latest version is available 
-`here <https://github.com/seqan/lambda/releases>`__. Versions prior to 0.9.0 are available 
-`here <https://github.com/h-2/seqan/releases>`__.
-
-Lambda is Free and open source software, so you can use it for any purpose, free of charge.
-However certain conditions apply when you (re-)distribute or modify Lambda, please respect the
-`license <./COPYING.rst>`__.
-
-You can also build lambda from source which will result in binaries optimized for your
-specific system (and thus faster). For instructions, please see the
-`wiki <https://github.com/seqan/lambda/wiki>`__.
-
-run
----
-
-Optionally mask the database:
++--------------------------------------------------------------------------+----------------+---------------------+----------------------------------------------------------------------+
+| Branch / Repository                                                      | Description    | Versions            | Build state                                                          |
++==========================================================================+================+=====================+======================================================================+
+| `master <https://github.com/seqan/lambda/tree/master>`__                 | stable         | ``0.9.* - 1.0.*``   | .. image:: https://travis-ci.org/seqan/lambda.svg?branch=master      |
+|                                                                          | (recommended)  |                     |    :alt: Travis CI build status                                      |
+|                                                                          |                |                     |    :target: https://travis-ci.org/seqan/lambda                       |
++--------------------------------------------------------------------------+----------------+---------------------+----------------------------------------------------------------------+
+| `lambda-next <https://github.com/seqan/lambda/tree/lambda-next>`__       | experimental   | ``1.9.* - 2.0.*``   | .. image:: https://travis-ci.org/seqan/lambda.svg?branch=lambda-next |
+|                                                                          |                |                     |    :alt: Travis CI build status                                      |
+|                                                                          |                |                     |    :target: https://travis-ci.org/seqan/lambda                       |
++--------------------------------------------------------------------------+----------------+---------------------+----------------------------------------------------------------------+
+| `old repo <https://github.com/h-2/seqan/tree/feature/lambda>`__          | initially      | ``0.4.*``           |                                                                      |
+|                                                                          | published      |                     |                                                                      |
++--------------------------------------------------------------------------+----------------+---------------------+----------------------------------------------------------------------+
+
+authorship and copyright
+------------------------
+
+Lambda is being developed by `Hannes Hauswedell <mailto:hannes.hauswedell@[molgen.mpg.de|fu-berlin.de]>`__, but it incorporates a lot of work from other members of the `SeqAn project <http://www.seqan.de>`__.
+
++------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+
+|  **Please always cite the publication, also if using Lambda in comparisons and pipelines**                                                                                                                                            |
++------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+
+| .. image:: https://raw.githubusercontent.com/seqan/lambda/gh-pages/images_readme/appbar.book.hardcover.open.png  | *Lambda: the local aligner for massive biological data*;                                                           |
+|    :alt: Please cite                                                                                             | Hannes Hauswedell, Jochen Singer, Knut Reinert;                                                                    |
+|    :target: http://bioinformatics.oxfordjournals.org/content/30/17/i349.abstract                                 | `Bioinformatics 2014 30 (17): i349-i355 <http://bioinformatics.oxfordjournals.org/content/30/17/i349.abstract>`__; |
+|    :width: 76px                                                                                                  | doi: 10.1093/bioinformatics/btu439                                                                                 |
++------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+
+| **Please respect the license of the software**                                                                                                                                                                                        |
++------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+
+| .. image:: https://raw.githubusercontent.com/seqan/lambda/gh-pages/images_readme/copyleft.png                    | Lambda is Free and open source software, so you can use it for any purpose, free of charge.                        |
+|    :alt: Respect the license                                                                                     | However certain conditions apply when you (re-)distribute and/or modify Lambda, please respect the                 |
+|    :target: https://github.com/seqan/lambda/blob/master/LICENSE.rst                                              | `license <https://github.com/seqan/lambda/blob/master/LICENSE.rst>`__.                                             |
+|    :width: 76px                                                                                                  |                                                                                                                    |
++------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+
+
+downloads and installation
+--------------------------
+
++------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+
+|  **Executables**                                                                                                                                                                                                                      |
++------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+
+| .. image:: https://raw.githubusercontent.com/seqan/lambda/gh-pages/images_readme/appbar.disk.download.png        | Pre-built executables for GNU/Linux, Mac and FreeBSD are available from the                                        |
+|    :alt: Download Executables                                                                                    | `releases page <https://github.com/seqan/lambda/releases>`__. If there is an ``_sse4`` package, try that first,    |
+|    :target: https://github.com/seqan/lambda/releases                                                             | it will be faster.                                                                                                 |
+|    :width: 76px                                                                                                  |                                                                                                                    |
++------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+
+|  **Source code**                                                                                                                                                                                                                      |
++------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+
+| .. image:: https://raw.githubusercontent.com/seqan/lambda/gh-pages/images_readme/appbar.column.three.png         | You can also build lambda from source which will result in binaries optimized for your                             |
+|    :alt: Build from source                                                                                       | specific system (and thus faster). For instructions, please see the                                                |
+|    :target: https://github.com/seqan/lambda/wiki                                                                 | `wiki <https://github.com/seqan/lambda/wiki>`__.                                                                   |
+|    :width: 76px                                                                                                  |                                                                                                                    |
++------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+
+
+usage instructions
+------------------
+
+
+Before you can search, you need to have an index. You can
+
+1. download and unzip a pre-built index from the `wiki <https://github.com/seqan/lambda/wiki>`__; or
+2. index one yourself (this can take some time but only has to be done once):
 
 ::
 
-    % /path/to/segmasker -infmt fasta -in db.fasta -outfmt interval -out db.seg
+    % bin/lambda_indexer -d db.fasta
 
-Run the indexer (or check the `wiki <https://github.com/seqan/lambda/wiki>`__ for pre-built indexes!):
-
-::
-
-    % bin/lambda_indexer -d db.fasta [-s db.seg]
-
-Run lambda:
+After that running Lambda is as simple as
 
 ::
 
     % bin/lambda -q query.fasta -d db.fasta
 
-*Please note that if you downloaded the binaries from the web-site, you might also have* ``bin/lambda-avx`` *which is
-measurably faster, so try that first!*
 
 For a list of options, see the help pages:
 
@@ -67,12 +94,24 @@ For a list of options, see the help pages:
 
 Or visit the Tuning-guide in the `wiki <https://github.com/seqan/lambda/wiki>`__.
 
-give feedback
--------------
-
-Please report bugs to the `bug-tracker <https://github.com/seqan/lambda/issues>`__.
-
-Any other questions or feedback you can send to 
-`Hannes Hauswedell <mailto:hannes.hauswedell@[molgen.mpg.de|fu-berlin.de]>`__.
-
-Thank you for using Lambda, we hope that it is useful to you!
\ No newline at end of file
+feedback & updates
+------------------
+
++-------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+
+| .. image:: https://raw.githubusercontent.com/seqan/lambda/gh-pages/images_readme/appbar.social.github.octocat.png | You can ask questions and report bugs on the `github tracker <https://github.com/seqan/lambda/issues>`__ .         |
+|    :alt: GitHub                                                                                                   | Please also `subscribe <https://github.com/seqan/lambda/subscription>`__ and/or star us!                           |
+|    :target: https://github.com/seqan/lambda/issues                                                                |                                                                                                                    |
+|    :width: 76px                                                                                                   |                                                                                                                    |
++-------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+
+| .. image:: https://raw.githubusercontent.com/seqan/lambda/gh-pages/images_readme/appbar.email.png                 | To stay up to date via e-mail, please subscribe to the                                                             |
+|    :alt: Newsletter                                                                                               | `newsletter <https://lists.fu-berlin.de/listinfo/lambda-users>`__. There is on average less than one e-mail        |
+|    :target: https://lists.fu-berlin.de/listinfo/lambda-users                                                      | per month.                                                                                                         |
+|    :width: 76px                                                                                                   |                                                                                                                    |
++-------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+
+| .. image:: https://raw.githubusercontent.com/seqan/lambda/gh-pages/images_readme/appbar.social.twitter.png        | You can also follow SeqAn on `twitter <https://twitter.com/SeqAnLib>`__ to receive updates on Lambda.              |
+|    :alt: Newsletter                                                                                               |                                                                                                                    |
+|    :target: https://twitter.com/SeqAnLib                                                                          |                                                                                                                    |
+|    :width: 76px                                                                                                   |                                                                                                                    |
++-------------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+
+
+*icons on this page by Austin Andrews / https://github.com/Templarian/WindowsIcons*
diff --git a/include/seqan/.travis.yml b/include/seqan/.travis.yml
deleted file mode 100644
index c823cdb..0000000
--- a/include/seqan/.travis.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-sudo: false
-language: cpp
-compiler:
-  - gcc-4.8
-  - clang
-cache:
-  apt: true
-install:
-  - if [ "$CC" == "gcc" ]; then export CXX=g++-4.8 CC=gcc-4.8; fi
-addons:
-  apt:
-    sources:
-      - ubuntu-toolchain-r-test
-    packages:
-      - cmake
-      - gcc-4.8
-      - g++-4.8
-      - clang
-      - zlib1g-dev
-      - libbz2-dev
-      - libboost-dev
-      - python
-      - python-nose
-      - python-jinja2
-      - python-pip
-before_script:
-  - export PATH=$HOME/.local/bin:$PATH
-  - pip install -r manual/requirements.txt --user `whoami`
-script:
-  ./util/travis/linux-cibuild.sh
diff --git a/include/seqan/util/cmake/CMakeFindJavaCommon.cmake b/include/seqan/util/cmake/CMakeFindJavaCommon.cmake
deleted file mode 100644
index 291d3c1..0000000
--- a/include/seqan/util/cmake/CMakeFindJavaCommon.cmake
+++ /dev/null
@@ -1,40 +0,0 @@
-#=============================================================================
-# Copyright 2013-2014 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-# Do not include this module directly from code outside CMake!
-set(_JAVA_HOME "")
-if(JAVA_HOME AND IS_DIRECTORY "${JAVA_HOME}")
-  set(_JAVA_HOME "${JAVA_HOME}")
-  set(_JAVA_HOME_EXPLICIT 1)
-else()
-  set(_ENV_JAVA_HOME "")
-  if(DEFINED ENV{JAVA_HOME})
-    file(TO_CMAKE_PATH "$ENV{JAVA_HOME}" _ENV_JAVA_HOME)
-  endif()
-  if(_ENV_JAVA_HOME AND IS_DIRECTORY "${_ENV_JAVA_HOME}")
-    set(_JAVA_HOME "${_ENV_JAVA_HOME}")
-    set(_JAVA_HOME_EXPLICIT 1)
-  else()
-    set(_CMD_JAVA_HOME "")
-    if(APPLE AND EXISTS /usr/libexec/java_home)
-      execute_process(COMMAND /usr/libexec/java_home
-        OUTPUT_VARIABLE _CMD_JAVA_HOME OUTPUT_STRIP_TRAILING_WHITESPACE)
-    endif()
-    if(_CMD_JAVA_HOME AND IS_DIRECTORY "${_CMD_JAVA_HOME}")
-      set(_JAVA_HOME "${_CMD_JAVA_HOME}")
-      set(_JAVA_HOME_EXPLICIT 0)
-    endif()
-    unset(_CMD_JAVA_HOME)
-  endif()
-  unset(_ENV_JAVA_HOME)
-endif()
diff --git a/include/seqan/util/cmake/CMakeMacroParseArguments.cmake b/include/seqan/util/cmake/CMakeMacroParseArguments.cmake
deleted file mode 100644
index 7ce4c49..0000000
--- a/include/seqan/util/cmake/CMakeMacroParseArguments.cmake
+++ /dev/null
@@ -1,138 +0,0 @@
-# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
-#
-# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for
-# parsing the arguments given to that macro or function.
-# It processes the arguments and defines a set of variables which hold the
-# values of the respective options.
-#
-# The <options> argument contains all options for the respective macro,
-# i.e. keywords which can be used when calling the macro without any value
-# following, like e.g. the OPTIONAL keyword of the install() command.
-#
-# The <one_value_keywords> argument contains all keywords for this macro
-# which are followed by one value, like e.g. DESTINATION keyword of the
-# install() command.
-#
-# The <multi_value_keywords> argument contains all keywords for this macro
-# which can be followed by more than one value, like e.g. the TARGETS or
-# FILES keywords of the install() command.
-#
-# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the
-# keywords listed in <options>, <one_value_keywords> and
-# <multi_value_keywords> a variable composed of the given <prefix>
-# followed by "_" and the name of the respective keyword.
-# These variables will then hold the respective value from the argument list.
-# For the <options> keywords this will be TRUE or FALSE.
-#
-# All remaining arguments are collected in a variable
-# <prefix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see whether
-# your macro was called with unrecognized parameters.
-#
-# As an example here a my_install() macro, which takes similar arguments as the
-# real install() command:
-#
-#   function(MY_INSTALL)
-#     set(options OPTIONAL FAST)
-#     set(oneValueArgs DESTINATION RENAME)
-#     set(multiValueArgs TARGETS CONFIGURATIONS)
-#     cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
-#     ...
-#
-# Assume my_install() has been called like this:
-#   my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
-#
-# After the cmake_parse_arguments() call the macro will have set the following
-# variables:
-#   MY_INSTALL_OPTIONAL = TRUE
-#   MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
-#   MY_INSTALL_DESTINATION = "bin"
-#   MY_INSTALL_RENAME = "" (was not used)
-#   MY_INSTALL_TARGETS = "foo;bar"
-#   MY_INSTALL_CONFIGURATIONS = "" (was not used)
-#   MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
-#
-# You can the continue and process these variables.
-#
-# Keywords terminate lists of values, e.g. if directly after a one_value_keyword
-# another recognized keyword follows, this is interpreted as the beginning of
-# the new option.
-# E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in
-# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would
-# be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor.
-
-#=============================================================================
-# Copyright 2010 Alexander Neundorf <neundorf at kde.org>
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-
-if(__CMAKE_PARSE_ARGUMENTS_INCLUDED)
-  return()
-endif()
-set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE)
-
-
-function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames)
-  # first set all result variables to empty/FALSE
-  foreach(arg_name ${_singleArgNames} ${_multiArgNames})
-    set(${prefix}_${arg_name})
-  endforeach(arg_name)
-
-  foreach(option ${_optionNames})
-    set(${prefix}_${option} FALSE)
-  endforeach(option)
-
-  set(${prefix}_UNPARSED_ARGUMENTS)
-
-  set(insideValues FALSE)
-  set(currentArgName)
-
-  # now iterate over all arguments and fill the result variables
-  foreach(currentArg ${ARGN})
-    list(FIND _optionNames "${currentArg}" optionIndex)  # ... then this marks the end of the arguments belonging to this keyword
-    list(FIND _singleArgNames "${currentArg}" singleArgIndex)  # ... then this marks the end of the arguments belonging to this keyword
-    list(FIND _multiArgNames "${currentArg}" multiArgIndex)  # ... then this marks the end of the arguments belonging to this keyword
-
-    if(${optionIndex} EQUAL -1  AND  ${singleArgIndex} EQUAL -1  AND  ${multiArgIndex} EQUAL -1)
-      if(insideValues)
-        if("${insideValues}" STREQUAL "SINGLE")
-          set(${prefix}_${currentArgName} ${currentArg})
-          set(insideValues FALSE)
-        elseif("${insideValues}" STREQUAL "MULTI")
-          list(APPEND ${prefix}_${currentArgName} ${currentArg})
-        endif()
-      else(insideValues)
-        list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
-      endif(insideValues)
-    else()
-      if(NOT ${optionIndex} EQUAL -1)
-        set(${prefix}_${currentArg} TRUE)
-        set(insideValues FALSE)
-      elseif(NOT ${singleArgIndex} EQUAL -1)
-        set(currentArgName ${currentArg})
-        set(${prefix}_${currentArgName})
-        set(insideValues "SINGLE")
-      elseif(NOT ${multiArgIndex} EQUAL -1)
-        set(currentArgName ${currentArg})
-        set(${prefix}_${currentArgName})
-        set(insideValues "MULTI")
-      endif()
-    endif()
-
-  endforeach(currentArg)
-
-  # propagate the result variables to the caller:
-  foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
-    set(${prefix}_${arg_name}  ${${prefix}_${arg_name}} PARENT_SCOPE)
-  endforeach(arg_name)
-  set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
-
-endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs)
diff --git a/include/seqan/util/cmake/CTestConfig.cmake b/include/seqan/util/cmake/CTestConfig.cmake
deleted file mode 100644
index 20b7d8d..0000000
--- a/include/seqan/util/cmake/CTestConfig.cmake
+++ /dev/null
@@ -1,13 +0,0 @@
-## This file should be placed in the root directory of your project.
-## Then modify the CMakeLists.txt file in the root directory of your
-## project to incorporate the testing dashboard.
-## # The following are required to uses Dart and the Cdash dashboard
-##   ENABLE_TESTING()
-##   INCLUDE(CTest)
-set(CTEST_PROJECT_NAME "SeqAn")
-set(CTEST_NIGHTLY_START_TIME "23:00:00 UTC")
-
-set(CTEST_DROP_METHOD "http")
-set(CTEST_DROP_SITE "cdash.seqan.de")
-set(CTEST_DROP_LOCATION "/submit.php?project=SeqAn")
-set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/include/seqan/util/cmake/FeatureSummary.cmake b/include/seqan/util/cmake/FeatureSummary.cmake
deleted file mode 100644
index 9e650d6..0000000
--- a/include/seqan/util/cmake/FeatureSummary.cmake
+++ /dev/null
@@ -1,117 +0,0 @@
-# Print missing optional dependencies and consequently missing SeqAn features.
-#
-# We have two main cases.  First, if all libraries were found, we print a
-# message indicating that.  In the second case, we print a more highlighted
-# message to warn the user.
-
-message("")
-message("==============================================================================")
-message("                            SeqAn Features")
-message("==============================================================================")
-message("")
-if (ZLIB_FOUND AND BZIP2_FOUND AND Boost_FOUND AND OPENMP_FOUND)
-    message("ALL dependencies were found and the SeqAn build system has SUCCESSFULLY")
-    message("configured your build files or IDE project files.  ALL functionality has")
-    message("been enabled.")
-else ()
-    message("The SeqAn build system has SUCCESSFULLY configured your build files or IDE")
-    message("project files.  Most features of SeqAn depend only on core C/C++ features and")
-    message("are available on any platform.  However, some functionality is only enabled")
-    message("with external libraries installed.  The following report shows you which of")
-    message("these OPTIONAL features are disabled on your system.  Also, it gives you")
-    message("some hints on what to do to enable the features.")
-endif ()
-message("")
-if (ZLIB_FOUND)
-    message("ZLIB       - FOUND")
-else (ZLIB_FOUND)
-    message("ZLIB       - NOT FOUND")
-    message("")
-    message("  zlib is a library for file compression (powering the ubiquitous .gz files,")
-    message("  for example.  Reading/writing zlib-compressed streams depends on zlib,")
-    message("  especially does support for BAM files.  For Linux systems, zlib is available")
-    message("  in all distribution's package repositoryies, make sure to also install the")
-    message("  developer files.  For Mac Os X, zlib should be installed together with the")
-    message("  XCode Tools.  For Windows, we have prepared a ZIP archive with common")
-    message("  binaries, available together with installation instructions here:")
-    message("")
-    message("    http://trac.seqan.de/wiki/HowTo/InstallContribsWindows")
-    message("")
-    message("  The following functionality has been disabled:")
-    message("")
-    message("    * Reading/writing of gzip and BGZF files (Stream<GZFile>, Stream<BGZF>).")
-    message("    * Reading/writing of BAM files.")
-    message("")
-endif (ZLIB_FOUND)
-if (BZIP2_FOUND)
-    message("BZIP2      - FOUND")
-else (BZIP2_FOUND)
-    message("BZIP2      - NOT FOUND")
-    message("")
-    message("  bzlib is a library for compression (powering .bz2 files).  The compression")
-    message("  ratio is better than with zlib/gzip but compression and decompression are")
-    message("  slower.  For Linux, libbz2 is available in all distribution's package")
-    message("  repositories, make sure to also install the developer files.  For Mac Os X,")
-    message("  bzlib should be installed together with the XCode Tools.  For Windows, we")
-    message("  have prepared a ZIP archive with common binaries, including bzlib, available")
-    message("  together with installation instructions here:")
-    message("")
-    message("    http://trac.seqan.de/wiki/HowTo/InstallContribsWindows")
-    message("")
-    message("  The following functionality has been disabled:")
-    message("")
-    message("   * Reading/writing of bz2 files (Stream<BZ2Stream>).")
-    message("")
-endif (BZIP2_FOUND)
-if (OPENMP_FOUND)
-    message("OPENMP     - FOUND")
-else (OPENMP_FOUND)
-    message("OPENMP     - NOT FOUND")
-    message("")
-    message("  OpenMP is a C/C++ language extension for parallel programming.  It provides")
-    message("  C pragmas that allow parallelization-related annotations of the program code")
-    message("  and a run time library.  No functionality is disabled but the parallel")
-    message("  versions of algorithms will not be available.  Also, some applications will")
-    message("  not be built with OpenMP missing (see messages above).")
-    message("")
-    message("  OpenMP is available in the GCC C++/MinGW and Microsoft Visual C++ compilers.")
-    message("  LLVM/Clang currently does not have support for OpenMP.")
-    message("")
-endif (OPENMP_FOUND)
-if (Boost_FOUND)
-    message("BOOST      - FOUND")
-else (Boost_FOUND)
-    message("BOOST      - NOT FOUND")
-    message("")
-    message("  Boost the largest C++ template library.  Because of its size, we chose not")
-    message("  to depend on Boost for core library functionality.  However, some")
-    message("  applications depend on Boost, e.g. for the math/statistics Boost libraries.")
-    message("  These applications will appear in your build and project files (as indicated")
-    message("  above).")
-    message("")
-endif (Boost_FOUND)
-message("")
-message("Build Type - ${CMAKE_BUILD_TYPE}")
-message("")
-if (CMAKE_BUILD_TYPE STREQUAL "Debug")
-message("             Programs will be built in DEBUG mode.  Debug symbols and")
-message("             assertions will be enabled.  The code is compiled with DISABLED")
-message("             OPTIMIZATIONS")
-message("")
-message("                  /!\\ DEBUG mode will result in BAD PERFORMANCE /!\\")
-message("")
-message("             For PRODUCTION USAGE, you should compile in Release mode. To")
-message("             enable the release mode, pass -DCMAKE_BUILD_TYPE=Release to the")
-message("             cmake call.")
-elseif (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
-message("             Programs will be built in RELEASE WITH DEBUG SYMBOLS mode.")
-message("             Debug symbols and optimizations are enabled, assertions are only")
-message("             enabled for the tests.")
-elseif (CMAKE_BUILD_TYPE STREQUAL "Release")
-message("             Programs will be built in RELEASE mode. Optimizations are")
-message("             enabled, debug symbols are disabled, and assertions are only")
-message("             enabled for the tests.")
-endif ()
-message("")
-message("==============================================================================")
-message("")
diff --git a/include/seqan/util/cmake/FindBZip2.cmake b/include/seqan/util/cmake/FindBZip2.cmake
deleted file mode 100644
index d42771d..0000000
--- a/include/seqan/util/cmake/FindBZip2.cmake
+++ /dev/null
@@ -1,61 +0,0 @@
-# - Try to find BZip2
-# Once done this will define
-#
-#  BZIP2_FOUND - system has BZip2
-#  BZIP2_INCLUDE_DIR - the BZip2 include directory
-#  BZIP2_LIBRARIES - Link these to use BZip2
-#  BZIP2_NEED_PREFIX - this is set if the functions are prefixed with BZ2_
-
-#=============================================================================
-# Copyright 2006-2009 Kitware, Inc.
-# Copyright 2006 Alexander Neundorf <neundorf at kde.org>
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-# This is based on the original FindZLIB.cmake file from the CMake
-# distribution.  However, we also look for zlib_d.lib etc. such
-# that we can have both debug and release builds.  Furthermore,
-# we also look for libbz2.lib since that's the name of the bz2 library
-# on windows and the lib is not automatically inferred as on Unices.
-
-FIND_PATH(BZIP2_INCLUDE_DIR bzlib.h)
-
-if (MSVC)
-	FIND_LIBRARY(BZIP2_LIBRARY   NAMES libbz2 bz2 bzip2)
-	FIND_LIBRARY(BZIP2_LIBRARY_D NAMES libbz2_d bz2_d bzip2_d)
-else (MSVC)
-    FIND_LIBRARY(BZIP2_LIBRARY   NAMES libbz2 bz2 bzip2 PATH_SUFFIXES "" lib lib32)
-    FIND_LIBRARY(BZIP2_LIBRARY_D NAMES libbz2_d bz2_d bzip2_d PATH_SUFFIXES "" lib lib32)
-endif (MSVC)
-
-mark_as_advanced(BZIP_LIBRARY BZIP_LIBRARY_D)
-
-# handle the QUIETLY and REQUIRED arguments and set BZip2_FOUND to TRUE if 
-# all listed variables are TRUE
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(BZip2 DEFAULT_MSG BZIP2_LIBRARY BZIP2_INCLUDE_DIR)
-
-IF (BZIP2_FOUND)
-    #message(STATUS "BZip2 libraries found at ${BZIP2_LIBRARY} ${BZIP2_LIBRARY_D}")
-    INCLUDE(CheckLibraryExists)
-    CHECK_LIBRARY_EXISTS(${BZIP2_LIBRARY} BZ2_bzCompressInit "" BZIP2_NEED_PREFIX)
-	IF (MSVC)
-		SET(BZIP2_LIBRARIES debug ${BZIP2_LIBRARY_D} optimized ${BZIP2_LIBRARY})
-	ELSE (MSVC)
-		SET(BZIP2_LIBRARIES ${BZIP2_LIBRARY})
-	ENDIF (MSVC)
-ELSE (BZIP2_FOUND)
-	message(STATUS "BZip2 libraries could not be found!")
-ENDIF (BZIP2_FOUND)
-
-
-MARK_AS_ADVANCED(BZIP2_INCLUDE_DIR BZIP2_LIBRARIES)
-
diff --git a/include/seqan/util/cmake/FindCXX11.cmake b/include/seqan/util/cmake/FindCXX11.cmake
deleted file mode 100644
index b0b0b95..0000000
--- a/include/seqan/util/cmake/FindCXX11.cmake
+++ /dev/null
@@ -1,39 +0,0 @@
-if(__FIND_CXX11_CMAKE__)
-  return()
-endif()
-set(__FIND_CXX11_CMAKE__ TRUE)
-
-# Visual Studio 2008 (vs9) doesn't seem to support C++11 directly (only as TR1)
-if (MSVC AND MSVC_VERSION GREATER 1500)
-  set(CXX11_FOUND 1)
-  # Visual Studio 2010 (vs10) doesn't support C++11 STL.
-  if (MSVC_VERSION GREATER 1600)
-    set(CXX11_STL_FOUND 1)
-  endif (MSVC_VERSION GREATER 1600)
-  return ()
-endif (MSVC AND MSVC_VERSION GREATER 1500)
-
-include(CheckCXXCompilerFlag)
-enable_language(CXX)
-
-check_cxx_compiler_flag("-std=c++11" CXX11_FOUND)
-if (CXX11_FOUND)
-  set (CXX11_CXX_FLAGS "-std=c++11")
-
-  # Tested on Mac OS X 10.8.2 with XCode 4.6 Command Line Tools
-  # Clang requires this to find the correct c++11 headers
-  if (CMAKE_HOST_APPLE AND (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
-     set (CXX11_CXX_FLAGS "${CXX11_CXX_FLAGS} -stdlib=libc++ -Qunused-arguments")
-  endif (CMAKE_HOST_APPLE AND (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
-
-else (CXX11_FOUND)
-
-  check_cxx_compiler_flag("-std=c++0x" CXX11_FOUND)
-  if (CXX11_FOUND)
-    set (CXX11_CXX_FLAGS "-std=c++0x")
-  endif (CXX11_FOUND)
-
-endif (CXX11_FOUND)
-
-# By default, C++11 compiler support implies the C++11 STL.
-set(CXX11_STL_FOUND ${CXX11_FOUND})
diff --git a/include/seqan/util/cmake/FindCXX14.cmake b/include/seqan/util/cmake/FindCXX14.cmake
deleted file mode 100644
index bd9221a..0000000
--- a/include/seqan/util/cmake/FindCXX14.cmake
+++ /dev/null
@@ -1,29 +0,0 @@
-if(__FIND_CXX14_CMAKE__)
-    return()
-endif()
-set(__FIND_CXX14_CMAKE__ TRUE)
-
-# make sure that c++11 detection happens first, so that the c++11-flag
-# doesn't overwrite the c++14 flag
-find_package(CXX11)
-
-# Visual Studio is still far away from C++14 (maybe add 2015 or 2015+1 later)
-# so no checks for this now
-
-include(CheckCXXCompilerFlag)
-enable_language(CXX)
-
-check_cxx_compiler_flag("-std=c++14" CXX14_FOUND)
-if (CXX14_FOUND)
-    set (CXX11_CXX_FLAGS "-std=c++14")
-else (CXX14_FOUND)
-    check_cxx_compiler_flag("-std=c++1y" CXX14_FOUND)
-    if (CXX14_FOUND)
-        set (CXX11_CXX_FLAGS "-std=c++1y")
-    endif (CXX14_FOUND)
-endif (CXX14_FOUND)
-
-# c++14 implies c++11
-if (CXX14_FOUND)
-    set (CXX11_FOUND TRUE)
-endif (CXX14_FOUND)
diff --git a/include/seqan/util/cmake/FindGitInfo.cmake b/include/seqan/util/cmake/FindGitInfo.cmake
deleted file mode 100644
index 0b61253..0000000
--- a/include/seqan/util/cmake/FindGitInfo.cmake
+++ /dev/null
@@ -1,64 +0,0 @@
-# ============================================================================
-#                  SeqAn - The Library for Sequence Analysis
-# ============================================================================
-# Copyright (c) 2006-2013, Knut Reinert, FU Berlin
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above copyright
-#       notice, this list of conditions and the following disclaimer in the
-#       documentation and/or other materials provided with the distribution.
-#     * Neither the name of Knut Reinert or the FU Berlin nor the names of
-#       its contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-# ============================================================================
-#
-# This CMake module will try to find git information. You can use  it the same
-# way you would use any other CMake module.
-#
-#   find_package(GitInfo [REQUIRED] ...)
-#
-# If the Git package is found, the macro
-#  GIT_WC_INFO(<dir> <var-prefix>)
-# is defined to extract information of a git working copy at a given location.
-#
-# The macro defines the following variables:
-#  <var-prefix>_WC_REVISION - Hash of last commit
-#  <var-prefix>_WC_LAST_CHANGED_DATE - Date of last commit
-#
-# ============================================================================
-
-find_package (Git QUIET)
-
-if (GIT_FOUND)
-
-  macro(GIT_WC_INFO dir prefix)
-    execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --verify -q --short=7 HEAD
-      WORKING_DIRECTORY ${dir}
-      ERROR_QUIET
-      OUTPUT_VARIABLE ${prefix}_WC_REVISION
-      OUTPUT_STRIP_TRAILING_WHITESPACE)
-    execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --simplify-by-decoration --pretty=%ai
-      WORKING_DIRECTORY ${dir}
-      ERROR_QUIET
-      OUTPUT_VARIABLE ${prefix}_WC_LAST_CHANGED_DATE
-      OUTPUT_STRIP_TRAILING_WHITESPACE)
-  endmacro(GIT_WC_INFO)
-
-endif()
diff --git a/include/seqan/util/cmake/FindJava.cmake b/include/seqan/util/cmake/FindJava.cmake
deleted file mode 100644
index ae5a69c..0000000
--- a/include/seqan/util/cmake/FindJava.cmake
+++ /dev/null
@@ -1,228 +0,0 @@
-#.rst:
-# FindJava
-# --------
-#
-# Find Java
-#
-# This module finds if Java is installed and determines where the
-# include files and libraries are.  The caller may set variable JAVA_HOME
-# to specify a Java installation prefix explicitly.
-#
-# This module sets the following result variables:
-#
-# ::
-#
-#   Java_JAVA_EXECUTABLE    = the full path to the Java runtime
-#   Java_JAVAC_EXECUTABLE   = the full path to the Java compiler
-#   Java_JAVAH_EXECUTABLE   = the full path to the Java header generator
-#   Java_JAVADOC_EXECUTABLE = the full path to the Java documention generator
-#   Java_JAR_EXECUTABLE     = the full path to the Java archiver
-#   Java_VERSION_STRING     = Version of java found, eg. 1.6.0_12
-#   Java_VERSION_MAJOR      = The major version of the package found.
-#   Java_VERSION_MINOR      = The minor version of the package found.
-#   Java_VERSION_PATCH      = The patch version of the package found.
-#   Java_VERSION_TWEAK      = The tweak version of the package found (after '_')
-#   Java_VERSION            = This is set to: $major.$minor.$patch(.$tweak)
-#
-#
-#
-# The minimum required version of Java can be specified using the
-# standard CMake syntax, e.g.  find_package(Java 1.5)
-#
-# NOTE: ${Java_VERSION} and ${Java_VERSION_STRING} are not guaranteed to
-# be identical.  For example some java version may return:
-# Java_VERSION_STRING = 1.5.0_17 and Java_VERSION = 1.5.0.17
-#
-# another example is the Java OEM, with: Java_VERSION_STRING = 1.6.0-oem
-# and Java_VERSION = 1.6.0
-#
-# For these components the following variables are set:
-#
-# ::
-#
-#   Java_FOUND                    - TRUE if all components are found.
-#   Java_INCLUDE_DIRS             - Full paths to all include dirs.
-#   Java_LIBRARIES                - Full paths to all libraries.
-#   Java_<component>_FOUND        - TRUE if <component> is found.
-#
-#
-#
-# Example Usages:
-#
-# ::
-#
-#   find_package(Java)
-#   find_package(Java COMPONENTS Runtime)
-#   find_package(Java COMPONENTS Development)
-
-#=============================================================================
-# Copyright 2002-2009 Kitware, Inc.
-# Copyright 2009-2011 Mathieu Malaterre <mathieu.malaterre at gmail.com>
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-include(${CMAKE_CURRENT_LIST_DIR}/CMakeFindJavaCommon.cmake)
-
-# The HINTS option should only be used for values computed from the system.
-set(_JAVA_HINTS)
-if(_JAVA_HOME)
-  list(APPEND _JAVA_HINTS ${_JAVA_HOME}/bin)
-endif()
-list(APPEND _JAVA_HINTS
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\2.0;JavaHome]/bin"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.9;JavaHome]/bin"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.8;JavaHome]/bin"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.7;JavaHome]/bin"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.6;JavaHome]/bin"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.5;JavaHome]/bin"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.4;JavaHome]/bin"
-  "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.3;JavaHome]/bin"
-  )
-# Hard-coded guesses should still go in PATHS. This ensures that the user
-# environment can always override hard guesses.
-set(_JAVA_PATHS
-  /usr/lib/java/bin
-  /usr/share/java/bin
-  /usr/local/java/bin
-  /usr/local/java/share/bin
-  /usr/java/j2sdk1.4.2_04
-  /usr/lib/j2sdk1.4-sun/bin
-  /usr/java/j2sdk1.4.2_09/bin
-  /usr/lib/j2sdk1.5-sun/bin
-  /opt/sun-jdk-1.5.0.04/bin
-  /usr/local/jdk-1.7.0/bin
-  /usr/local/jdk-1.6.0/bin
-  )
-find_program(Java_JAVA_EXECUTABLE
-  NAMES java
-  HINTS ${_JAVA_HINTS}
-  PATHS ${_JAVA_PATHS}
-)
-
-if(Java_JAVA_EXECUTABLE)
-    execute_process(COMMAND ${Java_JAVA_EXECUTABLE} -version
-      RESULT_VARIABLE res
-      OUTPUT_VARIABLE var
-      ERROR_VARIABLE var # sun-java output to stderr
-      OUTPUT_STRIP_TRAILING_WHITESPACE
-      ERROR_STRIP_TRAILING_WHITESPACE)
-    if( res )
-      if(var MATCHES "No Java runtime present, requesting install")
-        set_property(CACHE Java_JAVA_EXECUTABLE
-          PROPERTY VALUE "Java_JAVA_EXECUTABLE-NOTFOUND")
-      elseif(${Java_FIND_REQUIRED})
-        message( FATAL_ERROR "Error executing java -version" )
-      else()
-        message( STATUS "Warning, could not run java -version")
-      endif()
-    else()
-      # extract major/minor version and patch level from "java -version" output
-      # Tested on linux using
-      # 1. Sun / Sun OEM
-      # 2. OpenJDK 1.6
-      # 3. GCJ 1.5
-      # 4. Kaffe 1.4.2
-      # 5. OpenJDK 1.7.x on OpenBSD
-      if(var MATCHES "java version \"([0-9]+\\.[0-9]+\\.[0-9_.]+.*)\"")
-        # This is most likely Sun / OpenJDK, or maybe GCJ-java compat layer
-        set(Java_VERSION_STRING "${CMAKE_MATCH_1}")
-      elseif(var MATCHES "java full version \"kaffe-([0-9]+\\.[0-9]+\\.[0-9_]+)\"")
-        # Kaffe style
-        set(Java_VERSION_STRING "${CMAKE_MATCH_1}")
-      elseif(var MATCHES "openjdk version \"([0-9]+\\.[0-9]+\\.[0-9_]+.*)\"")
-        # OpenJDK ver 1.7.x on OpenBSD
-        set(Java_VERSION_STRING "${CMAKE_MATCH_1}")
-      else()
-        if(NOT Java_FIND_QUIETLY)
-          message(WARNING "regex not supported: ${var}. Please report")
-        endif()
-      endif()
-      string( REGEX REPLACE "([0-9]+).*" "\\1" Java_VERSION_MAJOR "${Java_VERSION_STRING}" )
-      string( REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_MINOR "${Java_VERSION_STRING}" )
-      string( REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" Java_VERSION_PATCH "${Java_VERSION_STRING}" )
-      # warning tweak version can be empty:
-      string( REGEX REPLACE "[0-9]+\\.[0-9]+\\.[0-9]+[_\\.]?([0-9]*).*$" "\\1" Java_VERSION_TWEAK "${Java_VERSION_STRING}" )
-      if( Java_VERSION_TWEAK STREQUAL "" ) # check case where tweak is not defined
-        set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH})
-      else()
-        set(Java_VERSION ${Java_VERSION_MAJOR}.${Java_VERSION_MINOR}.${Java_VERSION_PATCH}.${Java_VERSION_TWEAK})
-      endif()
-    endif()
-
-endif()
-
-
-find_program(Java_JAR_EXECUTABLE
-  NAMES jar
-  HINTS ${_JAVA_HINTS}
-  PATHS ${_JAVA_PATHS}
-)
-
-find_program(Java_JAVAC_EXECUTABLE
-  NAMES javac
-  HINTS ${_JAVA_HINTS}
-  PATHS ${_JAVA_PATHS}
-)
-
-find_program(Java_JAVAH_EXECUTABLE
-  NAMES javah
-  HINTS ${_JAVA_HINTS}
-  PATHS ${_JAVA_PATHS}
-)
-
-find_program(Java_JAVADOC_EXECUTABLE
-  NAMES javadoc
-  HINTS ${_JAVA_HINTS}
-  PATHS ${_JAVA_PATHS}
-)
-
-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-if(Java_FIND_COMPONENTS)
-  foreach(component ${Java_FIND_COMPONENTS})
-    # User just want to execute some Java byte-compiled
-    if(component STREQUAL "Runtime")
-      find_package_handle_standard_args(Java
-        REQUIRED_VARS Java_JAVA_EXECUTABLE
-        VERSION_VAR Java_VERSION
-        )
-    elseif(component STREQUAL "Development")
-      find_package_handle_standard_args(Java
-        REQUIRED_VARS Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE
-                      Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE
-        VERSION_VAR Java_VERSION
-        )
-    else()
-      message(FATAL_ERROR "Comp: ${component} is not handled")
-    endif()
-    set(Java_${component}_FOUND TRUE)
-  endforeach()
-else()
-  # Check for everything
-  find_package_handle_standard_args(Java
-    REQUIRED_VARS Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE
-                  Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE
-    VERSION_VAR Java_VERSION
-    )
-endif()
-
-
-mark_as_advanced(
-  Java_JAVA_EXECUTABLE
-  Java_JAR_EXECUTABLE
-  Java_JAVAC_EXECUTABLE
-  Java_JAVAH_EXECUTABLE
-  Java_JAVADOC_EXECUTABLE
-  )
-
-# LEGACY
-set(JAVA_RUNTIME ${Java_JAVA_EXECUTABLE})
-set(JAVA_ARCHIVE ${Java_JAR_EXECUTABLE})
-set(JAVA_COMPILE ${Java_JAVAC_EXECUTABLE})
diff --git a/include/seqan/util/cmake/FindOpenCL.cmake b/include/seqan/util/cmake/FindOpenCL.cmake
deleted file mode 100755
index f7f7c19..0000000
--- a/include/seqan/util/cmake/FindOpenCL.cmake
+++ /dev/null
@@ -1,79 +0,0 @@
-# - Try to find OpenCL
-# This module tries to find an OpenCL implementation on your system. It supports
-# AMD / ATI, Apple and NVIDIA implementations, but shoudl work, too.
-#
-# Once done this will define
-#  OPENCL_FOUND        - system has OpenCL
-#  OPENCL_INCLUDE_DIRS  - the OpenCL include directory
-#  OPENCL_LIBRARIES    - link these to use OpenCL
-#
-# WIN32 should work, but is untested
-
-FIND_PACKAGE( PackageHandleStandardArgs )
-
-SET (OPENCL_VERSION_STRING "0.1.0")
-SET (OPENCL_VERSION_MAJOR 0)
-SET (OPENCL_VERSION_MINOR 1)
-SET (OPENCL_VERSION_PATCH 0)
-
-IF (APPLE)
-
-  FIND_LIBRARY(OPENCL_LIBRARIES OpenCL DOC "OpenCL lib for OSX")
-  FIND_PATH(OPENCL_INCLUDE_DIRS OpenCL/cl.h DOC "Include for OpenCL on OSX")
-  FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS OpenCL/cl.hpp DOC "Include for OpenCL CPP bindings on OSX")
-
-ELSE (APPLE)
-
-	IF (WIN32)
-	
-	    FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h)
-	    FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp)
-	
-	    # The AMD SDK currently installs both x86 and x86_64 libraries
-	    # This is only a hack to find out architecture
-	    IF( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" )
-	    	SET(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86_64")
-	    ELSE (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64")
-	    	SET(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86")
-	    ENDIF( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" )
-	    FIND_LIBRARY(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR})
-	    
-	    GET_FILENAME_COMPONENT(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE)
-	    
-	    # On Win32 search relative to the library
-	    FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h PATHS "${_OPENCL_INC_CAND}")
-	    FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS "${_OPENCL_INC_CAND}")
-	
-	ELSE (WIN32)
-
-            # Unix style platforms
-            FIND_LIBRARY(OPENCL_LIBRARIES OpenCL
-              ENV LD_LIBRARY_PATH
-            )
-
-            GET_FILENAME_COMPONENT(OPENCL_LIB_DIR ${OPENCL_LIBRARIES} PATH)
-            GET_FILENAME_COMPONENT(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE)
-
-            # The AMD SDK currently does not place its headers
-            # in /usr/include, therefore also search relative
-            # to the library
-            FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h PATHS ${_OPENCL_INC_CAND})
-            FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS ${_OPENCL_INC_CAND})
-
-	ENDIF (WIN32)
-
-ENDIF (APPLE)
-
-FIND_PACKAGE_HANDLE_STANDARD_ARGS( OpenCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS )
-
-IF( _OPENCL_CPP_INCLUDE_DIRS )
-	SET( OPENCL_HAS_CPP_BINDINGS TRUE )
-	LIST( APPEND OPENCL_INCLUDE_DIRS ${_OPENCL_CPP_INCLUDE_DIRS} )
-	# This is often the same, so clean up
-	LIST( REMOVE_DUPLICATES OPENCL_INCLUDE_DIRS )
-ENDIF( _OPENCL_CPP_INCLUDE_DIRS )
-
-MARK_AS_ADVANCED(
-  OPENCL_INCLUDE_DIRS
-)
-
diff --git a/include/seqan/util/cmake/FindOpenMP.cmake b/include/seqan/util/cmake/FindOpenMP.cmake
deleted file mode 100644
index 3c0e8e2..0000000
--- a/include/seqan/util/cmake/FindOpenMP.cmake
+++ /dev/null
@@ -1,137 +0,0 @@
-# Updated FindOpenMP file such that the failure of finding OpenMP is cached.
-
-# - Finds OpenMP support
-# This module can be used to detect OpenMP support in a compiler.
-# If the compiler supports OpenMP, the flags required to compile with
-# openmp support are set.  
-#
-# The following variables are set:
-#   OpenMP_C_FLAGS - flags to add to the C compiler for OpenMP support
-#   OpenMP_CXX_FLAGS - flags to add to the CXX compiler for OpenMP support
-#   OPENMP_FOUND - true if openmp is detected
-#
-# Supported compilers can be found at http://openmp.org/wp/openmp-compilers/
-
-#=============================================================================
-# Copyright 2009 Kitware, Inc.
-# Copyright 2008-2009 André Rigland Brodtkorb <Andre.Brodtkorb at ifi.uio.no>
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-if (NOT CMAKE_CURRENT_LIST_DIR)  # CMAKE_CURRENT_LIST_DIR only from cmake 2.8.3.
-  get_filename_component(CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
-endif (NOT CMAKE_CURRENT_LIST_DIR)
-
-# Do not try to find OpenMP if we know that it cannot be found.
-if (_OPENMP_NOT_FOUND)
-    return ()
-endif ()
-
-# Clang-3.7.0 deactivated because of compiler bugs triggered by SeqAn
-if (COMPILER_IS_CLANG AND (_GCC_VERSION EQUAL 370))
-    set(_OPENMP_NOT_FOUND TRUE)
-    message (STATUS "OpenMP cannot be used becase Clang-3.7.0 has a bug. Please update your clang!")
-    return ()
-endif ()
-
-include(CheckCSourceCompiles)
-include(CheckCXXSourceCompiles)
-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-
-set(OpenMP_C_FLAG_CANDIDATES
-  #Gnu & LLVM
-  "-fopenmp"
-  #Microsoft Visual Studio
-  "/openmp"
-  #Intel windows
-  "-Qopenmp" 
-  #Intel
-  "-openmp" 
-  #Empty, if compiler automatically accepts openmp
-  " "
-  #Sun
-  "-xopenmp"
-  #HP
-  "+Oopenmp"
-  #IBM XL C/c++
-  "-qsmp"
-  #Portland Group
-  "-mp"
-)
-set(OpenMP_CXX_FLAG_CANDIDATES ${OpenMP_C_FLAG_CANDIDATES})
-
-# sample openmp source code to test
-set(OpenMP_C_TEST_SOURCE 
-"
-#include <omp.h>
-int main() { 
-#ifdef _OPENMP
-  return 0; 
-#else
-  breaks_on_purpose
-#endif
-}
-")
-# use the same source for CXX as C for now
-set(OpenMP_CXX_TEST_SOURCE ${OpenMP_C_TEST_SOURCE})
-# if these are set then do not try to find them again,
-# by avoiding any try_compiles for the flags
-if(DEFINED OpenMP_C_FLAGS AND DEFINED OpenMP_CXX_FLAGS)
-  set(OpenMP_C_FLAG_CANDIDATES)
-  set(OpenMP_CXX_FLAG_CANDIDATES)
-endif(DEFINED OpenMP_C_FLAGS AND DEFINED OpenMP_CXX_FLAGS)
-
-# check c compiler
-foreach(FLAG ${OpenMP_C_FLAG_CANDIDATES})
-  set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
-  set(CMAKE_REQUIRED_FLAGS "${FLAG}")
-  unset(OpenMP_FLAG_DETECTED CACHE)
-  message(STATUS "Try OpenMP C flag = [${FLAG}]")
-  check_c_source_compiles("${OpenMP_CXX_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
-  set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
-  if(OpenMP_FLAG_DETECTED)
-    set(OpenMP_C_FLAGS_INTERNAL "${FLAG}")
-    break()
-  endif(OpenMP_FLAG_DETECTED) 
-endforeach(FLAG ${OpenMP_C_FLAG_CANDIDATES})
-
-# check cxx compiler
-foreach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES})
-  set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
-  set(CMAKE_REQUIRED_FLAGS "${FLAG}")
-  unset(OpenMP_FLAG_DETECTED CACHE)
-  message(STATUS "Try OpenMP CXX flag = [${FLAG}]")
-  check_cxx_source_compiles("${OpenMP_C_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
-  set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
-  if(OpenMP_FLAG_DETECTED)
-    set(OpenMP_CXX_FLAGS_INTERNAL "${FLAG}")
-    break()
-  endif(OpenMP_FLAG_DETECTED)
-endforeach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES})
-
-set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS_INTERNAL}"
-  CACHE STRING "C compiler flags for OpenMP parallization")
-
-set(OpenMP_CXX_FLAGS "${OpenMP_CXX_FLAGS_INTERNAL}"
-  CACHE STRING "C++ compiler flags for OpenMP parallization")
-# handle the standard arguments for find_package
-find_package_handle_standard_args(OpenMP DEFAULT_MSG 
-  OpenMP_C_FLAGS OpenMP_CXX_FLAGS )
-
-mark_as_advanced(
-  OpenMP_C_FLAGS
-  OpenMP_CXX_FLAGS
-)
-
-if (NOT OPENMP_FOUND)
-    set (OPENMP_NOT_FOUND TRUE CACHE INTERNAL
-        "Set such that OpenMP is not searched for more than once.")
-endif ()
diff --git a/include/seqan/util/cmake/FindPackageHandleStandardArgs.cmake b/include/seqan/util/cmake/FindPackageHandleStandardArgs.cmake
deleted file mode 100644
index 229df4e..0000000
--- a/include/seqan/util/cmake/FindPackageHandleStandardArgs.cmake
+++ /dev/null
@@ -1,261 +0,0 @@
-# FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> ... )
-#
-# This function is intended to be used in FindXXX.cmake modules files.
-# It handles the REQUIRED, QUIET and version-related arguments to FIND_PACKAGE().
-# It also sets the <UPPERCASED_NAME>_FOUND variable.
-# The package is considered found if all variables <var1>... listed contain
-# valid results, e.g. valid filepaths.
-#
-# There are two modes of this function. The first argument in both modes is
-# the name of the Find-module where it is called (in original casing).
-#
-# The first simple mode looks like this:
-#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(<name> (DEFAULT_MSG|"Custom failure message") <var1>...<varN> )
-# If the variables <var1> to <varN> are all valid, then <UPPERCASED_NAME>_FOUND
-# will be set to TRUE.
-# If DEFAULT_MSG is given as second argument, then the function will generate
-# itself useful success and error messages. You can also supply a custom error message
-# for the failure case. This is not recommended.
-#
-# The second mode is more powerful and also supports version checking:
-#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [REQUIRED_VARS <var1>...<varN>]
-#                                           [VERSION_VAR   <versionvar>
-#                                           [CONFIG_MODE]
-#                                           [FAIL_MESSAGE "Custom failure message"] )
-#
-# As above, if <var1> through <varN> are all valid, <UPPERCASED_NAME>_FOUND
-# will be set to TRUE.
-# After REQUIRED_VARS the variables which are required for this package are listed.
-# Following VERSION_VAR the name of the variable can be specified which holds
-# the version of the package which has been found. If this is done, this version
-# will be checked against the (potentially) specified required version used
-# in the find_package() call. The EXACT keyword is also handled. The default
-# messages include information about the required version and the version
-# which has been actually found, both if the version is ok or not.
-# Use the option CONFIG_MODE if your FindXXX.cmake module is a wrapper for
-# a find_package(... NO_MODULE) call, in this case all the information
-# provided by the config-mode of find_package() will be evaluated
-# automatically.
-# Via FAIL_MESSAGE a custom failure message can be specified, if this is not
-# used, the default message will be displayed.
-#
-# Example for mode 1:
-#
-#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2  DEFAULT_MSG  LIBXML2_LIBRARY LIBXML2_INCLUDE_DIR)
-#
-# LibXml2 is considered to be found, if both LIBXML2_LIBRARY and
-# LIBXML2_INCLUDE_DIR are valid. Then also LIBXML2_FOUND is set to TRUE.
-# If it is not found and REQUIRED was used, it fails with FATAL_ERROR,
-# independent whether QUIET was used or not.
-# If it is found, success will be reported, including the content of <var1>.
-# On repeated Cmake runs, the same message won't be printed again.
-#
-# Example for mode 2:
-#
-#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON  REQUIRED_VARS BISON_EXECUTABLE
-#                                             VERSION_VAR BISON_VERSION)
-# In this case, BISON is considered to be found if the variable(s) listed
-# after REQUIRED_VAR are all valid, i.e. BISON_EXECUTABLE in this case.
-# Also the version of BISON will be checked by using the version contained
-# in BISON_VERSION.
-# Since no FAIL_MESSAGE is given, the default messages will be printed.
-#
-# Another example for mode 2:
-#
-#    FIND_PACKAGE(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
-#    FIND_PACKAGE_HANDLE_STANDARD_ARGS(Automoc4  CONFIG_MODE)
-# In this case, FindAutmoc4.cmake wraps a call to FIND_PACKAGE(Automoc4 NO_MODULE)
-# and adds an additional search directory for automoc4.
-# The following FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper
-# success/error message.
-
-#=============================================================================
-# Copyright 2007-2009 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-INCLUDE(FindPackageMessage)
-#INCLUDE(CMakeParseArguments)
-INCLUDE(CMakeMacroParseArguments)
-
-# internal helper macro
-MACRO(_FPHSA_FAILURE_MESSAGE _msg)
-  IF (${_NAME}_FIND_REQUIRED)
-    MESSAGE(FATAL_ERROR "${_msg}")
-  ELSE (${_NAME}_FIND_REQUIRED)
-    IF (NOT ${_NAME}_FIND_QUIETLY)
-      MESSAGE(STATUS "${_msg}")
-    ENDIF (NOT ${_NAME}_FIND_QUIETLY)
-  ENDIF (${_NAME}_FIND_REQUIRED)
-ENDMACRO(_FPHSA_FAILURE_MESSAGE _msg)
-
-
-# internal helper macro to generate the failure message when used in CONFIG_MODE:
-MACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
-  # <name>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found:
-  IF(${_NAME}_CONFIG)
-    _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})")
-  ELSE(${_NAME}_CONFIG)
-    # If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version.
-    # List them all in the error message:
-    IF(${_NAME}_CONSIDERED_CONFIGS)
-      SET(configsText "")
-      LIST(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
-      MATH(EXPR configsCount "${configsCount} - 1")
-      FOREACH(currentConfigIndex RANGE ${configsCount})
-        LIST(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
-        LIST(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
-        SET(configsText "${configsText}    ${filename} (version ${version})\n")
-      ENDFOREACH(currentConfigIndex)
-      _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
-
-    ELSE(${_NAME}_CONSIDERED_CONFIGS)
-      # Simple case: No Config-file was found at all:
-      _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}")
-    ENDIF(${_NAME}_CONSIDERED_CONFIGS)
-  ENDIF(${_NAME}_CONFIG)
-ENDMACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
-
-
-FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
-
-# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in
-# new extended or in the "old" mode:
-  SET(options CONFIG_MODE)
-  SET(oneValueArgs FAIL_MESSAGE VERSION_VAR)
-  SET(multiValueArgs REQUIRED_VARS)
-  SET(_KEYWORDS_FOR_EXTENDED_MODE  ${options} ${oneValueArgs} ${multiValueArgs} )
-  LIST(FIND _KEYWORDS_FOR_EXTENDED_MODE "${_FIRST_ARG}" INDEX)
-
-  IF(${INDEX} EQUAL -1)
-    SET(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
-    SET(FPHSA_REQUIRED_VARS ${ARGN})
-    SET(FPHSA_VERSION_VAR)
-  ELSE(${INDEX} EQUAL -1)
-
-    CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}"  ${_FIRST_ARG} ${ARGN})
-
-    IF(FPHSA_UNPARSED_ARGUMENTS)
-      MESSAGE(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
-    ENDIF(FPHSA_UNPARSED_ARGUMENTS)
-
-    IF(NOT FPHSA_FAIL_MESSAGE)
-      SET(FPHSA_FAIL_MESSAGE  "DEFAULT_MSG")
-    ENDIF(NOT FPHSA_FAIL_MESSAGE)
-  ENDIF(${INDEX} EQUAL -1)
-
-# now that we collected all arguments, process them
-
-  IF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
-    SET(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
-  ENDIF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
-
-  # In config-mode, we rely on the variable <package>_CONFIG, which is set by find_package()
-  # when it successfully found the config-file, including version checking:
-  IF(FPHSA_CONFIG_MODE)
-    LIST(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
-    LIST(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
-    SET(FPHSA_VERSION_VAR ${_NAME}_VERSION)
-  ENDIF(FPHSA_CONFIG_MODE)
-
-  IF(NOT FPHSA_REQUIRED_VARS)
-    MESSAGE(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
-  ENDIF(NOT FPHSA_REQUIRED_VARS)
-
-  LIST(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
-
-  STRING(TOUPPER ${_NAME} _NAME_UPPER)
-  STRING(TOLOWER ${_NAME} _NAME_LOWER)
-
-  # collect all variables which were not found, so they can be printed, so the
-  # user knows better what went wrong (#6375)
-  SET(MISSING_VARS "")
-  SET(DETAILS "")
-  SET(${_NAME_UPPER}_FOUND TRUE)
-  # check if all passed variables are valid
-  FOREACH(_CURRENT_VAR ${FPHSA_REQUIRED_VARS})
-    IF(NOT ${_CURRENT_VAR})
-      SET(${_NAME_UPPER}_FOUND FALSE)
-      SET(MISSING_VARS "${MISSING_VARS} ${_CURRENT_VAR}")
-    ELSE(NOT ${_CURRENT_VAR})
-      SET(DETAILS "${DETAILS}[${${_CURRENT_VAR}}]")
-    ENDIF(NOT ${_CURRENT_VAR})
-  ENDFOREACH(_CURRENT_VAR)
-
-
-  # version handling:
-  SET(VERSION_MSG "")
-  SET(VERSION_OK TRUE)
-  SET(VERSION ${${FPHSA_VERSION_VAR}} )
-  IF (${_NAME}_FIND_VERSION)
-
-    IF(VERSION)
-
-      IF(${_NAME}_FIND_VERSION_EXACT)       # exact version required
-        IF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
-          SET(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
-          SET(VERSION_OK FALSE)
-        ELSE (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
-          SET(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
-        ENDIF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
-
-      ELSE(${_NAME}_FIND_VERSION_EXACT)     # minimum version specified:
-        IF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
-          SET(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
-          SET(VERSION_OK FALSE)
-        ELSE ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
-          SET(VERSION_MSG "(found suitable version \"${VERSION}\", required is \"${${_NAME}_FIND_VERSION}\")")
-        ENDIF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
-      ENDIF(${_NAME}_FIND_VERSION_EXACT)
-
-    ELSE(VERSION)
-
-      # if the package was not found, but a version was given, add that to the output:
-      IF(${_NAME}_FIND_VERSION_EXACT)
-         SET(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
-      ELSE(${_NAME}_FIND_VERSION_EXACT)
-         SET(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
-      ENDIF(${_NAME}_FIND_VERSION_EXACT)
-
-    ENDIF(VERSION)
-  ELSE (${_NAME}_FIND_VERSION)
-    IF(VERSION)
-      SET(VERSION_MSG "(found version \"${VERSION}\")")
-    ENDIF(VERSION)
-  ENDIF (${_NAME}_FIND_VERSION)
-
-  IF(VERSION_OK)
-    SET(DETAILS "${DETAILS}[v${VERSION}(${${_NAME}_FIND_VERSION})]")
-  ELSE(VERSION_OK)
-    SET(${_NAME_UPPER}_FOUND FALSE)
-  ENDIF(VERSION_OK)
-
-
-  # print the result:
-  IF (${_NAME_UPPER}_FOUND)
-    FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG}" "${DETAILS}")
-  ELSE (${_NAME_UPPER}_FOUND)
-
-    IF(FPHSA_CONFIG_MODE)
-      _FPHSA_HANDLE_FAILURE_CONFIG_MODE()
-    ELSE(FPHSA_CONFIG_MODE)
-      IF(NOT VERSION_OK)
-        _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
-      ELSE(NOT VERSION_OK)
-        _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
-      ENDIF(NOT VERSION_OK)
-    ENDIF(FPHSA_CONFIG_MODE)
-
-  ENDIF (${_NAME_UPPER}_FOUND)
-
-  SET(${_NAME_UPPER}_FOUND ${${_NAME_UPPER}_FOUND} PARENT_SCOPE)
-
-ENDFUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _FIRST_ARG)
diff --git a/include/seqan/util/cmake/FindSeqAn.cmake b/include/seqan/util/cmake/FindSeqAn.cmake
deleted file mode 100644
index 7302d64..0000000
--- a/include/seqan/util/cmake/FindSeqAn.cmake
+++ /dev/null
@@ -1,480 +0,0 @@
-# ============================================================================
-#                  SeqAn - The Library for Sequence Analysis
-# ============================================================================
-# Copyright (c) 2006-2012, Knut Reinert, FU Berlin
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above copyright
-#       notice, this list of conditions and the following disclaimer in the
-#       documentation and/or other materials provided with the distribution.
-#     * Neither the name of Knut Reinert or the FU Berlin nor the names of
-#       its contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-# ============================================================================
-#
-# This CMake module will try to find SeqAn and its dependencies.  You can use
-# it the same way you would use any other CMake module.
-#
-#   find_package(SeqAn [REQUIRED] ...)
-#
-# You can control the exact behaviour by setting the following variables.  The
-# defaults are given after the variable name.
-#
-#   SEQAN_FIND_DEPENDENCIES   -- DEFAULT
-#   SEQAN_FIND_ENABLE_TESTING -- TRUE if ${CMAKE_BUILD_TYPE} == "Debug", FALSE
-#                                otherwise.
-#
-# For example:
-#
-#   set (SEQAN_FIND_DEPENDENCIES ZLIB BZip2)
-#   find_package (SeqAn)
-#
-# The first variable is either "ALL", "DEFAULT" or a list of dependency names
-# and gives the names of the dependencies to search for.  The other two
-# variables can be used to forcibly enabling/disabling the debug and testing
-# mode.
-#
-# Valid dependencies are:
-#
-#   ALL     -- Forcibly enable all dependencies.
-#   DEFAULT -- Enable default dependencies (zlib, OpenMP if available)
-#   NONE    -- Disable all dependencies.
-#
-#   ZLIB    -- zlib compression library
-#   BZip2   -- libbz2 compression library
-#   OpenMP  -- OpenMP language extensions to C/C++
-#   CUDA    -- CUDA language extensions to C/C++
-#
-#
-# Once the search has been performed, the following variables will be set.
-#
-#  SEQAN_FOUND           -- Indicate whether SeqAn was found.
-#
-# These variables are flags that indicate whether the various dependencies
-# of the SeqAn library were found.
-#
-#  SEQAN_HAS_ZLIB
-#  SEQAN_HAS_BZIP2
-#  SEQAN_HAS_OPENMP
-#  SEQAN_HAS_CUDA
-#
-# These variables give lists that are to be passed to the
-# include_directories(), target_link_libraries(), and add_definitions()
-# functions.
-#
-#  SEQAN_INCLUDE_DIRS
-#  SEQAN_LIBRARIES
-#  SEQAN_DEFINITIONS
-#
-# Additionally, the following two variables are set.  The first contains
-# the include paths for SeqAn, the second for dependencies.  This allows to
-# include the dependency headers using include_directories (SYSTEM ...),
-# such that warnings from these headers do not appear in the nightly builds.
-#
-#  SEQAN_INCLUDE_DIRS_MAIN
-#  SEQAN_INCLUDE_DIRS_DEPS
-#
-# The C++ compiler flags to set.
-#
-#  SEQAN_CXX_FLAGS
-#
-# The following variables give the version of the SeqAn library, its
-# major, minor, and the patch version part of the version string.
-#
-#  SEQAN_VERSION_STRING
-#  SEQAN_VERSION_MAJOR
-#  SEQAN_VERSION_MINOR
-#  SEQAN_VERSION_PATCH
-#
-# ============================================================================
-
-include(FindPackageMessage)
-include(CheckIncludeFiles)
-
-# ----------------------------------------------------------------------------
-# Define Constants.
-# ----------------------------------------------------------------------------
-
-set(_SEQAN_DEFAULT_LIBRARIES ZLIB OpenMP)
-set(_SEQAN_ALL_LIBRARIES     ZLIB BZip2 OpenMP CUDA)
-
-# ----------------------------------------------------------------------------
-# Set variables SEQAN_FIND_* to their default unless they have been set.
-# ----------------------------------------------------------------------------
-
-# SEQAN_FIND_DEPENDENCIES
-if (NOT SEQAN_FIND_DEPENDENCIES)
-  set(SEQAN_FIND_DEPENDENCIES "DEFAULT")
-endif ()
-if (SEQAN_FIND_DEPENDENCIES STREQUAL "DEFAULT")
-  set(SEQAN_FIND_DEPENDENCIES ${_SEQAN_DEFAULT_LIBRARIES})
-elseif (SEQAN_FIND_DEPENDENCIES STREQUAL "ALL")
-  set(SEQAN_FIND_DEPENDENCIES ${_SEQAN_ALL_LIBRARIES})
-elseif (SEQAN_FIND_DEPENDENCIES STREQUAL "NONE")
-  set(SEQAN_FIND_DEPENDENCIES)
-endif ()
-
-# SEQAN_FIND_ENABLE_TESTING
-if (NOT SEQAN_FIND_ENABLE_TESTING)
-  set(SEQAN_FIND_ENABLE_TESTING "FALSE")
-endif ()
-
-# ----------------------------------------------------------------------------
-# Compile-specific settings and workarounds around missing CMake features.
-# ----------------------------------------------------------------------------
-
-# Recognize Clang compiler.
-
-set (COMPILER_IS_CLANG FALSE)
-if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-  set (COMPILER_IS_CLANG TRUE)
-endif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-
-# Fix CMAKE_COMPILER_IS_GNUCXX for MinGW.
-
-if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
-  set (CMAKE_COMPILER_IS_GNUCXX TRUE)
-endif (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
-
-# Intel
-set (COMPILER_IS_INTEL FALSE)
-if (CMAKE_CXX_COMPILER_ID MATCHES "Intel")
-  set (COMPILER_IS_INTEL TRUE)
-endif (CMAKE_CXX_COMPILER_ID MATCHES "Intel")
-
-# GCC Setup
-
-if (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG OR COMPILER_IS_INTEL)
-  # Tune warnings for GCC.
-  set (CMAKE_CXX_WARNING_LEVEL 4)
-  # NOTE: First location to set SEQAN_CXX_FLAGS at the moment.  If you write
-  # to the variable for the first time earlier, update this line to append to
-  # the variable instead of overwriting.
-  set (SEQAN_CXX_FLAGS "-W -Wall -Wno-long-long -fstrict-aliasing -Wstrict-aliasing")
-  set (SEQAN_DEFINITIONS ${SEQAN_DEFINITIONS} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64)
-
-  # Determine GCC version.
-  EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
-               ARGS --version
-               OUTPUT_VARIABLE __GCC_VERSION)
-  # Remove all but first line.
-  STRING(REGEX REPLACE "([^\n]+).*" "\\1" __GCC_VERSION ${__GCC_VERSION})
-  # Find out version (3 or 2 components).
-  STRING(REGEX REPLACE ".*([0-9])\\.([0-9])\\.([0-9]).*" "\\1\\2\\3"
-         __GCC_VERSION ${__GCC_VERSION})
-  STRING(REGEX REPLACE ".*([0-9])\\.([0-9]).*" "\\1\\20"
-         _GCC_VERSION ${__GCC_VERSION})
-
-  # Add -Wno-longlong if the GCC version is < 4.0.0.  Add -pedantic flag but
-  # disable warnings for variadic macros with GCC >= 4.0.0.  Earlier versions
-  # warn because of anonymous variadic macros in pedantic mode but do not have
-  # a flag to disable these warnings.
-  if (400 GREATER _GCC_VERSION)
-    set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} -Wno-long-long")
-  else (400 GREATER _GCC_VERSION)
-    set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} -pedantic -Wno-variadic-macros")
-  endif (400 GREATER _GCC_VERSION)
-  
-  # Force GCC to keep the frame pointer when debugging is enabled.  This is
-  # mainly important for 64 bit but does not get into the way on 32 bit either
-  # at minimal performance impact.
-  if (CMAKE_BUILD_TYPE STREQUAL Debug)
-    set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} ${SEQAN_CXX_FLAGS_DEBUG} -fno-omit-frame-pointer")
-  elseif (CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
-    set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} ${SEQAN_CXX_FLAGS_RELEASE} -g -fno-omit-frame-pointer")
-  endif ()
-
-  # disable some warnings on ICC
-  if (COMPILER_IS_INTEL)
-    set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} -wd3373,2102")
-  endif (COMPILER_IS_INTEL)
-endif ()
-
-# Windows Setup
-
-if (WIN32)
-  # Always set NOMINMAX such that <Windows.h> does not define min/max as
-  # macros.
-  set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} -DNOMINMAX")
-endif (WIN32)
-
-# Visual Studio Setup
-if (MSVC)
-  # Enable intrinics (e.g. _interlockedIncrease)
-  set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} /EHsc /Oi")
-  # Warning level 3 for MSVC is disabled for now to see how much really bad warnings there are.
-  #set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} /W3)
-
-  # TODO(holtgrew): This rather belongs into the SeqAn build system and notso much into FindSeqAn.cmake.
-
-  # Force to always compile with W2.
-  # Use the /W2 warning level for visual studio.
-  SET(CMAKE_CXX_WARNING_LEVEL 2)
-  if (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
-    STRING (REGEX REPLACE "/W[0-4]"
-            "/W2" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
-  else (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
-    set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} /W2")
-  endif (CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
-
-  # Disable warnings about unsecure (although standard) functions.
-  set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} /D_SCL_SECURE_NO_WARNINGS")
-endif (MSVC)
-
-# ----------------------------------------------------------------------------
-# Search for directory seqan.
-# ----------------------------------------------------------------------------
-
-option (SEQAN_USE_SEQAN_BUILD_SYSTEM "Whether or not to expect the SeqAn build system." OFF)
-
-if (SEQAN_USE_SEQAN_BUILD_SYSTEM)
-  # When using the SeqAn build system, we scan all entries in
-  # CMAKE_INCLUDE_PATH for a subdirectory seqan and add all paths to the
-  # variable SEQAN_INCLUDE_DIRS_MAIN.
-  set (_SEQAN_INCLUDE_DIRS "")
-  foreach (_SEQAN_BASEDIR ${CMAKE_INCLUDE_PATH})
-    if (EXISTS ${_SEQAN_BASEDIR}/seqan)
-      get_filename_component(_SEQAN_BASEDIR "${_SEQAN_BASEDIR}" ABSOLUTE)
-      set(_SEQAN_INCLUDE_DIRS ${_SEQAN_INCLUDE_DIRS} ${_SEQAN_BASEDIR})
-    endif (EXISTS ${_SEQAN_BASEDIR}/seqan)
-  endforeach (_SEQAN_BASEDIR ${CMAKE_INCLUDE_PATH})
-
-  if (_SEQAN_INCLUDE_DIRS)
-    set(SEQAN_FOUND        TRUE)
-    set(SEQAN_INCLUDE_DIRS_MAIN ${SEQAN_INCLUDE_DIRS_MAIN} ${_SEQAN_INCLUDE_DIRS})
-  else (_SEQAN_INCLUDE_DIRS)
-    set(SEQAN_FOUND        FALSE)
-  endif (_SEQAN_INCLUDE_DIRS)
-else (SEQAN_USE_SEQAN_BUILD_SYSTEM)
-  # When NOT using the SeqAn build system then we only look for one directory
-  # with subdirectory seqan and thus only one library.
-  find_path(_SEQAN_BASEDIR "seqan"
-            PATHS ${SEQAN_INCLUDE_PATH} ENV SEQAN_INCLUDE_PATH
-            NO_DEFAULT_PATH)
-
-  if (NOT _SEQAN_BASEDIR)
-    find_path(_SEQAN_BASEDIR "seqan")
-  endif()
-
-  mark_as_advanced(_SEQAN_BASEDIR)
-
-  if (_SEQAN_BASEDIR)
-    set(SEQAN_FOUND        TRUE)
-    set(SEQAN_INCLUDE_DIRS_MAIN ${SEQAN_INCLUDE_DIRS_MAIN} ${_SEQAN_BASEDIR})
-  else ()
-    set(SEQAN_FOUND        FALSE)
-  endif ()
-endif (SEQAN_USE_SEQAN_BUILD_SYSTEM)
-
-# ----------------------------------------------------------------------------
-# Set defines for debug and testing.
-# ----------------------------------------------------------------------------
-
-if (SEQAN_FIND_ENABLE_TESTING)
-  set(SEQAN_DEFINITIONS ${SEQAN_DEFINITIONS} -DSEQAN_ENABLE_TESTING=1)
-else ()
-  set(SEQAN_DEFINITIONS ${SEQAN_DEFINITIONS} -DSEQAN_ENABLE_TESTING=0)
-endif ()
-
-# ----------------------------------------------------------------------------
-# Search for dependencies.
-# ----------------------------------------------------------------------------
-
-# librt, libpthread -- implicit, on Linux only
-
-if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
-  set (SEQAN_LIBRARIES ${SEQAN_LIBRARIES} rt pthread)
-elseif (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
-  set (SEQAN_LIBRARIES ${SEQAN_LIBRARIES} pthread)
-  set (SEQAN_DEFINITIONS ${SEQAN_DEFINITIONS} "-D_GLIBCXX_USE_C99=1")
-endif ()
-
-# libexecinfo -- implicit
-
-check_include_files(execinfo.h _SEQAN_HAVE_EXECINFO)
-mark_as_advanced(_SEQAN_HAVE_EXECINFO)
-if (_SEQAN_HAVE_EXECINFO)
-  set(SEQAN_DEFINITIONS ${SEQAN_DEFINITIONS} "-DSEQAN_HAS_EXECINFO=1")
-  if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
-    set (SEQAN_LIBRARIES ${SEQAN_LIBRARIES} execinfo elf)
-  endif (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
-endif (_SEQAN_HAVE_EXECINFO)
-
-
-# libstdc++ -- implicit, Mac only (clang seems not to do this automatically)
-
-if (APPLE)
-  set (SEQAN_LIBRARIES ${SEQAN_LIBRARIES} stdc++)
-endif (APPLE)
-
-# always use libc++ with clang
-# if (COMPILER_IS_CLANG)
-#     set(SEQAN_DEFINITIONS ${SEQAN_DEFINITIONS} "-stdlib=libc++")
-# endif()
-
-# ZLIB
-
-list(FIND SEQAN_FIND_DEPENDENCIES "ZLIB" _SEQAN_FIND_ZLIB)
-mark_as_advanced(_SEQAN_FIND_ZLIB)
-
-set (SEQAN_HAS_ZLIB FALSE)
-if (NOT _SEQAN_FIND_ZLIB EQUAL -1)
-  find_package(ZLIB QUIET)
-  if (ZLIB_FOUND)
-    set (SEQAN_HAS_ZLIB     TRUE)
-    set (SEQAN_LIBRARIES         ${SEQAN_LIBRARIES}         ${ZLIB_LIBRARIES})
-    set (SEQAN_INCLUDE_DIRS_DEPS ${SEQAN_INCLUDE_DIRS_DEPS} ${ZLIB_INCLUDE_DIRS})
-    set (SEQAN_DEFINITIONS       ${SEQAN_DEFINITIONS}       "-DSEQAN_HAS_ZLIB=1")
-  endif ()
-endif ()
-
-# BZip2
-
-list(FIND SEQAN_FIND_DEPENDENCIES "BZip2" _SEQAN_FIND_BZIP2)
-mark_as_advanced(_SEQAN_FIND_BZIP2)
-
-set (SEQAN_HAS_BZIP2 FALSE)
-if (NOT _SEQAN_FIND_BZIP2 EQUAL -1)
-  find_package(BZip2 QUIET)
-  if (BZIP2_FOUND)
-    set (SEQAN_HAS_BZIP2    TRUE)
-    set (SEQAN_LIBRARIES         ${SEQAN_LIBRARIES}         ${BZIP2_LIBRARIES})
-    set (SEQAN_INCLUDE_DIRS_DEPS ${SEQAN_INCLUDE_DIRS_DEPS} ${BZIP2_INCLUDE_DIRS})
-    set (SEQAN_DEFINITIONS       ${SEQAN_DEFINITIONS}       "-DSEQAN_HAS_BZIP2=1")
-  endif ()
-endif()
-
-# OpenMP
-
-list(FIND SEQAN_FIND_DEPENDENCIES "OpenMP" _SEQAN_FIND_OPENMP)
-mark_as_advanced(_SEQAN_FIND_OPENMP)
-
-set (SEQAN_HAS_OPENMP FALSE)
-if (NOT _SEQAN_FIND_OPENMP EQUAL -1)
-  find_package(OpenMP QUIET)
-  # Note that in the following, we do not check for OPENMP_FOUND since this is
-  # only true if both C and C++ compiler support OpenMP.  This is not the case
-  # if the user has a compiler without OpenMP support by default and overrides
-  # only the C++ compiler (e.g. on winter 2013's Mac Os X).
-  if (OpenMP_CXX_FLAGS)
-    set (SEQAN_HAS_OPENMP   TRUE)
-    set (SEQAN_LIBRARIES         ${SEQAN_LIBRARIES}         ${OpenMP_LIBRARIES})
-    set (SEQAN_INCLUDE_DIRS_DEPS ${SEQAN_INCLUDE_DIRS_DEPS} ${OpenMP_INCLUDE_DIRS})
-    set (SEQAN_DEFINITIONS       ${SEQAN_DEFINITIONS}       "-DSEQAN_HAS_OPENMP=1")
-    set (SEQAN_CXX_FLAGS        "${SEQAN_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
-  endif ()
-endif ()
-
-# CUDA
-
-list(FIND SEQAN_FIND_DEPENDENCIES "CUDA" _SEQAN_FIND_CUDA)
-mark_as_advanced(_SEQAN_FIND_CUDA)
-
-set (SEQAN_HAS_CUDA FALSE)
-if (SEQAN_ENABLE_CUDA AND NOT _SEQAN_FIND_CUDA EQUAL -1)
-  find_package(CUDA QUIET)
-  if (CUDA_FOUND)
-    set (SEQAN_HAS_CUDA TRUE)
-  endif ()
-endif (SEQAN_ENABLE_CUDA AND NOT _SEQAN_FIND_CUDA EQUAL -1)
-
-# Build SEQAN_INCLUDE_DIRS from SEQAN_INCLUDE_DIRS_MAIN and SEQAN_INCLUDE_DIRS_DEPS
-
-set (SEQAN_INCLUDE_DIRS ${SEQAN_INCLUDE_DIRS_MAIN} ${SEQAN_INCLUDE_DIRS_DEPS})
-
-# ----------------------------------------------------------------------------
-# Determine and set SEQAN_VERSION_* variables.
-# ----------------------------------------------------------------------------
-
-if (NOT DEFINED SEQAN_VERSION_STRING)
-  if (NOT CMAKE_CURRENT_LIST_DIR)  # CMAKE_CURRENT_LIST_DIR only from cmake 2.8.3.
-    get_filename_component (CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
-  endif (NOT CMAKE_CURRENT_LIST_DIR)
-
-  try_run (_SEQAN_RUN_RESULT
-           _SEQAN_COMPILE_RESULT
-           ${CMAKE_BINARY_DIR}/CMakeFiles/SeqAnVersion
-           ${CMAKE_CURRENT_LIST_DIR}/SeqAnVersion.cpp
-           CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${SEQAN_INCLUDE_DIRS_MAIN}"
-           COMPILE_OUTPUT_VARIABLE _COMPILE_OUTPUT
-           RUN_OUTPUT_VARIABLE _RUN_OUTPUT)
-  if (NOT _RUN_OUTPUT)
-    message ("")
-    message ("ERROR: Could not determine SeqAn version.")
-    message ("COMPILE OUTPUT:")
-    message (${_COMPILE_OUTPUT})
-  endif (NOT _RUN_OUTPUT)
-
-  string (REGEX REPLACE ".*SEQAN_VERSION_MAJOR:([0-9a-zA-Z]+).*" "\\1" _SEQAN_VERSION_MAJOR ${_RUN_OUTPUT})
-  string (REGEX REPLACE ".*SEQAN_VERSION_MINOR:([0-9a-zA-Z]+).*" "\\1" _SEQAN_VERSION_MINOR ${_RUN_OUTPUT})
-  string (REGEX REPLACE ".*SEQAN_VERSION_PATCH:([0-9a-zA-Z]+).*" "\\1" _SEQAN_VERSION_PATCH ${_RUN_OUTPUT})
-  string (REGEX REPLACE ".*SEQAN_VERSION_PRE_RELEASE:([0-9a-zA-Z]+).*" "\\1" _SEQAN_VERSION_PRE_RELEASE ${_RUN_OUTPUT})
-
-  if (SEQAN_VERSION_PRE_RELEASE EQUAL 1)
-    set (_SEQAN_VERSION_DEVELOPMENT "TRUE")
-  else ()
-    set (_SEQAN_VERSION_DEVELOPMENT "FALSE")
-  endif ()
-
-  set (_SEQAN_VERSION_STRING "${_SEQAN_VERSION_MAJOR}.${_SEQAN_VERSION_MINOR}.${_SEQAN_VERSION_PATCH}")
-  if (_SEQAN_VERSION_DEVELOPMENT)
-    set (_SEQAN_VERSION_STRING "${_SEQAN_VERSION_STRING}_dev")
-  endif ()
-
-  # Cache results.
-  set (SEQAN_VERSION_MAJOR "${_SEQAN_VERSION_MAJOR}" CACHE INTERNAL "SeqAn major version.")
-  set (SEQAN_VERSION_MINOR "${_SEQAN_VERSION_MINOR}" CACHE INTERNAL "SeqAn minor version.")
-  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 (SEQAN_FIND_DEBUG)
-  message("Result for ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt")
-  message("")
-  message("  CMAKE_BUILD_TYPE           ${CMAKE_BUILD_TYPE}")
-  message("  CMAKE_SOURCE_DIR           ${CMAKE_SOURCE_DIR}")
-  message("  CMAKE_INCLUDE_PATH         ${CMAKE_INCLUDE_PATH}")
-  message("  _SEQAN_BASEDIR             ${_SEQAN_BASEDIR}")
-  message("")
-  message("  SEQAN_FOUND                ${SEQAN_FOUND}")
-  message("  SEQAN_HAS_ZLIB             ${SEQAN_HAS_ZLIB}")
-  message("  SEQAN_HAS_BZIP2            ${SEQAN_HAS_BZIP2}")
-  message("  SEQAN_HAS_OPENMP           ${SEQAN_HAS_OPENMP}")
-  message("  SEQAN_HAS_CUDA             ${SEQAN_HAS_CUDA}")
-  message("")
-  message("  SEQAN_INCLUDE_DIRS         ${SEQAN_INCLUDE_DIRS}")
-  message("  SEQAN_INCLUDE_DIRS_DEPS    ${SEQAN_INCLUDE_DIRS_DEPS}")
-  message("  SEQAN_INCLUDE_DIRS_MAIN    ${SEQAN_INCLUDE_DIRS_MAIN}")
-  message("  SEQAN_LIBRARIES            ${SEQAN_LIBRARIES}")
-  message("  SEQAN_DEFINITIONS          ${SEQAN_DEFINITIONS}")
-  message("  SEQAN_CXX_FLAGS            ${SEQAN_CXX_FLAGS}")
-  message("")
-  message("  SEQAN_VERSION_STRING       ${SEQAN_VERSION_STRING}")
-  message("  SEQAN_VERSION_MAJOR        ${SEQAN_VERSION_MAJOR}")
-  message("  SEQAN_VERSION_MINORG       ${SEQAN_VERSION_MINOR}")
-  message("  SEQAN_VERSION_PATCH        ${SEQAN_VERSION_PATCH}")
-endif ()
diff --git a/include/seqan/util/cmake/FindSphinx.cmake b/include/seqan/util/cmake/FindSphinx.cmake
deleted file mode 100644
index 4607f78..0000000
--- a/include/seqan/util/cmake/FindSphinx.cmake
+++ /dev/null
@@ -1,145 +0,0 @@
-# - This module looks for Sphinx
-# Find the Sphinx documentation generator
-#
-# This modules defines
-#  SPHINX_EXECUTABLE
-#  SPHINX_FOUND
-
-find_program(SPHINX_EXECUTABLE
-  NAMES sphinx-build
-  PATHS
-    /usr/bin
-    /usr/local/bin
-    /opt/local/bin
-  DOC "Sphinx documentation generator"
-)
-
-if( NOT SPHINX_EXECUTABLE )
-  set(_Python_VERSIONS
-    2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5
-  )
-
-  foreach( _version ${_Python_VERSIONS} )
-    set( _sphinx_NAMES sphinx-build-${_version} )
-
-    find_program( SPHINX_EXECUTABLE
-      NAMES ${_sphinx_NAMES}
-      PATHS
-        /usr/bin
-        /usr/local/bin
-        /opt/loca/bin
-      DOC "Sphinx documentation generator"
-    )
-  endforeach()
-endif()
-
-include(FindPackageHandleStandardArgs)
-
-find_package_handle_standard_args(Sphinx DEFAULT_MSG
-  SPHINX_EXECUTABLE
-)
-
-
-option( SPHINX_HTML_OUTPUT "Build a single HTML with the whole content." ON )
-option( SPHINX_DIRHTML_OUTPUT "Build HTML pages, but with a single directory per document." OFF )
-option( SPHINX_HTMLHELP_OUTPUT "Build HTML pages with additional information for building a documentation collection in htmlhelp." OFF )
-option( SPHINX_QTHELP_OUTPUT "Build HTML pages with additional information for building a documentation collection in qthelp." OFF )
-option( SPHINX_DEVHELP_OUTPUT "Build HTML pages with additional information for building a documentation collection in devhelp." OFF )
-option( SPHINX_EPUB_OUTPUT "Build HTML pages with additional information for building a documentation collection in epub." OFF )
-option( SPHINX_LATEX_OUTPUT "Build LaTeX sources that can be compiled to a PDF document using pdflatex." OFF )
-option( SPHINX_MAN_OUTPUT "Build manual pages in groff format for UNIX systems." OFF )
-option( SPHINX_TEXT_OUTPUT "Build plain text files." OFF )
-
-
-mark_as_advanced(
-  SPHINX_EXECUTABLE
-  SPHINX_HTML_OUTPUT
-  SPHINX_DIRHTML_OUTPUT
-  SPHINX_HTMLHELP_OUTPUT
-  SPHINX_QTHELP_OUTPUT
-  SPHINX_DEVHELP_OUTPUT
-  SPHINX_EPUB_OUTPUT
-  SPHINX_LATEX_OUTPUT
-  SPHINX_MAN_OUTPUT
-  SPHINX_TEXT_OUTPUT
-)
-
-function( Sphinx_add_target target_name builder conf source destination )
-  add_custom_target( ${target_name} ALL
-    COMMAND ${SPHINX_EXECUTABLE} -b ${builder}
-    -c ${conf}
-    ${source}
-    ${destination}
-    COMMENT "Generating sphinx documentation: ${builder}"
-    )
-
-  set_property(
-    DIRECTORY APPEND PROPERTY
-    ADDITIONAL_MAKE_CLEAN_FILES
-    ${destination}
-    )
-endfunction()
-
-# Target dependencies can be optionally listed at the end.
-function( Sphinx_add_targets target_base_name conf source base_destination )
-
-  set( _dependencies )
-
-  foreach( arg IN LISTS ARGN )
-    set( _dependencies ${_dependencies} ${arg} )
-  endforeach()
-
-  if( ${SPHINX_HTML_OUTPUT} )
-    Sphinx_add_target( ${target_base_name}_html html ${conf} ${source} ${base_destination}/html )
-
-    add_dependencies( ${target_base_name}_html ${_dependencies} )
-  endif()
-
-  if( ${SPHINX_DIRHTML_OUTPUT} )
-    Sphinx_add_target( ${target_base_name}_dirhtml dirhtml ${conf} ${source} ${base_destination}/dirhtml )
-
-    add_dependencies( ${target_base_name}_dirhtml ${_dependencies} )
-  endif()
-
-  if( ${SPHINX_QTHELP_OUTPUT} )
-    Sphinx_add_target( ${target_base_name}_qthelp qthelp ${conf} ${source} ${base_destination}/qthelp )
-
-    add_dependencies( ${target_base_name}_qthelp ${_dependencies} )
-  endif()
-
-  if( ${SPHINX_DEVHELP_OUTPUT} )
-    Sphinx_add_target( ${target_base_name}_devhelp devhelp ${conf} ${source} ${base_destination}/devhelp )
-
-    add_dependencies( ${target_base_name}_devhelp ${_dependencies} )
-  endif()
-
-  if( ${SPHINX_EPUB_OUTPUT} )
-    Sphinx_add_target( ${target_base_name}_epub epub ${conf} ${source} ${base_destination}/epub )
-
-    add_dependencies( ${target_base_name}_epub ${_dependencies} )
-  endif()
-
-  if( ${SPHINX_LATEX_OUTPUT} )
-    Sphinx_add_target( ${target_base_name}_latex latex ${conf} ${source} ${base_destination}/latex )
-
-    add_dependencies( ${target_base_name}_latex ${_dependencies} )
-  endif()
-
-  if( ${SPHINX_MAN_OUTPUT} )
-    Sphinx_add_target( ${target_base_name}_man man ${conf} ${source} ${base_destination}/man )
-
-    add_dependencies( ${target_base_name}_man ${_dependencies} )
-  endif()
-
-  if( ${SPHINX_TEXT_OUTPUT} )
-    Sphinx_add_target( ${target_base_name}_text text ${conf} ${source} ${base_destination}/text )
-
-    add_dependencies( ${target_base_name}_text ${_dependencies} )
-  endif()
-
-  if( ${BUILD_TESTING} )
-    sphinx_add_target( ${target_base_name}_linkcheck linkcheck ${conf} ${source} ${base_destination}/linkcheck )
-
-    add_dependencies( ${target_base_name}_linkcheck ${_dependencies} )
-  endif()
-endfunction()
diff --git a/include/seqan/util/cmake/FindTBB/FindTBB.cmake b/include/seqan/util/cmake/FindTBB/FindTBB.cmake
deleted file mode 100644
index 336b054..0000000
--- a/include/seqan/util/cmake/FindTBB/FindTBB.cmake
+++ /dev/null
@@ -1,208 +0,0 @@
-# Locate Intel Threading Building Blocks include paths and libraries
-# TBB can be found at http://www.threadingbuildingblocks.org/ 
-# Written by Hannes Hofmann, hannes.hofmann _at_ informatik.uni-erlangen.de
-# Adapted by Gino van den Bergen gino _at_ dtecta.com
-
-# GvdB: This module uses the environment variable TBB_ARCH_PLATFORM which defines architecture and compiler.
-#   e.g. "ia32/vc8" or "em64t/cc4.1.0_libc2.4_kernel2.6.16.21"
-#   TBB_ARCH_PLATFORM is set by the build script tbbvars[.bat|.sh|.csh], which can be found
-#   in the TBB installation directory (TBB_INSTALL_DIR).
-#
-# For backwards compatibility, you may explicitely set the CMake variables TBB_ARCHITECTURE and TBB_COMPILER.
-# TBB_ARCHITECTURE     [ ia32 | em64t | itanium ]
-#   which architecture to use
-# TBB_COMPILER         e.g. vc9 or cc3.2.3_libc2.3.2_kernel2.4.21 or cc4.0.1_os10.4.9
-#   which compiler to use (detected automatically on Windows)
-
-# This module respects
-# TBB_INSTALL_DIR or $ENV{TBB21_INSTALL_DIR} or $ENV{TBB_INSTALL_DIR}
-
-# This module defines
-# TBB_INCLUDE_DIRS, where to find task_scheduler_init.h, etc.
-# TBB_LIBRARY_DIRS, where to find libtbb, libtbbmalloc
-# TBB_INSTALL_DIR, the base TBB install directory
-# TBB_LIBRARIES, the libraries to link against to use TBB.
-# TBB_DEBUG_LIBRARIES, the libraries to link against to use TBB with debug symbols.
-# TBB_FOUND, If false, don't try to use TBB.
-
-
-if (WIN32)
-    # has em64t/vc8   em64t/vc9
-    # has ia32/vc7.1  ia32/vc8   ia32/vc9
-    set(_TBB_DEFAULT_INSTALL_DIR "C:/Program Files/Intel/TBB" "C:/Program Files (x86)/Intel/TBB")
-    set(_TBB_LIB_NAME "tbb")
-    set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
-    set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
-    set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
-    if (MSVC71)
-        set (_TBB_COMPILER "vc7.1")
-    endif(MSVC71)
-    if (MSVC80)
-        set(_TBB_COMPILER "vc8")
-    endif(MSVC80)
-    if (MSVC90)
-        set(_TBB_COMPILER "vc9")
-    endif(MSVC90)
-    if (NOT _TBB_COMPILER)
-        message("ERROR: TBB supports only VC 7.1, 8 and 9 compilers on Windows platforms.")
-    endif (NOT _TBB_COMPILER)
-    set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
-endif (WIN32)
-
-if (UNIX)
-    if (APPLE)
-        # MAC
-        set(_TBB_DEFAULT_INSTALL_DIR "/Library/Frameworks/Intel_TBB.framework/Versions")
-        # libs: libtbb.dylib, libtbbmalloc.dylib, *_debug
-        set(_TBB_LIB_NAME "tbb")
-        set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
-        set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
-        set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
-        # has only one flavor: ia32/cc4.0.1_os10.4.9
-        set(_TBB_COMPILER "cc4.0.1_os10.4.9")
-        set(_TBB_ARCHITECTURE "ia32")
-    else (APPLE)
-        # LINUX
-        set(_TBB_DEFAULT_INSTALL_DIR "/opt/intel/tbb" "/usr/local/include" "/usr/include")
-        set(_TBB_LIB_NAME "tbb")
-        set(_TBB_LIB_MALLOC_NAME "${_TBB_LIB_NAME}malloc")
-        set(_TBB_LIB_DEBUG_NAME "${_TBB_LIB_NAME}_debug")
-        set(_TBB_LIB_MALLOC_DEBUG_NAME "${_TBB_LIB_MALLOC_NAME}_debug")
-        # has em64t/cc3.2.3_libc2.3.2_kernel2.4.21  em64t/cc3.3.3_libc2.3.3_kernel2.6.5  em64t/cc3.4.3_libc2.3.4_kernel2.6.9  em64t/cc4.1.0_libc2.4_kernel2.6.16.21
-        # has ia32/*
-        # has itanium/*
-        set(_TBB_COMPILER ${TBB_COMPILER})
-        set(_TBB_ARCHITECTURE ${TBB_ARCHITECTURE})
-    endif (APPLE)
-endif (UNIX)
-
-if (CMAKE_SYSTEM MATCHES "SunOS.*")
-# SUN
-# not yet supported
-# has em64t/cc3.4.3_kernel5.10
-# has ia32/*
-endif (CMAKE_SYSTEM MATCHES "SunOS.*")
-
-
-#-- Clear the public variables
-set (TBB_FOUND "NO")
-
-
-#-- Find TBB install dir and set ${_TBB_INSTALL_DIR} and cached ${TBB_INSTALL_DIR}
-# first: use CMake variable TBB_INSTALL_DIR
-if (TBB_INSTALL_DIR)
-    set (_TBB_INSTALL_DIR ${TBB_INSTALL_DIR})
-endif (TBB_INSTALL_DIR)
-# second: use environment variable
-if (NOT _TBB_INSTALL_DIR)
-    if (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "")
-        set (_TBB_INSTALL_DIR $ENV{TBB_INSTALL_DIR})
-    endif (NOT "$ENV{TBB_INSTALL_DIR}" STREQUAL "")
-    # Intel recommends setting TBB21_INSTALL_DIR
-    if (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "")
-        set (_TBB_INSTALL_DIR $ENV{TBB21_INSTALL_DIR})
-    endif (NOT "$ENV{TBB21_INSTALL_DIR}" STREQUAL "")
-    if (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "")
-        set (_TBB_INSTALL_DIR $ENV{TBB22_INSTALL_DIR})
-    endif (NOT "$ENV{TBB22_INSTALL_DIR}" STREQUAL "")
-    if (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "")
-        set (_TBB_INSTALL_DIR $ENV{TBB30_INSTALL_DIR})
-    endif (NOT "$ENV{TBB30_INSTALL_DIR}" STREQUAL "")
-endif (NOT _TBB_INSTALL_DIR)
-# third: try to find path automatically
-if (NOT _TBB_INSTALL_DIR)
-    if (_TBB_DEFAULT_INSTALL_DIR)
-        set (_TBB_INSTALL_DIR $ENV{_TBB_DEFAULT_INSTALL_DIR})
-    endif (_TBB_DEFAULT_INSTALL_DIR)
-endif (NOT _TBB_INSTALL_DIR)
-# sanity check
-if (NOT _TBB_INSTALL_DIR)
-    message ("ERROR: TBB_INSTALL_DIR not found. ${_TBB_INSTALL_DIR}")
-else (NOT _TBB_INSTALL_DIR)
-# finally: set the cached CMake variable TBB_INSTALL_DIR
-if (NOT TBB_INSTALL_DIR)
-    set (TBB_INSTALL_DIR ${_TBB_INSTALL_DIR} CACHE PATH "Intel TBB install directory")
-    mark_as_advanced(TBB_INSTALL_DIR)
-endif (NOT TBB_INSTALL_DIR)
-
-
-#-- A macro to rewrite the paths of the library. This is necessary, because 
-#   find_library() always found the em64t/vc9 version of the TBB libs
-macro(TBB_CORRECT_LIB_DIR var_name)
-#    if (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t")
-        string(REPLACE em64t "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
-#    endif (NOT "${_TBB_ARCHITECTURE}" STREQUAL "em64t")
-    string(REPLACE ia32 "${_TBB_ARCHITECTURE}" ${var_name} ${${var_name}})
-    string(REPLACE vc7.1 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
-    string(REPLACE vc8 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
-    string(REPLACE vc9 "${_TBB_COMPILER}" ${var_name} ${${var_name}})
-endmacro(TBB_CORRECT_LIB_DIR var_content)
-
-
-#-- Look for include directory and set ${TBB_INCLUDE_DIR}
-set (TBB_INC_SEARCH_DIR ${_TBB_INSTALL_DIR}/include)
-find_path(TBB_INCLUDE_DIR
-    tbb/task_scheduler_init.h
-    PATHS ${TBB_INC_SEARCH_DIR}
-    NO_DEFAULT_PATH
-)
-mark_as_advanced(TBB_INCLUDE_DIR)
-
-
-#-- Look for libraries
-# GvdB: $ENV{TBB_ARCH_PLATFORM} is set by the build script tbbvars[.bat|.sh|.csh]
-if (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
-    set (_TBB_LIBRARY_DIR 
-         ${_TBB_INSTALL_DIR}/lib/$ENV{TBB_ARCH_PLATFORM}
-         ${_TBB_INSTALL_DIR}/$ENV{TBB_ARCH_PLATFORM}/lib
-        )
-else (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
-    # HH: deprecated
-    message(STATUS "[Warning] FindTBB.cmake: The use of TBB_ARCHITECTURE and TBB_COMPILER is deprecated and may not be supported in future versions. Please set $ENV{TBB_ARCH_PLATFORM} (using tbbvars.[bat|csh|sh]).")
-    set (_TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/${_TBB_ARCHITECTURE}/${_TBB_COMPILER}/lib")
-endif (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
-
-# GvdB: Mac OS X distribution places libraries directly in lib directory.
-list(APPEND _TBB_LIBRARY_DIR ${_TBB_INSTALL_DIR}/lib)
-
-
-find_library(TBB_LIBRARY        ${_TBB_LIB_NAME}        ${_TBB_LIBRARY_DIR} NO_DEFAULT_PATH)
-find_library(TBB_MALLOC_LIBRARY ${_TBB_LIB_MALLOC_NAME} ${_TBB_LIBRARY_DIR} NO_DEFAULT_PATH)
-
-#Extract path from TBB_LIBRARY name
-get_filename_component(TBB_LIBRARY_DIR ${TBB_LIBRARY} PATH)
-
-#TBB_CORRECT_LIB_DIR(TBB_LIBRARY)
-#TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY)
-mark_as_advanced(TBB_LIBRARY TBB_MALLOC_LIBRARY)
-
-#-- Look for debug libraries
-find_library(TBB_LIBRARY_DEBUG        ${_TBB_LIB_DEBUG_NAME}        ${_TBB_LIBRARY_DIR} NO_DEFAULT_PATH)
-find_library(TBB_MALLOC_LIBRARY_DEBUG ${_TBB_LIB_MALLOC_DEBUG_NAME} ${_TBB_LIBRARY_DIR} NO_DEFAULT_PATH)
-#TBB_CORRECT_LIB_DIR(TBB_LIBRARY_DEBUG)
-#TBB_CORRECT_LIB_DIR(TBB_MALLOC_LIBRARY_DEBUG)
-mark_as_advanced(TBB_LIBRARY_DEBUG TBB_MALLOC_LIBRARY_DEBUG)
-
-
-if (TBB_INCLUDE_DIR)
-    if (TBB_LIBRARY)
-        set (TBB_FOUND "YES")
-        set (TBB_LIBRARIES ${TBB_LIBRARY} ${TBB_MALLOC_LIBRARY} ${TBB_LIBRARIES})
-        set (TBB_DEBUG_LIBRARIES ${TBB_LIBRARY_DEBUG} ${TBB_MALLOC_LIBRARY_DEBUG} ${TBB_DEBUG_LIBRARIES})
-        set (TBB_INCLUDE_DIRS ${TBB_INCLUDE_DIR} CACHE PATH "TBB include directory" FORCE)
-        set (TBB_LIBRARY_DIRS ${TBB_LIBRARY_DIR} CACHE PATH "TBB library directory" FORCE)
-        mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARY_DIRS TBB_LIBRARIES TBB_DEBUG_LIBRARIES)
-        message(STATUS "Found Intel TBB")
-    endif (TBB_LIBRARY)
-endif (TBB_INCLUDE_DIR)
-
-if (NOT TBB_FOUND)
-    message("ERROR: Intel TBB NOT found!")
-    message(STATUS "Looked for Threading Building Blocks in ${_TBB_INSTALL_DIR}")
-    # do only throw fatal, if this pkg is REQUIRED
-    if (TBB_FIND_REQUIRED)
-        message(FATAL_ERROR "Could NOT find TBB library.")
-    endif (TBB_FIND_REQUIRED)
-endif (NOT TBB_FOUND)
-
-endif (NOT _TBB_INSTALL_DIR)
diff --git a/include/seqan/util/cmake/FindTBB/README b/include/seqan/util/cmake/FindTBB/README
deleted file mode 100644
index 19309d9..0000000
--- a/include/seqan/util/cmake/FindTBB/README
+++ /dev/null
@@ -1,6 +0,0 @@
-CMake TBB Finder
-================
-
-Source: http://findtbb.googlecode.com/svn/trunk/CMake/FindTBB/
-Revision: 16
-Docs: http://code.google.com/p/findtbb/wiki/HowTo
\ No newline at end of file
diff --git a/include/seqan/util/cmake/FindZLIB.cmake b/include/seqan/util/cmake/FindZLIB.cmake
deleted file mode 100644
index 21ad489..0000000
--- a/include/seqan/util/cmake/FindZLIB.cmake
+++ /dev/null
@@ -1,107 +0,0 @@
-# - Find zlib
-# Find the native ZLIB includes and library.
-# Once done this will define
-#
-#  ZLIB_INCLUDE_DIRS   - where to find zlib.h, etc.
-#  ZLIB_LIBRARIES      - List of libraries when using zlib.
-#  ZLIB_FOUND          - True if zlib found.
-#
-#  ZLIB_VERSION_STRING - The version of zlib found (x.y.z)
-#  ZLIB_VERSION_MAJOR  - The major version of zlib
-#  ZLIB_VERSION_MINOR  - The minor version of zlib
-#  ZLIB_VERSION_PATCH  - The patch version of zlib
-#  ZLIB_VERSION_TWEAK  - The tweak version of zlib
-#
-# The following variable are provided for backward compatibility
-#
-#  ZLIB_MAJOR_VERSION  - The major version of zlib
-#  ZLIB_MINOR_VERSION  - The minor version of zlib
-#  ZLIB_PATCH_VERSION  - The patch version of zlib
-
-#=============================================================================
-# Copyright 2001-2009 Kitware, Inc.
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-#  License text for the above reference.)
-
-# This is based on the original FinZLIB.cmake file from the CMake
-# distribution.  However, we also look for zlib_d.lib etc. such
-# that we can have both debug and release builds.
-
-FIND_PATH(ZLIB_INCLUDE_DIR zlib.h
-    "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]/include"
-)
-
-SET(ZLIB_NAMES z zlib zlib1 zlibd zlibd1)
-if (MSVC)
-	SET(ZLIB_NAMES_D z_d zlib_d zlib1_d zlibd_d zlibd1_d)
-endif (MSVC)
-
-FIND_LIBRARY(ZLIB_LIBRARY
-    NAMES
-        ${ZLIB_NAMES}
-    PATHS
-        "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]/lib"
-    PATH_SUFFIXES
-        "" lib lib32
-)
-
-if (MSVC)
-	FIND_LIBRARY(ZLIB_LIBRARY_D
-		NAMES
-			${ZLIB_NAMES_D}
-		PATHS
-			"[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]/lib"
-	)
-endif (MSVC)
-
-MARK_AS_ADVANCED(ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-
-IF(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h")
-    FILE(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$")
-
-    STRING(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}")
-    STRING(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR  "${ZLIB_H}")
-    STRING(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}")
-    SET(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}")
-
-    # only append a TWEAK version if it exists:
-    SET(ZLIB_VERSION_TWEAK "")
-    IF( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$")
-        SET(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}")
-        SET(ZLIB_VERSION_STRING "${ZLIB_VERSION_STRING}.${ZLIB_VERSION_TWEAK}")
-    ENDIF( "${ZLIB_H}" MATCHES "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+).*$")
-
-    SET(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}")
-    SET(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}")
-    SET(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}")
-ENDIF()
-
-# handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if 
-# all listed variables are TRUE
-if (NOT CMAKE_CURRENT_LIST_DIR)  # CMAKE_CURRENT_LIST_DIR only from cmake 2.8.3.
-    get_filename_component(CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
-endif (NOT CMAKE_CURRENT_LIST_DIR)
-INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR
-                                       VERSION_VAR ZLIB_VERSION_STRING)
-
-IF(ZLIB_FOUND)
-	#message(STATUS "Zlib found at ${ZLIB_LIBRARY} ${ZLIB_LIBRARY_D}")
-    SET(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR})
-	if (MSVC)
-		SET(ZLIB_LIBRARIES debug ${ZLIB_LIBRARY_D} optimized ${ZLIB_LIBRARY})
-	else (MSVC)
-		SET(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
-	endif (MSVC)
-ELSE()
-	message(STATUS "Zlib could not be found!")
-ENDIF()
-
diff --git a/include/seqan/util/cmake/GetCurrentDate.cmake b/include/seqan/util/cmake/GetCurrentDate.cmake
deleted file mode 100644
index dcdfce2..0000000
--- a/include/seqan/util/cmake/GetCurrentDate.cmake
+++ /dev/null
@@ -1,57 +0,0 @@
-# ============================================================================
-#                  SeqAn - The Library for Sequence Analysis
-# ============================================================================
-# Copyright (c) 2006-2012, Knut Reinert, FU Berlin
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above copyright
-#       notice, this list of conditions and the following disclaimer in the
-#       documentation and/or other materials provided with the distribution.
-#     * Neither the name of Knut Reinert or the FU Berlin nor the names of
-#       its contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-# ============================================================================
-# Author: Manuel Holtgrewe <manuel.holtgrewe at fu-berlin.de>
-# ============================================================================
-# Get current date from compiled C++ program.
-#
-# The C++ program GetCurrentDate.cpp belongs together with this module.
-#
-# The resulting date will be written to the variables CURRENT_YEAR,
-# CURRENT_MONTH, and CURRENT_DAY.
-# ============================================================================
-
-if (NOT CMAKE_CURRENT_LIST_DIR)  # CMAKE_CURRENT_LIST_DIR only from cmake 2.8.3.
-  get_filename_component(CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
-endif (NOT CMAKE_CURRENT_LIST_DIR)
-
-try_run(_GET_CURRENT_DATE_RUN_RESULT
-        _GET_CURRENT_DATE_COMPILE_RESULT
-        ${CMAKE_BINARY_DIR}/CMakeFiles/GetCurrentDate
-        ${CMAKE_CURRENT_LIST_DIR}/GetCurrentDate.cpp
-        COMPILE_OUTPUT_VARIABLE _GET_CURRENT_DATE_COMPILE_OUTPUT
-        RUN_OUTPUT_VARIABLE _GET_CURRENT_DATE_RUN_OUTPUT)
-if (NOT _GET_CURRENT_DATE_RUN_OUTPUT)
-  message(FATAL_ERROR "Could not determine current date!.")
-endif ()
-
-string(REGEX REPLACE ".*YEAR ([0-9a-zA-Z]+).*" "\\1" CURRENT_YEAR ${_GET_CURRENT_DATE_RUN_OUTPUT})
-string(REGEX REPLACE ".*MONTH ([0-9a-zA-Z]+).*" "\\1" CURRENT_MONTH ${_GET_CURRENT_DATE_RUN_OUTPUT})
-string(REGEX REPLACE ".*DAY ([0-9a-zA-Z]+).*" "\\1" CURRENT_DAY ${_GET_CURRENT_DATE_RUN_OUTPUT})
diff --git a/include/seqan/util/cmake/GetCurrentDate.cpp b/include/seqan/util/cmake/GetCurrentDate.cpp
deleted file mode 100644
index e5cce2b..0000000
--- a/include/seqan/util/cmake/GetCurrentDate.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-// ==========================================================================
-//                 SeqAn - The Library for Sequence Analysis
-// ==========================================================================
-// Copyright (c) 2006-2010, Knut Reinert, FU Berlin
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of Knut Reinert or the FU Berlin nor the names of
-//       its contributors may be used to endorse or promote products derived
-//       from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-// DAMAGE.
-//
-// ==========================================================================
-// Author: Manuel Holtgrewe <manuel.holtgrewe at fu-berlin.de>
-// ==========================================================================
-// This C++ file prints the current date in a machine-readable format.  It
-// is used by the CMake module GetCurrentDate.cmake to get the current date
-// into the CMake build system.
-// ==========================================================================
-
-#include <ctime>
-#include <iostream>
-
-int main()
-{
-    char date[100];
-    time_t t = time(0);
-    struct tm *tm;
-
-    tm = gmtime(&t);
-    strftime(date, sizeof(date), "YEAR %Y\nMONTH %m\nDAY %d", tm);
-    std::cout << date << '\n';
-    return 0;
-}
diff --git a/include/seqan/util/cmake/LibFindMacros.cmake b/include/seqan/util/cmake/LibFindMacros.cmake
deleted file mode 100644
index 69975c5..0000000
--- a/include/seqan/util/cmake/LibFindMacros.cmake
+++ /dev/null
@@ -1,99 +0,0 @@
-# Works the same as find_package, but forwards the "REQUIRED" and "QUIET" arguments
-# used for the current package. For this to work, the first parameter must be the
-# prefix of the current package, then the prefix of the new package etc, which are
-# passed to find_package.
-macro (libfind_package PREFIX)
-  set (LIBFIND_PACKAGE_ARGS ${ARGN})
-  if (${PREFIX}_FIND_QUIETLY)
-    set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} QUIET)
-  endif (${PREFIX}_FIND_QUIETLY)
-  if (${PREFIX}_FIND_REQUIRED)
-    set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} REQUIRED)
-  endif (${PREFIX}_FIND_REQUIRED)
-  find_package(${LIBFIND_PACKAGE_ARGS})
-endmacro (libfind_package)
-
-# CMake developers made the UsePkgConfig system deprecated in the same release (2.6)
-# where they added pkg_check_modules. Consequently I need to support both in my scripts
-# to avoid those deprecated warnings. Here's a helper that does just that.
-# Works identically to pkg_check_modules, except that no checks are needed prior to use.
-macro (libfind_pkg_check_modules PREFIX PKGNAME)
-  if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
-    include(UsePkgConfig)
-    pkgconfig(${PKGNAME} ${PREFIX}_INCLUDE_DIRS ${PREFIX}_LIBRARY_DIRS ${PREFIX}_LDFLAGS ${PREFIX}_CFLAGS)
-  else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
-    find_package(PkgConfig)
-    if (PKG_CONFIG_FOUND)
-      pkg_check_modules(${PREFIX} ${PKGNAME})
-    endif (PKG_CONFIG_FOUND)
-  endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
-endmacro (libfind_pkg_check_modules)
-
-# Do the final processing once the paths have been detected.
-# If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain
-# all the variables, each of which contain one include directory.
-# Ditto for ${PREFIX}_PROCESS_LIBS and library files.
-# Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES.
-# Also handles errors in case library detection was required, etc.
-macro (libfind_process PREFIX)
-  # Skip processing if already processed during this run
-  if (NOT ${PREFIX}_FOUND)
-    # Start with the assumption that the library was found
-    set (${PREFIX}_FOUND TRUE)
-
-    # Process all includes and set _FOUND to false if any are missing
-    foreach (i ${${PREFIX}_PROCESS_INCLUDES})
-      if (${i})
-        set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}})
-        mark_as_advanced(${i})
-      else (${i})
-        set (${PREFIX}_FOUND FALSE)
-      endif (${i})
-    endforeach (i)
-
-    # Process all libraries and set _FOUND to false if any are missing
-    foreach (i ${${PREFIX}_PROCESS_LIBS})
-      if (${i})
-        set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}})
-        mark_as_advanced(${i})
-      else (${i})
-        set (${PREFIX}_FOUND FALSE)
-      endif (${i})
-    endforeach (i)
-
-    # Print message and/or exit on fatal error
-    if (${PREFIX}_FOUND)
-      if (NOT ${PREFIX}_FIND_QUIETLY)
-        message (STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
-      endif (NOT ${PREFIX}_FIND_QUIETLY)
-    else (${PREFIX}_FOUND)
-      if (${PREFIX}_FIND_REQUIRED)
-        foreach (i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS})
-          message("${i}=${${i}}")
-        endforeach (i)
-        message (FATAL_ERROR "Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually.")
-      endif (${PREFIX}_FIND_REQUIRED)
-    endif (${PREFIX}_FOUND)
-  endif (NOT ${PREFIX}_FOUND)
-endmacro (libfind_process)
-
-macro(libfind_library PREFIX basename)
-  set(TMP "")
-  if(MSVC80)
-    set(TMP -vc80)
-  endif(MSVC80)
-  if(MSVC90)
-    set(TMP -vc90)
-  endif(MSVC90)
-  set(${PREFIX}_LIBNAMES ${basename}${TMP})
-  if(${ARGC} GREATER 2)
-    set(${PREFIX}_LIBNAMES ${basename}${TMP}-${ARGV2})
-    string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES})
-    set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP})
-  endif(${ARGC} GREATER 2)
-  find_library(${PREFIX}_LIBRARY
-    NAMES ${${PREFIX}_LIBNAMES}
-    PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS}
-  )
-endmacro(libfind_library)
-
diff --git a/include/seqan/util/cmake/README b/include/seqan/util/cmake/README
deleted file mode 100644
index 404cb20..0000000
--- a/include/seqan/util/cmake/README
+++ /dev/null
@@ -1,84 +0,0 @@
-                  ** SeqAn Build System and Support Files **
-
-Description
-===========
-
-This directory contains the SeqAn CMake build system and supporting files.  We
-will give a rough overview of the most important files and mechanisms used in
-the build system.  It should be fairly easy to understand the system from the
-documentation embedded in the CMake files.
-
-Files
-=====
-
-  FindTBB
-
-    Copy from http://code.google.com/p/findtbb/ of the TBB finder.
-
-  CMakeMacroParseArguments.cmake
-
-   Makes writing CMake find modules easier.  Copied from CMake project, not
-   available in older CMake versions.
-
-  CTestConfig.cmake
-
-    This file is copied into the project root in nightly builds for
-    configuration.
-
-  FeatureSummary.cmake
-
-    Print a summary of the features enabled in the SeqAn library.
-
-  FindBZip2.cmake
-
-    Contains the functionality from FindZLIB.cmake for libbz2.
-
-  FindPackageHandleStandardArgs.cmake
-
-    See CMakeMacroParseArguments.cmake.
-
-  GetCurrentDate.cmake
-
-    Get the current date into ${CURRENT_YEAR}, ${CURRENT_MONTH}, and
-    ${CURRENT_DAY}.
-
-  package.cmake
-
-    CPack configuration for the SeqAn library/all-apps builds.
-
-  SeqAnBuildSystem.cmake
-
-    This CMake file defines various functions and macros to be used in the
-    SeqAn file hierarchy.  They form the SeqAn build system.
-
-  SeqAnContribs.cmake
-
-    Included from the root CMakeLists.txt, looks for the SeqAn contribs on
-    windows in their default install locations.
-
-  SeqAnLegacyBuildSystem.cmake
-
-   This CMake file defines functions from the previous build system.  They are
-   translated to the functions from SeqAnBuildSystem.cmake for backward
-   compatibility and a smoother upgrade path.
-
-  SeqAnUsabilityAnalyzer.cmake
-
-   CMake functions that allow for the integration of the SeqAn Usability
-   Analyzer (SUA) into the build process.
-
-  FindZLIB.cmake
-
-    A CMake module for finding the ZLIB.  This is a copy of the original
-    FindZLIB.cmake from the CMake project.  The main difference is that the
-    libraries are searched for in an optimized version (no suffix) and a debug
-    version (suffix "_d").
-
-    This is relevant on Windows where you can only link against libraries
-    build in the same optimization configuration.
-
-    Note that you can such compiled libraries from the SeqAn Contribs.
-
-  SetCPackSystemName.cmake
-
-    Include to set the system name into CPACK_SYSTEM_NAME.
\ No newline at end of file
diff --git a/include/seqan/util/cmake/SeqAnBuildSystem.cmake b/include/seqan/util/cmake/SeqAnBuildSystem.cmake
deleted file mode 100644
index 9450259..0000000
--- a/include/seqan/util/cmake/SeqAnBuildSystem.cmake
+++ /dev/null
@@ -1,731 +0,0 @@
-# ============================================================================
-#                  SeqAn - The Library for Sequence Analysis
-# ============================================================================
-# Copyright (c) 2006-2012, Knut Reinert, FU Berlin
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above copyright
-#       notice, this list of conditions and the following disclaimer in the
-#       documentation and/or other materials provided with the distribution.
-#     * Neither the name of Knut Reinert or the FU Berlin nor the names of
-#       its contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-# ============================================================================
-# Author: Manuel Holtgrewe <manuel.holtgrewe at fu-berlin.de>
-# ============================================================================
-# This CMake file defines the necessary macros for the SeqAn build system.
-#
-# Note that while the SeqAn build system uses the FindSeqAn.cmake module,
-# the FindSeqAn.cmake module itself can be used independently from the SeqAn
-# build system.
-# ============================================================================
-
-# Valid values for SEQAN_BUILD_SYSTEM:
-#
-# DEVELOP
-# SEQAN_RELEASE
-# SEQAN_RELEASE_LIBRARY
-# APP:${app_name}
-
-include (SeqAnUsabilityAnalyzer)
-
-# ---------------------------------------------------------------------------
-# Normalize CMAKE_CXX_FLAGS to be a string.
-#
-# If we do not do this then setting the environment variable CXXFLAGS will
-# cause CMAKE_CXX_FLAGS to become a list and this will generate compiler
-# command lines including the list item separator semicolon ";".  This makes
-# the compiler command fail.
-# ---------------------------------------------------------------------------
-
-#if (CMAKE_CXX_FLAGS)
-#  foreach (_FLAG ${CMAKE_CXX_FLAGS})
-#    set (_FLAGS "${_FLAGS} ${_FLAG}")
-#  endforeach (_FLAG ${CMAKE_CXX_FLAGS})
-#  set (CMAKE_CXX_FLAGS "${_FLAGS}")
-#endif (CMAKE_CXX_FLAGS)
-
-# ---------------------------------------------------------------------------
-# Enable /bigobj flag on Windows.
-# ---------------------------------------------------------------------------
-
-# We need the /bigobj switch on windows (for 64 bit builds only actually).
-# Set target system to be Windows Vista and later.
-if (MSVC)
-  add_definitions (/bigobj /D_WIN32_WINNT=0x0600 /DWINVER=0x0600)
-elseif (MINGW)
-  add_definitions (-D_WIN32_WINNT=0x0600 -DWINVER=0x0600)
-endif (MSVC)
-
-# ---------------------------------------------------------------------------
-# Set architecture for MinGW.
-#
-# If we do not set i586 as the architecture for MinGW then generating atomic
-# expressions will fail.
-# ---------------------------------------------------------------------------
-
-if (MINGW)
-	if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
-	    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=i586")
-	endif ("${CMAKE_SIZEOF_VOID_P}" EQUAL "4")
-endif (MINGW)
-
-# ---------------------------------------------------------------------------
-# Disable false positive terminal detection in Xcode
-# ---------------------------------------------------------------------------
-
-if (CMAKE_GENERATOR STREQUAL Xcode)
-  add_definitions (-DSEQAN_NO_TERMINAL)
-endif (CMAKE_GENERATOR STREQUAL Xcode)
-
-# ---------------------------------------------------------------------------
-# Function add_executable (name [WIN32] [MACOSX_BUNDLE] [EXCLUDE_FROM_ALL]
-#                          source1 source2 ... sourceN)
-#
-# Add an executable with the given name and sources.
-#
-# We overwrite the built-in function add_executable to automatically add
-# behaviour that is required in the SeqAn build system.  This includes:
-#
-# * Adding dependencies to the SeqAn library headers.
-# * Enabling the SeqAn Usability Analyzer (SUA).
-#
-# Note that it is not possible to overwrite the same function two times.
-# ---------------------------------------------------------------------------
-
-function (add_executable NAME)
-    # Call overwritten _add_executable.
-    _add_executable(${ARGV})
-
-    # Add dependencies on the SeqAn library.
-    add_dependencies(${NAME} seqan_library)
-
-    # Add dependency on the SUA target.
-    seqan_add_sua_dependency (${NAME})
-endfunction (add_executable)
-
-# ---------------------------------------------------------------------------
-# Macro seqan_add_app_subdirectory (APP_NAME)
-# ---------------------------------------------------------------------------
-
-macro (seqan_add_app_subdirectory APP_NAME)
-    if (("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE") OR
-         "${SEQAN_BUILD_SYSTEM}" STREQUAL "APP:${APP_NAME}")
-        add_subdirectory (${APP_NAME})
-    endif ()
-endmacro (seqan_add_app_subdirectory)
-
-# ---------------------------------------------------------------------------
-# Macro seqan_register_apps ()
-#
-# Register all apps by adding their subdirectories if they are to be built
-# (SEQAN_RELEASE and APP:${app} modes).
-# ---------------------------------------------------------------------------
-
-macro (seqan_register_apps)
-    # Set SeqAn flags.
-    set (SEQAN_FIND_ENABLE_TESTING 0)
-    set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DSEQAN_ENABLE_DEBUG=0")
-    set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DSEQAN_ENABLE_DEBUG=0")
-    set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSEQAN_ENABLE_DEBUG=1")
-
-    # enable static linkage for seqan apps
-    if (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG AND NOT MINGW)
-      set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
-      set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
-    endif ()
-
-    # Enable global exception handler for all seqan apps.
-    set (SEQAN_DEFINITIONS "${SEQAN_DEFINITIONS} -DSEQAN_GLOBAL_EXCEPTION_HANDLER")
-
-    # Get all direct entries of the current source directory into ENTRIES.
-    file (GLOB ENTRIES
-          RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
-          ${CMAKE_CURRENT_SOURCE_DIR}/[!.]*)
-
-    # Add all values from ${ENTRIES} that are subdirectories and have a file
-    # CMakeListst.txt.
-    foreach (ENTRY ${ENTRIES})
-        if (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${ENTRY})
-            if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${ENTRY}/CMakeLists.txt)
-                if (("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE") OR
-                    ("${SEQAN_BUILD_SYSTEM}" STREQUAL "DEVELOP") OR
-                    ("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE_APPS") OR
-                    ("${SEQAN_BUILD_SYSTEM}" STREQUAL "APP:${ENTRY}"))
-                    add_subdirectory(${ENTRY})
-                endif ()
-            endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${ENTRY}/CMakeLists.txt)
-        endif (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${ENTRY})
-    endforeach (ENTRY ${ENTRIES})
-endmacro (seqan_register_apps)
-
-# ---------------------------------------------------------------------------
-# Macro seqan_build_system_init ()
-#
-# Initialize build system.
-# ---------------------------------------------------------------------------
-
-macro (seqan_build_system_init)
-    # Enable CTest and command add_test().
-    enable_testing ()
-
-    if (NOT SEQAN_BUILD_SYSTEM)
-        set (SEQAN_BUILD_SYSTEM "DEVELOP")
-    endif (NOT SEQAN_BUILD_SYSTEM)
-    set (SEQAN_APP_VERSION "0.0.0" CACHE STRING "Version of the application.")
-    set (SEQAN_NIGHTLY_RELEASE FALSE CACHE BOOL "Set to TRUE to enable nightly app releases.")
-
-    if (("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE") OR
-        ("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE_LIBRARY"))
-        # Install SeqAn LICENSE, README.rst, CHANGELOG.rst files.
-        install (FILES LICENSE
-                       README.rst
-                       CHANGELOG.rst
-                 DESTINATION share/doc/seqan)
-    endif ()
-
-    set (SEQAN_BUILD_SYSTEM "DEVELOP" CACHE STRING "Build/Release mode to select. One of DEVELOP SEQAN_RELEASE, APP:\${APP_NAME}. Defaults to DEVELOP.")
-
-    set (_CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/include")
-    set (CMAKE_INCLUDE_PATH ${_CMAKE_INCLUDE_PATH} CACHE STRING "")
-
-    SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY
-         ${PROJECT_BINARY_DIR}/bin)
-endmacro (seqan_build_system_init)
-
-# ---------------------------------------------------------------------------
-# Macro seqan_add_app_test (APP_NAME SUFFIX)
-#
-# Add app test invocation.
-# ---------------------------------------------------------------------------
-
-# App tests are run using Python.  Search for Python and register test if the
-# Python interpreter could be found.
-
-macro (seqan_add_app_test APP_NAME)
-    if (MODEL MATCHES ".*MemCheck.*")
-        set (_VALGRIND_FLAG --valgrind)
-    else ()
-        set (_VALGRIND_FLAG)
-    endif ()
-    find_package (PythonInterp)
-    if (PYTHONINTERP_FOUND)
-      add_test (NAME app_test_${APP_NAME}${ARGV1}
-                COMMAND ${PYTHON_EXECUTABLE}
-                        ${CMAKE_CURRENT_SOURCE_DIR}/tests/run_tests${ARGV1}.py
-                        ${_VALGRIND_FLAG}
-                        ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
-    endif (PYTHONINTERP_FOUND)
-endmacro (seqan_add_app_test APP_NAME)
-
-# ---------------------------------------------------------------------------
-# Macro seqan_setup_library ()
-#
-# * Creates install targets for the library.
-# * Writes list SeqAn headers to ${_SEQAN_HEADERS}
-# ---------------------------------------------------------------------------
-
-macro (seqan_setup_library)
-    # Only install the library if the virtual build packages "SEQAN_RELEASE"
-    # or "SEQAN_LIBRARY_ONLY" are chosen.
-    if (("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE") OR
-        ("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE_LIBRARY"))
-        file (GLOB HEADERS
-              RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
-              include/seqan/[A-z]*/[A-z]/[A-z]*.h
-              include/seqan/[A-z]*/[A-z]*.h
-              include/seqan/[A-z]*.h)
-        foreach (HEADER ${HEADERS})
-            get_filename_component (_DESTINATION ${HEADER} PATH)
-            install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${HEADER} DESTINATION ${_DESTINATION})
-        endforeach ()
-    endif ()
-
-    # Get list of header and super header files.
-    file (GLOB SUPER_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/seqan/[A-z]*.h)
-    file (GLOB HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/seqan/[A-z]*/[A-z]*.h)
-    file (GLOB SUB_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/seqan/[A-z]*/[A-z]*/[A-z]*.h)
-
-    # Sort headers for Xcode, ...
-    if (SUB_HEADERS)
-        list (SORT SUB_HEADERS)
-    endif (SUB_HEADERS)
-
-    # Sort headers for Xcode, ...
-    if (HEADERS)
-        list (SORT HEADERS)
-    endif (HEADERS)
-
-    # Sort super-headers for Xcode, ...
-    if (SUPER_HEADERS)
-        list (SORT SUPER_HEADERS)
-    endif (SUPER_HEADERS)
-
-    # Create source groups for Visual Studio (and possibly other IDEs).
-    foreach (HEADER ${HEADERS})
-        file (RELATIVE_PATH HEADER_REL ${CMAKE_CURRENT_SOURCE_DIR}/include/seqan ${HEADER})
-        get_filename_component (MODULE ${HEADER_REL} PATH)
-        source_group (seqan\\${MODULE} FILES ${HEADER})
-    endforeach (HEADER ${HEADERS})
-    source_group (seqan FILES ${SUPER_HEADERS})
-
-#    # CMake bug workaround: For Non-IDE generators there is a bug in cmake.
-#    # The SOURCE command in add_custom_target is not recognized there.
-#    set (NONIDE_GENERATORS "Unix Makefiles" "MinGW Makefiles")
-#    list (FIND NONIDE_GENERATORS ${CMAKE_GENERATOR} FOUND)
-#    if (FOUND EQUAL -1)
-#        set (IDE_SOURCES SOURCES ${HEADERS} ${SUPER_HEADERS})
-#    endif (FOUND EQUAL -1)
-
-    # Add pseudo target for the library part.  Note that the IDE_SOURCES
-    # variable includes the "SOURCES" argument for add_custom_target when
-    # building with a generator for an IDE.
-    add_custom_target (seqan_library SOURCES ${SUB_HEADERS} ${HEADERS} ${SUPER_HEADERS})
-endmacro (seqan_setup_library)
-
-# ---------------------------------------------------------------------------
-# Macro seqan_setup_install_vars (APP_NAME)
-#
-# Setup variables for install, depending on build mode.
-# ---------------------------------------------------------------------------
-
-macro (seqan_setup_install_vars APP_NAME)
-    if ("${SEQAN_BUILD_SYSTEM}" STREQUAL "APP:${APP_NAME}")
-        set (SEQAN_PREFIX_SHARE ".")
-        set (SEQAN_PREFIX_SHARE_DOC ".")
-    else ()
-        set (SEQAN_PREFIX_SHARE "share/${APP_NAME}")
-        set (SEQAN_PREFIX_SHARE_DOC "share/doc/${APP_NAME}")
-    endif ()
-endmacro (seqan_setup_install_vars)
-
-# ---------------------------------------------------------------------------
-# Macro seqan_configure_cpack_app (APP_NAME APP_DIR)
-#
-# Setup variables for install, depending on build mode.
-#
-# Sets defaults for CPACK_PACKAGE_DESCRIPTION_FILE and CPACK_RESOURCE_FILE_LICENSE
-# ---------------------------------------------------------------------------
-
-macro (seqan_configure_cpack_app APP_NAME APP_DIR)
-  # The following include automates the MS Redistributable installer.
-  include (InstallRequiredSystemLibraries)
-
-  if (CMAKE_SYSTEM_NAME MATCHES "Windows")
-    set (CPACK_GENERATOR "ZIP")
-  else ()
-    set (CPACK_GENERATOR "ZIP;TBZ2")
-  endif ()
-
-  # Set defaults for CPACK_PACKAGE_DESCRIPTION_FILE and CPACK_RESOURCE_FILE_LICENSE
-  if (NOT CPACK_PACKAGE_DESCRIPTION_FILE)
-    set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
-  endif ()
-  if (NOT CPACK_RESOURCE_FILE_LICENSE)
-    set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
-  endif ()
-
-  # Automatically deduce system name for CPack.
-  include (SetCPackSystemName)
-
-  # Get SEQAN_APP_VERSION_{MAJOR,MINOR,PATCH} from SEQAN_APP_VERSION.
-  set (SEQAN_APP_VERSION_MAJOR "0")
-  if (SEQAN_APP_VERSION MATCHES "^([0-9]+).*")
-    string (REGEX REPLACE "^([0-9]+).*" "\\1" _SEQAN_APP_VERSION_MAJOR "${SEQAN_APP_VERSION}")
-  endif ()
-  if (_SEQAN_APP_VERSION_MAJOR)
-    set(SEQAN_APP_VERSION_MAJOR "${_SEQAN_APP_VERSION_MAJOR}")
-  endif ()
-  set (SEQAN_APP_VERSION_MINOR "0")
-  if (SEQAN_APP_VERSION MATCHES "^[0-9]+\\.([0-9]+).*")
-    string (REGEX REPLACE "^[0-9]+\\.([0-9]+).*" "\\1" _SEQAN_APP_VERSION_MINOR "${SEQAN_APP_VERSION}")
-  endif ()
-  if (_SEQAN_APP_VERSION_MINOR)
-    set(SEQAN_APP_VERSION_MINOR "${_SEQAN_APP_VERSION_MINOR}")
-  endif ()
-  set (SEQAN_APP_VERSION_PATCH "0")
-  if (SEQAN_APP_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.([0-9]+)$")
-    string (REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)$" "\\1" _SEQAN_APP_VERSION_PATCH "${SEQAN_APP_VERSION}")
-  endif ()
-  if (_SEQAN_APP_VERSION_PATCH)
-    set(SEQAN_APP_VERSION_PATCH "${_SEQAN_APP_VERSION_PATCH}")
-  endif ()
-
-  # Setup the app version.  SEQAN_APP_VERSION_{MAJOR,MINOR,PATCH} have
-  # to be set.  To create nightly releases, set SEQAN_NIGHTLY_RELEASE to
-  # TRUE on the command line.
-  if (SEQAN_NIGHTLY_RELEASE)
-    include (GetCurrentDate)
-    set (CPACK_PACKAGE_VERSION "${CURRENT_YEAR}${CURRENT_MONTH}${CURRENT_DAY}")
-  else ()
-    set (CPACK_PACKAGE_VERSION "${SEQAN_APP_VERSION_MAJOR}.${SEQAN_APP_VERSION_MINOR}.${SEQAN_APP_VERSION_PATCH}")
-  endif ()
-  set (CPACK_PACKAGE_VERSION_MAJOR "${SEQAN_APP_VERSION_MAJOR}")
-  set (CPACK_PACKAGE_VERSION_MINOR "${SEQAN_APP_VERSION_MINOR}")
-  set (CPACK_PACKAGE_VERSION_PATCH "${SEQAN_APP_VERSION_PATCH}")
-
-  set (CPACK_PACKAGE_INSTALL_DIRECTORY "${APP_DIR} ${CPACK_PACKAGE_VERSION}")
-
-  include (CPack)
-endmacro (seqan_configure_cpack_app)
-
-
-# ---------------------------------------------------------------------------
-# Macro seqan_setup_cuda_vars ([DISABLE_WARNINGS] [DEBUG_DEVICE]
-#                              [ARCH sm_xx] [FLAGS flags ...])
-#
-# Setup CUDA variables.
-# ---------------------------------------------------------------------------
-
-macro (seqan_setup_cuda_vars)
-  cmake_parse_arguments(_SEQAN_CUDA
-                        "DISABLE_WARNINGS;DEBUG_DEVICE"
-                        "ARCH"
-                        "FLAGS"
-                        ${ARGN})
-  if (SEQAN_HAS_CUDA)
-    # Wrap nvcc to make cudafe output gcc-like.
-    find_program (COLOR_NVCC colornvcc PATHS ${CMAKE_SOURCE_DIR}/util NO_DEFAULT_PATH)
-    set (CUDA_NVCC_EXECUTABLE ${COLOR_NVCC})
-
-    # Build CUDA targets from the given architecture upwards.
-    set (CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -arch ${_SEQAN_CUDA_ARCH} ${_SEQAN_CUDA_FLAGS}")
-
-    # Add debug symbols to device code.
-    if (_SEQAN_CUDA_DISABLE_WARNINGS)
-      set (CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} -G")
-    endif ()
-
-    # Add flags for the CUDA compiler.
-    list (APPEND CUDA_NVCC_FLAGS_RELEASE "-O3")
-    list (APPEND CUDA_NVCC_FLAGS_MINSIZEREL "-O3")
-    list (APPEND CUDA_NVCC_FLAGS_RELWITHDEBINFO "-O3 -g -lineinfo")
-    list (APPEND CUDA_NVCC_FLAGS_DEBUG "-O0 -g -lineinfo")
-
-    if (_SEQAN_CUDA_DISABLE_WARNINGS)
-      # Disable all CUDA warnings.
-      set (CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS} --disable-warnings")
-    else ()
-      # Disable only Thrust warnings.
-      string (REGEX REPLACE "-Wall" ""
-              SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS}")
-      string (REGEX REPLACE "-pedantic" ""
-              SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS}")
-      if (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
-        set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} -Wno-unused-parameter")
-      endif (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
-    endif ()
-
-    # Fix CUDA on OSX.
-    if (APPLE AND COMPILER_IS_CLANG)
-      # (weese:) I had to deactivate the C compiler override to make it compile again
-      # NVCC mistakes /usr/bin/cc as gcc.
-      #list (APPEND CUDA_NVCC_FLAGS "-ccbin /usr/bin/clang")
-      # NVCC does not support libc++.
-      set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libstdc++")
-    endif ()
-  endif ()
-endmacro (seqan_setup_cuda_vars)
-
-
-# ---------------------------------------------------------------------------
-# Function seqan_get_version()
-#
-# Sets the variables SEQAN_VERSION, SEQAN_VERSION_MAJOR, SEQAN_VERSION_MINOR,
-# SEQAN_VERSION_PATCH, determined from seqan/version.h
-# ---------------------------------------------------------------------------
-
-macro (seqan_get_version)
-  try_run(_SEQAN_RUN_RESULT
-          _SEQAN_COMPILE_RESULT
-          ${CMAKE_BINARY_DIR}/CMakeFiles/SeqAnVersion
-          ${CMAKE_CURRENT_SOURCE_DIR}/util/cmake/SeqAnVersion.cpp
-          CMAKE_FLAGS -DINCLUDE_DIRECTORIES:STRING=${CMAKE_CURRENT_SOURCE_DIR}/include
-          COMPILE_OUTPUT_VARIABLE _COMPILE_OUTPUT
-          RUN_OUTPUT_VARIABLE _RUN_OUTPUT)
-  if (NOT _RUN_OUTPUT)
-    message("")
-    message("ERROR: Could not determine SeqAn version.")
-    message("COMPILE OUTPUT:")
-    message(${_COMPILE_OUTPUT})
-  endif (NOT _RUN_OUTPUT)
-  string(REGEX REPLACE ".*SEQAN_VERSION_MAJOR:([0-9a-zA-Z]+).*" "\\1" SEQAN_VERSION_MAJOR ${_RUN_OUTPUT})
-  string(REGEX REPLACE ".*SEQAN_VERSION_MINOR:([0-9a-zA-Z]+).*" "\\1" SEQAN_VERSION_MINOR ${_RUN_OUTPUT})
-  string(REGEX REPLACE ".*SEQAN_VERSION_PATCH:([0-9a-zA-Z]+).*" "\\1" SEQAN_VERSION_PATCH ${_RUN_OUTPUT})
-  string(REGEX REPLACE ".*SEQAN_VERSION_PRE_RELEASE:([0-9a-zA-Z]+).*" "\\1" SEQAN_VERSION_PRE_RELEASE ${_RUN_OUTPUT})
-  set(SEQAN_VERSION "${SEQAN_VERSION_MAJOR}.${SEQAN_VERSION_MINOR}.${SEQAN_VERSION_PATCH}")
-#  if (SEQAN_VERSION_PRE_RELEASE STREQUAL 1)
-#    set(SEQAN_VERSION "pre${SEQAN_VERSION}")
-#  endif (SEQAN_VERSION_PRE_RELEASE STREQUAL 1)
-endmacro (seqan_get_version)
-
-# ---------------------------------------------------------------------------
-# Function seqan_get_repository_info()
-#
-# Sets the variables SEQAN_DATE and SEQAN_REVISION determined from git.
-# ---------------------------------------------------------------------------
-
-macro (seqan_get_repository_info)
-  set (_SEQAN_GIT_DIR "${CMAKE_SOURCE_DIR}/.git")
-
-  # Get Git information.
-  if (EXISTS ${_SEQAN_GIT_DIR})
-    find_package (GitInfo QUIET)
-    if (GIT_FOUND)
-      GIT_WC_INFO (${CMAKE_SOURCE_DIR} _SEQAN)
-    endif ()
-  else ()
-    message(STATUS "No revision system found.")
-  endif ()
-
-  # Set SeqAn date of last commit.
-  if (_SEQAN_WC_LAST_CHANGED_DATE)
-    set (SEQAN_DATE "${_SEQAN_WC_LAST_CHANGED_DATE}")
-    # icc doesn't cope with spaces..
-    string(REPLACE " " "_" SEQAN_DATE "${SEQAN_DATE}")
-    message (STATUS "  Determined repository date is ${SEQAN_DATE}")
-  else ()
-    message (STATUS "  Repository date not determined.")
-  endif ()
-
-  # Set SeqAn repository revision.
-  if (_SEQAN_WC_REVISION)
-    set (SEQAN_REVISION "${_SEQAN_WC_REVISION}" CACHE INTERNAL "SeqAn repository revision.")
-    message (STATUS "  Determined repository revision is ${SEQAN_REVISION}")
-   else ()
-    set (SEQAN_REVISION "tarball" CACHE INTERNAL "SeqAn repository revision.")
-    message (STATUS "  Repository revision not determined.")
-  endif ()
-endmacro (seqan_get_repository_info)
-
-# ---------------------------------------------------------------------------
-# Macro _seqan_setup_demo_test(cpp_file executable)
-#
-# When called with the file PATH.cpp, it will check whether PATH.cpp.stdout
-# and/or PATH.cpp.stderr exists.  If this is the case then we will add a test
-# that runs the demo and compares the standard output/error stream with the
-# given file.
-#
-# Used in seqan_build_demos_develop().
-# ---------------------------------------------------------------------------
-macro (_seqan_setup_demo_test CPP_FILE EXECUTABLE)
-    set (STDOUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${CPP_FILE}.stdout")
-    set (STDERR_PATH "${CMAKE_CURRENT_SOURCE_DIR}/${CPP_FILE}.stderr")
-    if (EXISTS "${STDOUT_PATH}" OR EXISTS "${STDERR_PATH}")
-        # Build the path to the demo_checker.py script.
-        set (CHECKER_PATH "${CMAKE_SOURCE_DIR}/util/bin/demo_checker.py")
-
-        # Compose arguments to the demo_checker.py script.
-        if (MSVC)
-            # Add buildtype path and ".exe" suffix under Windows.
-            set (ARGS "--binary-path" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${EXECUTABLE}.exe")
-        elseif (WIN32)
-          # Add ".exe" suffix for all other Windows compilers, e.g. MinGW.
-            set (ARGS "--binary-path" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${EXECUTABLE}.exe")
-        else ()
-            set (ARGS "--binary-path" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${EXECUTABLE}")
-        endif ()
-
-        if (EXISTS "${STDOUT_PATH}")
-            set (ARGS ${ARGS} "--stdout-path" "${STDOUT_PATH}")
-        endif ()
-        if (EXISTS "${STDERR_PATH}")
-            set (ARGS ${ARGS} "--stderr-path" "${STDERR_PATH}")
-        endif()
-
-        # Add the test.
-        find_package (PythonInterp)
-        if (PYTHONINTERP_FOUND)
-          add_test (NAME test_${EXECUTABLE}
-                    COMMAND ${PYTHON_EXECUTABLE} ${CHECKER_PATH} ${ARGS})
-          #message(STATUS "add_test (NAME test_${EXECUTABLE} COMMAND ${PYTHON_EXECUTABLE} ${CHECKER_PATH} ${ARGS})")
-        endif (PYTHONINTERP_FOUND)
-    endif ()
-endmacro (_seqan_setup_demo_test CPP_FILE)
-
-# ---------------------------------------------------------------------------
-# Macro seqan_register_demos([prefix])
-#
-# Use this in demos directories and subdirectories.
-#
-# This is only used when doing a Whole SeqAn Release or when developing.
-# When doing a SeqAn Release then we copy over the demos, otherwise we build
-# them.
-# ---------------------------------------------------------------------------
-
-# NOTE that we look with default SeqAn dependencies and also build if some are not found. The demos themselves must contain the appropriate #if preprocessor statements.
-
-# Install all demo source files.
-macro (seqan_install_demos_release)
-    # Set flags for SeqAn. Use PARENT_SCOPE since it is called from within a function.
-    set (SEQAN_FIND_ENABLE_TESTING 0 PARENT_SCOPE)
-    set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DSEQAN_ENABLE_DEBUG=0" PARENT_SCOPE)
-    set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DSEQAN_ENABLE_DEBUG=0" PARENT_SCOPE)
-    set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DSEQAN_ENABLE_DEBUG=1" PARENT_SCOPE)
-
-    # Get a list of all .cpp and .cu files in the current directory.
-    file (GLOB_RECURSE ENTRIES
-          RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
-          ${CMAKE_CURRENT_SOURCE_DIR}/[!.]*.cpp
-          ${CMAKE_CURRENT_SOURCE_DIR}/[!.]*.cu)
-
-    # Set global definitions set for demos.
-    add_definitions (${SEQAN_DEFINITIONS})
-
-    # Get path to current source directory, relative from root.  Will be used to install demos in.
-    file (RELATIVE_PATH INSTALL_DIR "${SEQAN_ROOT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
-
-    # Install all demo files into "share/doc/seqan/demos" (demos comes from INSTALL_DIR).
-    install (FILES ${ENTRIES} DESTINATION "share/doc/seqan/${INSTALL_DIR}")
-endmacro (seqan_install_demos_release)
-
-macro (seqan_build_demos_develop PREFIX)
-    # Get a list of all .cpp and .cu files in the current directory.
-    file (GLOB_RECURSE ENTRIES
-          RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
-          ${CMAKE_CURRENT_SOURCE_DIR}/[!.]*.cpp
-          ${CMAKE_CURRENT_SOURCE_DIR}/[!.]*.cu)
-
-    # Find SeqAn with all dependencies.
-    set (SEQAN_FIND_DEPENDENCIES ALL)
-    find_package (SeqAn REQUIRED)
-    find_package (CXX11)
-    find_package (OpenMP)
-    if (OPENMP_FOUND AND CMAKE_COMPILER_IS_GNUCXX)
-        set(SEQAN_LIBRARIES ${SEQAN_LIBRARIES} -lgomp)
-    endif()
-    # Setup include directories and definitions for SeqAn; flags follow below.
-    include_directories (${SEQAN_INCLUDE_DIRS})
-    add_definitions (${SEQAN_DEFINITIONS})
-
-    # Supress unused parameter warnings for demos.
-    if (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
-        set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} -Wno-unused-parameter")
-    endif (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
-
-    # Setup flags for CUDA demos.
-    seqan_setup_cuda_vars(ARCH sm_20 DEBUG_DEVICE DISABLE_WARNINGS)
-
-    # Add SeqAn flags to CXX and NVCC flags.
-    # Set to PARENT_SCOPE since this macro is executed from within a function which declares it's own scope.
-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SEQAN_CXX_FLAGS} ${CXX11_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" PARENT_SCOPE)
-
-    # Add all demos with found flags in SeqAn.
-    foreach (ENTRY ${ENTRIES})
-        string (REPLACE "/" "_" BIN_NAME "${ENTRY}")
-        string (REPLACE "\\" "_" BIN_NAME "${BIN_NAME}")
-        get_filename_component (BIN_NAME "${BIN_NAME}" NAME_WE)
-
-        get_filename_component (FILE_NAME "${ENTRY}" NAME)
-        if ("${FILE_NAME}" MATCHES "\\.cu$")
-            if (SEQAN_HAS_CUDA)
-                cuda_add_executable(${PREFIX}${BIN_NAME} ${ENTRY})
-                target_link_libraries (${PREFIX}${BIN_NAME} ${SEQAN_LIBRARIES})
-                if (APPLE AND COMPILER_IS_CLANG)
-                    set_target_properties (${PREFIX}${BIN_NAME} PROPERTIES LINK_FLAGS -stdlib=libstdc++)
-                endif ()
-                _seqan_setup_demo_test (${ENTRY} ${PREFIX}${BIN_NAME})
-            endif ()
-        else ()
-            add_executable(${PREFIX}${BIN_NAME} ${ENTRY})
-            target_link_libraries (${PREFIX}${BIN_NAME} ${SEQAN_LIBRARIES})
-            _seqan_setup_demo_test (${ENTRY} ${PREFIX}${BIN_NAME})
-        endif ()
-    endforeach (ENTRY ${ENTRIES})
-endmacro (seqan_build_demos_develop)
-
-function (seqan_register_demos)
-    # Set optional parameter with index 0 into variable PREFIX.
-    if (${ARGC} GREATER 0)
-        set (PREFIX ${ARGV0})
-    else (${ARGC} GREATER 0)
-        set (PREFIX "")
-    endif (${ARGC} GREATER 0)
-
-    # Enable global exception handler for demos.
-    set (SEQAN_DEFINITIONS "${SEQAN_DEFINITIONS} -DSEQAN_GLOBAL_EXCEPTION_HANDLER")
-
-    # Install demo source files when releasing and build demos when developing.
-    if ("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE")
-        seqan_install_demos_release ()
-    elseif ("${SEQAN_BUILD_SYSTEM}" STREQUAL "DEVELOP")
-        seqan_build_demos_develop ("${PREFIX}")
-    endif ()
-endfunction (seqan_register_demos)
-
-# ---------------------------------------------------------------------------
-# Macro seqan_register_tests ()
-# ---------------------------------------------------------------------------
-
-# Switch to testing mode and include all subdirectories with a CMakeLists.txt
-# file inside them.  This function should be called in the CMakeLists.txt in
-# the tests directories before including subdirectories.
-#
-# The following will happen:
-#
-# * Setting definitions SEQAN_ENABLE_DEBUG=1 and SEQAN_ENABLE_TESTING=1.
-# * If the ${MODEL} variable is NightlyCoverage OR ExperimentalCoverage,
-#   and the compiler is GCC C++ then symbols for test coverate are added.
-# * All subdirectories with a CMakeLists.txt file inside will be added.
-
-macro (seqan_register_tests)
-    # Setup flags for tests.
-    set (SEQAN_FIND_ENABLE_DEBUG TRUE)
-    set (SEQAN_FIND_ENABLE_TESTING TRUE)
-    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
-
-    # Remove NDEBUG definition for tests.
-    string (REGEX REPLACE "-DNDEBUG" ""
-            CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
-    string (REGEX REPLACE "-DNDEBUG" ""
-            CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
-
-    # Add global exception handler
-    set (SEQAN_DEFINITIONS "${SEQAN_DEFINITIONS} -DSEQAN_GLOBAL_EXCEPTION_HANDLER")
-
-    # Conditionally enable coverage mode by setting the appropriate flags.
-    if (MODEL STREQUAL "NightlyCoverage")
-        if (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
-            set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
-            set (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage")
-            add_definitions(-DSEQAN_ENABLE_CHECKPOINTS=0)
-        endif (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
-    endif (MODEL STREQUAL "NightlyCoverage")
-    if (MODEL STREQUAL "ExperimentalCoverage")
-        if (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
-            set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
-            set (LDFLAGS "${LDFLAGS} -fprofile-arcs -ftest-coverage")
-            add_definitions(-DSEQAN_ENABLE_CHECKPOINTS=0)
-        endif (CMAKE_COMPILER_IS_GNUCXX OR COMPILER_IS_CLANG)
-    endif (MODEL STREQUAL "ExperimentalCoverage")
-
-    # Add all subdirectories that have a CMakeLists.txt inside them.
-    file (GLOB ENTRIES
-          RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
-          ${CMAKE_CURRENT_SOURCE_DIR}/[!.]*)
-    foreach (ENTRY ${ENTRIES})
-        if (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${ENTRY})
-            if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${ENTRY}/CMakeLists.txt)
-                add_subdirectory(${ENTRY})
-            endif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${ENTRY}/CMakeLists.txt)
-        endif (IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${ENTRY})
-    endforeach (ENTRY ${ENTRIES})
-endmacro (seqan_register_tests)
-
diff --git a/include/seqan/util/cmake/SeqAnContribs.cmake b/include/seqan/util/cmake/SeqAnContribs.cmake
deleted file mode 100644
index 670c591..0000000
--- a/include/seqan/util/cmake/SeqAnContribs.cmake
+++ /dev/null
@@ -1,117 +0,0 @@
-# ============================================================================
-#                  SeqAn - The Library for Sequence Analysis
-# ============================================================================
-# Copyright (c) 2006-2012, Knut Reinert, FU Berlin
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above copyright
-#       notice, this list of conditions and the following disclaimer in the
-#       documentation and/or other materials provided with the distribution.
-#     * Neither the name of Knut Reinert or the FU Berlin nor the names of
-#       its contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-# ============================================================================
-# Author: Manuel Holtgrewe <manuel.holtgrewe at fu-berlin.de>
-# ============================================================================
-# This CMake file is included by the root CMakeLists.txt to look for
-# installed SeqAn contribs on the WIN32 platform.
-# ============================================================================
-
-if (WIN32)
-  # For all contrib versions...
-  foreach (_SEQAN_CONTRIB_VERSION D20111031 D20130710 D20131121)
-    set (_SEQAN_CONTRIB_DIR "seqan-contrib-${_SEQAN_CONTRIB_VERSION}")
-
-	  # Determine architecture for the precompiled contribs.
-	  if (CMAKE_SIZEOF_VOID_P EQUAL 8)
-		set (CONTRIB_ARCH "x64")
-	  else ()
-		set (CONTRIB_ARCH "x86")
-	  endif ()
-
-	  # Try to figure out where the user installed the contrib.  We expect
-	  # it to be either in C:\, or one of the Program Files dirs.
-	  #
-	  # First, look into Program Files on 64 bit.
-	  if (DEFINED ENV{ProgramW6432})
-		if (IS_DIRECTORY "$ENV{ProgramW6432}/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
-		  set (SEQAN_CONTRIB_BASE "$ENV{ProgramW6432}/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
-		endif (IS_DIRECTORY "$ENV{ProgramW6432}/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
-	  endif (DEFINED ENV{ProgramW6432})
-	  # Try out Program Files for 32bit Windows.
-	  if (NOT DEFINED SEQAN_CONTRIB_BASE)
-		if (IS_DIRECTORY "$ENV{ProgramFiles}/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
-		  set (SEQAN_CONTRIB_BASE "$ENV{ProgramFiles}/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
-		endif (IS_DIRECTORY "$ENV{ProgramFiles}/${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
-	  endif (NOT DEFINED SEQAN_CONTRIB_BASE)
-	  # Try out on C:/.
-	  if (NOT DEFINED SEQAN_CONTRIB_BASE)
-		if (IS_DIRECTORY C:\\${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH})
-		  set (SEQAN_CONTRIB_BASE "C:\\${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
-		elseif ()
-		  set (SEQAN_CONTRIB_BASE "C:\\${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
-		endif ()
-	  endif (NOT DEFINED SEQAN_CONTRIB_BASE)
-      # Try to fall back to x64 on C:\ (MinGW is only available as 32 bit).
-      set (CONTRIB_ARCH "x64")
-      if (NOT DEFINED SEQAN_CONTRIB_BASE)
-        if (IS_DIRECTORY "C:\\${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
-          set (SEQAN_CONTRIB_BASE "C:\\${_SEQAN_CONTRIB_DIR}-${CONTRIB_ARCH}")
-        endif ()
-      endif ()
-
-	  # Debug help.
-      #if (NOT DEFINED SEQAN_CONTRIB_BASE)
-      #	message("SEQAN_CONTRIB_BASE is undefined!")
-      #else (NOT DEFINED SEQAN_CONTRIB_BASE)
-      #	message("SEQAN_CONTRIB_BASE is ${SEQAN_CONTRIB_BASE}")
-      #endif (NOT DEFINED SEQAN_CONTRIB_BASE)
-
-	  # Try to figure out the generator.
-	  if (IS_DIRECTORY ${SEQAN_CONTRIB_BASE})
-		if (CMAKE_GENERATOR MATCHES "^Visual Studio .*")
-		  string (REGEX REPLACE "^Visual Studio ([0-9]+).*$" "\\1" SEQAN_CONTRIB_VARIANT ${CMAKE_GENERATOR})
-		  set (SEQAN_CONTRIB_VARIANT "vs${SEQAN_CONTRIB_VARIANT}")
-		elseif (MINGW)
-		  set (SEQAN_CONTRIB_VARIANT mingw)
-		endif (CMAKE_GENERATOR MATCHES "^Visual Studio .*")
-
-        #message(STATUS "SEQAN_CONTRIB_BASE    is ${SEQAN_CONTRIB_BASE}")
-        #message(STATUS "SEQAN_CONTRIB_VARIANT is ${SEQAN_CONTRIB_VARIANT}")
-
-		# Compose contrib path.
-		set(SEQAN_CONTRIB_PATH "${SEQAN_CONTRIB_BASE}/${SEQAN_CONTRIB_VARIANT}")
-
-		# Extend CMAKE_PREFIX_PATH.
-		if (IS_DIRECTORY ${SEQAN_CONTRIB_PATH})
-		  set (CMAKE_PREFIX_PATH ${SEQAN_CONTRIB_PATH} ${CMAKE_PREFIX_PATH})
-		endif (IS_DIRECTORY ${SEQAN_CONTRIB_PATH})
-	  endif (IS_DIRECTORY ${SEQAN_CONTRIB_BASE})
-
-      message(STATUS "CMAKE_PREFIX_PATH is \"${CMAKE_PREFIX_PATH}\".")
-
-      # Break out if contribs could be found.
-      if (DEFINED SEQAN_CONTRIB_BASE)
-        break ()  # found contribs at current path
-      endif (DEFINED SEQAN_CONTRIB_BASE)
-
-    endforeach ()  # all contrib versions.
-endif (WIN32)
-
diff --git a/include/seqan/util/cmake/SeqAnCtdSetup.cmake b/include/seqan/util/cmake/SeqAnCtdSetup.cmake
deleted file mode 100644
index d3ffb34..0000000
--- a/include/seqan/util/cmake/SeqAnCtdSetup.cmake
+++ /dev/null
@@ -1,242 +0,0 @@
-# ============================================================================
-#                  SeqAn - The Library for Sequence Analysis
-# ============================================================================
-# Copyright (c) 2006-2012, Knut Reinert, FU Berlin
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above copyright
-#       notice, this list of conditions and the following disclaimer in the
-#       documentation and/or other materials provided with the distribution.
-#     * Neither the name of Knut Reinert or the FU Berlin nor the names of
-#       its contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-# ============================================================================
-# Author: Manuel Holtgrewe <manuel.holtgrewe at fu-berlin.de>
-# ============================================================================
-# CMake code for generation of CTD structure.
-#
-# All executables in the list SEQAN_CTD_EXECUTABLES will be included in the
-# resulting CTD structure.
-#
-# The following environment variables configure the output:
-#
-#   WORKFLOW_PLUGIN_DIR -- Output directory for CTD structure.  Defaults to
-#                          ${CMAKE_BINARY_DIR}/workflow_plugin_dir
-# ============================================================================
-
-# ============================================================================
-# Dependency Check
-# ============================================================================
-
-# If Java cannot be found, we disable CTD support.
-
-find_package (Java)
-if (NOT Java_JAR_EXECUTABLE)
-  message (STATUS "jar binary not found, disabling CTD support.")
-  return ()
-endif ()
-
-# Create the payload binary ZIP file.
-if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
-  set (SEQAN_PLATFORM "lnx")
-elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
-  set (SEQAN_PLATFORM "win")
-elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
-  set (SEQAN_PLATFORM "mac")
-else ()
-  message (STATUS "Unsupported platform ${CMAKE_SYSTEM_NAME}, disabling CTD support.")
-  return()
-endif ()
-
-# ============================================================================
-# Variable Setup
-# ============================================================================
-
-# Get path that all binaries are placed in.  With MSVC, we have to extend that
-# path with the configuration name.
-set (SEQAN_BIN_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
-if (MSVC)
-  set (SEQAN_BIN_DIR "${SEQAN_BIN_DIR}/$(ConfigurationName)")
-endif ()
-
-# The user-definable setting for the output plugin dir.
-set (WORKFLOW_PLUGIN_DIR ${CMAKE_BINARY_DIR}/workflow_plugin_dir CACHE PATH
-     "Directory containing the generated plugin-sources for the SeqAn Workflow/KNIME package")
-# Shortcut to "descriptors" below target directory.
-set (CTD_PATH ${WORKFLOW_PLUGIN_DIR}/descriptors)
-# Shortcut to "payload" below target directory.
-set (PAYLOAD_PATH ${WORKFLOW_PLUGIN_DIR}/payload)
-
-# We will create the contents of the payload directory temporarily within the
-# output directory.
-set (PAYLOAD_TMP_PATH ${CMAKE_BINARY_DIR}/CMakeFiles/payload.tmp)
-set (PAYLOAD_TMP_BIN_PATH ${PAYLOAD_TMP_PATH}/bin)
-
-# ============================================================================
-# Creating directory structure.
-# ============================================================================
-
-# Create directory: workflow_plugin_dir
-add_custom_command (OUTPUT ${WORKFLOW_PLUGIN_DIR}
-                    COMMAND ${CMAKE_COMMAND} -E make_directory ${WORKFLOW_PLUGIN_DIR})
-# Create directory: workflow_plugin_dir/icons
-add_custom_command (OUTPUT ${WORKFLOW_PLUGIN_DIR}/icons
-                    COMMAND ${CMAKE_COMMAND} -E make_directory ${WORKFLOW_PLUGIN_DIR}/icons
-                    DEPENDS ${WORKFLOW_PLUGIN_DIR})
-# Create directory: workflow_plugin_dir/descriptors
-add_custom_command (OUTPUT ${CTD_PATH}
-                    COMMAND ${CMAKE_COMMAND} -E make_directory ${CTD_PATH}
-                    DEPENDS ${WORKFLOW_PLUGIN_DIR})
-# Create directory: workflow_plugin_dir/payload
-add_custom_command (OUTPUT ${PAYLOAD_PATH}
-                    COMMAND ${CMAKE_COMMAND} -E make_directory ${PAYLOAD_PATH}
-                    DEPENDS ${WORKFLOW_PLUGIN_DIR})
-
-# Create directory: workflow_plugin_dir/payload.tmp
-add_custom_command (OUTPUT ${PAYLOAD_TMP_PATH}
-                    COMMAND ${CMAKE_COMMAND} -E make_directory ${PAYLOAD_TMP_PATH}
-                    DEPENDS ${WORKFLOW_PLUGIN_DIR})
-# Create directory: workflow_plugin_dir/payload.tmp/bin
-add_custom_command (OUTPUT ${PAYLOAD_TMP_BIN_PATH}
-                    COMMAND ${CMAKE_COMMAND} -E make_directory ${PAYLOAD_TMP_BIN_PATH}
-                    DEPENDS ${PAYLOAD_TMP_PATH})
-
-# ============================================================================
-# Creating payload data.
-# ============================================================================
-
-# Binaries.
-foreach (_BINARY ${SEQAN_CTD_EXECUTABLES})
-  set (_TARGET ${_BINARY})
-  set (_BINARY_PATH "${SEQAN_BIN_DIR}/${_BINARY}")
-  if (WIN32)
-    set (_BINARY "${_BINARY}.exe")
-    set (_BINARY_PATH "${_BINARY_PATH}.exe")
-  endif ()
-
-  list (APPEND TMP_PAYLOAD_FILES "${PAYLOAD_TMP_BIN_PATH}/${_BINARY}")
-  add_custom_command (OUTPUT ${PAYLOAD_TMP_BIN_PATH}/${_BINARY}
-                      COMMAND ${CMAKE_COMMAND} -E copy "${_BINARY_PATH}" "${PAYLOAD_TMP_BIN_PATH}/${_BINARY}"
-                      DEPENDS ${_TARGET}
-                              ${PAYLOAD_TMP_BIN_PATH})
-endforeach ()
-
-# binaries.ini file.
-add_custom_command (OUTPUT "${PAYLOAD_TMP_PATH}/binaries.ini"
-                    COMMAND ${CMAKE_COMMAND} -E touch ${PAYLOAD_TMP_PATH}/binaries.ini
-                    DEPENDS ${PAYLOAD_TMP_PATH})
-
-if (CMAKE_SIZEOF_VOID_P EQUAL 8)
-  set (SEQAN_SYSTEM_WORDSIZE "64")
-else ()
-  set (SEQAN_SYSTEM_WORDSIZE "32")
-endif ()
-
-set (_ZIP_NAME "binaries_${SEQAN_PLATFORM}_${SEQAN_SYSTEM_WORDSIZE}.zip")
-set (_ZIP_PATH "${PAYLOAD_PATH}")
-add_custom_command (OUTPUT ${_ZIP_PATH}/${_ZIP_NAME}
-                    COMMAND ${Java_JAR_EXECUTABLE} cfvM ${_ZIP_PATH}/${_ZIP_NAME} -C ${PAYLOAD_TMP_PATH} .
-                    DEPENDS ${PAYLOAD_PATH}
-                            ${TMP_PAYLOAD_FILES}
-                            ${PAYLOAD_TMP_PATH}/binaries.ini)
-
-# ============================================================================
-# CTDs and other descriptors contents.
-# ============================================================================
-
-# descriptors/mimetypes.xml
-# Note: The mimetypes.xml file is deprecated but we keep it here for backward compatibilty.
-add_custom_command (OUTPUT ${CTD_PATH}/mimetypes.xml
-                    COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/util/cmake/ctd/mimetypes.xml"
-                                                     "${CTD_PATH}/mimetypes.xml"
-                    DEPENDS ${CTD_PATH}
-                            ${CMAKE_SOURCE_DIR}/util/cmake/ctd/mimetypes.xml)
-list (APPEND DESCRIPTOR_FILES ${CTD_PATH}/mimetypes.xml)
-
-# descriptors/mime.types
-add_custom_command (OUTPUT ${CTD_PATH}/mime.types
-                    COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/util/cmake/ctd/mime.types"
-                                                     "${CTD_PATH}/mime.types"
-                    DEPENDS ${CTD_PATH}
-                            ${CMAKE_SOURCE_DIR}/util/cmake/ctd/mime.types)
-list (APPEND DESCRIPTOR_FILES ${CTD_PATH}/mime.types)
-
-# *.ctd
-foreach (_BINARY ${SEQAN_CTD_EXECUTABLES})
-  set (_BINARY_PATH "${SEQAN_BIN_DIR}/${_BINARY}")
-  if (WIN32)
-    set (_BINARY_PATH "${_BINARY_PATH}.exe")
-  endif ()
-
-  add_custom_command (OUTPUT ${CTD_PATH}/${_BINARY}.ctd
-                      COMMAND ${_BINARY_PATH} --write-ctd "${CTD_PATH}/${_BINARY}.ctd"
-                      DEPENDS ${CTD_PATH}
-                              ${_BINARY})
-  list (APPEND DESCRIPTOR_FILES ${CTD_PATH}/${_BINARY}.ctd)
-endforeach ()
-
-# ============================================================================
-# Eclipse Plugin Files.
-# ============================================================================
-
-# plugin.properties
-add_custom_command (OUTPUT ${WORKFLOW_PLUGIN_DIR}/plugin.properties
-                    COMMAND ${CMAKE_COMMAND} "-DSEQAN_SOURCE_DIR=${CMAKE_SOURCE_DIR}"
-                                             "-DWORKFLOW_PLUGIN_DIR=${WORKFLOW_PLUGIN_DIR}"
-                                             "-DSEQAN_VERSION_STRING=${SEQAN_VERSION_STRING}"
-                                             "-DSEQAN_DATE=${SEQAN_DATE}"
-                                             -P "${CMAKE_SOURCE_DIR}/util/cmake/ctd/configure_profile_properties.cmake"
-                    DEPENDS ${WORKFLOW_PLUGIN_DIR}
-                            ${CMAKE_SOURCE_DIR}/util/cmake/ctd/plugin.properties.in)
-
-# ============================================================================
-# Static Files.
-# ============================================================================
-
-# Static files in plugin root.
-foreach (_FILE COPYRIGHT DESCRIPTION LICENSE)
-  add_custom_command (OUTPUT ${WORKFLOW_PLUGIN_DIR}/${_FILE}
-                      COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_SOURCE_DIR}/util/cmake/ctd/${_FILE}"
-                                                       "${WORKFLOW_PLUGIN_DIR}/${_FILE}"
-                      DEPENDS ${WORKFLOW_PLUGIN_DIR}
-                              ${CMAKE_SOURCE_DIR}/util/cmake/ctd/${_FILE})
-  list (APPEND STATIC_FILES ${WORKFLOW_PLUGIN_DIR}/${_FILE})
-endforeach ()
-
-# Icon files.
-foreach (_FILE category.png splash.png)
-  add_custom_command (OUTPUT ${WORKFLOW_PLUGIN_DIR}/icons/${_FILE}
-                      COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/util/cmake/ctd/icons/${_FILE}
-                                                       ${WORKFLOW_PLUGIN_DIR}/icons/${_FILE}
-                      DEPENDS ${WORKFLOW_PLUGIN_DIR}/icons
-                              ${CMAKE_SOURCE_DIR}/util/cmake/ctd/icons/${FILE})
-  list (APPEND ICON_FILES ${WORKFLOW_PLUGIN_DIR}/icons/${_FILE})
-endforeach ()
-
-# ============================================================================
-# Master target.
-# ============================================================================
-
-add_custom_target (prepare_workflow_plugin
-                   DEPENDS ${DESCRIPTOR_FILES}
-                           ${STATIC_FILES}
-                           ${ICON_FILES}
-                           ${WORKFLOW_PLUGIN_DIR}/plugin.properties
-                           ${_ZIP_PATH}/${_ZIP_NAME})
diff --git a/include/seqan/util/cmake/SeqAnUsabilityAnalyzer.cmake b/include/seqan/util/cmake/SeqAnUsabilityAnalyzer.cmake
deleted file mode 100644
index c84c199..0000000
--- a/include/seqan/util/cmake/SeqAnUsabilityAnalyzer.cmake
+++ /dev/null
@@ -1,98 +0,0 @@
-# ============================================================================
-#                  SeqAn - The Library for Sequence Analysis
-# ============================================================================
-# Copyright (c) 2006-2012, Knut Reinert, FU Berlin
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above copyright
-#       notice, this list of conditions and the following disclaimer in the
-#       documentation and/or other materials provided with the distribution.
-#     * Neither the name of Knut Reinert or the FU Berlin nor the names of
-#       its contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-# ============================================================================
-# Author: Manuel Holtgrewe <manuel.holtgrewe at fu-berlin.de>
-# ============================================================================
-# Define the macros required for using the instrumentation for the SeqAn
-# Usability Analyzer.
-# ============================================================================
-
-# ---------------------------------------------------------------------------
-# Macro seqan_setup_sua ()
-#
-# Setup target for the SUA data collection initialization.
-# ---------------------------------------------------------------------------
-
-function (seqan_setup_sua)
-  if (NOT SEQAN_INSTRUMENTATION)
-    return ()  # Do not process further when instrumentation is disabled.
-  endif (NOT SEQAN_INSTRUMENTATION)
-
-  message(STATUS "Prepare SeqAn Usability Analyzer data collection...")
-#  if (CMAKE_HOST_WIN32 AND NOT PYTHON_EXECUTABLE)
-#    # Use EXE for instrumentation with bundled Python runtime.
-#    execute_process (COMMAND ${CMAKE_SOURCE_DIR}/misc/seqan_instrumentation/py2exe/dist/seqan_instrumentation.exe cmake ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR})
-#    add_custom_target (seqan_sua_target ${CMAKE_SOURCE_DIR}/misc/seqan_instrumentation/py2exe/dist/seqan_instrumentation.exe build ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}
-#                       COMMENT "Build Instrumentation...")
-#  else (CMAKE_HOST_WIN32 AND NOT PYTHON_EXECUTABLE)
-    # Use system's Python runtime.
-    execute_process (COMMAND ${PYTHON_EXECUTABLE} ${SEQAN_ROOT_SOURCE_DIR}/misc/seqan_instrumentation/bin/seqan_instrumentation.py cmake ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR})
-    add_custom_target (seqan_sua_target ${PYTHON_EXECUTABLE} ${SEQAN_ROOT_SOURCE_DIR}/misc/seqan_instrumentation/bin/seqan_instrumentation.py build ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}
-                       COMMENT "Build Instrumentation...")
-#  endif (CMAKE_HOST_WIN32 AND NOT PYTHON_EXECUTABLE)
-endfunction (seqan_setup_sua)
-
-# ---------------------------------------------------------------------------
-# Macro seqan_add_sua_dependency (TARGET)
-#
-# Add hooks into the SUA data collection before and after building TARGET.
-# ---------------------------------------------------------------------------
-
-function (seqan_add_sua_dependency TARGET)
-  if (NOT SEQAN_INSTRUMENTATION)
-    return ()  # Do not add if instrumentation is disabled.
-  endif (NOT SEQAN_INSTRUMENTATION)
-
-  # Add dependency on the instrumentation target.
-  add_dependencies (${TARGET} seqan_sua_target)
-
-  # Add hooks before and after building.
-#  if (CMAKE_HOST_WIN32 AND NOT PYTHON_EXECUTABLE)
-#    set (_INST ${CMAKE_SOURCE_DIR}/misc/seqan_instrumentation/py2exe/dist/seqan_instrumentation.exe)
-#    add_custom_command (TARGET ${TARGET}
-#                        PRE_BUILD
-#                        COMMAND ${_INST} pre_build ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TARGET}
-#                        COMMENT "Pre Build Instrumentation...")
-#    add_custom_command (TARGET ${TARGET}
-#                        POST_BUILD
-#                        COMMAND ${_INST} post_build ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TARGET}
-#                        COMMENT "Post Build Instrumentation...")
-#  else (CMAKE_HOST_WIN32 AND NOT PYTHON_EXECUTABLE)
-    set (_INST ${PYTHON_EXECUTABLE} ${SEQAN_ROOT_SOURCE_DIR}/misc/seqan_instrumentation/bin/seqan_instrumentation.py)
-    add_custom_command (TARGET ${TARGET}
-                        PRE_BUILD
-                        COMMAND ${_INST} pre_build ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TARGET}
-                        COMMENT "Pre Build Instrumentation...")
-    add_custom_command (TARGET ${TARGET}
-                        POST_BUILD
-                        COMMAND ${_INST} post_build ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR} ${TARGET}
-                        COMMENT "Post Build Instrumentation...")
-#  endif (CMAKE_HOST_WIN32 AND NOT PYTHON_EXECUTABLE)
-endfunction (seqan_add_sua_dependency TARGET)
diff --git a/include/seqan/util/cmake/SeqAnVersion.cpp b/include/seqan/util/cmake/SeqAnVersion.cpp
deleted file mode 100755
index c79668b..0000000
--- a/include/seqan/util/cmake/SeqAnVersion.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-// ==========================================================================
-//                 SeqAn - The Library for Sequence Analysis
-// ==========================================================================
-// Copyright (c) 2006-2010, Knut Reinert, FU Berlin
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-//     * Redistributions of source code must retain the above copyright
-//       notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above copyright
-//       notice, this list of conditions and the following disclaimer in the
-//       documentation and/or other materials provided with the distribution.
-//     * Neither the name of Knut Reinert or the FU Berlin nor the names of
-//       its contributors may be used to endorse or promote products derived
-//       from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-// ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
-// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-// DAMAGE.
-//
-// ==========================================================================
-// Author: Manuel Holtgrewe <manuel.holtgrewe at fu-berlin.de>
-// ==========================================================================
-// Prints the current SeqAn version as it is available from the header
-// <seqan/version.h>.
-// ==========================================================================
-
-#include <iostream>
-#include <seqan/version.h>
-
-int main()
-{
-    std::cerr << "SEQAN_VERSION_MAJOR:" << SEQAN_VERSION_MAJOR << "\n"
-              << "SEQAN_VERSION_MINOR:" << SEQAN_VERSION_MINOR << "\n"
-              << "SEQAN_VERSION_PATCH:" << SEQAN_VERSION_PATCH << "\n"
-              << "SEQAN_VERSION_PRE_RELEASE:" << SEQAN_VERSION_PRE_RELEASE << "\n";
-    return 0;
-}
diff --git a/include/seqan/util/cmake/SetCPackSystemName.cmake b/include/seqan/util/cmake/SetCPackSystemName.cmake
deleted file mode 100644
index f9d2274..0000000
--- a/include/seqan/util/cmake/SetCPackSystemName.cmake
+++ /dev/null
@@ -1,51 +0,0 @@
-# ============================================================================
-#                  SeqAn - The Library for Sequence Analysis
-# ============================================================================
-# Copyright (c) 2006-2012, Knut Reinert, FU Berlin
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above copyright
-#       notice, this list of conditions and the following disclaimer in the
-#       documentation and/or other materials provided with the distribution.
-#     * Neither the name of Knut Reinert or the FU Berlin nor the names of
-#       its contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-# ============================================================================
-# Author: Manuel Holtgrewe <manuel.holtgrewe at fu-berlin.de>
-# ============================================================================
-# Autotection of the the system name.
-# ============================================================================
-
-# Setting CMAKE_SYSTEM_PROCESSOR from the command line does not work, so we
-# set it here.  We need this to make the naming of the package file automatic.
-if (SEQAN_SYSTEM_PROCESSOR)
-  set(CMAKE_SYSTEM_PROCESSOR "${SEQAN_SYSTEM_PROCESSOR}")
-endif ()
-
-if (NOT DEFINED CPACK_SYSTEM_NAME)
-  set(CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
-endif (NOT DEFINED CPACK_SYSTEM_NAME)
-
-if (${CPACK_SYSTEM_NAME} MATCHES Windows)
-  set(CPACK_SYSTEM_NAME Windows-${CMAKE_SYSTEM_PROCESSOR})
-elseif (${CPACK_SYSTEM_NAME} MATCHES Darwin)
-  set(CPACK_SYSTEM_NAME Mac-${CMAKE_SYSTEM_PROCESSOR})
-endif (${CPACK_SYSTEM_NAME} MATCHES Windows)
-
diff --git a/include/seqan/util/cmake/ctd/COPYRIGHT b/include/seqan/util/cmake/ctd/COPYRIGHT
deleted file mode 100644
index 652cf0e..0000000
--- a/include/seqan/util/cmake/ctd/COPYRIGHT
+++ /dev/null
@@ -1,2 +0,0 @@
-Copyright (c) 2006-2014, Knut Reinert, FU Berlin
-All rights reserved.
diff --git a/include/seqan/util/cmake/ctd/DESCRIPTION b/include/seqan/util/cmake/ctd/DESCRIPTION
deleted file mode 100644
index 6ea4bdf..0000000
--- a/include/seqan/util/cmake/ctd/DESCRIPTION
+++ /dev/null
@@ -1,7 +0,0 @@
-SeqAn is an open source C++ library of efficient algorithms and data structures
-for the analysis of sequences with the focus on biological data. SeqAn is free
-software available under the three clause BSD license and runs under Windows,
-MacOSX and Linux. The library applies a unique generic design that guarantees
-high performance, generality, extensibility, and integration with other
-libraries. SeqAn is easy to use and simplifies the development of new software
-tools with a minimal loss of performance.
diff --git a/include/seqan/util/cmake/ctd/LICENSE b/include/seqan/util/cmake/ctd/LICENSE
deleted file mode 100644
index 1dffcb4..0000000
--- a/include/seqan/util/cmake/ctd/LICENSE
+++ /dev/null
@@ -1,31 +0,0 @@
-BSD 3-Clause License
-
-==========================================================================
-                SeqAn - The Library for Sequence Analysis
-==========================================================================
-Copyright (c) 2006-2014, Knut Reinert, FU Berlin
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-    * Neither the name of Knut Reinert or the FU Berlin nor the names of
-      its contributors may be used to endorse or promote products derived
-      from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGE.
diff --git a/include/seqan/util/cmake/ctd/configure_profile_properties.cmake b/include/seqan/util/cmake/ctd/configure_profile_properties.cmake
deleted file mode 100644
index 074a716..0000000
--- a/include/seqan/util/cmake/ctd/configure_profile_properties.cmake
+++ /dev/null
@@ -1,13 +0,0 @@
-# If possible, get latest change date from SeqAn SVN.
-message(STATUS "SEQAN_SOURCE_DIR ${SEQAN_SOURCE_DIR}")
-message(STATUS "SEQAN_DATE ${SEQAN_DATE}")
-if (SEQAN_DATE)
-	string(REGEX REPLACE "^([0-9]+)-([0-9]+)-([0-9]+) ([0-9]+):([0-9]+).*"
-    "\\1\\2\\3\\4\\5" SEQAN_LAST_CHANGED_DATE "${SEQAN_DATE}")
-  set (CF_SEQAN_VERSION ${SEQAN_VERSION_STRING}.${SEQAN_LAST_CHANGED_DATE})
-else ()
-  set (CF_SEQAN_VERSION "${SEQAN_VERSION_STRING}")
-endif ()
-
-# Actually configure the file.
-configure_file (${SEQAN_SOURCE_DIR}/util/cmake/ctd/plugin.properties.in ${WORKFLOW_PLUGIN_DIR}/plugin.properties)
\ No newline at end of file
diff --git a/include/seqan/util/cmake/ctd/icons/app.png b/include/seqan/util/cmake/ctd/icons/app.png
deleted file mode 100644
index 768e425..0000000
Binary files a/include/seqan/util/cmake/ctd/icons/app.png and /dev/null differ
diff --git a/include/seqan/util/cmake/ctd/icons/category.png b/include/seqan/util/cmake/ctd/icons/category.png
deleted file mode 100644
index e439f1d..0000000
Binary files a/include/seqan/util/cmake/ctd/icons/category.png and /dev/null differ
diff --git a/include/seqan/util/cmake/ctd/icons/splash.png b/include/seqan/util/cmake/ctd/icons/splash.png
deleted file mode 100644
index 012d81a..0000000
Binary files a/include/seqan/util/cmake/ctd/icons/splash.png and /dev/null differ
diff --git a/include/seqan/util/cmake/ctd/mime.types b/include/seqan/util/cmake/ctd/mime.types
deleted file mode 100644
index 47255dd..0000000
--- a/include/seqan/util/cmake/ctd/mime.types
+++ /dev/null
@@ -1,37 +0,0 @@
-application/x-fasta fasta fa
-application/x-fastq fastq fq
-application/x-masic masic mas
-application/x-gsi gsi
-application/x-z-gsi gsi.gz
-application/x-gff gff
-application/x-gtf gtf
-application/x-razers razers
-application/x-eland eland
-application/x-masai raw
-application/x-sam sam
-application/x-bam bam
-application/x-afg afg
-application/x-dist dist
-application/x-dot dot
-application/x-newick newick
-application/x-alftsv alf.tsv
-application/x-txt txt
-application/x-fasta fasta fa
-application/x-fastq fastq fq
-application/x-masic masic mas
-application/x-gsi gsi
-application/x-z-gsi gsi.gz
-application/x-razers razers
-application/x-eland eland
-application/x-masai raw
-application/x-sam sam
-application/x-bam bam
-application/x-afg afg
-application/x-dist dist
-application/x-dot dot
-application/x-newick newick
-application/x-alftsv alf.tsv
-application/x-txt txt
-application/x-bam-coverage-tsv bam_coverage_tsv
-application/x-fq-stats-tsv fq_stats_tsv
-application/x-rabema-report-tsv rabema_report_tsv
\ No newline at end of file
diff --git a/include/seqan/util/cmake/ctd/mimetypes.xml b/include/seqan/util/cmake/ctd/mimetypes.xml
deleted file mode 100644
index 4eac9ec..0000000
--- a/include/seqan/util/cmake/ctd/mimetypes.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<mimetypes xmlns="http://www.ball-project.org/mimetypes">
- <mimetype name="FASTA" binary="false" ext="FASTA" description="FASTA"/>
- <mimetype name="FASTA" binary="false" ext="FA" description="FASTA"/>
- <mimetype name="FASTQ" binary="false" ext="FQ" description="FASTQ"/>
- <mimetype name="FASTQ" binary="false" ext="FASTQ" description="FASTQ"/>
- <mimetype name="MASIC" binary="false" ext="masic" description="MASIC"/>
- <mimetype name="MASIC" binary="false" ext="mas" description="MASIC"/>
- <mimetype name="GSI" binary="false" ext="gsi" description="Gold Standard Intervals"/>
- <mimetype name="ZGSI" binary="true" ext="gsi.gz" description="GZiped Gold Standard Intervals"/>
- <mimetype name="GFF" binary="false" ext="gff" description="General Feature Format"/>
- <mimetype name="GTF" binary="false" ext="gtf" description="Gene transfer format"/> 
- <mimetype name="RAZERS" binary="false" ext="razers" description="RazerS read mapping format"/>
- <mimetype name="ELAND" binary="false" ext="eland" description="ELAND read mapping format"/>
- <mimetype name="MASAI" binary="true" ext="raw" description="Masai read mapping format"/>
- <mimetype name="SAM" binary="true" ext="sam" description="SAM Sequence Alignment and Mapping Format"/>
- <mimetype name="BAM" binary="true" ext="sam" description="BAM Binary Sequence Alignment and Mapping Format"/>
- <mimetype name="AFG" binary="true" ext="afg" description="AMOS Assembly Container"/>
- <mimetype name="DIST" binary="true" ext="dist" description="PHYLIP Formatted Distance Matrix"/>
- <mimetype name="DOT" binary="true" ext="dot" description="GraphViz DOT Graph Format"/>
- <mimetype name="NEWICK" binary="true" ext="newick" description="NEWICK Tree Format"/>
- <mimetype name="ALFTSV" binary="true" ext="alf.tsv" description="ALF output format"/>
- <mimetype name="TXT" binary="true" ext="txt" description="Text"/>
-</mimetypes>
diff --git a/include/seqan/util/cmake/ctd/plugin.properties.in b/include/seqan/util/cmake/ctd/plugin.properties.in
deleted file mode 100644
index d3b87ff..0000000
--- a/include/seqan/util/cmake/ctd/plugin.properties.in
+++ /dev/null
@@ -1,15 +0,0 @@
-# the package of the plugin
-pluginPackage=de.seqan
-
-# the name of the plugin
-pluginName=SeqAn
-
-# the version of the plugin
-pluginVersion=@CF_SEQAN_VERSION@
-
-# the path (starting from KNIMEs Community Nodes node)
-nodeRepositoyRoot=community
-
-
-executor=com.genericworkflownodes.knime.execution.impl.LocalToolExecutor
-commandGenerator=com.genericworkflownodes.knime.execution.impl.CLICommandGenerator
\ No newline at end of file
diff --git a/include/seqan/util/cmake/package.cmake b/include/seqan/util/cmake/package.cmake
deleted file mode 100644
index a3147b3..0000000
--- a/include/seqan/util/cmake/package.cmake
+++ /dev/null
@@ -1,96 +0,0 @@
-# ============================================================================
-#                  SeqAn - The Library for Sequence Analysis
-# ============================================================================
-# Copyright (c) 2006-2012, Knut Reinert, FU Berlin
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-#
-#     * Redistributions of source code must retain the above copyright
-#       notice, this list of conditions and the following disclaimer.
-#     * Redistributions in binary form must reproduce the above copyright
-#       notice, this list of conditions and the following disclaimer in the
-#       documentation and/or other materials provided with the distribution.
-#     * Neither the name of Knut Reinert or the FU Berlin nor the names of
-#       its contributors may be used to endorse or promote products derived
-#       from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
-# DAMAGE.
-# ============================================================================
-# Author: Manuel Holtgrewe <manuel.holtgrewe at fu-berlin.de>
-# ============================================================================
-# CMake file that is included from the root CMakeLists.txt.
-#
-# It sets variables for configuring CPack and then invokes CPack such that the
-# "make package" command is available.
-# ============================================================================
-
-if (("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE") OR
-    ("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE_APPS"))
-    include (InstallRequiredSystemLibraries)
-endif ()
-
-if (("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE") OR
-    ("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE_LIBRARY") OR
-    ("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE_APPS"))
-    include (SetCPackSystemName)
-
-    # NOTE that you have to run "make dox" before running cpack.  The reason
-    # is that we cannot add dependencies to the install target at the moment.
-    # See: http://public.kitware.com/Bug/view.php?id=8438
-
-    # ===========================================================================
-    # Archive Packages (.tar & .tar.bz2)
-    # ===========================================================================
-
-    if (WIN32)
-        SET (CPACK_GENERATOR "ZIP")
-    else ()
-        SET (CPACK_GENERATOR "ZIP;TBZ2")
-    endif ()
-    if ("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE")
-      SET(CPACK_PACKAGE_NAME "seqan")
-    elseif ("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE_LIBRARY")
-      SET(CPACK_PACKAGE_NAME "seqan-library")
-    elseif ("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE_APPS")
-      SET(CPACK_PACKAGE_NAME "seqan-apps")
-    endif ()
-    SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "SeqAn - The C++ library for sequence analysis.")
-    SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Manuel Holtgrewe <manuel.holtgrewe at fu-berlin.de>")
-    SET(CPACK_PACKAGE_VENDOR "SeqAn Team, FU Berlin")
-    SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README.rst")
-    SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
-
-    seqan_get_version()
-
-    if (SEQAN_NIGHTLY_RELEASE)
-      include (GetCurrentDate)
-      set (CPACK_PACKAGE_VERSION "${CURRENT_YEAR}${CURRENT_MONTH}${CURRENT_DAY}")
-      set (CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}")
-    else ()
-      set (CPACK_PACKAGE_VERSION "${SEQAN_VERSION_MAJOR}.${SEQAN_VERSION_MINOR}.${SEQAN_VERSION_PATCH}")
-      set (CPACK_PACKAGE_VERSION "${SEQAN_VERSION}")
-    endif (SEQAN_NIGHTLY_RELEASE)
-    SET(CPACK_PACKAGE_VERSION_MAJOR "${SEQAN_VERSION_MAJOR}")
-    SET(CPACK_PACKAGE_VERSION_MINOR "${SEQAN_VERSION_MINOR}")
-    SET(CPACK_PACKAGE_VERSION_PATCH "${SEQAN_VERSION_PATCH}")
-    SET(CPACK_PACKAGE_INSTALL_DIRECTORY "SeqAn ${CPACK_PACKAGE_VERSION}")
-
-    if ("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE_LIBRARY")
-        set (CPACK_PACKAGE_FILE_NAME "seqan-library-${CPACK_PACKAGE_VERSION}")
-    endif ("${SEQAN_BUILD_SYSTEM}" STREQUAL "SEQAN_RELEASE_LIBRARY")
-
-    # Should be the last include.
-    INCLUDE(CPack)
-endif ()
diff --git a/include/seqan/util/colornvcc b/include/seqan/util/colornvcc
deleted file mode 100755
index 83b91be..0000000
--- a/include/seqan/util/colornvcc
+++ /dev/null
@@ -1,259 +0,0 @@
-#! /usr/bin/perl -w
-
-#
-# colornvcc
-#
-# Version: 1.0.0
-#
-# A wrapper to colorize the output from Nvidia's cuda
-# compiler "nvcc".  This wrapper also outputs messages
-# in gcc format instead of nvcc's format so that tools
-# which parse gcc errors can find filenames and line 
-# numbers (e.g. eclipse).
-#
-# This colornvcc wrapper is based on the colorgcc wrapper:
-# colorgcc Version: 1.3.2 by Jamie Moyers
-#
-# Requires the ANSIColor module from CPAN.
-#
-# Usage:
-#
-# In a directory that occurs in your PATH _before_ the directory
-# where the compiler lives, create a softlink to colornvcc for
-# each compiler you want to colorize:
-#
-#    nvcc -> colornvcc
-#
-# That's it. When "nvcc" is invoked, colornvcc is run instead.
-# colornvcc looks at the program name to figure out which compiler to run.
-#
-# The default settings can be overridden with ~/.colornvccrc.
-# See the comments in the sample .colornvccrc for more information.
-#
-# Note:
-#
-# colornvcc will only emit color codes if:
-# 
-#    (1) Its STDOUT is a tty and
-#    (2) the value of $TERM is not listed in the "nocolor" option.
-#
-# If colornvcc colorizes the output, the compiler's STDERR will be
-# combined with STDOUT. Otherwise, colornvcc just passes the output from
-# the compiler through without modification.
-# 
-# Author: Kristi Tsukida <kristi.tsukida at gmail.com>
-# Started: April 23, 2009
-# Licence: GNU Public License
-#
-# Credits:
-#
-#    I got the idea for this from "colorgcc" by Jamie Moyers
-#       who was inspired by a script called "color_cvs":
-#       color_cvs .03   Adrian Likins <adrian at gimp.org> <adrian at redhat.com>
-#
-# Changes:
-#
-# 1.0.0 Initial Version
-
-use Term::ANSIColor;
-use IPC::Open3;
-
-sub initDefaults
-{
-   $compilerPaths{"nvcc"} = "/usr/local/cuda/bin/nvcc";
-
-   $nocolor{"dumb"} = "true";
-
-   $colors{"srcColor"} = color("cyan");
-   $colors{"introColor"} = color("blue");
-
-   $colors{"warningFileNameColor"} = color("yellow");
-   $colors{"warningNumberColor"}   = color("yellow");
-   $colors{"warningMessageColor"}  = color("yellow");
-
-   $colors{"errorFileNameColor"} = color("bold red");
-   $colors{"errorNumberColor"}   = color("bold red");
-   $colors{"errorMessageColor"}  = color("bold red");
-}
-
-sub loadPreferences
-{
-# Usage: loadPreferences("filename");
-
-   my($filename) = @_;
-
-   open(PREFS, "<$filename") || return;
-
-   my $nvccVersion;
-   my $overrideCompilerPaths = 0;
-
-   while(<PREFS>)
-   {
-      next if (m/^\#.*/);          # It's a comment.
-      next if (!m/(.*):\s*(.*)/);  # It's not of the form "foo: bar".
-
-      $option = $1;
-      $value = $2;
-
-      if ($option =~ m/\A(nvcc)\Z/)
-      {
-                  $compilerPaths{$option} = $value;
-                  $overrideCompilerPaths  = 1;
-      }
-          elsif ($option eq "nvccVersion")
-          {
-                  $nvccVersion = $value;
-          }
-      elsif ($option eq "nocolor")
-      {
-         # The nocolor option lists terminal types, separated by
-         # spaces, not to do color on.
-         foreach $termtype (split(/\s+/, $value))
-         {
-            $nocolor{$termtype} = "true";
-         }
-      }
-      else
-      {
-         $colors{$option} = color($value);
-      }
-   }
-   close(PREFS);
-
-   # Append "-<nvccVersion>" to user-defined compilerPaths
-   if ($overrideCompilerPaths && $nvccVersion) {
-           $compilerPaths{$_} .= "-$nvccVersion" foreach (keys %compilerPaths);
-   }
-}
-
-sub srcscan
-{
-# Usage: srcscan($text, $normalColor)
-#    $text -- the text to colorize
-#    $normalColor -- The escape sequence to use for non-source text.
-
-# Looks for text between ` and ', and colors it srcColor.
-
-   my($line, $normalColor) = @_;
-
-   my($srcon) = color("reset") . $colors{"srcColor"};
-   my($srcoff) = color("reset") . $normalColor;
-
-   $line = $normalColor . $line;
-
-   # This substitute replaces `foo' with `AfooB' where A is the escape
-   # sequence that turns on the the desired source color, and B is the
-   # escape sequence that returns to $normalColor.
-   $line =~ s/\`(.*?)\'/\`$srcon$1$srcoff\'/g;
-
-   print($line, color("reset"));
-}
-
-#
-# Main program
-#
-
-# Set up default values for colors and compilers.
-initDefaults();
-
-# Read the configuration file, if there is one.
-$configFile = $ENV{"HOME"} . "/.colornvccrc";
-$default_configFile = "/etc/colornvccrc";
-if (-f $configFile)
-{
-   loadPreferences($configFile);
-} elsif (-f $default_configFile ) {
-        loadPreferences($default_configFile)
-        }
-
-# Figure out which compiler to invoke based on our program name.
-$0 =~ m%.*/(.*)$%;
-$progName = $1 || $0;
-
-$compiler = $compilerPaths{$progName} || $compilerPaths{"nvcc"};
-
-# Check that we don't reference self
-die "$compiler is self-referencing"
-        if ( -l $compiler and (stat $compiler)[1] == (stat $0)[1] );
-
-# Get the terminal type. 
-$terminal = $ENV{"TERM"} || "dumb";
-
-# If it's in the list of terminal types not to color, or if
-# we're writing to something that's not a tty, don't do color.
-$noColor = "false";
-if (! -t STDOUT || $nocolor{$terminal})
-{
-   $noColor = "true"; 
-   #exec $compiler, @ARGV
-   #   or die("Couldn't exec");
-}
-
-# Keep the pid of the compiler process so we can get its return
-# code and use that as our return code.
-$compiler_pid = open3('<&STDIN', \*NVCCOUT, \*NVCCOUT, $compiler, @ARGV);
-
-$line = "";
-
-# Colorize the output from the compiler.
-while(<NVCCOUT>)
-{
-   if (m/^(.*?)\(([0-9]+)\):(.*)$/) # filename(lineno):message
-   {
-      $field1 = $1 || "";
-      $field2 = $2 || "";
-      $field3 = $3 || "";
-	  if ($field3 =~ m/\s+(H|h)ere.*/)
-	  {
-         #print("$lineInstantiated from $1")
-	     print("$field1:$field2   instantiated from $line");
-	  }
-      elsif ($noColor eq "true")
-      {
-         print("$field1:$field2:$field3");
-      }
-      elsif ($field3 =~ m/\s+(W|w)arn(u|i)ng:.*/)
-      {
-         # Warning
-         print($colors{"warningFileNameColor"}, "$field1:", color("reset"));
-         print($colors{"warningNumberColor"}, "$field2:", color("reset"));
-         srcscan($field3, $colors{"warningMessageColor"});
-      }
-      else 
-      {
-         # Error
-         print($colors{"errorFileNameColor"}, "$field1:", color("reset"));
-         print($colors{"errorNumberColor"}, "$field2:", color("reset"));
-         srcscan($field3, $colors{"errorMessageColor"});
-      }
-      print("\n");
-   }
-   elsif (m/^$/) # empty line
-   {
-   }
-   elsif ($noColor eq "true")
-   {
-      print($_);
-   }
-   elsif (m/^(.*?):(.+):$/) # filename:message:
-   {
-      # No line number, treat as an "introductory" line of text.
-      srcscan($_, $colors{"introColor"});
-   }
-   elsif (m/^\s+detected during:$/)
-   {
-   }
-   elsif (m/^\s+(detected during )?instantiation of (.*)$/)
-   {
-      $line = $2 || "";
-   }
-   else # Anything else.        
-   {
-      # Doesn't seem to be a warning or an error. Print normally.
-      print(color("reset"), $_);
-   }
-}
-
-# Get the return code of the compiler and exit with that.
-waitpid($compiler_pid, 0);
-exit ($? >> 8);
diff --git a/include/seqan/util/ctd2galaxy.py b/include/seqan/util/ctd2galaxy.py
deleted file mode 100644
index e39173a..0000000
--- a/include/seqan/util/ctd2galaxy.py
+++ /dev/null
@@ -1,192 +0,0 @@
-#!/usr/bin/env python
-
-import argparse
-import sys
-import xml.sax
-
-
-class CLIElement(object):
-    """Represents a <clielement> tag.
-
-    option_identifier -- str with parameters (e.g. --param), empty if argument.
-    is_list -- bool whether the element is a list.
-    """
-
-    def __init__(self, option_identifier='', mapping_path='', is_list=False):
-        self.option_identifier = option_identifier
-        self.mapping = None  # Link to ParametersNode, set after parsing.
-        self.mapping_path = mapping_path
-        self.is_list = is_list
-
-    def __str__(self):
-        t = (self.option_identifier, self.mapping_path, self.is_list)
-        return 'CLIElement(%s, %s, %s)' % tuple(map(repr, list(t)))
-
-
-class ParametersNode(object):
-    """Represents a <NODE> tag inside the <PARAMETERS> tags."""
-    
-    def __init__(self, kind='', name='', description='', value='', type_='', tags='',
-                 restrictions='', supported_formats=''):
-        self.name = name
-        self.description = description
-        self.value = value
-        self.type_ = type_
-        self.tags = tags
-        self.supported_formats = supported_formats
-        self.restrictions = None
-        self.path = None  # root if is None
-        self.parent = None  # not set, usually a list
-        self.children = {}
-
-    def computePath(self):
-        """Compute path entry from parent links."""
-
-    def __str__(self):
-        t = (self.name, self.description, self.value, self.type_, self.tags,
-             self.supported_formats, self.children)
-        return 'ParametersNode(%s, %s, %s, %s, %s, %s, %s)' % tuple(map(repr, t))
-
-    def __repr__(self):
-        return str(self)
-
-
-class Tool(object):
-    """Represents the top-level <tool> tag from a CTD file."""
-
-    def __init__(self, name='', executable_name='', version='',
-                 description='', manual='', doc_url='',
-                 category=''):
-        self.name = name
-        self.executable_name = executable_name
-        self.version = version
-        self.description = description
-        self.manual = manual
-        self.doc_url = doc_url
-        self.category = category
-        self.cli_elements = []
-        self.parameters = None
-
-    def __str__(self):
-        t = (self.name, self.executable_name, self.version, self.description,
-             self.manual, self.doc_url, self.category)
-        return 'Tool(%s, %s, %s, %s, %s, %s, %s)' % tuple(map(repr, list(t)))
-
-        
-
-class CTDFormatException(Exception):
-    """Raised when there is a format error in CTD."""
-
-    
-class CTDHandler(xml.sax.handler.ContentHandler):
-    def __init__(self):
-        self.result = None
-        # A stack of tag names that are currently open.
-        self.stack = []
-        # The current parameter to append nodes below.
-        self.parameter_node = None
-
-    def startElement(self, name, attrs):
-        """Handle start of element."""
-        # Maintain a stack of open tags.
-        self.stack.append(name)
-        if self.stack == ['tool']:
-            # Create the top level Tool object.
-            self.tool = Tool()
-            self.result = self.tool
-        elif self.stack == ['tool', 'cli', 'clielement']:
-            # Create a new CLIElement object for a <clieelement> tag.
-            if not attrs.get('isList'):
-                raise CTDFormatException('No attribute isList in <clielement>.')
-            if attrs.get('optionIdentifier') is None:
-                raise CTDFormatException('no attribute optionIdentifier in <clielement>.')
-            is_list = (attrs.get('isList') == 'false')
-            option_identifier = attrs.get('optionIdentifier')
-            self.tool.cli_elements.append(CLIElement(option_identifier=option_identifier, is_list=is_list))
-        elif self.stack == ['tool', 'cli', 'clielement', 'mapping']:
-            # Handle a <mapping> sub entry of a <clieelement> tag.
-            if not attrs.get('referenceName'):
-                raise CTDFormatException('no attribute referenceName in <mapping>')
-            self.tool.cli_elements[-1].mapping_path = attrs['referenceName']
-        elif self.stack == ['tool', 'PARAMETERS']:
-            # Handle the <PARAMETERS> entry by creating a new top parameters node.
-            self.tool.parameters = ParametersNode(kind='node', name='<root>')
-            self.parameter_node = self.tool.parameters
-        elif self.stack[:2] == ['tool', 'PARAMETERS'] and self.stack[-1] == 'NODE':
-            # Create a new node ParametersNode for the <PARAMETERS> entry.
-            if not attrs.get('name'):
-                raise CTDFormatException('no attribute name in <NODE>')
-            name = attrs.get('name')
-            node = ParametersNode(kind='node', name=name)
-            node.parent = self.parameter_node
-            self.parameter_node.children[name] = node
-            self.parameter_node = node.parent
-        elif self.stack[:2] == ['tool', 'PARAMETERS'] and self.stack[-1] == 'ITEM':
-            # Create a new item ParametersNode for the <ITEM> entry.
-            if not attrs.get('name'):
-                raise CTDFormatException('no attribute name in <ITEM>')
-            name = attrs.get('name')
-            value = attrs.get('value')
-            type_ = attrs.get('type')
-            tags = attrs.get('tags')
-            description = attrs.get('description')
-            restrictions = attrs.get('restrictions')
-            supported_formats = attrs.get('supported_formats')
-            child = ParametersNode(
-                kind='item', name=name, description=description, value=value,
-                type_=type_, tags=tags, supported_formats=supported_formats)
-            self.parameter_node.children[name] = child
-
-    def endElement(self, name):
-        self.stack.pop()
-        if name == 'NODE':
-            self.parameter_node = self.parameter_node.parent
-
-    def characters(self, content):
-        if self.stack == ['tool', 'name']:
-            self.tool.name += content
-        elif self.stack == ['tool', 'executableName']:
-            self.tool.executable_name += content
-        elif self.stack == ['tool', 'version']:
-            self.tool.version += content
-        elif self.stack == ['tool', 'description']:
-            self.tool.description += content
-        elif self.stack == ['tool', 'manual']:
-            self.tool.manual += content
-        elif self.stack == ['tool', 'docurl']:
-            self.tool.doc_url += content
-        elif self.stack == ['tool', 'category']:
-            self.tool.category += content
-
-
-class CTDParser(object):
-    """Parser for CTD files."""
-
-    def __init__(self):
-        self.handler = CTDHandler()
-
-    def parse(self, path):
-        parser = xml.sax.make_parser()
-        parser.setContentHandler(self.handler)
-        parser.parse(path)
-        return self.handler.result
-
-
-def main():
-    parser = argparse.ArgumentParser(description='Convert CTD to Galaxy XML')
-    parser.add_argument('-i', '--in-file', metavar='FILE',
-                        help='CTD file to read.', dest='in_file',
-                        required=True)
-
-    args = parser.parse_args()
-
-    ctd_parser = CTDParser()
-    tool = ctd_parser.parse(args.in_file)
-    print tool
-    for cli in tool.cli_elements:
-        print '  %s' % cli
-    print tool.parameters
-        
-
-if __name__ == '__main__':
-    sys.exit(main())
\ No newline at end of file
diff --git a/include/seqan/util/linux_binary_tests.sh b/include/seqan/util/linux_binary_tests.sh
deleted file mode 100755
index 4a004f8..0000000
--- a/include/seqan/util/linux_binary_tests.sh
+++ /dev/null
@@ -1,171 +0,0 @@
-#!/bin/bash
-# ----------------------------------------------------------------------------
-#                  SeqAn - The Library for Sequence Analysis
-# ----------------------------------------------------------------------------
-# Copyright (c) 2006-2013, Knut Reinert, FU Berlin
-# All rights reserved.
-#
-# License: BSD 3-clause
-# ----------------------------------------------------------------------------
-# Author: Sabrina Krakau <sabrina.krakau at fu-berlin.de>
-# Author: Manuel Holtgrewe <manuel.holtgrewe at fu-berlin.de>
-# ----------------------------------------------------------------------------
-# Binary test helper script.
-#
-# This script downloads binary packages of SeqAn apps on remote Linux machines
-# and calls the programs to test whether the applications can be executed at
-# all and thus check whether the system's libraries are compatible.
-#
-# The following packages have to be installed in order to run on the operating
-# systems:
-#
-# SUSE 64 Bit:
-#   zypper install libgomp1-32bit
-#
-# Fedora 64 Bit:
-#   yum install -y glibc.i686 libstdc++.i686 zlib.i686 libgomp.i686
-# ----------------------------------------------------------------------------
-
-# Global variables with user name and target host.
-USER_NAME=$USER
-SERVER_NAMES=
-
-# Parse option values.
-while getopts ":u:h:" opt
-do
-    case $opt in
-        u)
-            USER_NAME=$OPTARG
-            ;;
-        h)
-            SERVER_NAMES=$OPTARG
-            ;;
-        \?)
-            echo "Invalid option: -$OPTARG" >&2
-            exit 1
-            ;;
-    esac
-done
-
-
-# Check that ${USER_NAME} and ${SERVER_NAMES} are set.
-if [[ "$USER_NAME" == "" || "$SERVER_NAMES" == "" ]]; then
-    echo "Missing option -h" >&2
-    exit 1
-fi
-
-# List of binary packages to tests.
-BINARY_URLS=(
-    "http://packages.seqan.de/razers3/razers3-3.1.1-Linux-i686.tar.bz2"
-    "http://packages.seqan.de/razers3/razers3-3.1.1-Linux-x86_64.tar.bz2"
-    "http://packages.seqan.de/stellar/stellar-1.4.1-Linux-i686.tar.bz2"
-    "http://packages.seqan.de/stellar/stellar-1.4.1-Linux-x86_64.tar.bz2"
-    "http://packages.seqan.de/breakpoint_calculator/breakpoint_calculator-0.2.1-Linux-i686.tar.bz2"
-    "http://packages.seqan.de/breakpoint_calculator/breakpoint_calculator-0.2.1-Linux-x86_64.tar.bz2"
-    "http://packages.seqan.de/snp_store/snp_store-1.0.1-Linux-i686.tar.bz2"
-    "http://packages.seqan.de/snp_store/snp_store-1.0.1-Linux-x86_64.tar.bz2")
-
-# Array with test calls for each package.
-APP_CALLS=(
-    "./razers3 -o output.razers ../example/genome.fa ../example/reads.fa"
-    "./razers3 -o output.razers ../example/genome.fa ../example/reads.fa"
-    "./stellar -o ../example/mapped_reads.gff --minLength 30 ../example/NC_001477.fasta ../example/reads.fasta" 
-    "./stellar -o ../example/mapped_reads.gff --minLength 30 ../example/NC_001477.fasta ../example/reads.fasta"
-    "./breakpoint_calculator -d2 ../example/alignment.maf"
-    "./breakpoint_calculator -d2 ../example/alignment.maf"
-    "./snp_store ../example/exampleGenome.fa ../example/exampleReads.gff -o output_snp.txt -id output_indel1.txt"
-    "./snp_store ../example/exampleGenome.fa ../example/exampleReads.gff -o output_snp.txt -id output_indel1.txt")
-
-# Create tmp directory, download binaries, call program and return success/error message
-#
-# Arguments:
-#
-#  $1 server to connect to
-#  $2 call to application
-function test_app ()
-{
-    USER_SERVER=$1
-    APP_CALL=$2
-    # Create temporary directory.
-    echo "testing ${F}" >&2
-   	TMPDIR=$(ssh $USER_SERVER "mktemp -d")
-
-    # Download package.
-    echo -n "  downloading ..." >&2
-	ssh $USER_SERVER "cd $TMPDIR && curl $F -o binaryName.tar.bz2 &>/dev/null"
-    if [[ "$?" = "0" ]]; then
-        echo " OK" >&2
-    else
-        echo " FAILED" >&2
-        echo "FAILED"  # for caller
-        return
-    fi
-
-    # Extracting package.
-    echo -n "  unpacking ..." >&2
-	ssh $USER_SERVER "cd $TMPDIR && tar -xjf binaryName.tar.bz2"
-    if [[ "$?" = "0" ]]; then
-        echo " OK" >&2
-    else
-        echo " FAILED" >&2
-        echo "FAILED"  # for caller
-        return
-    fi
-
-    # Calling binary.
-    echo -n "  calling test ..." >&2
-    FILE=$(mktemp)
-    MSG=`ssh $USER_SERVER "cd $TMPDIR && cd */bin && (${APP_CALL}) > file.stdout" &>${FILE}`
-    RET=$?
-    if [[ "${RET}" = "0" ]]; then
-        echo " OK" >&2
-        echo "OK"  # for caller
-        return
-    else
-        echo " FAILED" >&2
-        echo " The program call returns: ${RET}." >&2
-        echo " Program output is >>>" >&2
-        cat ${FILE} >&2
-        rm -f ${FILE}
-        echo ${MSG}
-        echo "<<<" >&2
-        echo "FAILED"  # for caller
-        return
-    fi
-
-    # Remove temporary directory.
-	ssh $USER_SERVER "rm -r $TMPDIR"
-    
-}
-
-echo "Testing SeqAn Linux Binaries..." >&2
-echo >&2
-
-RESULTS=()
-IFS=";"; 
-
-# Execute tests for each server.
-for SERVER_NAME in ${SERVER_NAMES[@]}; do
-    echo "testing on ${SERVER_NAME}"
-	USER_SERVER="$USER_NAME@$SERVER_NAME"
-	COUNTER=0
-	for F in ${BINARY_URLS[@]}; do
-        #echo "${APP_CALLS[$COUNTER]}" >&2
-        RET=`test_app $USER_SERVER "${APP_CALLS[$COUNTER]}"`
-	    RESULTS+=("${RET}")
-		let COUNTER=COUNTER+1
-	done
-done
-
-# For each server and for each binary-url: Output test result
-echo -e '\t'
-for (( I = 0 ; I < ${#SERVER_NAMES[@]} ; I++ )) do
-    echo "Binary tests on ${SERVER_NAMES[$I]}:"
-    echo ""
-    for (( J = 0 ; J < ${#BINARY_URLS[@]} ; J++ )) do
-        K=$(($J+$I*${#BINARY_URLS[@]}))
-        echo -e "${BINARY_URLS[$J]}\t${RESULTS[$K]}"
-    done
-done
-
-
diff --git a/include/seqan/util/makefile_project/Makefile b/include/seqan/util/makefile_project/Makefile
deleted file mode 100644
index 7321460..0000000
--- a/include/seqan/util/makefile_project/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-default: all
-
-all: debug release
-
-debug:
-	$(MAKE) -C debug
-
-release:
-	$(MAKE) -C release
-
-clean:
-	$(MAKE) -C debug clean
-	$(MAKE) -C release clean
-
-.PHONY: default all debug release clean
\ No newline at end of file
diff --git a/include/seqan/util/makefile_project/Makefile.rules b/include/seqan/util/makefile_project/Makefile.rules
deleted file mode 100644
index 0b4c6ce..0000000
--- a/include/seqan/util/makefile_project/Makefile.rules
+++ /dev/null
@@ -1,17 +0,0 @@
-SRC=../src
-CXXFLAGS+=-I../../../include
-CXXFLAGS+=-I../../../include
-
-default: all
-all: main
-
-main: main.o
-	$(CXX) $(LDFLAGS) -o main main.o
-
-main.o: $(SRC)/main.cpp
-	$(CXX) $(CXXFLAGS) -c -o main.o $(SRC)/main.cpp
-
-clean:
-	rm -f main.o main
-
-.PHONY: default all clean
diff --git a/include/seqan/util/makefile_project/README b/include/seqan/util/makefile_project/README
deleted file mode 100644
index 269885c..0000000
--- a/include/seqan/util/makefile_project/README
+++ /dev/null
@@ -1 +0,0 @@
-This is an example of how to use SeqAn in a Makefile based project.
diff --git a/include/seqan/util/makefile_project/debug/Makefile b/include/seqan/util/makefile_project/debug/Makefile
deleted file mode 100644
index 44d8dd6..0000000
--- a/include/seqan/util/makefile_project/debug/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-include ../Makefile.rules
-
-CXXFLAGS+=-g -O0 -DSEQAN_ENABLE_TESTING=0 -DSEQAN_ENABLE_DEBUG=1
diff --git a/include/seqan/util/makefile_project/release/Makefile b/include/seqan/util/makefile_project/release/Makefile
deleted file mode 100644
index 0533793..0000000
--- a/include/seqan/util/makefile_project/release/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-include ../Makefile.rules
-
-CXXFLAGS+=-O3 -DNDEBUG -DSEQAN_ENABLE_TESTING=0 -DSEQAN_ENABLE_DEBUG=0
diff --git a/include/seqan/util/makefile_project/src/main.cpp b/include/seqan/util/makefile_project/src/main.cpp
deleted file mode 100644
index 7f77b33..0000000
--- a/include/seqan/util/makefile_project/src/main.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <seqan/basic.h>
-#include <seqan/sequence.h>
-#include <seqan/stream.h>
-
-using namespace seqan;
-
-int main()
-{
-    std::cout << CharString("Hello SeqAn!") << std::endl;
-    return 0;
-}
diff --git a/include/seqan/util/raw_cmake_project/CMakeLists.txt b/include/seqan/util/raw_cmake_project/CMakeLists.txt
deleted file mode 100644
index 914f0db..0000000
--- a/include/seqan/util/raw_cmake_project/CMakeLists.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-# Example CMakeLists.txt file that uses the FindSeqAn.cmake module for
-# building a SeqAn-based app.
-
-project (raw_cmake_project)
-cmake_minimum_required (VERSION 2.8.2)
-
-# Place binaries into "bin" directory.
-set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/")
-
-# Go to "src" subdirectory.
-add_subdirectory (src)
diff --git a/include/seqan/util/raw_cmake_project/README b/include/seqan/util/raw_cmake_project/README
deleted file mode 100644
index 0b6a72c..0000000
--- a/include/seqan/util/raw_cmake_project/README
+++ /dev/null
@@ -1,2 +0,0 @@
-This is an example of how to use SeqAn in a CMake-based project independently
-from the SeqAn build system.
diff --git a/include/seqan/util/raw_cmake_project/src/CMakeLists.txt b/include/seqan/util/raw_cmake_project/src/CMakeLists.txt
deleted file mode 100644
index b7005ae..0000000
--- a/include/seqan/util/raw_cmake_project/src/CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-# Configure SeqAn, enabling features for libbz2 and zlib.
-set (SEQAN_FIND_DEPENDENCIES ZLIB BZip2)
-find_package (SeqAn REQUIRED)
-
-# Add include directories, defines, and flags for SeqAn (and its dependencies).
-include_directories (${SEQAN_INCLUDE_DIRS})
-add_definitions (${SEQAN_DEFINITIONS})
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SEQAN_CXX_FLAGS}")
-
-# Build the program and link it against the SeqAn dependency libraries.
-add_executable (main main.cpp)
-target_link_libraries (main ${SEQAN_LIBRARIES})
diff --git a/include/seqan/util/raw_cmake_project/src/main.cpp b/include/seqan/util/raw_cmake_project/src/main.cpp
deleted file mode 100644
index b409fcd..0000000
--- a/include/seqan/util/raw_cmake_project/src/main.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-#include <iostream>
-
-#include <seqan/basic.h>
-#include <seqan/sequence.h>
-#include <seqan/stream.h>
-
-using namespace seqan;
-
-int main() {
-    std::cout << CharString("Hello SeqAn!") << std::endl;
-    return 0;
-}
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3e42748..d90968a 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -6,98 +6,162 @@
 # CMakeLists.txt file for lambda.
 # ===========================================================================
 
-cmake_minimum_required (VERSION 2.8.2)
-project (lambda)
-message (STATUS "Configuring lambda")
+# ----------------------------------------------------------------------------
+# App version
+# ----------------------------------------------------------------------------
+
+# change this after every release
+set (SEQAN_APP_VERSION_MAJOR "1")
+set (SEQAN_APP_VERSION_MINOR "9")
+set (SEQAN_APP_VERSION_PATCH "0")
+
+# don't change the following
+set (SEQAN_APP_VERSION "${SEQAN_APP_VERSION_MAJOR}.${SEQAN_APP_VERSION_MINOR}.${SEQAN_APP_VERSION_PATCH}")
 
 # ----------------------------------------------------------------------------
-# Dependencies
+# Dependencies (continued)
 # ----------------------------------------------------------------------------
 
 # Search SeqAn and select dependencies.
-set (SEQAN_FIND_DEPENDENCIES OpenMP ZLIB BZip2)
-find_package(SeqAn REQUIRED)
-find_package(CXX11 REQUIRED)
-find_package(CXX14)
+find_package(OpenMP QUIET)
+find_package(ZLIB   QUIET)
+find_package(BZip2  QUIET)
+find_package(SeqAn  QUIET REQUIRED)
 
-if (NOT CXX11_FOUND)
-    message (FATAL_ERROR "  C++11 not found: Not building lambda.")
-    return ()
-endif (NOT CXX11_FOUND)
+message(STATUS "These dependencies where found:")
+message(   "     OPENMP     ${OPENMP_FOUND}      ${OpenMP_CXX_FLAGS}")
+message(   "     ZLIB       ${ZLIB_FOUND}      ${ZLIB_VERSION_STRING}")
+message(   "     BZIP2      ${BZIP2_FOUND}      ${BZIP2_VERSION_STRING}")
+message(   "     SEQAN      ${SEQAN_FOUND}      ${SEQAN_VERSION_STRING}")
 
 # Warn if OpenMP was not found.
-if (NOT SEQAN_HAS_OPENMP)
+if (NOT OPENMP_FOUND)
     message (WARNING "WARNING WARNING WARNING\nWARNING: OpenMP not found. Lambda will be built without multi-threading! "
-    "This is probably not what you want! Use GCC or a very, very recent version of Clang.\nWARNING WARNING WARNING")
-endif (NOT SEQAN_HAS_OPENMP)
+    "This is probably not what you want! Use GCC >= 4.9.1, Clang >= 3.8.0 or ICC >= 16.0.2\nWARNING WARNING WARNING")
+endif (NOT OPENMP_FOUND)
 
 # Warn if Zlib was not found.
-if (NOT SEQAN_HAS_ZLIB)
+if (NOT ZLIB_FOUND)
   message (WARNING "WARNING: Zlib not found. Building lambda without support for gzipped input and output (this includes support for .bam).")
-endif (NOT SEQAN_HAS_ZLIB)
+endif (NOT ZLIB_FOUND)
 
 # Warn if BZip2 was not found.
-if (NOT SEQAN_HAS_BZIP2)
+if (NOT BZIP2_FOUND)
   message (WARNING "WARNING: BZip2 not found. Building lambda without support for bzipped input and output.")
-endif (NOT SEQAN_HAS_BZIP2)
-
-if (COMPILER_IS_CLANG)
-    set (CXX11_CXX_FLAGS "${CXX11_CXX_FLAGS} -ftemplate-depth-1024")
-endif (COMPILER_IS_CLANG)
-
-if(CMAKE_COMPILER_IS_GNUCXX)
-  if (491 GREATER _GCC_VERSION)
-    message (FATAL_ERROR "Your GCC version is too old. Minimum version is GCC-4.9.1!")
+endif (NOT BZIP2_FOUND)
+
+if (CMAKE_COMPILER_IS_GNUCXX)
+    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9.1)
+        message (FATAL_ERROR "Your GCC version is too old. Minimum version is GCC-4.9.1!")
+        return ()
+    endif ()
+elseif (COMPILER_IS_CLANG)
+    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.6)
+        message (FATAL_ERROR "Your Clang version is too old. Please upgrade to 3.8.0 or use GCC.")
+        return()
+    elseif (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.8)
+        message (WARNING "Your Clang version is too old, you will not have parallelism! Upgrade to 3.8.0 or newer.")
+    endif ()
+elseif (COMPILER_IS_INTEL)
+    if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0.2)
+        message(WARNING "Your Intel Compiler version is too old. Please upgrade to 16.0.2 or newer!")
+    endif ()
+endif ()
+
+if (SEQAN_VERSION_STRING VERSION_LESS "2.2.0")
+    message (FATAL_ERROR "The minimum SeqAn verison required is 2.2.0!")
     return ()
-  endif(491 GREATER _GCC_VERSION)
-endif(CMAKE_COMPILER_IS_GNUCXX)
+endif ()
+
+message(STATUS "The requirements where met.")
 
 # ----------------------------------------------------------------------------
 # App-Level Configuration
 # ----------------------------------------------------------------------------
 
-set (SEQAN_APP_VERSION "0.9.3")
+message ("\n${ColourBold}Build configuration${ColourReset}")
+
+message (STATUS "LAMBDA version is: ${SEQAN_APP_VERSION}")
+
+option (LAMBDA_FASTBUILD    "Build only blastp and blastx modes (speeds up build)."                             OFF)
+option (LAMBDA_NATIVE_BUILD "Architecture-specific optimizations, i.e. g++ -march=native."                      ON)
+option (LAMBDA_STATIC_BUILD "Include all libraries in the binaries."                                            OFF)
+option (LAMBDA_MMAPPED_DB   "Use mmapped access to the database."                                               OFF)
+option (LAMBDA_LINGAPS_OPT  "Add optimized codepaths for linear gap costs (inc. bin size and compile time)."    OFF)
 
-option (LAMBDA_FASTBUILD "Skip certain rarely used codepaths (speeds up build)." OFF)
 if (LAMBDA_FASTBUILD)
     add_definitions (-DFASTBUILD=1)
-    message (STATUS "FASTBUILD set, not all command line options available.")
 endif (LAMBDA_FASTBUILD)
 
-option (LAMBDA_NATIVE_BUILD "Architecture-specific optimizations, i.e. g++ -march=native." ON)
 if (LAMBDA_NATIVE_BUILD)
     add_definitions (-DLAMBDA_NATIVE_BUILD=1)
     set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} -march=native")
     if (COMPILER_IS_INTEL)
         set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} -xHOST -ipo -no-prec-div -fp-model fast=2")
     endif (COMPILER_IS_INTEL)
-    message (STATUS "NATIVE_BUILD set, binaries will be optimized for this CPU (and might not work on others).")
-    message (STATUS "To deactivate, pass -DLAMBDA_NATIVE_BUILD=0 to cmake.")
 endif (LAMBDA_NATIVE_BUILD)
 
-option (LAMBDA_STATIC_BUILD "Include all libraries in the binaries." OFF)
 if (LAMBDA_STATIC_BUILD)
     add_definitions (-DLAMBDA_STATIC_BUILD=1)
     set(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
-    if (CMAKE_COMPILER_IS_GNUCXX)
+    # apple does not support fully static builds, but at least libgcc and libstdc++
+    if (APPLE)
         set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
-    endif (CMAKE_COMPILER_IS_GNUCXX)
-    # apple does not support fully static builds
-    if (NOT APPLE)
-        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
-    else (NOT APPLE)
         message (WARNING "WARNING: Builds on Mac are never fully static.")
-    endif (NOT APPLE)
-    message (STATUS "STATIC_BUILD set, binaries built with all libs included.")
+    else (APPLE)
+        set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static")
+    endif (APPLE)
+    # on linux cmake adds -rdynamic automatically which clang can't handle in static builds
+    if (CMAKE_SYSTEM_NAME MATCHES "Linux")
+        SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
+    endif (CMAKE_SYSTEM_NAME MATCHES "Linux")
 endif (LAMBDA_STATIC_BUILD)
 
-option (LAMBDA_MMAPPED_DB "Use mmapped access to the database." ON)
 if (LAMBDA_MMAPPED_DB)
     add_definitions (-DLAMBDA_MMAPPED_DB=1)
-    message (STATUS "MMAPPED_DB set, using memory-mapped IO to access the database.")
-    message (STATUS "To deactivate, pass -DLAMBDA_MMAPPED_DB=0 to cmake.")
 endif (LAMBDA_MMAPPED_DB)
 
+if (LAMBDA_LINGAPS_OPT)
+    add_definitions (-DLAMBDA_LINGAPS_OPT=1)
+endif ()
+
+message(STATUS "The following options are selected for the build:")
+message(   "     LAMBDA_FASTBUILD         ${LAMBDA_FASTBUILD}")
+message(   "     LAMBDA_LINGAPS_OPT       ${LAMBDA_LINGAPS_OPT}")
+message(   "     LAMBDA_MMAPPED_DB        ${LAMBDA_MMAPPED_DB}")
+message(   "     LAMBDA_NATIVE_BUILD      ${LAMBDA_NATIVE_BUILD}")
+message(   "     LAMBDA_STATIC_BUILD      ${LAMBDA_STATIC_BUILD}")
+message(STATUS "Run 'cmake -LH' to get a comment on each option.")
+message(STATUS "Remove CMakeCache.txt and re-run cmake with -DOPTIONNAME=ON|OFF to change an option.")
+
+# ----------------------------------------------------------------------------
+# Compiler specifics
+# ----------------------------------------------------------------------------
+
+if (COMPILER_IS_CLANG)
+    set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} -ftemplate-depth-1024")
+
+    # do not warn for variable length arrays
+    set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} -Wno-vla-extension")
+endif (COMPILER_IS_CLANG)
+
+if(CMAKE_COMPILER_IS_GNUCXX)
+    # do not warn for variable length arrays
+    set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} -Wno-vla")
+
+    # parallelize parts of build even for one translation unit
+    include(ProcessorCount)
+    ProcessorCount(NCPU)
+    if(NCPU GREATER 1)
+        set (SEQAN_CXX_FLAGS "${SEQAN_CXX_FLAGS} -flto=${NCPU}")
+    endif()
+endif(CMAKE_COMPILER_IS_GNUCXX)
+
+if (NOT COMPILER_IS_INTEL)
+    # strip binaries to make them smaller
+    set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
+endif ()
+
 # ----------------------------------------------------------------------------
 # Build Setup
 # ----------------------------------------------------------------------------
@@ -118,15 +182,18 @@ add_definitions (-DSEQAN_DATE="${SEQAN_DATE}")
 add_definitions (-DSEQAN_APP_VERSION="${SEQAN_APP_VERSION}")
 add_definitions (-DCMAKE_BUILD_TYPE="${CMAKE_BUILD_TYPE}")
 
+# Set the right output directory
+set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
+
 # Update the list of file names below if you add source files to your application.
 add_executable (lambda lambda.cpp
                 lambda.hpp
                 misc.hpp
                 match.hpp
                 options.hpp
-                alph.hpp
                 holders.hpp
                 output.hpp)
+
 add_executable (lambda_indexer lambda_indexer.cpp
                 lambda_indexer.hpp
                 options.hpp
@@ -138,10 +205,7 @@ target_link_libraries (lambda ${SEQAN_LIBRARIES})
 target_link_libraries (lambda_indexer ${SEQAN_LIBRARIES})
 
 # Add CXX flags found by find_package (SeqAn).
-set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SEQAN_CXX_FLAGS} ${CXX11_CXX_FLAGS}")
-if (NOT COMPILER_IS_INTEL)
-   set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-vla")
-endif (NOT COMPILER_IS_INTEL)
+set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SEQAN_CXX_FLAGS}")
 
 set(BUILD_SHARED_LIBS OFF)
 
@@ -149,35 +213,63 @@ set(BUILD_SHARED_LIBS OFF)
 # Installation
 # ----------------------------------------------------------------------------
 
-# Set variables for installing, depending on the selected build type.
-if (NOT SEQAN_PREFIX_SHARE_DOC)
-  seqan_setup_install_vars (lambda)
-endif (NOT SEQAN_PREFIX_SHARE_DOC)
-
 # Install lambda in ${PREFIX}/bin directory
 install (TARGETS lambda lambda_indexer
          DESTINATION bin)
 
-# Install non-binary files for the package to "." for app builds and
-# ${PREFIX}/share/doc/lambda for SeqAn release builds.
-install (FILES ../LICENSE-GPL3.rst
+# Install non-binary files for the package to share/lambda
+install (FILES ../LICENSE.rst
+               ../LICENSE-BSD.rst
+               ../LICENSE-AGPL3.rst
                ../README.rst
-               ../COPYING.rst
-         DESTINATION ${SEQAN_PREFIX_SHARE_DOC})
-# install (FILES example/fasta1.fa
-#               example/fasta2.fa
-#         DESTINATION ${SEQAN_PREFIX_SHARE_DOC}/example)
+         DESTINATION "share/doc/lambda")
 
 # ----------------------------------------------------------------------------
 # CPack Install
 # ----------------------------------------------------------------------------
 
-if (SEQAN_BUILD_SYSTEM STREQUAL "APP:lambda")
-  set (CPACK_PACKAGE_NAME "lambda")
-  set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "lambda")
-  set (CPACK_DEBIAN_PACKAGE_MAINTAINER "Your Name <your.email at example.net>")
-  set (CPACK_PACKAGE_VENDOR "Your Name <your.email at example.net>")
-
-  seqan_configure_cpack_app (lambda "lambda")
-endif (SEQAN_BUILD_SYSTEM STREQUAL "APP:lambda")
-
+# Information
+set (CPACK_PACKAGE_NAME "lambda")
+set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "lambda -- the local aligner for massive bioligical data")
+set (CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/../README.rst")
+set (CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE.rst")
+set (CPACK_PACKAGE_VENDOR "Hannes Hauswedell <hannes.hauswedell at fu-berlin.de>")
+set (CPACK_PACKAGE_CONTACT "${CPACK_PACKAGE_VENDOR}")
+set (CPACK_PACKAGE_VERSION_MAJOR "${SEQAN_APP_VERSION_MAJOR}")
+set (CPACK_PACKAGE_VERSION_MINOR "${SEQAN_APP_VERSION_MINOR}")
+set (CPACK_PACKAGE_VERSION_PATCH "${SEQAN_APP_VERSION_PATCH}")
+set (CPACK_PACKAGE_VERSION "${SEQAN_APP_VERSION}")
+set (CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
+
+# Package format(s)
+if (CMAKE_SYSTEM_NAME MATCHES "Windows")
+    set(CPACK_GENERATOR "ZIP;NSIS")
+elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
+    set(CPACK_GENERATOR "ZIP;DragNDrop")
+elseif (CMAKE_VERSION VERSION_LESS "3.1") # TXZ support since 3.1
+    set(CPACK_GENERATOR "TBZ2")
+else()
+    set(CPACK_GENERATOR "TXZ")
+endif ()
+
+if (CMAKE_SYSTEM_NAME MATCHES "Linux")
+    set(CPACK_GENERATOR "${CPACK_GENERATOR};DEB;RPM")
+endif ()
+
+# Package architecture
+if (CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64")
+    set(CMAKE_SYSTEM_PROCESSOR "x86_64")
+    set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
+endif ()
+if (CMAKE_CXX_FLAGS MATCHES "avx2")
+    set (CMAKE_SYSTEM_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}_avx2")
+elseif (CMAKE_CXX_FLAGS MATCHES "sse4")
+    set (CMAKE_SYSTEM_PROCESSOR "${CMAKE_SYSTEM_PROCESSOR}_sse4")
+endif()
+
+# Include architecture in package name
+if (NOT DEFINED CPACK_SYSTEM_NAME)
+  set(CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
+endif (NOT DEFINED CPACK_SYSTEM_NAME)
+
+include (CPack)
diff --git a/src/alph.hpp b/src/alph.hpp
deleted file mode 100644
index e63b952..0000000
--- a/src/alph.hpp
+++ /dev/null
@@ -1,237 +0,0 @@
-// ==========================================================================
-//                                  lambda
-// ==========================================================================
-// Copyright (c) 2013-2015, Hannes Hauswedell, FU Berlin
-// All rights reserved.
-//
-// This file is part of Lambda.
-//
-// Lambda is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
-//
-// Lambda is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Lambda.  If not, see <http://www.gnu.org/licenses/>.*/
-// ==========================================================================
-// Author: Hannes Hauswedell <hannes.hauswedell @ fu-berlin.de>
-// ==========================================================================
-// alph.hpp: Functions and Metafunctions for Alphabet reduction
-// ==========================================================================
-
-#ifndef SEQAN_LAMBDA_ALPH_H_
-#define SEQAN_LAMBDA_ALPH_H_
-
-#include <seqan/basic.h>
-#include <seqan/sequence.h>
-
-// using namespace seqan;
-
-namespace seqan {
-
-// ----------------------------------------------------------------------------
-// Specialization AminoAcid10
-// ----------------------------------------------------------------------------
-
-/**
-.Spec.AminoAcid10:
-..cat:Alphabets
-..summary:Iupac code for amino acids.
-..general:Class.SimpleType
-..signature:AminoAcid10
-..remarks:
-...text:The @Metafunction.ValueSize@ of $AminoAcid10$ is 24.
-...text:The amino acids are enumerated from 0 to 15 in this order:
-...text:'A'=0, 'R', 'N', 'D', 'C', 'Q', 'E', 'G', 'H', 'I', 'L', 'K', 'M', 'F', 'P', 'S', 'T', 'W', 'Y', 'V'=19.
-...text:The remaining 4 symbols are:
-...text: 'B'=20 (Aspartic Acid, Asparagine), 'Z'=21 (Glutamic Acid, Glutamine), 'X'=22 (unknown), '*'=23 (terminator)
-...text:Objects of type $AminoAcid10$ can be converted to $char$ and vice versa.
-Unkown values are converted to $'X'$.
-...text:$AminoAcid10$ is typedef for $SimpleType<char,AminoAcid10_>$, while $AminoAcid10_$ is a helper
-specialization tag class.
-..see:Metafunction.ValueSize
-..include:seqan/basic.h
-*/
-
-struct AminoAcid10_ {};
-typedef SimpleType<unsigned char, AminoAcid10_> AminoAcid10;
-
-template <> struct ValueSize<AminoAcid10>
-{
-    typedef __uint8 Type;
-    static const Type VALUE = 10;
-};
-
-template <> struct BitsPerValue<AminoAcid10>
-{
-    typedef __uint8 Type;
-    static const Type VALUE = 4;
-};
-
-inline AminoAcid10
-unknownValueImpl(AminoAcid10 *)
-{
-    static const AminoAcid10 _result = AminoAcid10('X');
-    return _result;
-}
-
-// --------------------------------------------------------------------------
-// Amino Acid
-// --------------------------------------------------------------------------
-
-template <typename T = void>
-struct TranslateTableAA10ToAscii_
-{
-    static char const VALUE[10];
-};
-
-template <typename T>
-char const TranslateTableAA10ToAscii_<T>::VALUE[10] =
-{
-    'A', // 0 Acidic or Proto-Acidic
-         // 'N' Asn Asparagine, 'D' Asp Apartic Acid,  'B' Asn or Asp
-         // 'Q' Gln Glutamine, 'E' Glu Glutamic Acid, 'Z' Glu or Gln
-    'B', // 1 BASIC
-         // 'R' Arg Arginine, 'K' Lys Lysine
-    'C', // 2 Cys Cystine
-    'H', // 3 His Histidine
-    'S', // 4 SMALL UNPOLAR
-         // 'A' Ala Alanine, 'G' Gly Glycine
-    'U', // 5 UNPOLAR
-         // 'I' Ile Isoleucine, 'L' Leu Leucine, 'V' Val Valine, 'M' Met Methionine
-    'O', // 6 POLAR
-         // 'S' Ser Serine, 'T' Thr Threonine
-    'P', // 7 Pro Proline
-    'R', // 8 AROMATIC
-         //'F' Phe Phenylalanine, 'W' Trp Tryptophan, 'Y' Tyr Tyrosine
-    'X', // 9 'X' Unknown, '*' Terminator
-};
-
-template <typename T = void>
-struct TranslateTableAsciiToAA10_
-{
-    static char const VALUE[256];
-};
-
-template <typename T>
-char const TranslateTableAsciiToAA10_<T>::VALUE[256] =
-{
-     9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9, //0
-     9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9, //1
-     9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9, //2
-//                                                     *
-     9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9, //3
-     9,   4,   0,   2,   0,   0,   8,   4,   3,   5,   9,   1,   5,   5,   0,   9, //4
-//    ,   A,   B,   C,   D,   E,   F,   G,   H,   I,   J,   K,   L,   M,   N,   O,
-
-     7,   0,   1,   6,   6,   9,   5,   8,   9,   8,   0,   9,   9,   9,   9,   9, //5
-//   P,   Q,   R,   S,   T,   U,   V,   W,   X,   Y,   Z,    ,    ,    ,    ,    ,
-
-     9,   4,   0,   2,   0,   0,   8,   4,   3,   5,   9,   1,   5,   5,   0,   9, //6
-//    ,   a,   b,   c,   d,   e,   f,   g,   h,   i,   j,   k,   l,   m,   n,   o,
-
-     7,   0,   1,   6,   6,   9,   5,   8,   9,   8,   0,   9,   9,   9,   9,   9, //7
-//   p,   q,   r,   s,   t,   u,   v,   w,   x,   y,   z,    ,    ,    ,    ,    ,
-
-     9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9, //8
-     9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9, //9
-     9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9, //10
-     9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9, //11
-     9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9, //12
-     9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9, //13
-     9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9, //14
-     9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9,   9  //15
-};
-
-template <typename T = void>
-struct TranslateTableAAToAA10_
-{
-    static char const VALUE[24];
-};
-
-template <typename T>
-char const TranslateTableAAToAA10_<T>::VALUE[24] =
-{
-    4,  1,  0,  0,  0,  2,  0,  4,  3,  5,  5,  1,  5,  8,  7,  6,  6,  8,  8,
-//  A   R   N   D   C   Q   E   G   H   I   L   K   M   F   P   S   T   W   Y
-    5,  0,  0,  9,  9
-//  V   B   Z   X   *
-};
-
-
-template <typename T = void>
-struct TranslateTableByteToAA10_
-{
-    static char const VALUE[256];
-};
-
-template <typename T>
-char const TranslateTableByteToAA10_<T>::VALUE[256] =
-{
-    0,  1,  2,  3,  4,  5,  6,  7,  8,  9,  9,  9,  9,  9,  9,  9, //0
-    9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9, //1
-    9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9, //2
-    9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9, //3
-    9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9, //4
-    9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9, //5
-    9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9, //6
-    9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9, //7
-    9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9, //8
-    9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9, //9
-    9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9, //10
-    9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9, //11
-    9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9, //12
-    9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9, //13
-    9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9, //14
-    9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9,  9  //15
-};
-
-
-
-inline void assign(char & c_target, AminoAcid10 const & source)
-{
-    c_target = TranslateTableAA10ToAscii_<>::VALUE[source.value];
-}
-
-
-template <>
-struct CompareType<AminoAcid10, __uint8>
-{
-    typedef AminoAcid10 Type;
-};
-
-inline void assign(AminoAcid10 & target, __uint8 c_source)
-{
-    target.value = TranslateTableByteToAA10_<>::VALUE[c_source];
-}
-
-template <>
-struct CompareType<AminoAcid10, char>
-{
-    typedef AminoAcid10 Type;
-};
-
-inline void assign(AminoAcid10 & target, char c_source)
-{
-    target.value = TranslateTableAsciiToAA10_<>::VALUE[(unsigned char) c_source];
-}
-
-template <>
-struct CompareType<AminoAcid10, AminoAcid>
-{
-    typedef AminoAcid10 Type;
-};
-
-inline void assign(AminoAcid10 & target, AminoAcid c_source)
-{
-    target.value = TranslateTableAAToAA10_<>::VALUE[c_source.value];
-}
-
-} // namespace seqan
-
-#endif // header guard
\ No newline at end of file
diff --git a/src/holders.hpp b/src/holders.hpp
index 8c1613c..4aa9bf9 100644
--- a/src/holders.hpp
+++ b/src/holders.hpp
@@ -1,36 +1,31 @@
 // ==========================================================================
 //                                  lambda
 // ==========================================================================
-// Copyright (c) 2013-2015, Hannes Hauswedell, FU Berlin
+// Copyright (c) 2013-2016, Hannes Hauswedell <h2 @ fsfe.org>
+// Copyright (c) 2016, Knut Reinert and Freie Universität Berlin
 // All rights reserved.
 //
 // This file is part of Lambda.
 //
-// Lambda is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
+// Lambda is Free Software: you can redistribute it and/or modify it
+// under the terms found in the LICENSE[.md|.rst] file distributed
+// together with this file.
 //
 // Lambda is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 //
-// You should have received a copy of the GNU General Public License
-// along with Lambda.  If not, see <http://www.gnu.org/licenses/>.*/
-// ==========================================================================
-// Author: Hannes Hauswedell <hannes.hauswedell @ fu-berlin.de>
 // ==========================================================================
 // holders.hpp: Data container structs
 // ==========================================================================
 
-
 #ifndef SEQAN_LAMBDA_HOLDERS_H_
 #define SEQAN_LAMBDA_HOLDERS_H_
 
+#include <seqan/align_extend.h>
 
-#include "match.hpp"
 #include "options.hpp"
+#include "match.hpp"
 
 // ============================================================================
 // Forwards
@@ -59,6 +54,7 @@ struct StatsHolder
     uint64_t hitsMerged;
     uint64_t hitsTooShort;
     uint64_t hitsMasked;
+    std::vector<uint16_t> seedLengths;
 
 // pre-extension
     uint64_t hitsFailedPreExtendTest;
@@ -75,6 +71,12 @@ struct StatsHolder
     uint64_t hitsFinal;
     uint64_t qrysWithHit;
 
+// times
+    double timeGenSeeds;
+    double timeSearch;
+    double timeSort;
+    double timeExtend;
+
     StatsHolder()
     {
         clear();
@@ -86,6 +88,7 @@ struct StatsHolder
         hitsMerged = 0;
         hitsTooShort = 0;
         hitsMasked = 0;
+        seedLengths.clear();
 
         hitsFailedPreExtendTest = 0;
         hitsPutativeDuplicate = 0;
@@ -98,6 +101,11 @@ struct StatsHolder
 
         hitsFinal = 0;
         qrysWithHit = 0;
+
+        timeGenSeeds = 0;
+        timeSearch = 0;
+        timeSort = 0;
+        timeExtend = 0;
     }
 
     StatsHolder plus(StatsHolder const & rhs)
@@ -106,6 +114,7 @@ struct StatsHolder
         hitsMerged += rhs.hitsMerged;
         hitsTooShort += rhs.hitsTooShort;
         hitsMasked += rhs.hitsMasked;
+        append(seedLengths, rhs.seedLengths);
 
         hitsFailedPreExtendTest += rhs.hitsFailedPreExtendTest;
         hitsPutativeDuplicate += rhs.hitsPutativeDuplicate;
@@ -118,6 +127,12 @@ struct StatsHolder
 
         hitsFinal += rhs.hitsFinal;
         qrysWithHit += rhs.qrysWithHit;
+
+        timeGenSeeds += rhs.timeGenSeeds;
+        timeSearch   += rhs.timeSearch;
+        timeSort     += rhs.timeSort;
+        timeExtend   += rhs.timeExtend;
+
         return *this;
     }
 
@@ -134,6 +149,95 @@ struct StatsHolder
     }
 };
 
+void printStats(StatsHolder const & stats, LambdaOptions const & options)
+{
+    if ((options.verbosity >= 1) && options.isTerm && options.doubleIndexing)
+        for (unsigned char i=0; i < options.threads + 3; ++i)
+            std::cout << std::endl;
+
+    if (options.verbosity >= 2)
+    {
+        unsigned long rem = stats.hitsAfterSeeding;
+        auto const w = _numberOfDigits(rem); // number of digits
+        #define R  " " << std::setw(w)
+        #define RR " = " << std::setw(w)
+        #define BLANKS for (unsigned i = 0; i< w; ++i) std::cout << " ";
+        std::cout << "\033[1m   HITS                         "; BLANKS;
+        std::cout << "Remaining\033[0m"
+                  << "\n   after Seeding               "; BLANKS;
+        std::cout << R << rem;
+        if (stats.hitsMasked)
+            std::cout << "\n - masked                   " << R << stats.hitsMasked
+                      << RR << (rem -= stats.hitsMasked);
+        if (options.mergePutativeSiblings)
+            std::cout << "\n - merged                   " << R << stats.hitsMerged
+                      << RR << (rem -= stats.hitsMerged);
+        if (options.filterPutativeDuplicates)
+            std::cout << "\n - putative duplicates      " << R
+                      << stats.hitsPutativeDuplicate << RR
+                      << (rem -= stats.hitsPutativeDuplicate);
+        if (options.filterPutativeAbundant)
+            std::cout << "\n - putative abundant        " << R
+                      << stats.hitsPutativeAbundant   << RR
+                      << (rem -= stats.hitsPutativeAbundant);
+        if (options.preScoring)
+            std::cout << "\n - failed pre-extend test   " << R
+                      << stats.hitsFailedPreExtendTest  << RR
+                      << (rem -= stats.hitsFailedPreExtendTest);
+        std::cout << "\n - failed %-identity test   " << R
+                  << stats.hitsFailedExtendPercentIdentTest << RR
+                  << (rem -= stats.hitsFailedExtendPercentIdentTest);
+        std::cout << "\n - failed e-value test      " << R
+                  << stats.hitsFailedExtendEValueTest << RR
+                  << (rem -= stats.hitsFailedExtendEValueTest);
+        std::cout << "\n - abundant                 " << R
+                  << stats.hitsAbundant << RR
+                  << (rem -= stats.hitsAbundant);
+        std::cout << "\n - duplicates               " << R
+                  << stats.hitsDuplicate << "\033[1m" << RR
+                  << (rem -= stats.hitsDuplicate)
+                  << "\033[0m\n\n";
+
+        if (rem != stats.hitsFinal)
+            std::cout << "WARNING: hits dont add up\n";
+
+        std::cout << "Detailed Non-Wall-Clock times:\n"
+                  << " genSeeds: " << stats.timeGenSeeds << "\n"
+                  << " search:   " << stats.timeSearch << "\n"
+                  << " sort:     " << stats.timeSort << "\n"
+                  << " extend:   " << stats.timeExtend << "\n\n";
+
+        if (length(stats.seedLengths))
+        {
+            double _seedLengthSum       = std::accumulate(stats.seedLengths.begin(), stats.seedLengths.end(), 0.0);
+            double seedLengthMean       = _seedLengthSum / stats.seedLengths.size();
+
+            double _seedLengthMeanSqSum = std::inner_product(stats.seedLengths.begin(),
+                                                            stats.seedLengths.end(),
+                                                            stats.seedLengths.begin(),
+                                                            0.0);
+            double seedLengthStdDev     = std::sqrt(_seedLengthMeanSqSum / stats.seedLengths.size() -
+                                                    seedLengthMean * seedLengthMean);
+            uint16_t seedLengthMax      = *std::max_element(stats.seedLengths.begin(), stats.seedLengths.end());
+
+            std::cout << "SeedStats:\n"
+                    << " avgLength:   " << seedLengthMean << "\n"
+                    << " stddev:      " << seedLengthStdDev << "\n"
+                    << " max:         " << seedLengthMax << "\n\n";
+        }
+    }
+
+    if (options.verbosity >= 1)
+    {
+        auto const w = _numberOfDigits(stats.hitsFinal);
+        std::cout << "Number of valid hits:                           "
+                  << std::setw(w) << stats.hitsFinal
+                  << "\nNumber of Queries with at least one valid hit:  "
+                  << std::setw(w) << stats.qrysWithHit
+                  << "\n";
+    }
+
+}
 
 // ----------------------------------------------------------------------------
 // struct GlobalDataHolder  -- one object per program
@@ -143,7 +247,7 @@ template <typename T>
 inline T &
 _initHelper(T & t1, T &&)
 {
-    std::cout << "FOO\n";
+//     std::cout << "FOO\n";
     return t1;
 }
 
@@ -151,12 +255,11 @@ template <typename T, typename T2>
 inline T2 &&
 _initHelper(T &, T2 && t2)
 {
-    std::cout << "BAR\n";
+//     std::cout << "BAR\n";
     return std::move(t2);
 }
 
 template <typename TRedAlph_,
-          typename TScoreScheme_,
           typename TIndexSpec_,
           typename TFileFormat,
           BlastProgram p,
@@ -165,6 +268,7 @@ class GlobalDataHolder
 {
 public:
     using TRedAlph       = RedAlph<p, TRedAlph_>; // ensures == Dna5 for BlastN
+    using TMatch         = Match<TRedAlph>;
 
     static constexpr BlastProgram blastProgram  = p;
     static constexpr bool indexIsFM             = std::is_same<TIndexSpec_, TFMIndex<>>::value;
@@ -218,7 +322,10 @@ public:
     using TDbIndex      = Index<typename std::remove_reference<TRedSubjSeqs>::type, TIndexSpec>;
 
     /* output file */
-    using TScoreScheme  = TScoreScheme_;
+    using TScoreScheme  = std::conditional_t<std::is_same<TRedAlph, Dna5>::value,
+                                             Score<int, Simple>,
+                                             Score<int, ScoreMatrix<AminoAcid, ScoreSpecSelectable>>>;
+//     using TScoreScheme  = TScoreScheme_;
     using TIOContext    = BlastIOContext<TScoreScheme, p, h>;
     using TFile         = FormattedFile<TFileFormat, Output, TIOContext>;
     using TBamFile      = FormattedFile<Bam, Output, BlastTabular>;
@@ -291,9 +398,8 @@ public:
 // struct LocalDataHolder  -- one object per thread
 // ----------------------------------------------------------------------------
 
-template <typename TMatch,
-          typename TGlobalHolder_,
-          typename TScoreExtension>
+template <typename TGlobalHolder_,
+          typename TScoreExtension_>
 class LocalDataHolder
 {
 public:
@@ -301,6 +407,8 @@ public:
     using TRedQrySeq    = typename Value<typename std::remove_reference<typename TGlobalHolder::TRedQrySeqs>::type>::Type;
     using TSeeds        = StringSet<typename Infix<TRedQrySeq const>::Type>;
     using TSeedIndex    = Index<TSeeds, IndexSa<>>;
+    using TMatch        = typename TGlobalHolder::TMatch;
+    using TScoreExtension = TScoreExtension_;
 
 
     // references to global stuff
@@ -320,8 +428,8 @@ public:
     TSeedIndex          seedIndex;
 //     std::forward_list<TMatch>   matches;
     std::vector<TMatch>   matches;
-    std::vector<typename Match::TQId>   seedRefs;  // mapping seed -> query
-    std::vector<uint16_t>               seedRanks; // mapping seed -> relative rank
+    std::vector<typename TMatch::TQId> seedRefs;  // mapping seed -> query
+    std::vector<typename TMatch::TPos> seedRanks; // mapping seed -> relative rank
 
     // regarding extension
     using TAlignRow0 = Gaps<typename Infix<typename Value<typename TGlobalHolder::TTransQrySeqs>::Type>::Type,
@@ -379,170 +487,6 @@ public:
         statusStr.clear();
         statusStr.precision(2);
     }
-
 };
 
-// perform a fast local alignment score calculation on the seed and see if we
-// reach above threshold
-// WARNING the following function only works for hammingdistanced seeds
-template <typename TMatch,
-          typename TGlobalHolder,
-          typename TScoreExtension>
-inline bool
-seedLooksPromising(
-            LocalDataHolder<TMatch, TGlobalHolder, TScoreExtension> const & lH,
-            TMatch const & m)
-{
-    // no pre-scoring, but still filter out XXX and NNN hits
-//     if (!lH.options.preScoring))
-//     {
-//         for (unsigned i = m.qryStart, count = 0; i < m.qryStart + lH.options.seedLength; ++i)
-//             if (lH.gH.qrySeqs[m.qryId][i] == unkownValue<typename TGlobalHolder::TRedAlph>())
-//                 if (++count > lH.options.maxSeedDist)
-//                     return false;
-//         return true;
-//     }
-
-    int64_t effectiveQBegin = m.qryStart;
-    int64_t effectiveSBegin = m.subjStart;
-    uint64_t effectiveLength = lH.options.seedLength * lH.options.preScoring;
-    if (lH.options.preScoring > 1)
-    {
-        effectiveQBegin -= (lH.options.preScoring - 1) *
-                           lH.options.seedLength / 2;
-        effectiveSBegin -= (lH.options.preScoring - 1) *
-                           lH.options.seedLength / 2;
-//         std::cout << effectiveQBegin << "\t" << effectiveSBegin << "\n";
-        int64_t min = std::min(effectiveQBegin, effectiveSBegin);
-        if (min < 0)
-        {
-            effectiveQBegin -= min;
-            effectiveSBegin -= min;
-            effectiveLength += min;
-        }
-
-        effectiveLength = std::min({
-                            length(lH.gH.qrySeqs[m.qryId]) - effectiveQBegin,
-                            length(lH.gH.subjSeqs[m.subjId]) - effectiveSBegin,
-                            effectiveLength});
-//         std::cout << effectiveQBegin << "\t" << effectiveSBegin << "\t"
-//                   << effectiveLength << "\n";
-    }
-
-    auto const & qSeq = infix(lH.gH.qrySeqs[m.qryId],
-                              effectiveQBegin,
-                              effectiveQBegin + effectiveLength);
-    auto const & sSeq = infix(lH.gH.subjSeqs[m.subjId],
-                              effectiveSBegin,
-                              effectiveSBegin + effectiveLength);
-    int maxScore = 0;
-
-    int scores[effectiveLength+1]; // C99, C++14, -Wno-vla before that
-    scores[0] = 0;
-
-    // score the diagonal
-    for (uint64_t i = 0; i < effectiveLength; ++i)
-    {
-        scores[i] += score(seqanScheme(context(lH.gH.outfile).scoringScheme), qSeq[i], sSeq[i]);
-        if (scores[i] < 0)
-            scores[i] = 0;
-        else if (scores[i] > maxScore)
-            maxScore = scores[i];
-
-//         if (i < static_cast<uint64_t>(effectiveLength - 1)) // TODO remove
-        scores[i+1] = scores[i];
-    }
-
-    return (maxScore >= int(lH.options.preScoringThresh * effectiveLength));
-}
-
-template <typename TMatch,
-          typename TGlobalHolder,
-          typename TScoreExtension,
-          typename TSeedId,
-          typename TSubjOcc>
-inline void
-onFindImpl(LocalDataHolder<TMatch, TGlobalHolder, TScoreExtension> & lH,
-           TSeedId const & seedId,
-           TSubjOcc subjOcc)
-{
-    if (TGlobalHolder::indexIsFM) // positions are reversed
-        setSeqOffset(subjOcc,
-                     length(lH.gH.subjSeqs[getSeqNo(subjOcc)])
-                     - getSeqOffset(subjOcc)
-                     - lH.options.seedLength);
-
-    Match m {static_cast<Match::TQId>(lH.seedRefs[seedId]),
-             static_cast<Match::TSId>(getSeqNo(subjOcc)),
-             static_cast<Match::TPos>(lH.seedRanks[seedId] * lH.options.seedOffset),
-             static_cast<Match::TPos>(getSeqOffset(subjOcc))};
-
-    bool discarded = false;
-    auto const halfSubjL = lH.options.seedLength /  2;
-
-    if (!sIsTranslated(lH.gH.blastProgram))
-    {
-        for (unsigned k = 0; k < length(lH.gH.segIntStarts[m.subjId]); ++k)
-        {
-            // more than half of the seed falls into masked interval
-            if (intervalOverlap(m.subjStart,
-                                m.subjStart + lH.options.seedLength,
-                                lH.gH.segIntStarts[m.subjId][k],
-                                lH.gH.segIntEnds[m.subjId][k])
-                    >= halfSubjL)
-            {
-                ++lH.stats.hitsMasked;
-                discarded = true;
-                break;
-            }
-        }
-    }
-
-     if ((!discarded) && (!seedLooksPromising(lH, m)))
-     {
-         discarded = true;
-         ++lH.stats.hitsFailedPreExtendTest;
-     }
-
-    if (!discarded)
-        lH.matches.emplace_back(m);
-}
-
-template <typename TMatch,
-          typename TGlobalHolder,
-          typename TScoreExtension,
-          typename TFinder>
-inline void
-onFindDoubleIndex(LocalDataHolder<TMatch, TGlobalHolder, TScoreExtension> & lH,
-                  TFinder const & finder)
-{
-    auto qryOccs = getOccurrences(back(finder.patternStack));
-    auto subjOccs = getOccurrences(back(finder.textStack));
-
-    lH.stats.hitsAfterSeeding += length(qryOccs) * length(subjOccs);
-
-    for (unsigned i = 0; i < length(qryOccs); ++i)
-        for (unsigned j = 0; j < length(subjOccs); ++j)
-            onFindImpl(lH, getSeqNo(qryOccs[i]), subjOccs[j]);
-}
-
-template <typename TMatch,
-          typename TGlobalHolder,
-          typename TScoreExtension,
-          typename TSeedListIterator,
-          typename TIndexIterator>
-inline void
-onFindSingleIndex(LocalDataHolder<TMatch, TGlobalHolder, TScoreExtension> & lH,
-                  TSeedListIterator const & seedIt,
-                  TIndexIterator const & indexIt)
-{
-    auto qryOcc = position(seedIt);
-    auto subjOccs = getOccurrences(indexIt);
-
-    lH.stats.hitsAfterSeeding += length(subjOccs);
-
-    for (unsigned j = 0; j < length(subjOccs); ++j)
-        onFindImpl(lH, qryOcc, subjOccs[j]);
-}
-
 #endif // SEQAN_LAMBDA_HOLDERS_H_
diff --git a/src/lambda.cpp b/src/lambda.cpp
index 4f97ca2..a640b40 100644
--- a/src/lambda.cpp
+++ b/src/lambda.cpp
@@ -1,31 +1,29 @@
 // ==========================================================================
 //                                  lambda
 // ==========================================================================
-// Copyright (c) 2013-2015, Hannes Hauswedell, FU Berlin
+// Copyright (c) 2013-2016, Hannes Hauswedell <h2 @ fsfe.org>
+// Copyright (c) 2016, Knut Reinert and Freie Universität Berlin
 // All rights reserved.
 //
 // This file is part of Lambda.
 //
-// Lambda is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
+// Lambda is Free Software: you can redistribute it and/or modify it
+// under the terms found in the LICENSE[.md|.rst] file distributed
+// together with this file.
 //
 // Lambda is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 //
-// You should have received a copy of the GNU General Public License
-// along with Lambda.  If not, see <http://www.gnu.org/licenses/>.*/
-// ==========================================================================
-// Author: Hannes Hauswedell <hannes.hauswedell @ fu-berlin.de>
 // ==========================================================================
 // lambda.cpp: Main File for Lambda
 // ==========================================================================
 
 #include <iostream>
 
+//TODO TEMPORARY REMOVE
+#define amd64
+
 #include <seqan/basic.h>
 #include <seqan/sequence.h>
 #include <seqan/arg_parse.h>
@@ -33,14 +31,13 @@
 #include <seqan/reduced_aminoacid.h>
 #include <seqan/misc/terminal.h>
 
+#include "output.hpp"
 #include "options.hpp"
-#include "match.hpp"
+#include "holders.hpp"
 #include "lambda.hpp"
-#include "misc.hpp"
 
 using namespace seqan;
 
-
 // inline BlastFormatFile
 // _fileType(LambdaOptions const & options)
 // {
@@ -57,20 +54,20 @@ using namespace seqan;
 // forwards
 
 inline int
-argConv0(LambdaOptions const & options);
+argConv0(LambdaOptions & options);
 //-
 template <typename TOutFormat,
           BlastTabularSpec h>
 inline int
-argConv05(LambdaOptions                 const & options,
-          TOutFormat                    const & /**/,
-          BlastTabularSpecSelector<h>   const &);
+argConv1(LambdaOptions                       & options,
+         TOutFormat                    const & /**/,
+         BlastTabularSpecSelector<h>   const &);
 //-
 template <typename TOutFormat,
           BlastTabularSpec h,
           BlastProgram p>
 inline int
-argConv1(LambdaOptions                  const & options,
+argConv2(LambdaOptions                        & options,
          TOutFormat                     const & /**/,
          BlastTabularSpecSelector<h>    const &,
          BlastProgramSelector<p>        const &);
@@ -80,7 +77,7 @@ template <typename TOutFormat,
           BlastTabularSpec h,
           BlastProgram p>
 inline int
-argConv2(LambdaOptions                  const & options,
+argConv3(LambdaOptions                        & options,
          TOutFormat                     const &,
          BlastTabularSpecSelector<h>    const &,
          BlastProgramSelector<p>        const &,
@@ -88,46 +85,29 @@ argConv2(LambdaOptions                  const & options,
 //-
 template <typename TOutFormat,
           typename TRedAlph,
-          typename TScoreScheme,
-          BlastTabularSpec h,
-          BlastProgram p>
-inline int
-argConv3(LambdaOptions                  const & options,
-         TOutFormat                     const &,
-         BlastTabularSpecSelector<h>    const &,
-         BlastProgramSelector<p>        const &,
-         TRedAlph                       const &,
-         TScoreScheme                   const &);
-//-
-template <typename TOutFormat,
-          typename TRedAlph,
-          typename TScoreScheme,
           typename TScoreExtension,
           BlastTabularSpec h,
           BlastProgram p>
 inline int
-argConv4(LambdaOptions                  const & options,
+argConv4(LambdaOptions                        & options,
          TOutFormat                     const & /**/,
          BlastTabularSpecSelector<h>    const &,
          BlastProgramSelector<p>        const &,
          TRedAlph                       const & /**/,
-         TScoreScheme                   const & /**/,
          TScoreExtension                const & /**/);
 //-
 template <typename TIndexSpec,
           typename TRedAlph,
-          typename TScoreScheme,
           typename TScoreExtension,
           typename TOutFormat,
           BlastProgram p,
           BlastTabularSpec h>
 inline int
-realMain(LambdaOptions                  const & options,
+realMain(LambdaOptions                        & options,
          TOutFormat                     const & /**/,
          BlastTabularSpecSelector<h>    const &,
          BlastProgramSelector<p>        const &,
          TRedAlph                       const & /**/,
-         TScoreScheme                   const & /**/,
          TScoreExtension                const & /**/);
 
 // --------------------------------------------------------------------------
@@ -156,7 +136,7 @@ int main(int argc, char const ** argv)
 
 // CONVERT Run-time options to compile-time Format-Type
 inline int
-argConv0(LambdaOptions const & options)
+argConv0(LambdaOptions & options)
 {
     CharString output = options.output;
     if (endsWith(output, ".gz"))
@@ -165,13 +145,13 @@ argConv0(LambdaOptions const & options)
         output = prefix(output, length(output) - 4);
 
     if (endsWith(output, ".m0"))
-        return argConv05(options, BlastReport(), BlastTabularSpecSelector<BlastTabularSpec::NO_COMMENTS>());
+        return argConv1(options, BlastReport(), BlastTabularSpecSelector<BlastTabularSpec::NO_COMMENTS>());
     else if (endsWith(output, ".m8"))
-        return argConv05(options, BlastTabular(), BlastTabularSpecSelector<BlastTabularSpec::NO_COMMENTS>());
+        return argConv1(options, BlastTabular(), BlastTabularSpecSelector<BlastTabularSpec::NO_COMMENTS>());
     else if (endsWith(output, ".m9"))
-        return argConv05(options, BlastTabular(), BlastTabularSpecSelector<BlastTabularSpec::COMMENTS>());
+        return argConv1(options, BlastTabular(), BlastTabularSpecSelector<BlastTabularSpec::COMMENTS>());
     else if (endsWith(output, ".sam") || endsWith(output, ".bam")) // handled elsewhere
-        return argConv05(options, BlastTabular(), BlastTabularSpecSelector<BlastTabularSpec::COMMENTS>());
+        return argConv1(options, BlastTabular(), BlastTabularSpecSelector<BlastTabularSpec::COMMENTS>());
 
     std::cerr << "ERROR: Cannot handle output extension.\n";
     return -1;
@@ -180,37 +160,38 @@ argConv0(LambdaOptions const & options)
 template <typename TOutFormat,
           BlastTabularSpec h>
 inline int
-argConv05(LambdaOptions                 const & options,
-          TOutFormat                    const & /**/,
-          BlastTabularSpecSelector<h>   const &)
+argConv1(LambdaOptions                       & options,
+         TOutFormat                    const & /**/,
+         BlastTabularSpecSelector<h>   const &)
 {
     switch(options.blastProgram)
     {
 #ifndef FASTBUILD
         case BlastProgram::BLASTN:
-            return argConv1(options,
+            return argConv3(options,
                             TOutFormat(),
                             BlastTabularSpecSelector<h>(),
-                            BlastProgramSelector<BlastProgram::BLASTN>());
+                            BlastProgramSelector<BlastProgram::BLASTN>(),
+                            Dna5());
 #endif
         case BlastProgram::BLASTP:
-            return argConv1(options,
+            return argConv2(options,
                             TOutFormat(),
                             BlastTabularSpecSelector<h>(),
                             BlastProgramSelector<BlastProgram::BLASTP>());
         case BlastProgram::BLASTX:
-            return argConv1(options,
+            return argConv2(options,
                             TOutFormat(),
                             BlastTabularSpecSelector<h>(),
                             BlastProgramSelector<BlastProgram::BLASTX>());
 #ifndef FASTBUILD
         case BlastProgram::TBLASTN:
-            return argConv1(options,
+            return argConv2(options,
                             TOutFormat(),
                             BlastTabularSpecSelector<h>(),
                             BlastProgramSelector<BlastProgram::TBLASTN>());
         case BlastProgram::TBLASTX:
-            return argConv1(options,
+            return argConv2(options,
                             TOutFormat(),
                             BlastTabularSpecSelector<h>(),
                             BlastProgramSelector<BlastProgram::TBLASTX>());
@@ -228,20 +209,19 @@ template <typename TOutFormat,
           BlastTabularSpec h,
           BlastProgram p>
 inline int
-argConv1(LambdaOptions                  const & options,
+argConv2(LambdaOptions                        & options,
          TOutFormat                     const & /**/,
          BlastTabularSpecSelector<h>    const &,
          BlastProgramSelector<p>        const &)
 {
-    using TUnred = typename std::conditional<p == BlastProgram::BLASTN, Dna5, AminoAcid>::type;
     using Th = BlastTabularSpecSelector<h>;
     using Tp = BlastProgramSelector<p>;
     switch (options.alphReduction)
     {
         case 0:
-            return argConv2(options, TOutFormat(), Th(), Tp(), TUnred());
+            return argConv3(options, TOutFormat(), Th(), Tp(), AminoAcid());
         case 2:
-            return argConv2(options, TOutFormat(), Th(), Tp(), ReducedAminoAcid<Murphy10>());
+            return argConv3(options, TOutFormat(), Th(), Tp(), ReducedAminoAcid<Murphy10>());
 #if 0
         case 10:
             return argConv2(options, TOutFormat(), ReducedAminoAcid<ClusterReduction<10>>());
@@ -259,61 +239,30 @@ argConv1(LambdaOptions                  const & options,
     return -1;
 }
 
-/// scoring scheme
-
+// extension model
 template <typename TOutFormat,
           typename TRedAlph,
           BlastTabularSpec h,
           BlastProgram p>
 inline int
-argConv2(LambdaOptions                  const & options,
+argConv3(LambdaOptions                        & options,
          TOutFormat                     const &,
          BlastTabularSpecSelector<h>    const &,
          BlastProgramSelector<p>        const &,
          TRedAlph                       const &)
 {
-    using Th = BlastTabularSpecSelector<h>;
-    using Tp = BlastProgramSelector<p>;
-    switch (options.scoringMethod)
-    {
-#ifndef FASTBUILD
-        case 0:
-            return argConv3(options, TOutFormat(), Th(), Tp(), TRedAlph(), Score<int, Simple>());
-        case 45:
-            return argConv3(options, TOutFormat(), Th(), Tp(), TRedAlph(), Blosum45());
-        case 80:
-            return argConv3(options, TOutFormat(), Th(), Tp(), TRedAlph(), Blosum80());
-#endif
-        case 62:
-            return argConv3(options, TOutFormat(), Th(), Tp(), TRedAlph(), Blosum62());
-        default:
-            break;
-    }
-    std::cerr << "Unsupported Scoring Scheme selected.\n";
-    return -1;
-}
 
-template <typename TOutFormat,
-          typename TRedAlph,
-          typename TScoreScheme,
-          BlastTabularSpec h,
-          BlastProgram p>
-inline int
-argConv3(LambdaOptions                  const & options,
-         TOutFormat                     const &,
-         BlastTabularSpecSelector<h>    const &,
-         BlastProgramSelector<p>        const &,
-         TRedAlph                       const &,
-         TScoreScheme                   const &)
-{
-#ifndef FASTBUILD
     if (options.gapOpen == 0)
+#ifndef LAMBDA_LINGAPS_OPT
+        std::cerr << "ATTENTION: You have set the additional gap open cost to 0. If you run LAMBDA "
+                     "in this configuration regularly, you might want to rebuild it with "
+                     "LAMBDA_LINGAPS_OPT=1 to profit from additional optimizations.\n";
+#else
         return argConv4(options,
                         TOutFormat(),
                         BlastTabularSpecSelector<h>(),
                         BlastProgramSelector<p>(),
                         TRedAlph(),
-                        TScoreScheme(),
                         LinearGaps());
     else
 #endif
@@ -322,60 +271,28 @@ argConv3(LambdaOptions                  const & options,
                         BlastTabularSpecSelector<h>(),
                         BlastProgramSelector<p>(),
                         TRedAlph(),
-                        TScoreScheme(),
                         AffineGaps());
 }
 
 template <typename TOutFormat,
           typename TRedAlph,
-          typename TScoreScheme,
           typename TScoreExtension,
           BlastTabularSpec h,
           BlastProgram p>
 inline int
-argConv4(LambdaOptions                  const & options,
+argConv4(LambdaOptions                        & options,
          TOutFormat                     const & /**/,
          BlastTabularSpecSelector<h>    const &,
          BlastProgramSelector<p>        const &,
          TRedAlph                       const & /**/,
-         TScoreScheme                   const & /**/,
          TScoreExtension                const & /**/)
 {
-    int indexType = options.dbIndexType;
-//     if (indexType == -1) // autodetect
-//     {
-//         //TODO FIX THIS WITH NEW EXTENSIONS
-//         CharString file = options.dbFile;
-//         append(file, ".sa");
-//         struct stat buffer;
-//         if (stat(toCString(file), &buffer) == 0)
-//         {
-//             indexType = 0;
-//         } else
-//         {
-//             file = options.dbFile;
-//             append(file, ".sa.val"); // FM Index
-//             struct stat buffer;
-//             if (stat(toCString(file), &buffer) == 0)
-//             {
-//                 indexType = 1;
-//             } else
-//             {
-//                 std::cerr << "No Index file could be found, please make sure paths "
-//                         << "are correct and the files are readable.\n" << std::flush;
-// 
-//                 return -1;
-//             }
-//         }
-//     }
-
-    if (indexType == 0)
+    if (options.dbIndexType == DbIndexType::SUFFIX_ARRAY)
         return realMain<IndexSa<>>(options,
                                    TOutFormat(),
                                    BlastTabularSpecSelector<h>(),
                                    BlastProgramSelector<p>(),
                                    TRedAlph(),
-                                   TScoreScheme(),
                                    TScoreExtension());
     else
         return realMain<TFMIndex<>>(options,
@@ -383,7 +300,6 @@ argConv4(LambdaOptions                  const & options,
                                    BlastTabularSpecSelector<h>(),
                                    BlastProgramSelector<p>(),
                                    TRedAlph(),
-                                   TScoreScheme(),
                                    TScoreExtension());
 }
 
@@ -395,38 +311,36 @@ argConv4(LambdaOptions                  const & options,
 #endif
 template <typename TIndexSpec,
           typename TRedAlph,
-          typename TScoreScheme,
           typename TScoreExtension,
           typename TOutFormat,
           BlastProgram p,
           BlastTabularSpec h>
 inline int
-realMain(LambdaOptions                  const & options,
+realMain(LambdaOptions                        & options,
          TOutFormat                     const & /**/,
          BlastTabularSpecSelector<h>    const &,
          BlastProgramSelector<p>        const &,
          TRedAlph                       const & /**/,
-         TScoreScheme                   const & /**/,
          TScoreExtension                const & /**/)
 {
-    using TGlobalHolder = GlobalDataHolder<TRedAlph,
-                                           TScoreScheme,
-                                           TIndexSpec,
-                                           TOutFormat,
-                                           p,
-                                           h>;
-    using TLocalHolder = LocalDataHolder<Match, TGlobalHolder, TScoreExtension>;
+    using TGlobalHolder = GlobalDataHolder<TRedAlph, TIndexSpec, TOutFormat, p, h>;
+    using TLocalHolder = LocalDataHolder<TGlobalHolder, TScoreExtension>;
 
     myPrint(options, 1, "LAMBDA - the Local Aligner for Massive Biological DatA"
                       "\n======================================================"
                       "\nVersion ", SEQAN_APP_VERSION, "\n\n");
 
+    int ret = validateIndexOptions<TRedAlph, p>(options);
+    if (ret)
+        return ret;
+
     if (options.verbosity >= 2)
         printOptions<TLocalHolder>(options);
 
     TGlobalHolder globalHolder;
+//     context(globalHolder.outfile).scoringScheme._internalScheme = matr;
 
-    int ret = prepareScoring(globalHolder, options);
+    ret = prepareScoring(globalHolder, options);
     if (ret)
         return ret;
 
@@ -438,9 +352,9 @@ realMain(LambdaOptions                  const & options,
     if (ret)
         return ret;
 
-    ret = loadSegintervals(globalHolder, options);
-    if (ret)
-        return ret;
+//     ret = loadSegintervals(globalHolder, options);
+//     if (ret)
+//         return ret;
 
     ret = loadQuery(globalHolder, options);
     if (ret)
@@ -506,9 +420,13 @@ realMain(LambdaOptions                  const & options,
             localHolder.init(t);
 
             // seed
-            res = generateSeeds(localHolder);
-            if (res)
-                continue;
+            double buf = sysTime();
+            if (!options.adaptiveSeeding)
+            {
+                res = generateSeeds(localHolder);
+                if (res)
+                    continue;
+            }
 
             if (options.doubleIndexing)
             {
@@ -516,19 +434,33 @@ realMain(LambdaOptions                  const & options,
                 if (res)
                     continue;
             }
+            localHolder.stats.timeGenSeeds += sysTime() - buf;
 
             // search
-            search(localHolder);
+            buf = sysTime();
+            search(localHolder); //TODO seed refining if iterateMatches gives 0 results
+            localHolder.stats.timeSearch += sysTime() - buf;
+
+//             // TODO DEBUG
+//             for (auto const & m : localHolder.matches)
+//                 _printMatch(m);
 
             // sort
-            sortMatches(localHolder);
+            if (options.filterPutativeAbundant || options.filterPutativeDuplicates || options.mergePutativeSiblings)
+            {
+                buf = sysTime();
+                sortMatches(localHolder);
+                localHolder.stats.timeSort += sysTime() - buf;
+            }
 
             // extend
-            res = iterateMatches(localHolder);
+            buf = sysTime();
+            if (length(localHolder.matches) > 0)
+                res = iterateMatches(localHolder);
+            localHolder.stats.timeExtend += sysTime() - buf;
             if (res)
                 continue;
 
-
             if ((!options.doubleIndexing) && (TID == 0) &&
                 (options.verbosity >= 1))
             {
@@ -554,7 +486,7 @@ realMain(LambdaOptions                  const & options,
 
     if (!options.doubleIndexing)
     {
-        myPrint(options, 2, "Runtime: ", sysTime() - start, "s.\n\n");
+        myPrint(options, 2, "Runtime total: ", sysTime() - start, "s.\n\n");
     }
 
     printStats(globalHolder.stats, options);
diff --git a/src/lambda.hpp b/src/lambda.hpp
index b8ad55c..ccc179c 100644
--- a/src/lambda.hpp
+++ b/src/lambda.hpp
@@ -1,25 +1,20 @@
 // ==========================================================================
 //                                  lambda
 // ==========================================================================
-// Copyright (c) 2013-2015, Hannes Hauswedell, FU Berlin
+// Copyright (c) 2013-2016, Hannes Hauswedell <h2 @ fsfe.org>
+// Copyright (c) 2016, Knut Reinert and Freie Universität Berlin
 // All rights reserved.
 //
 // This file is part of Lambda.
 //
-// Lambda is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
+// Lambda is Free Software: you can redistribute it and/or modify it
+// under the terms found in the LICENSE[.md|.rst] file distributed
+// together with this file.
 //
 // Lambda is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 //
-// You should have received a copy of the GNU General Public License
-// along with Lambda.  If not, see <http://www.gnu.org/licenses/>.
-// ==========================================================================
-// Author: Hannes Hauswedell <hannes.hauswedell @ fu-berlin.de>
 // ==========================================================================
 // lambda.hpp: contains the main progam pipeline
 // ==========================================================================
@@ -46,12 +41,28 @@
 #include "options.hpp"
 #include "match.hpp"
 #include "misc.hpp"
-#include "alph.hpp"
-#include "holders.hpp"
-#include "output.hpp"
 
 using namespace seqan;
 
+// ============================================================================
+// Forwards
+// ============================================================================
+
+template <typename TRedAlph_,
+          typename TIndexSpec_,
+          typename TFileFormat,
+          BlastProgram p,
+          BlastTabularSpec h>
+class GlobalDataHolder;
+
+template <typename TGlobalHolder_,
+          typename TScoreExtension>
+class LocalDataHolder;
+
+// ============================================================================
+// Classes, structs, enums
+// ============================================================================
+
 enum COMPUTERESULT_
 {
     SUCCESS = 0,
@@ -84,17 +95,91 @@ struct Comp :
 // ============================================================================
 
 // --------------------------------------------------------------------------
+// Function readIndexOption()
+// --------------------------------------------------------------------------
+
+inline void
+readIndexOption(std::string            & optionString,
+                std::string      const & optionIdentifier,
+                LambdaOptions    const & options)
+{
+    std::ifstream f{(options.indexDir + "/option:" + optionIdentifier).c_str(),
+                    std::ios_base::in | std::ios_base::binary};
+    if (f.is_open())
+    {
+        auto fit = directionIterator(f, Input());
+        readLine(optionString, fit);
+        f.close();
+    }
+    else
+    {
+        throw std::runtime_error("ERROR: Expected option specifier:\n" + options.indexDir + "/option:" +
+                                 optionIdentifier + "\nYour index seems incompatible, try to recreate it "
+                                 "and report a bug if the issue persists.");
+    }
+}
+
+// --------------------------------------------------------------------------
+// Function validateIndexOptions()
+// --------------------------------------------------------------------------
+
+template <typename TRedAlph,
+          BlastProgram p>
+inline int
+validateIndexOptions(LambdaOptions const & options)
+{
+    std::string buffer;
+    readIndexOption(buffer, "alph_translated", options);
+    if (buffer != _alphName(TransAlph<p>()))
+    {
+        std::cerr << "ERROR: Your index is of translated alphabet type: " << buffer <<  "\n       But lambda expected: "
+                  << _alphName(TransAlph<p>()) << "\n       Did you specify the right -p parameter?\n\n";
+        return -1;
+
+    }
+    buffer.clear();
+    readIndexOption(buffer, "alph_reduced", options);
+    if (buffer != _alphName(TRedAlph()))
+    {
+        std::cerr << "ERROR: Your index is of reduced alphabet type: " << buffer << "\n       But lambda expected: "
+                  << _alphName(TRedAlph()) << "\n       Did you specify the right -ar parameter?\n\n";
+        return -1;
+    }
+    buffer.clear();
+    readIndexOption(buffer, "db_index_type", options);
+    unsigned long b = 0;
+    if ((!lexicalCast(b, buffer)) || (b != static_cast<unsigned long>(options.dbIndexType)))
+    {
+        std::cerr << "ERROR: Your index type is: " << _indexName(static_cast<DbIndexType>(std::stoul(buffer)))
+                  << "\n       But lambda expected: " << _indexName(options.dbIndexType)
+                  << "\n       Did you specify the right -di parameter?\n\n";
+        return -1;
+    }
+    if (qIsTranslated(p) && sIsTranslated(p))
+    {
+        buffer.clear();
+        readIndexOption(buffer, "genetic_code", options);
+        unsigned long b = 0;
+        if ((!lexicalCast(b, buffer)) || (b != static_cast<unsigned long>(options.geneticCode)))
+        {
+            std::cerr << "WARNING: The codon translation table used during indexing and during search are different. "
+                         "This is not a problem per se, but is likely not what you want.\n\n";
+        }
+    }
+    return 0;
+}
+
+// --------------------------------------------------------------------------
 // Function prepareScoring()
 // --------------------------------------------------------------------------
 
 template <BlastTabularSpec h,
           BlastProgram p,
           typename TRedAlph,
-          typename TScoreScheme,
           typename TIndexSpec,
           typename TOutFormat>
 inline void
-prepareScoringMore(GlobalDataHolder<TRedAlph, TScoreScheme,TIndexSpec, TOutFormat, p, h>  & globalHolder,
+prepareScoringMore(GlobalDataHolder<TRedAlph, TIndexSpec, TOutFormat, p, h>  & globalHolder,
                    LambdaOptions                                                    const & options,
                    std::true_type                                                   const & /**/)
 {
@@ -105,31 +190,51 @@ prepareScoringMore(GlobalDataHolder<TRedAlph, TScoreScheme,TIndexSpec, TOutForma
 template <BlastTabularSpec h,
           BlastProgram p,
           typename TRedAlph,
-          typename TScoreScheme,
           typename TIndexSpec,
           typename TOutFormat>
 inline void
-prepareScoringMore(GlobalDataHolder<TRedAlph, TScoreScheme, TIndexSpec, TOutFormat, p, h> & /*globalHolder*/,
-                   LambdaOptions                                                    const & /*options*/,
+prepareScoringMore(GlobalDataHolder<TRedAlph, TIndexSpec, TOutFormat, p, h> & globalHolder,
+                   LambdaOptions                                                    const & options,
                    std::false_type                                                  const & /**/)
 {
+    switch (options.scoringMethod)
+    {
+//         case 0:
+//             return argConv3(options, TOutFormat(), Th(), Tp(), TRedAlph(), Score<int, Simple>());
+        case 45:
+            setScoreMatrixById(context(globalHolder.outfile).scoringScheme._internalScheme,
+                               AminoAcidScoreMatrixID::BLOSUM45);
+            break;
+        case 62:
+            setScoreMatrixById(context(globalHolder.outfile).scoringScheme._internalScheme,
+                               AminoAcidScoreMatrixID::BLOSUM62);
+            break;
+        case 80:
+            setScoreMatrixById(context(globalHolder.outfile).scoringScheme._internalScheme,
+                               AminoAcidScoreMatrixID::BLOSUM80);
+            break;
+        default:
+            break;
+    }
 }
 
 template <BlastTabularSpec h,
           BlastProgram p,
           typename TRedAlph,
-          typename TScoreScheme,
           typename TIndexSpec,
           typename TOutFormat>
 inline int
-prepareScoring(GlobalDataHolder<TRedAlph, TScoreScheme, TIndexSpec, TOutFormat, p, h> & globalHolder,
+prepareScoring(GlobalDataHolder<TRedAlph, TIndexSpec, TOutFormat, p, h> & globalHolder,
                LambdaOptions                                                    const & options)
 {
+    using TGlobalHolder = GlobalDataHolder<TRedAlph, TIndexSpec, TOutFormat, p, h>;
+    prepareScoringMore(globalHolder,
+                       options,
+                       std::is_same<typename TGlobalHolder::TScoreScheme, Score<int, Simple>>());
+
     setScoreGapOpenBlast(context(globalHolder.outfile).scoringScheme, options.gapOpen);
     setScoreGapExtend(context(globalHolder.outfile).scoringScheme, options.gapExtend);
 
-    prepareScoringMore(globalHolder, options, std::is_same<TScoreScheme, Score<int, Simple>>());
-
     if (!isValid(context(globalHolder.outfile).scoringScheme))
     {
         std::cerr << "Could not computer Karlin-Altschul-Values for "
@@ -146,14 +251,13 @@ prepareScoring(GlobalDataHolder<TRedAlph, TScoreScheme, TIndexSpec, TOutFormat,
 template <BlastTabularSpec h,
           BlastProgram p,
           typename TRedAlph,
-          typename TScoreScheme,
           typename TIndexSpec,
           typename TOutFormat>
 inline int
-loadSubjects(GlobalDataHolder<TRedAlph, TScoreScheme, TIndexSpec, TOutFormat, p, h> & globalHolder,
+loadSubjects(GlobalDataHolder<TRedAlph, TIndexSpec, TOutFormat, p, h> & globalHolder,
              LambdaOptions                                                    const & options)
 {
-    using TGH = GlobalDataHolder<TRedAlph, TScoreScheme, TIndexSpec, TOutFormat, p, h>;
+    using TGH = GlobalDataHolder<TRedAlph, TIndexSpec, TOutFormat, p, h>;
 
     double start, finish;
     std::string strIdent;
@@ -166,9 +270,8 @@ loadSubjects(GlobalDataHolder<TRedAlph, TScoreScheme, TIndexSpec, TOutFormat, p,
         strIdent = "Loading Subj Sequences...";
         myPrint(options, 1, strIdent);
 
-        _dbSeqs = options.dbFile;
-        append(_dbSeqs, ".");
-        append(_dbSeqs, _alphName(TransAlph<p>()));
+        _dbSeqs = options.indexDir;
+        append(_dbSeqs, "/translated_seqs");
 
         ret = open(globalHolder.subjSeqs, toCString(_dbSeqs), OPEN_RDONLY);
         if (ret != true)
@@ -178,6 +281,12 @@ loadSubjects(GlobalDataHolder<TRedAlph, TScoreScheme, TIndexSpec, TOutFormat, p,
             return 1;
         }
 
+        if (length(globalHolder.subjSeqs) == 0)
+        {
+            std::cerr << "ERROR: No sequences in database. Aborting.\n";
+            return -1;
+        }
+
         if (TGH::alphReduction)
             globalHolder.redSubjSeqs.limits = globalHolder.subjSeqs.limits;
 
@@ -191,8 +300,8 @@ loadSubjects(GlobalDataHolder<TRedAlph, TScoreScheme, TIndexSpec, TOutFormat, p,
     strIdent = "Loading Subj Ids...";
     myPrint(options, 1, strIdent);
 
-    _dbSeqs = options.dbFile;
-    append(_dbSeqs, ".ids");
+    _dbSeqs = options.indexDir;
+    append(_dbSeqs, "/seq_ids");
     ret = open(globalHolder.subjIds, toCString(_dbSeqs), OPEN_RDONLY);
     if (ret != true)
     {
@@ -204,7 +313,7 @@ loadSubjects(GlobalDataHolder<TRedAlph, TScoreScheme, TIndexSpec, TOutFormat, p,
     myPrint(options, 1, " done.\n");
     myPrint(options, 2, "Runtime: ", finish, "s \n\n");
 
-    context(globalHolder.outfile).dbName = options.dbFile;
+    context(globalHolder.outfile).dbName = options.indexDir;
 
     // if subjects where translated, we don't have the untranslated seqs at all
     // but we still need the data for statistics and position un-translation
@@ -214,8 +323,8 @@ loadSubjects(GlobalDataHolder<TRedAlph, TScoreScheme, TIndexSpec, TOutFormat, p,
         std::string strIdent = "Loading Lengths of untranslated Subj sequences...";
         myPrint(options, 1, strIdent);
 
-        _dbSeqs = options.dbFile;
-        append(_dbSeqs, ".untranslengths");
+        _dbSeqs = options.indexDir;
+        append(_dbSeqs, "/untranslated_seq_lengths");
         ret = open(globalHolder.untransSubjSeqLengths, toCString(_dbSeqs), OPEN_RDONLY);
         if (ret != true)
         {
@@ -244,24 +353,8 @@ loadDbIndexFromDisk(TGlobalHolder       & globalHolder,
     std::string strIdent = "Loading Database Index...";
     myPrint(options, 1, strIdent);
     double start = sysTime();
-    std::string path = toCString(options.dbFile);
-    path += '.' + std::string(_alphName(typename TGlobalHolder::TRedAlph()));
-    if (TGlobalHolder::indexIsFM)
-        path += ".fm";
-    else
-        path += ".sa";
-
-    // Check if the index is of the old format (pre 0.9.0) by looking for different files
-    if ((globalHolder.blastProgram != BlastProgram::BLASTN) && // BLASTN indexes are compatible
-        ((TGlobalHolder::alphReduction && fileExists(toCString(path + ".txt.concat"))) ||
-        (!TGlobalHolder::alphReduction && TGlobalHolder::indexIsFM && !fileExists(toCString(path + ".lf.drv.wtc.24")))))
-    {
-        std::cerr << ((options.verbosity == 0) ? strIdent : std::string())
-                  << " failed.\n"
-                  << "It appears you tried to open an old index (created before 0.9.0) which "
-                  << "is not supported. Please remove the old files and create a new index with lambda_indexer!\n";
-        return 200;
-    }
+    std::string path = toCString(options.indexDir);
+    path += "/index";
 
     int ret = open(globalHolder.dbIndex, path.c_str(), OPEN_RDONLY);
     if (ret != true)
@@ -283,7 +376,7 @@ loadDbIndexFromDisk(TGlobalHolder       & globalHolder,
             length(indexSA(globalHolder.dbIndex)), "\n\n");
 
     // this is actually part of prepareScoring(), but the values are just available now
-    if (sIsTranslated(globalHolder.blastProgram ))
+    if (sIsTranslated(TGlobalHolder::blastProgram ))
     {
         // last value has sum of lengths
         context(globalHolder.outfile).dbTotalLength  = back(globalHolder.untransSubjSeqLengths);
@@ -301,55 +394,54 @@ loadDbIndexFromDisk(TGlobalHolder       & globalHolder,
 // Function loadSegintervals()
 // --------------------------------------------------------------------------
 
-template <BlastTabularSpec h,
-          BlastProgram p,
-          typename TRedAlph,
-          typename TScoreScheme,
-          typename TIndexSpec,
-          typename TOutFormat>
-inline int
-loadSegintervals(GlobalDataHolder<TRedAlph, TScoreScheme, TIndexSpec, TOutFormat, p, h>     & globalHolder,
-                 LambdaOptions                                            const & options)
-{
-
-    double start = sysTime();
-    std::string strIdent = "Loading Database Masking file...";
-    myPrint(options, 1, strIdent);
-
-    CharString segFileS = options.dbFile;
-    append(segFileS, ".binseg_s.concat");
-    CharString segFileE = options.dbFile;
-    append(segFileE, ".binseg_e.concat");
-    bool fail = false;
-    struct stat buffer;
-    // file exists
-    if ((stat(toCString(segFileS), &buffer) == 0) &&
-        (stat(toCString(segFileE), &buffer) == 0))
-    {
-        //cut off ".concat" again
-        resize(segFileS, length(segFileS) - 7);
-        resize(segFileE, length(segFileE) - 7);
-
-        fail = !open(globalHolder.segIntStarts, toCString(segFileS), OPEN_RDONLY);
-        if (!fail)
-            fail = !open(globalHolder.segIntEnds, toCString(segFileE), OPEN_RDONLY);
-    } else
-    {
-        fail = true;
-    }
-
-    if (fail)
-    {
-        std::cerr << ((options.verbosity == 0) ? strIdent : std::string())
-                  << " failed.\n";
-        return 1;
-    }
-
-    double finish = sysTime() - start;
-    myPrint(options, 1, " done.\n");
-    myPrint(options, 2, "Runtime: ", finish, "s \n\n");
-    return 0;
-}
+// template <BlastTabularSpec h,
+//           BlastProgram p,
+//           typename TRedAlph,
+//           typename TIndexSpec,
+//           typename TOutFormat>
+// inline int
+// loadSegintervals(GlobalDataHolder<TRedAlph, TIndexSpec, TOutFormat, p, h>     & globalHolder,
+//                  LambdaOptions                                            const & options)
+// {
+//
+//     double start = sysTime();
+//     std::string strIdent = "Loading Database Masking file...";
+//     myPrint(options, 1, strIdent);
+//
+//     CharString segFileS = options.dbFile;
+//     append(segFileS, ".binseg_s.concat");
+//     CharString segFileE = options.dbFile;
+//     append(segFileE, ".binseg_e.concat");
+//     bool fail = false;
+//     struct stat buffer;
+//     // file exists
+//     if ((stat(toCString(segFileS), &buffer) == 0) &&
+//         (stat(toCString(segFileE), &buffer) == 0))
+//     {
+//         //cut off ".concat" again
+//         resize(segFileS, length(segFileS) - 7);
+//         resize(segFileE, length(segFileE) - 7);
+//
+//         fail = !open(globalHolder.segIntStarts, toCString(segFileS), OPEN_RDONLY);
+//         if (!fail)
+//             fail = !open(globalHolder.segIntEnds, toCString(segFileE), OPEN_RDONLY);
+//     } else
+//     {
+//         fail = true;
+//     }
+//
+//     if (fail)
+//     {
+//         std::cerr << ((options.verbosity == 0) ? strIdent : std::string())
+//                   << " failed.\n";
+//         return 1;
+//     }
+//
+//     double finish = sysTime() - start;
+//     myPrint(options, 1, " done.\n");
+//     myPrint(options, 2, "Runtime: ", finish, "s \n\n");
+//     return 0;
+// }
 
 // --------------------------------------------------------------------------
 // Function loadQuery()
@@ -378,7 +470,11 @@ loadQueryImplTrans(TCDStringSet<String<TTargetAlph, TSpec1>> & target,
            length(source.limits),
            Exact());
 
+#ifdef __clang__
+    SEQAN_OMP_PRAGMA(parallel for)
+#else
     SEQAN_OMP_PRAGMA(parallel for simd)
+#endif
     for (uint32_t i = 0; i < (length(untransQrySeqLengths) - 1); ++i)
         untransQrySeqLengths[i] = source.limits[i + 1] - source.limits[i];
 
@@ -447,14 +543,13 @@ loadQueryImplTrans(TCDStringSet<String<TransAlph<BlastProgram::BLASTP>, TSpec1>>
 template <BlastTabularSpec h,
           BlastProgram p,
           typename TRedAlph,
-          typename TScoreScheme,
           typename TIndexSpec,
           typename TOutFormat>
 inline int
-loadQuery(GlobalDataHolder<TRedAlph, TScoreScheme, TIndexSpec, TOutFormat, p, h> & globalHolder,
-          LambdaOptions                                                    const & options)
+loadQuery(GlobalDataHolder<TRedAlph, TIndexSpec, TOutFormat, p, h>      & globalHolder,
+          LambdaOptions                                                 & options)
 {
-    using TGH = GlobalDataHolder<TRedAlph, TScoreScheme, TIndexSpec, TOutFormat, p, h>;
+    using TGH = GlobalDataHolder<TRedAlph, TIndexSpec, TOutFormat, p, h>;
     double start = sysTime();
 
     std::string strIdent = "Loading Query Sequences and Ids...";
@@ -484,7 +579,7 @@ loadQuery(GlobalDataHolder<TRedAlph, TScoreScheme, TIndexSpec, TOutFormat, p, h>
                        options);
 
     // sam and bam need original sequences if translation happened
-    if (qIsTranslated(globalHolder.blastProgram) && (options.outFileFormat > 0) &&
+    if (qIsTranslated(TGH::blastProgram) && (options.outFileFormat > 0) &&
         (options.samBamSeq > 0))
         std::swap(origSeqs, globalHolder.untranslatedQrySeqs);
 
@@ -494,17 +589,59 @@ loadQuery(GlobalDataHolder<TRedAlph, TScoreScheme, TIndexSpec, TOutFormat, p, h>
     double finish = sysTime() - start;
     myPrint(options, 1, " done.\n");
 
-    if (options.verbosity >= 2)
+    unsigned long maxLen = 0ul;
+    for (auto const & s : globalHolder.qrySeqs)
+        if (length(s) > maxLen)
+            maxLen = length(s);
+
+    myPrint(options, 2, "Runtime: ", finish, "s \n",
+            "Number of effective query sequences: ",
+            length(globalHolder.qrySeqs), "\nLongest query sequence: ",
+            maxLen, "\n\n");
+
+    if (length(globalHolder.qrySeqs) == 0)
+    {
+        std::cerr << "ERROR: Zero sequences submitted. Aborting.\n";
+        return -1;
+    }
+
+    if (length(globalHolder.qrySeqs) >= std::numeric_limits<typename TGH::TMatch::TQId>::max())
+    {
+        std::cerr << "ERROR: Too many sequences submitted. The maximum (including frames) is "
+                  << std::numeric_limits<typename TGH::TMatch::TQId>::max()
+                  << ".\n";
+        return -1;
+    }
+
+    if (maxLen >= std::numeric_limits<typename TGH::TMatch::TPos>::max())
     {
-        unsigned long maxLen = 0ul;
-        for (auto const & s : globalHolder.qrySeqs)
-            if (length(s) > maxLen)
-                maxLen = length(s);
-        myPrint(options, 2, "Runtime: ", finish, "s \n",
-                "Number of effective query sequences: ",
-                length(globalHolder.qrySeqs), "\nLongest query sequence: ",
-                maxLen, "\n\n");
+        std::cerr << "ERROR: one or more of your query sequences are too long. "
+                  << "The maximum length is " << std::numeric_limits<typename TGH::TMatch::TPos>::max()
+                  << ".\n";
+        return -1;
     }
+
+    if (options.extensionMode == LambdaOptions::ExtensionMode::AUTO)
+    {
+        if (maxLen <= 100)
+        {
+        #if 0 // defined(SEQAN_SIMD_ENABLED) && defined(__AVX2__)
+            options.extensionMode = LambdaOptions::ExtensionMode::FULL_SIMD;
+            options.band = -1;
+        #else
+            options.extensionMode = LambdaOptions::ExtensionMode::FULL_SERIAL;
+        #endif
+            options.xDropOff = -1;
+            options.filterPutativeAbundant = false;
+            options.filterPutativeDuplicates = false;
+            options.mergePutativeSiblings = false;
+        }
+        else
+        {
+            options.extensionMode = LambdaOptions::ExtensionMode::XDROP;
+        }
+    }
+
     return 0;
 }
 
@@ -606,10 +743,328 @@ generateTrieOverSeeds(TLocalHolder & lH)
     return 0;
 }
 
+// perform a fast local alignment score calculation on the seed and see if we
+// reach above threshold
+// WARNING the following function only works for hammingdistanced seeds
+template <typename TGlobalHolder,
+          typename TScoreExtension>
+inline bool
+seedLooksPromising(LocalDataHolder<TGlobalHolder, TScoreExtension> const & lH,
+                   typename TGlobalHolder::TMatch const & m)
+{
+    // no pre-scoring, but still filter out XXX and NNN hits
+//     if (!lH.options.preScoring))
+//     {
+//         for (unsigned i = m.qryStart, count = 0; i < m.qryStart + lH.options.seedLength; ++i)
+//             if (lH.gH.qrySeqs[m.qryId][i] == unkownValue<typename TGlobalHolder::TRedAlph>())
+//                 if (++count > lH.options.maxSeedDist)
+//                     return false;
+//         return true;
+//     }
+
+    int64_t effectiveQBegin = m.qryStart;
+    int64_t effectiveSBegin = m.subjStart;
+    uint64_t actualLength = m.qryEnd - m.qryStart;
+    uint64_t effectiveLength = std::max(static_cast<uint64_t>(lH.options.seedLength * lH.options.preScoring),
+                                        actualLength);
+
+    if (effectiveLength > actualLength)
+    {
+        effectiveQBegin -= (lH.options.preScoring - 1) *
+                           actualLength / 2;
+        effectiveSBegin -= (lH.options.preScoring - 1) *
+                           actualLength / 2;
+//         std::cout << effectiveQBegin << "\t" << effectiveSBegin << "\n";
+        int64_t min = std::min(effectiveQBegin, effectiveSBegin);
+        if (min < 0)
+        {
+            effectiveQBegin -= min;
+            effectiveSBegin -= min;
+            effectiveLength += min;
+        }
+
+        effectiveLength = std::min({
+                            length(lH.gH.qrySeqs[m.qryId]) - effectiveQBegin,
+                            length(lH.gH.subjSeqs[m.subjId]) - effectiveSBegin,
+                            effectiveLength});
+//         std::cout << effectiveQBegin << "\t" << effectiveSBegin << "\t"
+//                   << effectiveLength << "\n";
+    }
+
+    auto const & qSeq = infix(lH.gH.qrySeqs[m.qryId],
+                              effectiveQBegin,
+                              effectiveQBegin + effectiveLength);
+    auto const & sSeq = infix(lH.gH.subjSeqs[m.subjId],
+                              effectiveSBegin,
+                              effectiveSBegin + effectiveLength);
+    int maxScore = 0;
+
+    int scores[effectiveLength+1]; // C99, C++14, -Wno-vla before that
+    scores[0] = 0;
+
+    // score the diagonal
+    for (uint64_t i = 0; i < effectiveLength; ++i)
+    {
+        scores[i] += score(seqanScheme(context(lH.gH.outfile).scoringScheme), qSeq[i], sSeq[i]);
+        if (scores[i] < 0)
+            scores[i] = 0;
+        else if (scores[i] > maxScore)
+            maxScore = scores[i];
+
+//         if (i < static_cast<uint64_t>(effectiveLength - 1)) // TODO remove
+        scores[i+1] = scores[i];
+    }
+
+    return (maxScore >= int(lH.options.preScoringThresh * effectiveLength));
+}
+
+// --------------------------------------------------------------------------
+// Function onFind()
+// --------------------------------------------------------------------------
+
+template <typename TGlobalHolder,
+          typename TScoreExtension,
+          typename TSeedId,
+          typename TSubjOcc>
+inline void
+onFind(LocalDataHolder<TGlobalHolder, TScoreExtension> & lH,
+       TSeedId const & seedId,
+       TSubjOcc subjOcc)
+{
+    using TMatch = typename TGlobalHolder::TMatch;
+    SEQAN_ASSERT_LEQ_MSG(getSeqOffset(subjOcc) + lH.options.seedLength,
+                         length(lH.gH.subjSeqs[getSeqNo(subjOcc)]),
+                         "ERROR: Seed reaches beyond end of subject sequence! Please report a bug with your files at "
+                         "http://www.seqan.de/lambda !");
+
+    if (TGlobalHolder::indexIsFM) // positions are reversed
+        setSeqOffset(subjOcc,
+                     length(lH.gH.subjSeqs[getSeqNo(subjOcc)])
+                     - getSeqOffset(subjOcc)
+                     - lH.options.seedLength);
+
+    TMatch m {static_cast<typename TMatch::TQId>(lH.seedRefs[seedId]),
+              static_cast<typename TMatch::TSId>(getSeqNo(subjOcc)),
+              static_cast<typename TMatch::TPos>(lH.seedRanks[seedId] * lH.options.seedOffset),
+              static_cast<typename TMatch::TPos>(lH.seedRanks[seedId] * lH.options.seedOffset + lH.options.seedLength),
+              static_cast<typename TMatch::TPos>(getSeqOffset(subjOcc)),
+              static_cast<typename TMatch::TPos>(getSeqOffset(subjOcc) + lH.options.seedLength)};
+
+    bool discarded = false;
+    auto const halfSubjL = lH.options.seedLength /  2;
+
+    if (!sIsTranslated(TGlobalHolder::blastProgram))
+    {
+        for (unsigned k = 0; k < length(lH.gH.segIntStarts[m.subjId]); ++k)
+        {
+            // more than half of the seed falls into masked interval
+            if (intervalOverlap(m.subjStart,
+                                m.subjEnd,
+                                lH.gH.segIntStarts[m.subjId][k],
+                                lH.gH.segIntEnds[m.subjId][k])
+                    >= halfSubjL)
+            {
+                ++lH.stats.hitsMasked;
+                discarded = true;
+                break;
+            }
+        }
+    }
+
+     if ((!discarded) && (!seedLooksPromising(lH, m)))
+     {
+         discarded = true;
+         ++lH.stats.hitsFailedPreExtendTest;
+     }
+
+    if (!discarded)
+        lH.matches.emplace_back(m);
+}
+
+template <typename TGlobalHolder,
+          typename TScoreExtension,
+          typename TSubjOcc>
+inline void
+onFindVariable(LocalDataHolder<TGlobalHolder, TScoreExtension> & lH,
+               TSubjOcc subjOcc,
+               typename TGlobalHolder::TMatch::TQId const seedId,
+               typename TGlobalHolder::TMatch::TPos const seedBegin,
+               typename TGlobalHolder::TMatch::TPos const seedLength)
+{
+    using TMatch = typename TGlobalHolder::TMatch;
+    if (TGlobalHolder::indexIsFM) // positions are reversed
+        setSeqOffset(subjOcc,
+                     length(lH.gH.subjSeqs[getSeqNo(subjOcc)])
+                     - getSeqOffset(subjOcc)
+                     - seedLength);
+
+    TMatch m {seedId,
+              static_cast<typename TGlobalHolder::TMatch::TSId>(getSeqNo(subjOcc)),
+              seedBegin,
+              static_cast<typename TGlobalHolder::TMatch::TPos>(seedBegin + seedLength),
+              static_cast<typename TGlobalHolder::TMatch::TPos>(getSeqOffset(subjOcc)),
+              static_cast<typename TGlobalHolder::TMatch::TPos>(getSeqOffset(subjOcc) + seedLength)};
+
+     if (!seedLooksPromising(lH, m))
+         ++lH.stats.hitsFailedPreExtendTest;
+     else
+        lH.matches.emplace_back(m);
+}
+
 // --------------------------------------------------------------------------
 // Function search()
 // --------------------------------------------------------------------------
 
+//TODO experiment with tuned branch prediction
+
+template <typename TIndexIt, typename TNeedleIt, typename TLambda, typename TLambda2>
+inline void
+__goDownNoErrors(TIndexIt const & indexIt,
+                 TNeedleIt const & needleIt,
+                 TNeedleIt const & needleItEnd,
+                 TLambda & continRunnable,
+                 TLambda2 & reportRunnable)
+{
+    TIndexIt nextIndexIt(indexIt);
+    if ((needleIt != needleItEnd) &&
+        goDown(nextIndexIt, *needleIt) &&
+        continRunnable(indexIt, nextIndexIt))
+    {
+        __goDownNoErrors(nextIndexIt, needleIt + 1, needleItEnd, continRunnable, reportRunnable);
+    } else
+    {
+        reportRunnable(indexIt);
+    }
+}
+
+template <typename TIndexIt, typename TNeedleIt, typename TLambda, typename TLambda2>
+inline void
+__goDownErrors(TIndexIt const & indexIt,
+               TNeedleIt const & needleIt,
+               TNeedleIt const & needleItEnd,
+               TLambda & continRunnable,
+               TLambda2 & reportRunnable)
+{
+    using TAlph = typename Value<TNeedleIt>::Type;
+
+    unsigned contin = 0;
+
+    if (needleIt != needleItEnd)
+    {
+        for (unsigned i = 0; i < ValueSize<TAlph>::VALUE; ++i)
+        {
+            TIndexIt nextIndexIt(indexIt);
+            if (goDown(nextIndexIt, static_cast<TAlph>(i)) &&
+                continRunnable(indexIt, nextIndexIt))
+            {
+                ++contin;
+                if (ordValue(*needleIt) == i)
+                    __goDownErrors(nextIndexIt, needleIt + 1, needleItEnd, continRunnable, reportRunnable);
+                else
+                    __goDownNoErrors(nextIndexIt, needleIt + 1, needleItEnd, continRunnable, reportRunnable);
+            }
+        }
+    }
+
+    if (contin == 0)
+        reportRunnable(indexIt);
+}
+
+template <typename TGlobalHolder,
+          typename TScoreExtension>
+inline void
+__serachAdaptive(LocalDataHolder<TGlobalHolder, TScoreExtension> & lH,
+                 uint64_t const seedLength)
+{
+    typedef typename Iterator<typename TGlobalHolder::TDbIndex, TopDown<> >::Type TIndexIt;
+
+    // TODO optionize
+    size_t constexpr seedHeurFactor = 10;
+    size_t constexpr minResults = 1;
+
+    size_t needlesSum = lH.gH.redQrySeqs.limits[lH.indexEndQry] - lH.gH.redQrySeqs.limits[lH.indexBeginQry];
+    // BROKEN:lengthSum(infix(lH.gH.redQrySeqs, lH.indexBeginQry, lH.indexEndQry));
+    // the above is faster anyway (but only works on concatdirect sets)
+
+    size_t needlesPos = 0;
+
+    TIndexIt root(lH.gH.dbIndex);
+    TIndexIt indexIt = root;
+
+    for (size_t i = lH.indexBeginQry; i < lH.indexEndQry; ++i)
+    {
+        for (size_t seedBegin = 0; /* below */; seedBegin += lH.options.seedOffset)
+        {
+            // skip proteine 'X' or Dna 'N'
+            while ((lH.gH.qrySeqs[i][seedBegin] == unknownValue<TransAlph<TGlobalHolder::blastProgram>>()) &&
+                   (seedBegin <= length(lH.gH.redQrySeqs[i]) - seedLength))
+                ++seedBegin;
+
+            // termination criterium
+            if (seedBegin > length(lH.gH.redQrySeqs[i]) - seedLength)
+                break;
+
+            indexIt = root;
+
+            size_t desiredOccs = length(lH.matches) >= lH.options.maxMatches
+                                    ? minResults
+                                    : (lH.options.maxMatches - length(lH.matches)) * seedHeurFactor /
+                                        ((needlesSum - needlesPos - seedBegin) / lH.options.seedOffset);
+
+            if (desiredOccs == 0)
+                desiredOccs = minResults;
+
+            // go down seedOffset number of characters without errors
+            for (size_t k = 0; k < lH.options.seedOffset; ++k)
+                if (!goDown(indexIt, lH.gH.redQrySeqs[i][seedBegin + k]))
+                    break;
+            // if unsuccessful, move to next seed
+            if (repLength(indexIt) != lH.options.seedOffset)
+                continue;
+
+            auto continRunnable = [&seedLength, &desiredOccs] (TIndexIt const & prevIndexIt, TIndexIt const & indexIt)
+            {
+                // NON-ADAPTIVE
+//                 return (repLength(indexIt) <= seedLength);
+                // ADAPTIVE SEEDING:
+
+                // always continue if minimum seed length not reached
+                if (repLength(indexIt) <= seedLength)
+                    return true;
+
+                // always continue if it means not loosing hits
+                if (countOccurrences(indexIt) == countOccurrences(prevIndexIt))
+                    return true;
+
+                // do vodoo heuristics to see if this hit is to frequent
+                if (countOccurrences(indexIt) < desiredOccs)
+                    return false;
+
+                return true;
+            };
+
+            auto reportRunnable = [&seedLength, &lH, &i, &seedBegin] (TIndexIt const & indexIt)
+            {
+                if (repLength(indexIt) >= seedLength)
+                {
+                    appendValue(lH.stats.seedLengths, repLength(indexIt));
+                    lH.stats.hitsAfterSeeding += countOccurrences(indexIt);
+                    for (auto const & occ : getOccurrences(indexIt))
+                        onFindVariable(lH, occ, i, seedBegin, repLength(indexIt));
+                }
+            };
+
+            __goDownErrors(indexIt,
+                           begin(lH.gH.redQrySeqs[i], Standard()) + seedBegin + lH.options.seedOffset,
+                           end(lH.gH.redQrySeqs[i], Standard()),
+                           continRunnable,
+                           reportRunnable);
+        }
+
+        needlesPos += length(lH.gH.redQrySeqs[i]);
+    }
+}
+
 template <typename BackSpec, typename TLocalHolder>
 inline void
 __searchDoubleIndex(TLocalHolder & lH)
@@ -630,7 +1085,14 @@ __searchDoubleIndex(TLocalHolder & lH)
 
     auto delegate = [&lH] (LambdaFinder const & finder)
     {
-        onFindDoubleIndex(lH, finder);
+        auto qryOccs = getOccurrences(back(finder.patternStack));
+        auto subjOccs = getOccurrences(back(finder.textStack));
+
+        lH.stats.hitsAfterSeeding += length(qryOccs) * length(subjOccs);
+
+        for (unsigned i = 0; i < length(qryOccs); ++i)
+            for (unsigned j = 0; j < length(subjOccs); ++j)
+                onFind(lH, getSeqNo(qryOccs[i]), subjOccs[j]);
     };
 
     _find(finder, lH.gH.dbIndex, lH.seedIndex, lH.options.maxSeedDist, delegate);
@@ -661,7 +1123,13 @@ __searchSingleIndex(TLocalHolder & lH)
                            TSeedsIt const & seedsIt,
                            int /*score*/)
     {
-        onFindSingleIndex(lH, seedsIt, indexIt);
+        auto qryOcc = position(seedsIt);
+        auto subjOccs = getOccurrences(indexIt);
+
+        lH.stats.hitsAfterSeeding += length(subjOccs);
+
+        for (unsigned j = 0; j < length(subjOccs); ++j)
+            onFind(lH, qryOcc, subjOccs[j]);
     };
 
     find(lH.gH.dbIndex, lH.seeds, int(lH.options.maxSeedDist), delegate,
@@ -682,23 +1150,19 @@ template <typename TLocalHolder>
 inline void
 search(TLocalHolder & lH)
 {
+    //TODO implement adaptive seeding with 0-n mismatches
     if (lH.options.maxSeedDist == 0)
         __search<Backtracking<Exact>>(lH);
-    else if (lH.options.hammingOnly)
-        __search<Backtracking<HammingDistance>>(lH);
+    else if (lH.options.adaptiveSeeding)
+        __serachAdaptive(lH, lH.options.seedLength);
     else
-#if 0 // reactivate if edit-distance seeding is readded
-        __search<Backtracking<EditDistance>>(lH);
-#else
-        return;
-#endif
+        __search<Backtracking<HammingDistance>>(lH);
 }
 
 // --------------------------------------------------------------------------
 // Function joinAndFilterMatches()
 // --------------------------------------------------------------------------
 
-
 template <typename TLocalHolder>
 inline void
 sortMatches(TLocalHolder & lH)
@@ -724,7 +1188,7 @@ sortMatches(TLocalHolder & lH)
     if ((lH.options.filterPutativeAbundant) &&
         (lH.matches.size() > lH.options.maxMatches))
         // more expensive sort to get likely targets to front
-        myHyperSortSingleIndex(lH.matches, lH.options, lH.gH);
+        myHyperSortSingleIndex(lH.matches, lH.options.doubleIndexing, lH.gH);
     else
         std::sort(lH.matches.begin(), lH.matches.end());
 
@@ -738,13 +1202,95 @@ sortMatches(TLocalHolder & lH)
     }
 }
 
+// --------------------------------------------------------------------------
+// Function _setFrames()
+// --------------------------------------------------------------------------
+
+template <typename TBlastMatch,
+          typename TLocalHolder>
+inline void
+_setFrames(TBlastMatch                          & bm,
+           typename TLocalHolder::TMatch  const & m,
+           TLocalHolder                   const & lH)
+{
+    if (qIsTranslated(TLocalHolder::TGlobalHolder::blastProgram))
+    {
+        bm.qFrameShift = (m.qryId % 3) + 1;
+        if (m.qryId % 6 > 2)
+            bm.qFrameShift = -bm.qFrameShift;
+    } else if (qHasRevComp(TLocalHolder::TGlobalHolder::blastProgram))
+    {
+        bm.qFrameShift = 1;
+        if (m.qryId % 2)
+            bm.qFrameShift = -bm.qFrameShift;
+    } else
+    {
+        bm.qFrameShift = 0;
+    }
+
+    if (sIsTranslated(TLocalHolder::TGlobalHolder::blastProgram))
+    {
+        bm.sFrameShift = (m.subjId % 3) + 1;
+        if (m.subjId % 6 > 2)
+            bm.sFrameShift = -bm.sFrameShift;
+    } else if (sHasRevComp(TLocalHolder::TGlobalHolder::blastProgram))
+    {
+        bm.sFrameShift = 1;
+        if (m.subjId % 2)
+            bm.sFrameShift = -bm.sFrameShift;
+    } else
+    {
+        bm.sFrameShift = 0;
+    }
+}
+
+// --------------------------------------------------------------------------
+// Function _writeMatches()
+// --------------------------------------------------------------------------
+
+template <typename TBlastRecord,
+          typename TLocalHolder>
+inline void
+_writeRecord(TBlastRecord & record,
+             TLocalHolder & lH)
+{
+    if (length(record.matches) > 0)
+    {
+        ++lH.stats.qrysWithHit;
+        // sort and remove duplicates -> STL, yeah!
+        auto const before = record.matches.size();
+        record.matches.sort();
+        if (!lH.options.filterPutativeDuplicates)
+        {
+            record.matches.unique();
+            lH.stats.hitsDuplicate += before - record.matches.size();
+        }
+        if (record.matches.size() > lH.options.maxMatches)
+        {
+            lH.stats.hitsAbundant += record.matches.size() -
+                                        lH.options.maxMatches;
+            record.matches.resize(lH.options.maxMatches);
+        }
+        lH.stats.hitsFinal += record.matches.size();
+
+        myWriteRecord(lH, record);
+    }
+}
+
+// --------------------------------------------------------------------------
+// Function computeBlastMatch()
+// --------------------------------------------------------------------------
+
 template <typename TBlastMatch,
           typename TLocalHolder>
 inline int
 computeBlastMatch(TBlastMatch         & bm,
-                  Match         const & m,
+                  typename TLocalHolder::TMatch const & m,
                   TLocalHolder        & lH)
 {
+    using TMatch = typename TLocalHolder::TMatch;
+    using TPos   = typename TMatch::TPos;
+
     const unsigned long qryLength = length(value(lH.gH.qrySeqs, m.qryId));
 
     SEQAN_ASSERT_LEQ(bm.qStart, bm.qEnd);
@@ -758,10 +1304,10 @@ computeBlastMatch(TBlastMatch         & bm,
 //                                 bm.sEnd);
 
 //     std::cout << "Query Id: " << m.qryId
-//               << "\t TrueQryId: " << getTrueQryId(bm.m, lH.options, lH.gH.blastProgram)
+//               << "\t TrueQryId: " << getTrueQryId(bm.m, lH.options, TGlobalHolder::blastProgram)
 //               << "\t length(qryIds): " << length(qryIds)
 //               << "Subj Id: " << m.subjId
-//               << "\t TrueSubjId: " << getTrueSubjId(bm.m, lH.options, lH.gH.blastProgram)
+//               << "\t TrueSubjId: " << getTrueSubjId(bm.m, lH.options, TGlobalHolder::blastProgram)
 //               << "\t length(subjIds): " << length(subjIds) << "\n\n";
 
     assignSource(bm.alignRow0, infix(lH.gH.qrySeqs[m.qryId], bm.qStart, bm.qEnd));
@@ -777,9 +1323,9 @@ computeBlastMatch(TBlastMatch         & bm,
 //     double         seedE = 0;
 //     double         seedB = 0;
 
-    unsigned row0len = bm.qEnd - bm.qStart;
-    unsigned row1len = bm.sEnd - bm.sStart;
-    unsigned short band = (!lH.options.hammingOnly) * (lH.options.maxSeedDist);
+    TPos row0len = bm.qEnd - bm.qStart;
+    TPos row1len = bm.sEnd - bm.sStart;
+    TPos band = (!lH.options.hammingOnly) * (lH.options.maxSeedDist);
 
 //     // TODO FIGURE THIS OUT
 //     if ((row0len > (lH.options.seedLength + band)) ||
@@ -794,7 +1340,7 @@ computeBlastMatch(TBlastMatch         & bm,
 
     auto seedsInSeed = std::max(row0len, row1len) / lH.options.seedLength;
 
-    unsigned short maxDist =  0;
+    TPos  maxDist =  0;
     if (lH.options.maxSeedDist <= 1)
         maxDist = std::abs(int(row1len) - int(row0len));
     else
@@ -845,13 +1391,17 @@ computeBlastMatch(TBlastMatch         & bm,
     } else
     {
         // compute with DP-code
-//         scr = localAlignment(bm.align, seqanScheme(context(lH.gH.outfile).scoringScheme), -maxDist, +maxDist);
-        scr = localAlignment2(bm.alignRow0,
+        scr = localAlignment(bm.alignRow0,
                               bm.alignRow1,
                               seqanScheme(context(lH.gH.outfile).scoringScheme),
                               -maxDist,
-                              +maxDist,
-                              lH.alignContext);
+                              +maxDist);
+//         scr = localAlignment2(bm.alignRow0,
+//                               bm.alignRow1,
+//                               seqanScheme(context(lH.gH.outfile).scoringScheme),
+//                               -maxDist,
+//                               +maxDist,
+//                               lH.alignContext);
     }
 
     // save new bounds of alignment
@@ -1059,53 +1609,17 @@ computeBlastMatch(TBlastMatch         & bm,
 //     std::cout << "ALIGN BEFORE STATS:\n" << bm.align << "\n";
 
     computeAlignmentStats(bm, context(lH.gH.outfile));
-
     if (bm.alignStats.alignmentIdentity < lH.options.idCutOff)
         return PERCENTIDENT;
 
 //     const unsigned long qryLength = length(row0);
     computeBitScore(bm, context(lH.gH.outfile));
 
-    // the length adjustment cache must no be written to by multiple threads
-    SEQAN_OMP_PRAGMA(critical(evalue_length_adj_cache))
-    {
-        computeEValue(bm, context(lH.gH.outfile));
-    }
-
+    computeEValueThreadSafe(bm, context(lH.gH.outfile));
     if (bm.eValue > lH.options.eCutOff)
-    {
         return EVALUE;
-    }
-
-    if (qIsTranslated(TLocalHolder::TGlobalHolder::blastProgram))
-    {
-        bm.qFrameShift = (m.qryId % 3) + 1;
-        if (m.qryId % 6 > 2)
-            bm.qFrameShift = -bm.qFrameShift;
-    } else if (qHasRevComp(TLocalHolder::TGlobalHolder::blastProgram))
-    {
-        bm.qFrameShift = 1;
-        if (m.qryId % 2)
-            bm.qFrameShift = -bm.qFrameShift;
-    } else
-    {
-        bm.qFrameShift = 0;
-    }
 
-    if (sIsTranslated(TLocalHolder::TGlobalHolder::blastProgram))
-    {
-        bm.sFrameShift = (m.subjId % 3) + 1;
-        if (m.subjId % 6 > 2)
-            bm.sFrameShift = -bm.sFrameShift;
-    } else if (sHasRevComp(TLocalHolder::TGlobalHolder::blastProgram))
-    {
-        bm.sFrameShift = 1;
-        if (m.subjId % 2)
-            bm.sFrameShift = -bm.sFrameShift;
-    } else
-    {
-        bm.sFrameShift = 0;
-    }
+    _setFrames(bm, m, lH);
 
     return 0;
 }
@@ -1113,22 +1627,24 @@ computeBlastMatch(TBlastMatch         & bm,
 
 template <typename TLocalHolder>
 inline int
-iterateMatches(TLocalHolder & lH)
+iterateMatchesExtend(TLocalHolder & lH)
 {
     using TGlobalHolder = typename TLocalHolder::TGlobalHolder;
-    using TPos          = uint32_t; //typename Match::TPos;
+//     using TMatch        = typename TGlobalHolder::TMatch;
+//     using TPos          = typename TMatch::TPos;
+    using TBlastPos     = uint32_t; //TODO why can't this be == TPos
     using TBlastMatch   = BlastMatch<
                            typename TLocalHolder::TAlignRow0,
                            typename TLocalHolder::TAlignRow1,
-                           TPos,
+                           TBlastPos,
                            typename Value<typename TGlobalHolder::TQryIds>::Type,// const &,
                            typename Value<typename TGlobalHolder::TSubjIds>::Type// const &,
                            >;
     using TBlastRecord  = BlastRecord<TBlastMatch>;
 
 //     constexpr TPos TPosMax = std::numeric_limits<TPos>::max();
-//     constexpr uint8_t qFactor = qHasRevComp(lH.gH.blastProgram) ? 3 : 1;
-//     constexpr uint8_t sFactor = sHasRevComp(lH.gH.blastProgram) ? 3 : 1;
+//     constexpr uint8_t qFactor = qHasRevComp(TGlobalHolder::blastProgram) ? 3 : 1;
+//     constexpr uint8_t sFactor = sHasRevComp(TGlobalHolder::blastProgram) ? 3 : 1;
 
     double start = sysTime();
     if (lH.options.doubleIndexing)
@@ -1142,7 +1658,7 @@ iterateMatches(TLocalHolder & lH)
 //     std::cout << "Length of matches:   " << length(lH.matches);
 //     for (auto const & m :  lH.matches)
 //     {
-//         std::cout << m.qryId << "\t" << getTrueQryId(m,lH.options, lH.gH.blastProgram) << "\n";
+//         std::cout << m.qryId << "\t" << getTrueQryId(m,lH.options, TGlobalHolder::blastProgram) << "\n";
 //     }
 
 //     double topMaxMatchesMedianBitScore = 0;
@@ -1155,11 +1671,11 @@ iterateMatches(TLocalHolder & lH)
          ++it)
     {
         itN = std::next(it,1);
-        auto const trueQryId = it->qryId / qNumFrames(lH.gH.blastProgram);
+        auto const trueQryId = it->qryId / qNumFrames(TGlobalHolder::blastProgram);
 
         TBlastRecord record(lH.gH.qryIds[trueQryId]);
 
-        record.qLength = (qIsTranslated(lH.gH.blastProgram)
+        record.qLength = (qIsTranslated(TGlobalHolder::blastProgram)
                             ? lH.gH.untransQrySeqLengths[trueQryId]
                             : length(lH.gH.qrySeqs[it->qryId]));
 
@@ -1168,7 +1684,7 @@ iterateMatches(TLocalHolder & lH)
         // inner loop over matches per record
         for (; it != itEnd; ++it)
         {
-            auto const trueSubjId = it->subjId / sNumFrames(lH.gH.blastProgram);
+            auto const trueSubjId = it->subjId / sNumFrames(TGlobalHolder::blastProgram);
             itN = std::next(it,1);
 //             std::cout << "FOO\n" << std::flush;
 //             std::cout << "QryStart: " << it->qryStart << "\n" << std::flush;
@@ -1220,7 +1736,7 @@ iterateMatches(TLocalHolder & lH)
                             {
                                 // declare all the rest as putative abundant
                                 while ((it != itEnd) &&
-                                       (trueQryId == it->qryId / qNumFrames(lH.gH.blastProgram)))
+                                       (trueQryId == it->qryId / qNumFrames(TGlobalHolder::blastProgram)))
                                 {
                                     // not already marked as abundant, duplicate or merged
                                     if (!isSetToSkip(*it))
@@ -1242,57 +1758,56 @@ iterateMatches(TLocalHolder & lH)
                 auto & bm = back(record.matches);
 
                 bm.qStart    = it->qryStart;
-                bm.qEnd      = it->qryStart + lH.options.seedLength;
+                bm.qEnd      = it->qryEnd; // it->qryStart + lH.options.seedLength;
                 bm.sStart    = it->subjStart;
-                bm.sEnd      = it->subjStart + lH.options.seedLength;
+                bm.sEnd      = it->subjEnd;//it->subjStart + lH.options.seedLength;
 
                 bm.qLength = record.qLength;
-                bm.sLength = sIsTranslated(lH.gH.blastProgram)
+                bm.sLength = sIsTranslated(TGlobalHolder::blastProgram)
                                 ? lH.gH.untransSubjSeqLengths[trueSubjId]
                                 : length(lH.gH.subjSeqs[it->subjId]);
 
                 // MERGE PUTATIVE SIBLINGS INTO THIS MATCH
-                for (auto it2 = itN;
-                     (it2 != itEnd) &&
-                     (trueQryId == it2->qryId / qNumFrames(lH.gH.blastProgram)) &&
-                     (trueSubjId == it2->subjId / sNumFrames(lH.gH.blastProgram));
-                    ++it2)
+                if (lH.options.mergePutativeSiblings)
                 {
-                    // same frame
-                    if ((it->qryId % qNumFrames(lH.gH.blastProgram) == it2->qryId % qNumFrames(lH.gH.blastProgram)) &&
-                        (it->subjId % sNumFrames(lH.gH.blastProgram) == it2->subjId % sNumFrames(lH.gH.blastProgram)))
+                    for (auto it2 = itN;
+                        (it2 != itEnd) &&
+                        (trueQryId == it2->qryId / qNumFrames(TGlobalHolder::blastProgram)) &&
+                        (trueSubjId == it2->subjId / sNumFrames(TGlobalHolder::blastProgram));
+                        ++it2)
                     {
-
-//                         TPos const qDist = (it2->qryStart >= bm.qEnd)
-//                                             ? it2->qryStart - bm.qEnd // upstream
-//                                             : 0; // overlap
-// 
-//                         TPos sDist = TPosMax; // subj match region downstream of *it
-//                         if (it2->subjStart >= bm.sEnd) // upstream
-//                             sDist = it2->subjStart - bm.sEnd;
-//                         else if (it2->subjStart >= it->subjStart) // overlap
-//                             sDist = 0;
-
-                        // due to sorting it2->qryStart never <= it->qStart
-                        // so subject sequences must have same order
-                        if (it2->subjStart < it->subjStart)
-                            continue;
-
-                        long const qDist = it2->qryStart - bm.qEnd;
-                        long const sDist = it2->subjStart - bm.sEnd;
-
-                        if ((qDist == sDist) &&
-                            (qDist <= (long)lH.options.seedGravity))
+                        // same frame
+                        if ((it->qryId % qNumFrames(TGlobalHolder::blastProgram) == it2->qryId % qNumFrames(TGlobalHolder::blastProgram)) &&
+                            (it->subjId % sNumFrames(TGlobalHolder::blastProgram) == it2->subjId % sNumFrames(TGlobalHolder::blastProgram)))
                         {
-                            bm.qEnd = std::max(bm.qEnd,
-                                               (TPos)(it2->qryStart
-                                               + lH.options.seedLength));
-                            bm.sEnd = std::max(bm.sEnd,
-                                               (TPos)(it2->subjStart
-                                               + lH.options.seedLength));
-                            ++lH.stats.hitsMerged;
-
-                            setToSkip(*it2);
+
+    //                         TPos const qDist = (it2->qryStart >= bm.qEnd)
+    //                                             ? it2->qryStart - bm.qEnd // upstream
+    //                                             : 0; // overlap
+    //
+    //                         TPos sDist = TPosMax; // subj match region downstream of *it
+    //                         if (it2->subjStart >= bm.sEnd) // upstream
+    //                             sDist = it2->subjStart - bm.sEnd;
+    //                         else if (it2->subjStart >= it->subjStart) // overlap
+    //                             sDist = 0;
+
+                            // due to sorting it2->qryStart never <= it->qStart
+                            // so subject sequences must have same order
+                            if (it2->subjStart < it->subjStart)
+                                continue;
+
+                            long const qDist = it2->qryStart - bm.qEnd;
+                            long const sDist = it2->subjStart - bm.sEnd;
+
+                            if ((qDist == sDist) &&
+                                (qDist <= (long)lH.options.seedGravity))
+                            {
+                                bm.qEnd = std::max(bm.qEnd, static_cast<TBlastPos>(it2->qryEnd));
+                                bm.sEnd = std::max(bm.sEnd, static_cast<TBlastPos>(it2->subjEnd));
+                                ++lH.stats.hitsMerged;
+
+                                setToSkip(*it2);
+                            }
                         }
                     }
                 }
@@ -1306,8 +1821,8 @@ iterateMatches(TLocalHolder & lH)
     //                     ++lH.stats.goodMatches;
                         if (lH.options.outFileFormat > 0)
                         {
-                            bm._n_qId = it->qryId / qNumFrames(lH.gH.blastProgram);
-                            bm._n_sId = it->subjId / sNumFrames(lH.gH.blastProgram);
+                            bm._n_qId = it->qryId / qNumFrames(TGlobalHolder::blastProgram);
+                            bm._n_sId = it->subjId / sNumFrames(TGlobalHolder::blastProgram);
                         }
                         break;
                     case EVALUE:
@@ -1325,16 +1840,20 @@ iterateMatches(TLocalHolder & lH)
                           << "subjId: " << it->subjId << "\t"
                           << "seed    qry: " << infix(lH.gH.redQrySeqs,
                                                       it->qryStart,
-                                                      it->qryStart + lH.options.seedLength)
+                                                      it->qryEnd)
+//                                                       it->qryStart + lH.options.seedLength)
                           << "\n       subj: " << infix(lH.gH.redSubjSeqs,
                                                       it->subjStart,
-                                                      it->subjStart + lH.options.seedLength)
+                                                      it->subjEnd)
+//                                                       it->subjStart + lH.options.seedLength)
                           << "\nunred  qry: " << infix(lH.gH.qrySeqs,
                                                       it->qryStart,
-                                                      it->qryStart + lH.options.seedLength)
+                                                      it->qryEnd)
+//                                                       it->qryStart + lH.options.seedLength)
                           << "\n       subj: " << infix(lH.gH.subjSeqs,
                                                       it->subjStart,
-                                                      it->subjStart + lH.options.seedLength)
+                                                      it->subjEnd)
+//                                                       it->subjStart + lH.options.seedLength)
                           << "\nmatch    qry: " << infix(lH.gH.qrySeqs,
                                                       bm.qStart,
                                                       bm.qEnd)
@@ -1355,19 +1874,21 @@ iterateMatches(TLocalHolder & lH)
                     // PUTATIVE DUBLICATES CHECK
                     for (auto it2 = itN;
                          (it2 != itEnd) &&
-                         (trueQryId == it2->qryId / qNumFrames(lH.gH.blastProgram)) &&
-                         (trueSubjId == it2->subjId / sNumFrames(lH.gH.blastProgram));
+                         (trueQryId == it2->qryId / qNumFrames(TGlobalHolder::blastProgram)) &&
+                         (trueSubjId == it2->subjId / sNumFrames(TGlobalHolder::blastProgram));
                          ++it2)
                     {
                         // same frame and same range
                         if ((it->qryId == it2->qryId) &&
                             (it->subjId == it2->subjId) &&
                             (intervalOverlap(it2->qryStart,
-                                             it2->qryStart + lH.options.seedLength,
+                                             it2->qryEnd,
+//                                              it2->qryStart + lH.options.seedLength,
                                              bm.qStart,
                                              bm.qEnd) > 0) &&
                             (intervalOverlap(it2->subjStart,
-                                             it2->subjStart + lH.options.seedLength,
+                                             it2->subjEnd,
+//                                              it2->subjStart + lH.options.seedLength,
                                              bm.sStart,
                                              bm.sEnd) > 0))
                         {
@@ -1392,32 +1913,11 @@ iterateMatches(TLocalHolder & lH)
 
             // last item or new TrueQryId
             if ((itN == itEnd) ||
-                (trueQryId != itN->qryId / qNumFrames(lH.gH.blastProgram)))
+                (trueQryId != itN->qryId / qNumFrames(TGlobalHolder::blastProgram)))
                 break;
         }
 
-        if (length(record.matches) > 0)
-        {
-            ++lH.stats.qrysWithHit;
-            // sort and remove duplicates -> STL, yeah!
-            auto const before = record.matches.size();
-            record.matches.sort();
-            if (!lH.options.filterPutativeDuplicates)
-            {
-                record.matches.unique();
-                lH.stats.hitsDuplicate += before - record.matches.size();
-            }
-            if (record.matches.size() > lH.options.maxMatches)
-            {
-                lH.stats.hitsAbundant += record.matches.size() -
-                                         lH.options.maxMatches;
-                record.matches.resize(lH.options.maxMatches);
-            }
-            lH.stats.hitsFinal += record.matches.size();
-
-            myWriteRecord(lH, record);
-        }
-
+        _writeRecord(record, lH);
     }
 
     if (lH.options.doubleIndexing)
@@ -1432,64 +1932,313 @@ iterateMatches(TLocalHolder & lH)
     return 0;
 }
 
-void printStats(StatsHolder const & stats, LambdaOptions const & options)
+#ifdef SEQAN_SIMD_ENABLED
+template <typename TLocalHolder>
+inline int
+iterateMatchesFullSimd(TLocalHolder & lH)
+{
+    using TGlobalHolder = typename TLocalHolder::TGlobalHolder;
+    using TMatch        = typename TGlobalHolder::TMatch;
+    using TPos          = typename TMatch::TPos;
+    using TBlastPos     = uint32_t; //TODO why can't this be == TPos
+    using TBlastMatch   = BlastMatch<
+                           typename TLocalHolder::TAlignRow0,
+                           typename TLocalHolder::TAlignRow1,
+                           TBlastPos,
+                           typename Value<typename TGlobalHolder::TQryIds>::Type,// const &,
+                           typename Value<typename TGlobalHolder::TSubjIds>::Type// const &,
+                           >;
+    using TBlastRecord  = BlastRecord<TBlastMatch>;
+
+    typedef FreeEndGaps_<True, True, True, True> TFreeEndGaps;
+    typedef AlignConfig2<LocalAlignment_<>,
+                         DPBandConfig<BandOff>,
+                         TFreeEndGaps,
+                         TracebackOn<TracebackConfig_<CompleteTrace, GapsLeft> > > TAlignConfig;
+
+    typedef int TScoreValue; //TODO don't hardcode
+    typedef typename Size<typename TLocalHolder::TAlignRow0>::Type      TSize;
+    typedef TraceSegment_<TPos, TSize>                                  TTraceSegment;
+
+    typedef typename SimdVector<int16_t>::Type                          TSimdAlign;
+
+    unsigned const numAlignments = length(lH.matches);
+    unsigned const sizeBatch = LENGTH<TSimdAlign>::VALUE;
+    unsigned const fullSize = sizeBatch * ((numAlignments + sizeBatch - 1) / sizeBatch);
+
+    String<TScoreValue> results;
+    resize(results, numAlignments);
+
+    // Create a SIMD scoring scheme.
+    Score<TSimdAlign, ScoreSimdWrapper<typename TGlobalHolder::TScoreScheme> > simdScoringScheme(seqanScheme(context(lH.gH.outfile).scoringScheme));
+
+    // Prepare string sets with sequences.
+    StringSet<typename Source<typename TLocalHolder::TAlignRow0>::Type, Dependent<> > depSetH;
+    StringSet<typename Source<typename TLocalHolder::TAlignRow1>::Type, Dependent<> > depSetV;
+    reserve(depSetH, fullSize);
+    reserve(depSetV, fullSize);
+
+
+    auto const trueQryId = lH.matches[0].qryId / qNumFrames(TGlobalHolder::blastProgram);
+
+    TBlastRecord record(lH.gH.qryIds[trueQryId]);
+    record.qLength = (qIsTranslated(TGlobalHolder::blastProgram)
+                        ? lH.gH.untransQrySeqLengths[trueQryId]
+                        : length(lH.gH.qrySeqs[lH.matches[0].qryId]));
+
+    size_t maxDist = 0;
+    switch (lH.options.band)
+    {
+        case -3: maxDist = ceil(log2(record.qLength)); break;
+        case -2: maxDist = floor(sqrt(record.qLength)); break;
+        case -1: break;
+        default: maxDist = lH.options.band; break;
+    }
+
+    TAlignConfig config;//(-maxDist, maxDist);
+
+    // create blast matches
+    for (auto it = lH.matches.begin(), itEnd = lH.matches.end(); it != itEnd; ++it)
+    {
+        auto const trueSubjId = it->subjId / sNumFrames(TGlobalHolder::blastProgram);
+
+        // create blastmatch in list without copy or move
+        record.matches.emplace_back(lH.gH.qryIds [trueQryId],
+                                    lH.gH.subjIds[trueSubjId]);
+
+        auto & bm = back(record.matches);
+        auto &  m = *it;
+
+        bm.qLength = record.qLength;
+        bm.sLength = sIsTranslated(TGlobalHolder::blastProgram)
+                        ? lH.gH.untransSubjSeqLengths[trueSubjId]
+                        : length(lH.gH.subjSeqs[it->subjId]);
+
+        long lenDiff = (long)it->subjStart - (long)it->qryStart;
+
+        TPos sStart;
+        TPos qStart;
+        if (lenDiff >= 0)
+        {
+            sStart = lenDiff;
+            qStart = 0;
+        }
+        else
+        {
+            sStart = 0;
+            qStart = -lenDiff;
+        }
+        TPos sEnd   = std::min(sStart + length(lH.gH.qrySeqs[it->qryId]), length(lH.gH.subjSeqs[it->subjId]));
+
+        assignSource(bm.alignRow0, infix(lH.gH.qrySeqs[it->qryId],   qStart, length(lH.gH.qrySeqs[it->qryId])));
+        assignSource(bm.alignRow1, infix(lH.gH.subjSeqs[it->subjId], sStart, sEnd));
+
+
+        appendValue(depSetH, source(bm.alignRow0));
+        appendValue(depSetV, source(bm.alignRow1));
+
+        _setFrames(bm, *it, lH);
+    }
+
+    // fill up last batch
+    for (size_t i = numAlignments; i < fullSize; ++i)
+    {
+        appendValue(depSetH, source(back(record.matches).alignRow0));
+        appendValue(depSetV, source(back(record.matches).alignRow1));
+    }
+
+    // Run alignments in batches.
+    auto matchIt = record.matches.begin();
+    for (auto pos = 0u; pos < fullSize; pos += sizeBatch)
+    {
+        auto infSetH = infixWithLength(depSetH, pos, sizeBatch);
+        auto infSetV = infixWithLength(depSetV, pos, sizeBatch);
+
+        TSimdAlign resultsBatch;
+
+        StringSet<String<TTraceSegment> > trace;
+        resize(trace, sizeBatch, Exact());
+
+        _prepareAndRunSimdAlignment(resultsBatch, trace, infSetH, infSetV, simdScoringScheme, config, typename TLocalHolder::TScoreExtension());
+
+        // copy results and finish traceback
+        // TODO(rrahn): Could be parallelized!
+        // to for_each call
+        for(auto x = pos; x < pos + sizeBatch && x < numAlignments; ++x)
+        {
+            results[x] = resultsBatch[x - pos];
+            _adaptTraceSegmentsTo(matchIt->alignRow0, matchIt->alignRow1, trace[x - pos]);
+            ++matchIt;
+        }
+    }
+
+    // TODO share this code with above function
+    for (auto it = record.matches.begin(), itEnd = record.matches.end(); it != itEnd; /*below*/)
+    {
+        TBlastMatch & bm = *it;
+
+        bm.sStart = beginPosition(bm.alignRow1);
+        bm.qStart = beginPosition(bm.alignRow0);
+        bm.sEnd   = endPosition(bm.alignRow1);
+        bm.qEnd   = endPosition(bm.alignRow0);
+
+        computeAlignmentStats(bm, context(lH.gH.outfile));
+
+        if (bm.alignStats.alignmentIdentity < lH.options.idCutOff)
+        {
+            ++lH.stats.hitsFailedExtendPercentIdentTest;
+            it = record.matches.erase(it);
+            continue;
+        }
+
+        computeBitScore(bm, context(lH.gH.outfile));
+
+        computeEValueThreadSafe(bm, context(lH.gH.outfile));
+
+        if (bm.eValue > lH.options.eCutOff)
+        {
+            ++lH.stats.hitsFailedExtendEValueTest;
+            it = record.matches.erase(it);
+            continue;
+        }
+
+        ++it;
+    }
+
+    _writeRecord(record, lH);
+
+    return 0;
+}
+
+#endif // SEQAN_SIMD_ENABLED
+
+template <typename TLocalHolder>
+inline int
+iterateMatchesFullSerial(TLocalHolder & lH)
 {
-    if ((options.verbosity >= 1) && options.isTerm && options.doubleIndexing)
-        for (unsigned char i=0; i < options.threads + 3; ++i)
-            std::cout << std::endl;
+    using TGlobalHolder = typename TLocalHolder::TGlobalHolder;
+    using TMatch        = typename TGlobalHolder::TMatch;
+    using TPos          = typename TMatch::TPos;
+    using TBlastPos     = uint32_t; //TODO why can't this be == TPos
+    using TBlastMatch   = BlastMatch<
+                           typename TLocalHolder::TAlignRow0,
+                           typename TLocalHolder::TAlignRow1,
+                           TBlastPos,
+                           typename Value<typename TGlobalHolder::TQryIds>::Type,// const &,
+                           typename Value<typename TGlobalHolder::TSubjIds>::Type// const &,
+                           >;
+    using TBlastRecord  = BlastRecord<TBlastMatch>;
+
+    auto const trueQryId = lH.matches[0].qryId / qNumFrames(TGlobalHolder::blastProgram);
+
+    TBlastRecord record(lH.gH.qryIds[trueQryId]);
+    record.qLength = (qIsTranslated(TGlobalHolder::blastProgram)
+                        ? lH.gH.untransQrySeqLengths[trueQryId]
+                        : length(lH.gH.qrySeqs[lH.matches[0].qryId]));
 
-    if (options.verbosity >= 2)
+    unsigned maxDist = 0;
+    switch (lH.options.band)
     {
-        unsigned long rem = stats.hitsAfterSeeding;
-        auto const w = _numberOfDigits(rem); // number of digits
-        #define R  " " << std::setw(w)
-        #define RR " = " << std::setw(w)
-        #define BLANKS for (unsigned i = 0; i< w; ++i) std::cout << " ";
-        std::cout << "\033[1m   HITS                         "; BLANKS;
-        std::cout << "Remaining\033[0m"
-                  << "\n   after Seeding               "; BLANKS;
-        std::cout << R << rem;
-        std::cout << "\n - masked                   " << R << stats.hitsMasked
-                  << RR << (rem -= stats.hitsMasked);
-        std::cout << "\n - merged                   " << R << stats.hitsMerged
-                  << RR << (rem -= stats.hitsMerged);
-        std::cout << "\n - putative duplicates      " << R
-                  << stats.hitsPutativeDuplicate << RR
-                  << (rem -= stats.hitsPutativeDuplicate);
-        std::cout << "\n - putative abundant        " << R
-                  << stats.hitsPutativeAbundant   << RR
-                  << (rem -= stats.hitsPutativeAbundant);
-        std::cout << "\n - failed pre-extend test   " << R
-                  << stats.hitsFailedPreExtendTest  << RR
-                  << (rem -= stats.hitsFailedPreExtendTest);
-        std::cout << "\n - failed %-identity test   " << R
-                  << stats.hitsFailedExtendPercentIdentTest << RR
-                  << (rem -= stats.hitsFailedExtendPercentIdentTest);
-        std::cout << "\n - failed e-value test      " << R
-                  << stats.hitsFailedExtendEValueTest << RR
-                  << (rem -= stats.hitsFailedExtendEValueTest);
-        std::cout << "\n - abundant                 " << R
-                  << stats.hitsAbundant << RR
-                  << (rem -= stats.hitsAbundant);
-        std::cout << "\n - duplicates               " << R
-                  << stats.hitsDuplicate << "\033[1m" << RR
-                  << (rem -= stats.hitsDuplicate)
-                  << "\033[0m\n\n";
-
-        if (rem != stats.hitsFinal)
-            std::cout << "WARNING: hits dont add up\n";
+        case -3: maxDist = ceil(log2(record.qLength)); break;
+        case -2: maxDist = floor(sqrt(record.qLength)); break;
+        case -1: break;
+        default: maxDist = lH.options.band; break;
     }
 
-    if (options.verbosity >= 1)
+    // create blast matches
+    for (auto it = lH.matches.begin(), itEnd = lH.matches.end(); it != itEnd; ++it)
     {
-        auto const w = _numberOfDigits(stats.hitsFinal);
-        std::cout << "Number of valid hits:                           "
-                  << std::setw(w) << stats.hitsFinal
-                  << "\nNumber of Queries with at least one valid hit:  "
-                  << std::setw(w) << stats.qrysWithHit
-                  << "\n";
+        auto const trueSubjId = it->subjId / sNumFrames(TGlobalHolder::blastProgram);
+
+        // create blastmatch in list without copy or move
+        record.matches.emplace_back(lH.gH.qryIds [trueQryId],
+                                    lH.gH.subjIds[trueSubjId]);
+
+        auto & bm = back(record.matches);
+        auto &  m = *it;
+
+        bm.qLength = record.qLength;
+        bm.sLength = sIsTranslated(TGlobalHolder::blastProgram)
+                        ? lH.gH.untransSubjSeqLengths[trueSubjId]
+                        : length(lH.gH.subjSeqs[it->subjId]);
+
+        long lenDiff = (long)it->subjStart - (long)it->qryStart;
+
+        TPos sStart;
+        TPos qStart;
+        if (lenDiff >= 0)
+        {
+            sStart = lenDiff;
+            qStart = 0;
+        }
+        else
+        {
+            sStart = 0;
+            qStart = -lenDiff;
+        }
+        TPos sEnd   = std::min(sStart + length(lH.gH.qrySeqs[it->qryId]), length(lH.gH.subjSeqs[it->subjId]));
+
+        assignSource(bm.alignRow0, infix(lH.gH.qrySeqs[it->qryId],   qStart, length(lH.gH.qrySeqs[it->qryId])));
+        assignSource(bm.alignRow1, infix(lH.gH.subjSeqs[it->subjId], sStart, sEnd));
+
+//         localAlignment2(bm.alignRow0,
+//                         bm.alignRow1,
+//                         seqanScheme(context(lH.gH.outfile).scoringScheme),
+//                         -maxDist,
+//                         maxDist,
+//                         lH.alignContext);
+        localAlignment(bm.alignRow0,
+                       bm.alignRow1,
+                       seqanScheme(context(lH.gH.outfile).scoringScheme),
+                       -maxDist,
+                       maxDist);
+
+        bm.sStart = beginPosition(bm.alignRow1);
+        bm.qStart = beginPosition(bm.alignRow0);
+        bm.sEnd   = endPosition(bm.alignRow1);
+        bm.qEnd   = endPosition(bm.alignRow0);
+
+        computeAlignmentStats(bm, context(lH.gH.outfile));
+
+        if (bm.alignStats.alignmentIdentity < lH.options.idCutOff)
+        {
+            ++lH.stats.hitsFailedExtendPercentIdentTest;
+            record.matches.pop_back();
+            continue;
+        }
+
+        computeBitScore(bm, context(lH.gH.outfile));
+
+        computeEValueThreadSafe(bm, context(lH.gH.outfile));
+
+        if (bm.eValue > lH.options.eCutOff)
+        {
+            ++lH.stats.hitsFailedExtendEValueTest;
+            record.matches.pop_back();
+            continue;
+        }
+
+        _setFrames(bm, m, lH);
     }
 
+    _writeRecord(record, lH);
+
+    return 0;
+}
+
+template <typename TLocalHolder>
+inline int
+iterateMatches(TLocalHolder & lH)
+{
+#ifdef SEQAN_SIMD_ENABLED
+    if (lH.options.extensionMode == LambdaOptions::ExtensionMode::FULL_SIMD)
+        return iterateMatchesFullSimd(lH);
+    else
+#endif
+    if (lH.options.extensionMode == LambdaOptions::ExtensionMode::FULL_SERIAL)
+        return iterateMatchesFullSerial(lH);
+    else
+        return iterateMatchesExtend(lH);
 }
 
 #endif // HEADER GUARD
diff --git a/src/lambda_indexer.cpp b/src/lambda_indexer.cpp
index 9332577..90eafd9 100644
--- a/src/lambda_indexer.cpp
+++ b/src/lambda_indexer.cpp
@@ -1,31 +1,27 @@
 // ==========================================================================
 //                                  lambda
 // ==========================================================================
-// Copyright (c) 2013-2015, Hannes Hauswedell, FU Berlin
+// Copyright (c) 2013-2016, Hannes Hauswedell <h2 @ fsfe.org>
+// Copyright (c) 2016, Knut Reinert and Freie Universität Berlin
 // All rights reserved.
 //
 // This file is part of Lambda.
 //
-// Lambda is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
+// Lambda is Free Software: you can redistribute it and/or modify it
+// under the terms found in the LICENSE[.md|.rst] file distributed
+// together with this file.
 //
 // Lambda is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 //
-// You should have received a copy of the GNU General Public License
-// along with Lambda.  If not, see <http://www.gnu.org/licenses/>.*/
-// ==========================================================================
-// Author: Hannes Hauswedell <hannes.hauswedell @ fu-berlin.de>
 // ==========================================================================
 // lambda.cpp: Main File for the main application
 // ==========================================================================
 
-#include <seqan/basic.h>
+#include <initializer_list>
 
+#include <seqan/basic.h>
 #include <seqan/arg_parse.h>
 #include <seqan/seq_io.h>
 
@@ -183,24 +179,24 @@ realMain(LambdaIndexerOptions     const & options,
         if (sIsTranslated(p))
             _saveOriginalSeqLengths(originalSeqs.limits, options);
 
-        // convert the seg file to seqan binary format
-        ret = convertMaskingFile(length(originalSeqs), options);
-        if (ret)
-            return ret;
+//         // convert the seg file to seqan binary format
+//         ret = convertMaskingFile(length(originalSeqs), options);
+//         if (ret)
+//             return ret;
 
         // translate or swap depending on program
         translateOrSwap(translatedSeqs, originalSeqs, options);
     }
 
     // dump translated and unreduced sequences (except where they are included in index)
-    if ((options.alphReduction != 0) || (options.dbIndexType != 0))
+    if ((options.alphReduction != 0) || (options.dbIndexType == DbIndexType::FM_INDEX))
         dumpTranslatedSeqs(translatedSeqs, options);
 
     // see if final sequence set actually fits into index 
     if (!checkIndexSize(translatedSeqs))
         return -1;
 
-    if (options.dbIndexType == 1)
+    if (options.dbIndexType == DbIndexType::FM_INDEX)
     {
         using TIndexSpec = TFMIndex<TIndexSpecSpec>;
         generateIndexAndDump<TIndexSpec,TIndexSpecSpec>(translatedSeqs,
@@ -216,6 +212,21 @@ realMain(LambdaIndexerOptions     const & options,
                                                         TRedAlph());
     }
 
+    // dump options
+    for (auto && s : std::initializer_list<std::pair<std::string, std::string>>
+         {
+             { options.indexDir + "/option:db_index_type",   std::to_string(static_cast<uint32_t>(options.dbIndexType))},
+             { options.indexDir + "/option:alph_original",   std::string(_alphName(OrigSubjAlph<p>())) },
+             { options.indexDir + "/option:alph_translated", std::string(_alphName(TransAlph<p>())) },
+             { options.indexDir + "/option:alph_reduced",    std::string(_alphName(TRedAlph())) },
+             { options.indexDir + "/option:genetic_code",    std::to_string(options.geneticCode) }
+         })
+    {
+        std::ofstream f{std::get<0>(s).c_str(),  std::ios_base::out | std::ios_base::binary};
+        f << std::get<1>(s);
+        f.close();
+    }
+
     return 0;
 }
 
diff --git a/src/lambda_indexer.hpp b/src/lambda_indexer.hpp
index d70a0cd..ce40b9f 100644
--- a/src/lambda_indexer.hpp
+++ b/src/lambda_indexer.hpp
@@ -1,25 +1,20 @@
 // ==========================================================================
 //                                  lambda
 // ==========================================================================
-// Copyright (c) 2013-2015, Hannes Hauswedell, FU Berlin
+// Copyright (c) 2013-2016, Hannes Hauswedell <h2 @ fsfe.org>
+// Copyright (c) 2016, Knut Reinert and Freie Universität Berlin
 // All rights reserved.
 //
 // This file is part of Lambda.
 //
-// Lambda is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
+// Lambda is Free Software: you can redistribute it and/or modify it
+// under the terms found in the LICENSE[.md|.rst] file distributed
+// together with this file.
 //
 // Lambda is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 //
-// You should have received a copy of the GNU General Public License
-// along with Lambda.  If not, see <http://www.gnu.org/licenses/>.*/
-// ==========================================================================
-// Author: Hannes Hauswedell <hannes.hauswedell @ fu-berlin.de>
 // ==========================================================================
 // lambda_indexer.hpp: Main File for the indexer application
 // ==========================================================================
@@ -36,9 +31,9 @@
 #include <seqan/translation.h>
 #include <seqan/reduced_aminoacid.h>
 
+#include "output.hpp" //TODO only needed because options are in one file, remove later
 #include "misc.hpp"
 #include "options.hpp"
-#include "alph.hpp"
 #include "radix_inplace.h"
 #include "lambda_indexer_misc.hpp"
 
@@ -76,18 +71,50 @@ loadSubjSeqsAndIds(TCDStringSet<String<TOrigAlph>> & originalSeqs,
     double finish = sysTime() - start;
     myPrint(options, 2, "Runtime: ", finish, "s \n");
 
+    if (length(originalSeqs) == 0)
+    {
+        std::cerr << "ERROR: No sequences in file. Aborting.\n";
+        return -1;
+    }
     unsigned long maxLen = 0ul;
     for (auto const & s : originalSeqs)
+    {
         if (length(s) > maxLen)
+        {
             maxLen = length(s);
+        }
+        else if (length(s) == 0)
+        {
+            std::cerr << "ERROR: Unexpectedly encountered a sequence of length 0 in the file."
+                      << "Remove the entry and try again. Aborting.\n";
+            return -1;
+        }
+    }
     myPrint(options, 2, "Number of sequences read: ", length(originalSeqs),
             "\nLongest sequence read: ", maxLen, "\n\n");
 
+    if (length(originalSeqs) * 6 >= std::numeric_limits<SizeTypeNum_<TOrigAlph>>::max())
+    {
+        std::cerr << "ERROR: Too many sequences submitted. The maximum (including frames) is "
+                  << std::numeric_limits<SizeTypeNum_<TOrigAlph>>::max()
+                  << ".\n";
+        return -1;
+    }
+
+    if (maxLen >= std::numeric_limits<SizeTypePos_<TOrigAlph>>::max())
+    {
+        std::cerr << "ERROR: one or more of your subject sequences are too long. "
+                  << "The maximum length is " << std::numeric_limits<SizeTypePos_<TOrigAlph>>::max()
+                  << ".\n";
+        return -1;
+    }
+
+
     myPrint(options, 1, "Dumping Subj Ids...");
 
     //TODO save to TMPDIR instead
-    CharString _path = options.dbFile;
-    append(_path, ".ids");
+    CharString _path = options.indexDir;
+    append(_path, "/seq_ids");
     save(ids, toCString(_path));
 
     myPrint(options, 1, " done.\n");
@@ -112,8 +139,8 @@ _saveOriginalSeqLengths(TLimits limits, // we want copy!
 
     myPrint(options, 1, " dumping untranslated subject lengths...");
     //TODO save to TMPDIR instead
-    CharString _path = options.dbFile;
-    append(_path, ".untranslengths");
+    CharString _path = options.indexDir;
+    append(_path, "/untranslated_seq_lengths");
     save(limits, toCString(_path));
 }
 
@@ -157,7 +184,7 @@ dumpTranslatedSeqs(TCDStringSet<String<TTransAlph>> const & translatedSeqs,
     myPrint(options, 1, "Dumping unreduced Subj Sequences...");
 
     //TODO save to TMPDIR instead
-    std::string _path = options.dbFile + '.' + std::string(_alphName(TTransAlph()));
+    std::string _path = options.indexDir + "/translated_seqs";
     save(translatedSeqs, _path.c_str());
 
     myPrint(options, 1, " done.\n");
@@ -225,132 +252,132 @@ checkIndexSize(TCDStringSet<String<TRedAlph>> const & seqs)
     return true;
 }
 
-// --------------------------------------------------------------------------
-// Function loadSubj()
-// --------------------------------------------------------------------------
-
-inline int
-convertMaskingFile(uint64_t numberOfSeqs,
-                   LambdaIndexerOptions const & options)
-
-{
-    StringSet<String<unsigned>, Owner<ConcatDirect<>>> segIntStarts;
-    StringSet<String<unsigned>, Owner<ConcatDirect<>>> segIntEnds;
-//     resize(segIntervals, numberOfSeqs, Exact());
-
-    if (options.segFile != "")
-    {
-        myPrint(options, 1, "Constructing binary seqan masking from seg-file...");
-
-        std::ifstream stream;
-        stream.open(toCString(options.segFile));
-        if (!stream.is_open())
-        {
-            std::cerr << "ERROR: could not open seg file.\n";
-            return -1;
-        }
-
-        auto reader = directionIterator(stream, Input());
-
-//         StringSet<String<Tuple<unsigned, 2>>> _segIntervals;
-//         auto & _segIntervals = segIntervals;
-//         resize(_segIntervals, numberOfSeqs, Exact());
-        StringSet<String<unsigned>> _segIntStarts;
-        StringSet<String<unsigned>> _segIntEnds;
-        resize(_segIntStarts, numberOfSeqs, Exact());
-        resize(_segIntEnds, numberOfSeqs, Exact());
-        CharString buf;
-//         std::tuple<unsigned, unsigned> tup;
-
-//         auto curSeq = begin(_segIntervals);
-        unsigned curSeq = 0;
-        while (value(reader) == '>')
-        {
-//             if (curSeq == end(_segIntervals))
-//                 return -7;
-            if (curSeq == numberOfSeqs)
-            {
-                std::cerr << "ERROR: seg file has more entries then database.\n";
-                return -7;
-            }
-            skipLine(reader);
-            if (atEnd(reader))
-                break;
-
-            unsigned curInt = 0;
-            while ((!atEnd(reader)) && (value(reader) != '>'))
-            {
-                resize(_segIntStarts[curSeq], length(_segIntStarts[curSeq])+1);
-                resize(_segIntEnds[curSeq], length(_segIntEnds[curSeq])+1);
-                clear(buf);
-                readUntil(buf, reader, IsWhitespace());
-
-//                 std::get<0>(tup) = strtoumax(toCString(buf), 0, 10);
-                _segIntStarts[curSeq][curInt] = strtoumax(toCString(buf), 0, 10);
-                skipUntil(reader, IsDigit());
-
-                clear(buf);
-                readUntil(buf, reader, IsWhitespace());
-
-//                 std::get<1>(tup) = strtoumax(toCString(buf), 0, 10);
-                _segIntEnds[curSeq][curInt] = strtoumax(toCString(buf), 0, 10);
-
-//                 appendValue(*curSeq, tup);
-
-                skipLine(reader);
-                curInt++;
-            }
-            if (atEnd(reader))
-                break;
-            else
-                curSeq++;
-        }
-//         if (curSeq != end(_segIntervals))
-//             return -9;
-        if (curSeq != (numberOfSeqs - 1))
-        {
-            std::cerr << "ERROR: seg file has less entries (" << curSeq + 1
-                      << ") than database (" << numberOfSeqs << ").\n";
-            return -9;
-        }
-
-        segIntStarts.concat = concat(_segIntStarts);
-        segIntStarts.limits = stringSetLimits(_segIntStarts);
-        segIntEnds.concat = concat(_segIntEnds);
-        segIntEnds.limits = stringSetLimits(_segIntEnds);
-//         segIntEnds = _segIntEnds;
-//         segIntervals = _segIntervals; // non-concatdirect to concatdirect
-
-        stream.close();
-
-    } else
-    {
-        myPrint(options, 1, "No Seg-File specified, no masking will take place.\n");
-//         resize(segIntervals, numberOfSeqs, Exact());
-        resize(segIntStarts, numberOfSeqs, Exact());
-        resize(segIntEnds, numberOfSeqs, Exact());
-    }
-
-//     for (unsigned u = 0; u < length(segIntStarts); ++u)
+// // --------------------------------------------------------------------------
+// // Function loadSubj()
+// // --------------------------------------------------------------------------
+//
+// inline int
+// convertMaskingFile(uint64_t numberOfSeqs,
+//                    LambdaIndexerOptions const & options)
+//
+// {
+//     StringSet<String<unsigned>, Owner<ConcatDirect<>>> segIntStarts;
+//     StringSet<String<unsigned>, Owner<ConcatDirect<>>> segIntEnds;
+// //     resize(segIntervals, numberOfSeqs, Exact());
+//
+//     if (options.segFile != "")
 //     {
-//         myPrint(options, 1,u, ": ";
-//         for (unsigned v = 0; v < length(segIntStarts[u]); ++v)
+//         myPrint(options, 1, "Constructing binary seqan masking from seg-file...");
+//
+//         std::ifstream stream;
+//         stream.open(toCString(options.segFile));
+//         if (!stream.is_open())
+//         {
+//             std::cerr << "ERROR: could not open seg file.\n";
+//             return -1;
+//         }
+//
+//         auto reader = directionIterator(stream, Input());
+//
+// //         StringSet<String<Tuple<unsigned, 2>>> _segIntervals;
+// //         auto & _segIntervals = segIntervals;
+// //         resize(_segIntervals, numberOfSeqs, Exact());
+//         StringSet<String<unsigned>> _segIntStarts;
+//         StringSet<String<unsigned>> _segIntEnds;
+//         resize(_segIntStarts, numberOfSeqs, Exact());
+//         resize(_segIntEnds, numberOfSeqs, Exact());
+//         CharString buf;
+// //         std::tuple<unsigned, unsigned> tup;
+//
+// //         auto curSeq = begin(_segIntervals);
+//         unsigned curSeq = 0;
+//         while (value(reader) == '>')
+//         {
+// //             if (curSeq == end(_segIntervals))
+// //                 return -7;
+//             if (curSeq == numberOfSeqs)
+//             {
+//                 std::cerr << "ERROR: seg file has more entries then database.\n";
+//                 return -7;
+//             }
+//             skipLine(reader);
+//             if (atEnd(reader))
+//                 break;
+//
+//             unsigned curInt = 0;
+//             while ((!atEnd(reader)) && (value(reader) != '>'))
+//             {
+//                 resize(_segIntStarts[curSeq], length(_segIntStarts[curSeq])+1);
+//                 resize(_segIntEnds[curSeq], length(_segIntEnds[curSeq])+1);
+//                 clear(buf);
+//                 readUntil(buf, reader, IsWhitespace());
+//
+// //                 std::get<0>(tup) = strtoumax(toCString(buf), 0, 10);
+//                 _segIntStarts[curSeq][curInt] = strtoumax(toCString(buf), 0, 10);
+//                 skipUntil(reader, IsDigit());
+//
+//                 clear(buf);
+//                 readUntil(buf, reader, IsWhitespace());
+//
+// //                 std::get<1>(tup) = strtoumax(toCString(buf), 0, 10);
+//                 _segIntEnds[curSeq][curInt] = strtoumax(toCString(buf), 0, 10);
+//
+// //                 appendValue(*curSeq, tup);
+//
+//                 skipLine(reader);
+//                 curInt++;
+//             }
+//             if (atEnd(reader))
+//                 break;
+//             else
+//                 curSeq++;
+//         }
+// //         if (curSeq != end(_segIntervals))
+// //             return -9;
+//         if (curSeq != (numberOfSeqs - 1))
 //         {
-//             myPrint(options, 1,'(', segIntStarts[u][v], ", ", segIntEnds[u][v], ")  ";
+//             std::cerr << "ERROR: seg file has less entries (" << curSeq + 1
+//                       << ") than database (" << numberOfSeqs << ").\n";
+//             return -9;
 //         }
-//         myPrint(options, 1,'\n';
+//
+//         segIntStarts.concat = concat(_segIntStarts);
+//         segIntStarts.limits = stringSetLimits(_segIntStarts);
+//         segIntEnds.concat = concat(_segIntEnds);
+//         segIntEnds.limits = stringSetLimits(_segIntEnds);
+// //         segIntEnds = _segIntEnds;
+// //         segIntervals = _segIntervals; // non-concatdirect to concatdirect
+//
+//         stream.close();
+//
+//     } else
+//     {
+//         myPrint(options, 1, "No Seg-File specified, no masking will take place.\n");
+// //         resize(segIntervals, numberOfSeqs, Exact());
+//         resize(segIntStarts, numberOfSeqs, Exact());
+//         resize(segIntEnds, numberOfSeqs, Exact());
 //     }
-    myPrint(options, 1, "Dumping binary seqan mask file...");
-    CharString _path = options.dbFile;
-    append(_path, ".binseg_s");
-    save(segIntStarts, toCString(_path));
-    _path = options.dbFile;
-    append(_path, ".binseg_e");
-    save(segIntEnds, toCString(_path));
-    myPrint(options, 1, " done.\n");
-    myPrint(options, 2, "\n");
-    return 0;
-}
+//
+// //     for (unsigned u = 0; u < length(segIntStarts); ++u)
+// //     {
+// //         myPrint(options, 1,u, ": ";
+// //         for (unsigned v = 0; v < length(segIntStarts[u]); ++v)
+// //         {
+// //             myPrint(options, 1,'(', segIntStarts[u][v], ", ", segIntEnds[u][v], ")  ";
+// //         }
+// //         myPrint(options, 1,'\n';
+// //     }
+//     myPrint(options, 1, "Dumping binary seqan mask file...");
+//     CharString _path = options.dbFile;
+//     append(_path, ".binseg_s");
+//     save(segIntStarts, toCString(_path));
+//     _path = options.dbFile;
+//     append(_path, ".binseg_e");
+//     save(segIntEnds, toCString(_path));
+//     myPrint(options, 1, " done.\n");
+//     myPrint(options, 2, "\n");
+//     return 0;
+// }
 
 // --------------------------------------------------------------------------
 // Function createSuffixArray()
@@ -539,13 +566,10 @@ generateIndexAndDump(StringSet<TString, TSpec>        & seqs,
     // Dump Index
     myPrint(options, 1, "Writing Index to disk...");
     s = sysTime();
-    std::string path = toCString(options.dbFile);
-    path += '.' + std::string(_alphName(TRedAlph()));
-    if (indexIsFM)
-        path += ".fm";
-    else
-        path += ".sa";
+    std::string path = options.indexDir + "/index";
+
     save(dbIndex, path.c_str());
+
     e = sysTime() - s;
     myPrint(options, 1, " done.\n");
     myPrint(options, 2, "Runtime: ", e, "s \n");
diff --git a/src/lambda_indexer_misc.hpp b/src/lambda_indexer_misc.hpp
index 51d2a0b..94d3864 100644
--- a/src/lambda_indexer_misc.hpp
+++ b/src/lambda_indexer_misc.hpp
@@ -1,25 +1,20 @@
 // ==========================================================================
 //                                  lambda
 // ==========================================================================
-// Copyright (c) 2013-2015, Hannes Hauswedell, FU Berlin
+// Copyright (c) 2013-2016, Hannes Hauswedell <h2 @ fsfe.org>
+// Copyright (c) 2016, Knut Reinert and Freie Universität Berlin
 // All rights reserved.
 //
 // This file is part of Lambda.
 //
-// Lambda is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
+// Lambda is Free Software: you can redistribute it and/or modify it
+// under the terms found in the LICENSE[.md|.rst] file distributed
+// together with this file.
 //
 // Lambda is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 //
-// You should have received a copy of the GNU General Public License
-// along with Lambda.  If not, see <http://www.gnu.org/licenses/>.*/
-// ==========================================================================
-// Author: Hannes Hauswedell <hannes.hauswedell @ fu-berlin.de>
 // ==========================================================================
 // lambda_indexer_misc.hpp: misc stuff for indexer
 // ==========================================================================
@@ -146,4 +141,4 @@ struct ComparisonCounter<TText, std::true_type>
 };
 #endif
 
-#endif // LAMBDA_INDEXER_MISC_HPP_
\ No newline at end of file
+#endif // LAMBDA_INDEXER_MISC_HPP_
diff --git a/src/match.hpp b/src/match.hpp
index 83b47e7..d44d99a 100644
--- a/src/match.hpp
+++ b/src/match.hpp
@@ -1,25 +1,20 @@
 // ==========================================================================
 //                                  lambda
 // ==========================================================================
-// Copyright (c) 2013-2015, Hannes Hauswedell, FU Berlin
+// Copyright (c) 2013-2016, Hannes Hauswedell <h2 @ fsfe.org>
+// Copyright (c) 2016, Knut Reinert and Freie Universität Berlin
 // All rights reserved.
 //
 // This file is part of Lambda.
 //
-// Lambda is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
+// Lambda is Free Software: you can redistribute it and/or modify it
+// under the terms found in the LICENSE[.md|.rst] file distributed
+// together with this file.
 //
 // Lambda is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 //
-// You should have received a copy of the GNU General Public License
-// along with Lambda.  If not, see <http://www.gnu.org/licenses/>.*/
-// ==========================================================================
-// Author: Hannes Hauswedell <hannes.hauswedell @ fu-berlin.de>
 // ==========================================================================
 // match.h: Main File for the match class
 // ==========================================================================
@@ -27,13 +22,11 @@
 #ifndef SEQAN_LAMBDA_FINDER_H_
 #define SEQAN_LAMBDA_FINDER_H_
 
-#include <forward_list>
-#include <unordered_map>
+// #include <forward_list>
+// #include <unordered_map>
 #include <vector>
 
-#include "misc.hpp"
-
-
+#include "options.hpp"
 
 using namespace seqan;
 
@@ -41,18 +34,20 @@ using namespace seqan;
 //                  Finder
 //-----------------------------------------------------------------------------
 
+template<typename TAlph>
 struct Match
 {
-    typedef uint32_t    TQId;
-    typedef uint32_t    TSId;// many suffixes in subject-index TODO can be smaller now?
-    typedef uint16_t    TPos;
+    typedef SizeTypeNum_<TAlph>    TQId;
+    typedef SizeTypeNum_<TAlph>    TSId;
+    typedef SizeTypePos_<TAlph>    TPos;
+
     TQId qryId;
     TSId subjId;
     TPos qryStart;
-//     TPos qryEnd;
+    TPos qryEnd;
 
     TPos subjStart;
-//     TPos subjEnd;
+    TPos subjEnd;
 
 //     Match()
 //     :
@@ -72,29 +67,31 @@ struct Match
 
     inline bool operator== (Match const & m2) const
     {
-         return std::tie(qryId, subjId, qryStart, subjStart/*, qryEnd, subjEnd*/)
-             == std::tie(m2.qryId, m2.subjId, m2.qryStart, m2.subjStart/*, m2.qryEnd, m2.subjEnd*/);
+         return std::tie(qryId, subjId, qryStart, subjStart, qryEnd, subjEnd)
+             == std::tie(m2.qryId, m2.subjId, m2.qryStart, m2.subjStart, m2.qryEnd, m2.subjEnd);
     }
     inline bool operator< (Match const & m2) const
     {
-         return std::tie(qryId, subjId, qryStart, subjStart/*, qryEnd, subjEnd*/)
-              < std::tie(m2.qryId, m2.subjId, m2.qryStart, m2.subjStart/*, m2.qryEnd, m2.subjEnd*/);
+         return std::tie(qryId, subjId, qryStart, subjStart, qryEnd, subjEnd)
+              < std::tie(m2.qryId, m2.subjId, m2.qryStart, m2.subjStart, m2.qryEnd, m2.subjEnd);
     }
 };
 
+template <typename TAlph>
 inline void
-setToSkip(Match & m)
+setToSkip(Match<TAlph> & m)
 {
-    using TPos          = typename Match::TPos;
+    using TPos          = typename Match<TAlph>::TPos;
     constexpr TPos posMax = std::numeric_limits<TPos>::max();
     m.qryStart = posMax;
     m.subjStart = posMax;
 }
 
+template <typename TAlph>
 inline bool
-isSetToSkip(Match const & m)
+isSetToSkip(Match<TAlph> const & m)
 {
-    using TPos          = typename Match::TPos;
+    using TPos          = typename Match<TAlph>::TPos;
     constexpr TPos posMax = std::numeric_limits<TPos>::max();
     return (m.qryStart == posMax) && (m.subjStart == posMax);
 }
@@ -141,13 +138,13 @@ isSetToSkip(Match const & m)
 //     }
 // };
 
-template <typename TGH>
+template <typename TGH, typename TAlph>
 inline void
-myHyperSortSingleIndex(std::vector<Match> & matches,
-                       LambdaOptions const & options,
+myHyperSortSingleIndex(std::vector<Match<TAlph>> & matches,
+                       bool const doubleIndexing,
                        TGH const &)
 {
-    using TId = typename Match::TQId;
+    using TId = typename Match<TAlph>::TQId;
 
     // regular sort
     std::sort(matches.begin(), matches.end());
@@ -174,7 +171,7 @@ myHyperSortSingleIndex(std::vector<Match> & matches,
         }
     }
 
-    if (options.doubleIndexing)
+    if (doubleIndexing)
     {
         // sort by trueQryId, then lengths of interval
         std::sort(intervals.begin(), intervals.end(),
@@ -198,7 +195,7 @@ myHyperSortSingleIndex(std::vector<Match> & matches,
         });
     }
 
-    std::vector<Match> tmpVector;
+    std::vector<Match<TAlph>> tmpVector;
     tmpVector.resize(matches.size());
 
     TId newIndex = 0;
@@ -275,16 +272,16 @@ myHyperSortSingleIndex(std::vector<Match> & matches,
 //     m1.subjEnd   = std::max(m1.subjEnd,  m2.subjEnd);
 // }
 
-
-// inline void
-// _printMatch(Match const & m)
-// {
-//     std::cout << "MATCH  Query " << m.qryId
-//               << "(" << m.qryStart << ", " << m.qryEnd
-//               << ")   on Subject "<< m.subjId
-//               << "(" << m.subjStart << ", " << m.subjEnd
-//               << ")" <<  std::endl << std::flush;
-// }
+template <typename TAlph>
+inline void
+_printMatch(Match<TAlph> const & m)
+{
+    std::cout << "MATCH  Query " << m.qryId
+              << "(" << m.qryStart << ", " << m.qryEnd
+              << ")   on Subject "<< m.subjId
+              << "(" << m.subjStart << ", " << m.subjEnd
+              << ")" <<  std::endl << std::flush;
+}
 
 
 
diff --git a/src/misc.hpp b/src/misc.hpp
index da5ac74..ddd0967 100644
--- a/src/misc.hpp
+++ b/src/misc.hpp
@@ -1,25 +1,20 @@
 // ==========================================================================
 //                                  lambda
 // ==========================================================================
-// Copyright (c) 2013-2015, Hannes Hauswedell, FU Berlin
+// Copyright (c) 2013-2016, Hannes Hauswedell <h2 @ fsfe.org>
+// Copyright (c) 2016, Knut Reinert and Freie Universität Berlin
 // All rights reserved.
 //
 // This file is part of Lambda.
 //
-// Lambda is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
+// Lambda is Free Software: you can redistribute it and/or modify it
+// under the terms found in the LICENSE[.md|.rst] file distributed
+// together with this file.
 //
 // Lambda is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 //
-// You should have received a copy of the GNU General Public License
-// along with Lambda.  If not, see <http://www.gnu.org/licenses/>.*/
-// ==========================================================================
-// Author: Hannes Hauswedell <hannes.hauswedell @ fu-berlin.de>
 // ==========================================================================
 // store.h: contains types and definitions for storing sequences and indices
 // ==========================================================================
@@ -32,12 +27,9 @@
 
 #include <seqan/basic.h>
 #include <seqan/sequence.h>
-
 #include <seqan/index.h>
-
 #include <seqan/align.h>
 #include <seqan/blast.h>
-// #include <seqan/reduced_aminoacid.h>
 
 #include "options.hpp"
 
@@ -354,7 +346,7 @@ myPrintImplThread(SharedOptions const & options,
 //                   T const & first,
                   Args const & ... args)
 {
-    #pragma omp critical(stdout)
+    SEQAN_OMP_PRAGMA(critical(stdout))
     {
 //                 std::cout << "\033[" << omp_get_thread_num() << "B";
 //                 std::cout << "\033E";
@@ -420,6 +412,41 @@ appendToStatus(std::stringstream & status,
 }
 
 // ----------------------------------------------------------------------------
+// Function computeEValueThreadSafe
+// ----------------------------------------------------------------------------
+
+template <typename TBlastMatch,
+          typename TScore,
+          BlastProgram p,
+          BlastTabularSpec h>
+inline double
+computeEValueThreadSafe(TBlastMatch & match,
+                        BlastIOContext<TScore, p, h> & context)
+{
+#if defined(__FreeBSD__) && defined(STDLIB_LLVM)
+    // https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=192320
+    static std::vector<std::unordered_map<uint64_t, uint64_t>> _cachedLengthAdjustmentsArray(omp_get_num_threads());
+    static std::unordered_map<uint64_t, uint64_t> & _cachedLengthAdjustments = _cachedLengthAdjustmentsArray[omp_get_thread_num()];
+#else
+    static thread_local std::unordered_map<uint64_t, uint64_t> _cachedLengthAdjustments;
+#endif
+
+    // convert to 64bit and divide for translated sequences
+    uint64_t ql = match.qLength / (qIsTranslated(context.blastProgram) ? 3 : 1);
+    // length adjustment not yet computed
+    if (_cachedLengthAdjustments.find(ql) == _cachedLengthAdjustments.end())
+        _cachedLengthAdjustments[ql] = _lengthAdjustment(context.dbTotalLength, ql, context.scoringScheme);
+
+    uint64_t adj = _cachedLengthAdjustments[ql];
+
+    match.eValue = _computeEValue(match.alignStats.alignmentScore,
+                                  ql - adj,
+                                  context.dbTotalLength - adj,
+                                  context.scoringScheme);
+    return match.eValue;
+}
+
+// ----------------------------------------------------------------------------
 // remove tag type
 // ----------------------------------------------------------------------------
 
diff --git a/src/options.hpp b/src/options.hpp
index 5227bb4..b73dc5b 100644
--- a/src/options.hpp
+++ b/src/options.hpp
@@ -1,25 +1,20 @@
 // ==========================================================================
 //                                  lambda
 // ==========================================================================
-// Copyright (c) 2013-2015, Hannes Hauswedell, FU Berlin
+// Copyright (c) 2013-2016, Hannes Hauswedell <h2 @ fsfe.org>
+// Copyright (c) 2016, Knut Reinert and Freie Universität Berlin
 // All rights reserved.
 //
 // This file is part of Lambda.
 //
-// Lambda is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
+// Lambda is Free Software: you can redistribute it and/or modify it
+// under the terms found in the LICENSE[.md|.rst] file distributed
+// together with this file.
 //
 // Lambda is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 //
-// You should have received a copy of the GNU General Public License
-// along with Lambda.  If not, see <http://www.gnu.org/licenses/>.
-// ==========================================================================
-// Author: Hannes Hauswedell <hannes.hauswedell @ fu-berlin.de>
 // ==========================================================================
 // options.h: contains the options and argument parser
 // ==========================================================================
@@ -36,39 +31,63 @@
 #include <seqan/translation.h>
 #include <seqan/arg_parse.h>
 #include <seqan/index.h>
-#include "output.hpp"
+#include <seqan/blast.h>
+
+// ==========================================================================
+// Forwards
+// ==========================================================================
+
+template <typename T>
+struct SamBamExtraTags;
 
 // ==========================================================================
 // Metafunctions
 // ==========================================================================
 
-// suffix array overloads
-namespace SEQAN_NAMESPACE_MAIN
+// SIZE TYPES
+
+// Expected Number of Sequences
+template <typename TAlph>
+using SizeTypeNum_ = uint32_t;
+
+// Expected Lengths of Sequences
+template <typename T>
+struct SizeTypePosMeta_
 {
+    using Type = uint16_t;
+};
 
-template<typename TSpec1, typename TSpec2, typename TSpec3>
-struct SAValue<StringSet<String<ReducedAminoAcid<TSpec1>, TSpec2>, TSpec3> >
+template <>
+struct SizeTypePosMeta_<Dna5>
 {
-    typedef Pair<uint32_t, uint16_t, Pack> Type;
+    // DNA sequences are expected to be longer
+    using Type = uint32_t;
 };
 
-template<typename TSpec2, typename TSpec3, typename TFunctor>
-struct SAValue<StringSet<ModifiedString<String<AminoAcid, TSpec2>, TFunctor>, TSpec3> >
+template <typename TAlph>
+using SizeTypePos_ = typename SizeTypePosMeta_<TAlph>::Type;
+
+
+// suffix array overloads
+namespace seqan
 {
-    typedef Pair<uint32_t, uint16_t, Pack> Type;
+
+template<typename TSpec1, typename TSpec2, typename TSpec3>
+struct SAValue<StringSet<String<ReducedAminoAcid<TSpec1>, TSpec2>, TSpec3> >
+{
+    typedef Pair<SizeTypeNum_<TSpec1>, SizeTypePos_<TSpec1>, Pack> Type;
 };
 
-template<typename TSpec2, typename TSpec3>
-struct SAValue<StringSet<String<AminoAcid, TSpec2>, TSpec3> >
+template<typename TSpec1, typename TSpec2, typename TSpec3, typename TFunctor>
+struct SAValue<StringSet<ModifiedString<String<TSpec1, TSpec2>, TFunctor>, TSpec3> >
 {
-    typedef Pair<uint32_t, uint16_t, Pack> Type;
+    typedef Pair<SizeTypeNum_<TSpec1>, SizeTypePos_<TSpec1>, Pack> Type;
 };
 
-// Dna Sequences might be longer (chromosomes, genomes)
-template<typename TSpec1, typename TSpec2>
-struct SAValue<StringSet<String<Dna5, TSpec1>, TSpec2> >
+template<typename TSpec1, typename TSpec2, typename TSpec3>
+struct SAValue<StringSet<String<TSpec1, TSpec2>, TSpec3> >
 {
-    typedef Pair<uint32_t, uint32_t, Pack> Type;
+    typedef Pair<SizeTypeNum_<TSpec1>, SizeTypePos_<TSpec1>, Pack> Type;
 };
 
 template <typename TString, typename TSpec>
@@ -85,9 +104,10 @@ struct DefaultIndexStringSpec<StringSet<TString, TSpec>>
 template <typename TDirection, typename TStorageSpec>
 struct FormattedFileContext<FormattedFile<Bam, TDirection, BlastTabular>, TStorageSpec>
 {
-    typedef StringSet<Segment<String<char, MMap<> >, InfixSegment> >   TNameStore;
-    typedef NameStoreCache<TNameStore>                                  TNameStoreCache;
-    typedef BamIOContext<TNameStore, TNameStoreCache, TStorageSpec>     Type;
+    typedef typename DefaultIndexStringSpec<StringSet<void, void>>::Type TStringSpec; // see above
+    typedef StringSet<Segment<String<char, TStringSpec>, InfixSegment> > TNameStore;
+    typedef NameStoreCache<TNameStore>                                   TNameStoreCache;
+    typedef BamIOContext<TNameStore, TNameStoreCache, TStorageSpec>      Type;
 };
 
 }
@@ -103,7 +123,8 @@ struct LambdaFMIndexConfig
 #else
     using TAlloc    = Alloc<>;
 #endif
-    using Bwt       = WaveletTree<void, WTRDConfig<LengthSum, TAlloc> >;
+//     using Bwt       = WaveletTree<void, WTRDConfig<LengthSum, TAlloc> >;
+    using Bwt       = Levels<void, LevelsRDConfig<LengthSum, TAlloc, 1, 3> >;
     using Sentinels = Levels<void, LevelsRDConfig<LengthSum, TAlloc> >;
 
     static const unsigned SAMPLING = 10;
@@ -168,11 +189,22 @@ bool setEnv(TString const & key, TValue & value)
 }
 
 // ==========================================================================
+// Option Enums
+// ==========================================================================
+
+enum class DbIndexType : uint8_t
+{
+    SUFFIX_ARRAY,
+    FM_INDEX,
+    BI_FM_INDEX
+};
+
+// ==========================================================================
 // Classes
 // ==========================================================================
 
 // --------------------------------------------------------------------------
-// Class LambdaOptions
+// Class SharedOptions
 // --------------------------------------------------------------------------
 
 // This struct stores the options from the command line.
@@ -184,13 +216,9 @@ struct SharedOptions
 
     std::string commandLine;
 
-    std::string dbFile;
+    std::string indexDir;
 
-    int      dbIndexType = 0;
-    // for indexer, the file format of database sequences
-    // for main app, the file format of query sequences
-    // 0 -- fasta, 1 -- fastq
-//     int      fileFormat = 0;
+    DbIndexType dbIndexType;
 
     int      alphReduction = 0;
 
@@ -214,6 +242,9 @@ struct SharedOptions
     }
 };
 
+// --------------------------------------------------------------------------
+// Class LambdaOptions
+// --------------------------------------------------------------------------
 
 struct LambdaOptions : public SharedOptions
 {
@@ -228,6 +259,7 @@ struct LambdaOptions : public SharedOptions
     std::bitset<64> samBamTags;
     bool            samWithRefHeader;
     unsigned        samBamSeq;
+    bool            samBamHardClip;
     bool            versionInformationToOutputFile;
 
     unsigned        queryPart = 0;
@@ -235,6 +267,7 @@ struct LambdaOptions : public SharedOptions
 //     bool            semiGlobal;
 
     bool            doubleIndexing = true;
+    bool            adaptiveSeeding;
 
     unsigned        seedLength  = 0;
     unsigned        maxSeedDist = 1;
@@ -261,8 +294,18 @@ struct LambdaOptions : public SharedOptions
     int             idCutOff    = 0;
     unsigned long   maxMatches  = 500;
 
+    enum class ExtensionMode : uint8_t
+    {
+        AUTO,
+        XDROP,
+        FULL_SERIAL,
+        FULL_SIMD
+    };
+    ExtensionMode   extensionMode;
+
     bool            filterPutativeDuplicates = true;
     bool            filterPutativeAbundant = true;
+    bool            mergePutativeSiblings = true;
 
     int             preScoring = 0; // 0 = off, 1 = seed, 2 = region (
     double          preScoringThresh    = 0.0;
@@ -273,9 +316,14 @@ struct LambdaOptions : public SharedOptions
     }
 };
 
+// --------------------------------------------------------------------------
+// Class LambdaIndexerOptions
+// --------------------------------------------------------------------------
+
 struct LambdaIndexerOptions : public SharedOptions
 {
-    std::string     segFile = "";
+    std::string     dbFile;
+//     std::string     segFile = "";
     std::string     algo = "";
 
     bool            truncateIDs;
@@ -290,7 +338,7 @@ struct LambdaIndexerOptions : public SharedOptions
 // ==========================================================================
 
 // --------------------------------------------------------------------------
-// Function displayCopyright()
+// Function sharedSetup()
 // --------------------------------------------------------------------------
 
 void
@@ -301,26 +349,54 @@ sharedSetup(ArgumentParser & parser)
                                 std::string(SEQAN_REVISION) + ")";
     setVersion(parser, versionString);
     setDate(parser, __DATE__);
-    setShortCopyright(parser, "2013-2015 Hannes Hauswedell; released under the GNU GPL v3 (or later).");
+    setShortCopyright(parser, "2013-2016 Hannes Hauswedell, released under the GNU AGPL v3 (or later); "
+                              "2016 Knut Reinert and Freie Universität Berlin, released under the 3-clause-BSDL");
 
     setCitation(parser, "Hauswedell et al (2014); doi: 10.1093/bioinformatics/btu439");
 
     setLongCopyright(parser,
-        " Copyright (c) 2013-2015, Hannes Hauswedell, FU Berlin\n"
+        " Copyright (c) 2013-2016, Hannes Hauswedell\n"
         " All rights reserved.\n"
         "\n"
-        " Lambda is free software: you can redistribute it and/or modify\n"
-        " it under the terms of the GNU General Public License as published by\n"
-        " the Free Software Foundation, either version 3 of the License, or\n"
-        " (at your option) any later version.\n"
+        " This program is free software: you can redistribute it and/or modify\n"
+        " it under the terms of the GNU Affero General Public License as\n"
+        " published by the Free Software Foundation, either version 3 of the\n"
+        " License, or (at your option) any later version.\n"
         "\n"
         " Lambda is distributed in the hope that it will be useful,\n"
         " but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
         " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
         " GNU General Public License for more details.\n"
         "\n"
-        " You should have received a copy of the GNU General Public License\n"
-        " along with Lambda.  If not, see <http://www.gnu.org/licenses/>.\n");
+        " You should have received a copy of the GNU Affero General Public License\n"
+        " along with this program.  If not, see <http://www.gnu.org/licenses/>.\n"
+        "\n"
+        " Copyright (c) 2016 Knut Reinert and Freie Universität Berlin\n"
+        " All rights reserved.\n"
+        "\n"
+        " Redistribution and use in source and binary forms, with or without\n"
+        " modification, are permitted provided that the following conditions are met:\n"
+        "\n"
+        " * Redistributions of source code must retain the above copyright\n"
+        "   notice, this list of conditions and the following disclaimer.\n"
+        " * Redistributions in binary form must reproduce the above copyright\n"
+        "   notice, this list of conditions and the following disclaimer in the\n"
+        "   documentation and/or other materials provided with the distribution.\n"
+        " * Neither the name of Knut Reinert or the FU Berlin nor the names of\n"
+        "   its contributors may be used to endorse or promote products derived\n"
+        "   from this software without specific prior written permission.\n"
+        "\n"
+        " THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n"
+        " AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n"
+        " IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n"
+        " ARE DISCLAIMED. IN NO EVENT SHALL KNUT REINERT OR THE FU BERLIN BE LIABLE\n"
+        " FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n"
+        " DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n"
+        " SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n"
+        " CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n"
+        " LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n"
+        " OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n"
+        " DAMAGE.\n");
 
     addOption(parser, ArgParseOption("v", "verbosity",
         "Display more/less diagnostic output during operation: 0 [only errors]; 1 [default]; 2 "
@@ -362,7 +438,7 @@ parseCommandLine(LambdaOptions & options, int argc, char const ** argv)
 
     // Define usage line and long description.
     addUsageLine(parser, "[\\fIOPTIONS\\fP] \\fI-q QUERY.fasta\\fP "
-                         "\\fI-d DATABASE.fasta\\fP "
+                         "\\fI-i INDEX.lambda\\fP "
                          "[\\fI-o output.m8\\fP]");
 
     sharedSetup(parser);
@@ -375,12 +451,12 @@ parseCommandLine(LambdaOptions & options, int argc, char const ** argv)
     setValidValues(parser, "query", toCString(concat(getFileExtensions(SeqFileIn()), ' ')));
     setRequired(parser, "q");
 
-    addOption(parser, ArgParseOption("d", "database",
-        "Path to original database sequences (a precomputed index with .sa or .fm needs to exist!).",
+    addOption(parser, ArgParseOption("i", "index",
+        "The database index (created by the lambda_indexer executable).",
         ArgParseArgument::INPUT_FILE,
         "IN"));
-    setValidValues(parser, "database", toCString(concat(getFileExtensions(SeqFileIn()), ' ')));
-    setRequired(parser, "d");
+    setRequired(parser, "index");
+    setValidValues(parser, "index", ".lambda");
 
     addOption(parser, ArgParseOption("di", "db-index-type",
         "database index is in this format.",
@@ -471,6 +547,15 @@ parseCommandLine(LambdaOptions & options, int argc, char const ** argv)
     setDefaultValue(parser, "sam-bam-tags", "AS NM ZE ZI ZF");
     setAdvanced(parser, "sam-bam-tags");
 
+    addOption(parser, ArgParseOption("", "sam-bam-clip",
+        "Whether to hard-clip or soft-clip the regions beyond the local match. Soft-clipping retains the full sequence "
+        "in the output file, but obviously uses more space.",
+        ArgParseArgument::STRING,
+        "STR"));
+    setValidValues(parser, "sam-bam-clip", "hard soft");
+    setDefaultValue(parser, "sam-bam-clip", "hard");
+    setAdvanced(parser, "sam-bam-clip");
+
     addOption(parser, ArgParseOption("", "version-to-outputfile",
         "Write the Lambda program tag and version number to the output file.",
         ArgParseArgument::STRING,
@@ -517,7 +602,11 @@ parseCommandLine(LambdaOptions & options, int argc, char const ** argv)
         "Blast Operation Mode.",
         ArgParseArgument::STRING,
         "STR"));
+#ifdef FASTBUILD
+    setValidValues(parser, "program", "blastp blastx");
+#else
     setValidValues(parser, "program", "blastn blastp blastx tblastn tblastx");
+#endif
     setDefaultValue(parser, "program", "blastx");
 
 //     addOption(parser, ArgParseOption("qa", "query-alphabet",
@@ -566,6 +655,14 @@ parseCommandLine(LambdaOptions & options, int argc, char const ** argv)
 //                                             ArgParseArgument::INTEGER));
 //     setDefaultValue(parser, "ungapped-seeds", "1");
 
+    addOption(parser, ArgParseOption("as", "adaptive-seeding",
+        "SECRET",
+        ArgParseArgument::STRING,
+        "STR"));
+    setValidValues(parser, "adaptive-seeding", "on off");
+    setDefaultValue(parser, "adaptive-seeding", "on");
+    setAdvanced(parser, "adaptive-seeding");
+
     addOption(parser, ArgParseOption("sl", "seed-length",
         "Length of the seeds (default = 14 for BLASTN).",
         ArgParseArgument::INTEGER));
@@ -576,7 +673,7 @@ parseCommandLine(LambdaOptions & options, int argc, char const ** argv)
         "Offset for seeding (if unset = seed-length, non-overlapping; "
         "default = 5 for BLASTN).",
         ArgParseArgument::INTEGER));
-    setDefaultValue(parser, "seed-offset", "10");
+    setDefaultValue(parser, "seed-offset", "5");
     setAdvanced(parser, "seed-offset");
 
     addOption(parser, ArgParseOption("sd", "seed-delta",
@@ -630,6 +727,14 @@ parseCommandLine(LambdaOptions & options, int argc, char const ** argv)
     setDefaultValue(parser, "filter-putative-abundant", "on");
     setAdvanced(parser, "filter-putative-abundant");
 
+    addOption(parser, ArgParseOption("pm", "merge-putative-siblings",
+        "Merge seed from one region, "
+        "stop searching if the remaining realm looks unfeasable.",
+        ArgParseArgument::STRING));
+    setValidValues(parser, "merge-putative-siblings", "on off");
+    setDefaultValue(parser, "merge-putative-siblings", "on");
+    setAdvanced(parser, "merge-putative-siblings");
+
 //     addOption(parser, ArgParseOption("se",
 //                                             "seedminevalue",
 //                                             "after postproc worse seeds are "
@@ -649,8 +754,8 @@ parseCommandLine(LambdaOptions & options, int argc, char const ** argv)
     addSection(parser, "Scoring");
 
     addOption(parser, ArgParseOption("sc", "scoring-scheme",
-        "'62' for Blosum62 (default); '50' for Blosum50; '0' for manual "
-        "(default for BlastN)",
+        "'45' for Blosum45; '62' for Blosum62 (default);  '80' for Blosum80; "
+        "[ignored for BlastN]",
         ArgParseArgument::INTEGER));
     setDefaultValue(parser, "scoring-scheme", "62");
     setAdvanced(parser, "scoring-scheme");
@@ -668,13 +773,13 @@ parseCommandLine(LambdaOptions & options, int argc, char const ** argv)
     setAdvanced(parser, "score-gap-open");
 
     addOption(parser, ArgParseOption("ma", "score-match",
-        "Match score (BLASTN or manual scoring)",
+        "Match score [only BLASTN])",
         ArgParseArgument::INTEGER));
     setDefaultValue(parser, "score-match", "2");
     setAdvanced(parser, "score-match");
 
     addOption(parser, ArgParseOption("mi", "score-mismatch",
-        "Mismatch score (BLASTN or manual scoring)",
+        "Mismatch score [only BLASTN]",
         ArgParseArgument::INTEGER));
     setDefaultValue(parser, "score-mismatch", "-3");
     setAdvanced(parser, "score-mismatch");
@@ -698,6 +803,17 @@ parseCommandLine(LambdaOptions & options, int argc, char const ** argv)
     setMinValue(parser, "band", "-3");
     setAdvanced(parser, "band");
 
+    addOption(parser, ArgParseOption("em", "extension-mode",
+        "Choice of extension algorithms.",
+        ArgParseArgument::STRING));
+#ifdef SEQAN_SIMD_ENABLED
+    setValidValues(parser, "extension-mode", "auto xdrop fullSerial fullSIMD");
+#else
+    setValidValues(parser, "extension-mode", "auto xdrop fullSerial");
+#endif
+    setDefaultValue(parser, "extension-mode", "auto");
+    setAdvanced(parser, "extension-mode");
+
     addTextSection(parser, "Tuning");
     addText(parser, "Tuning the seeding parameters and (de)activating alphabet "
                     "reduction has a strong "
@@ -743,6 +859,9 @@ parseCommandLine(LambdaOptions & options, int argc, char const ** argv)
 
     // Extract option values.
     getOptionValue(options.queryFile, parser, "query");
+
+    getOptionValue(options.indexDir, parser, "index");
+
 //     if (endsWith(options.queryFile, ".fastq") ||
 //         endsWith(options.queryFile, ".fq"))
 //         options.fileFormat = 1;
@@ -777,6 +896,10 @@ parseCommandLine(LambdaOptions & options, int argc, char const ** argv)
         options.samBamSeq = 2;
 
     clear(buffer);
+    getOptionValue(buffer, parser, "sam-bam-clip");
+    options.samBamHardClip = (buffer == "hard");
+
+    clear(buffer);
     getOptionValue(buffer, parser, "output-columns");
     if (buffer == "help")
     {
@@ -864,6 +987,10 @@ parseCommandLine(LambdaOptions & options, int argc, char const ** argv)
     options.versionInformationToOutputFile = (buffer == "on");
 
     clear(buffer);
+    getOptionValue(buffer, parser, "adaptive-seeding");
+    options.adaptiveSeeding = (buffer == "on");
+
+    clear(buffer);
     getOptionValue(options.seedLength, parser, "seed-length");
     if ((!isSet(parser, "seed-length")) &&
         (options.blastProgram == BlastProgram::BLASTN))
@@ -872,7 +999,7 @@ parseCommandLine(LambdaOptions & options, int argc, char const ** argv)
     if (isSet(parser, "seed-offset"))
         getOptionValue(options.seedOffset, parser, "seed-offset");
     else
-        options.seedOffset = options.seedLength;
+        options.seedOffset = options.seedLength / 2;
 
     if (isSet(parser, "seed-gravity"))
         getOptionValue(options.seedGravity, parser, "seed-gravity");
@@ -944,11 +1071,17 @@ parseCommandLine(LambdaOptions & options, int argc, char const ** argv)
     getOptionValue(buffer, parser, "filter-putative-abundant");
     options.filterPutativeAbundant = (buffer == "on");
 
+    getOptionValue(buffer, parser, "merge-putative-siblings");
+    options.mergePutativeSiblings = (buffer == "on");
+
     // TODO always prescore 1
     getOptionValue(options.preScoring, parser, "pre-scoring");
     if ((!isSet(parser, "pre-scoring")) &&
         (options.alphReduction == 0))
         options.preScoring = 1;
+    // for adaptive seeding we take the full resized seed (and no surroundings)
+//     if (options.adaptiveSeeding)
+//         options.preScoring = 1;
 
     getOptionValue(options.preScoringThresh, parser, "pre-scoring-threshold");
 //     if (options.preScoring == 0)
@@ -958,6 +1091,33 @@ parseCommandLine(LambdaOptions & options, int argc, char const ** argv)
     getOptionValue(numbuf, parser, "num-matches");
     options.maxMatches = static_cast<unsigned long>(numbuf);
 
+    getOptionValue(buffer, parser, "extension-mode");
+    if (buffer == "fullSIMD")
+    {
+        options.extensionMode = LambdaOptions::ExtensionMode::FULL_SIMD;
+        options.filterPutativeAbundant = false;
+        options.filterPutativeDuplicates = false;
+        options.mergePutativeSiblings = false;
+        options.xDropOff = -1;
+        options.band = -1;
+    }
+    else if (buffer == "fullSerial")
+    {
+        options.extensionMode = LambdaOptions::ExtensionMode::FULL_SERIAL;
+        options.filterPutativeAbundant = false;
+        options.filterPutativeDuplicates = false;
+        options.mergePutativeSiblings = false;
+        options.xDropOff = -1;
+    }
+    else if (buffer == "xdrop")
+    {
+        options.extensionMode = LambdaOptions::ExtensionMode::XDROP;
+    }
+    else
+    {
+        options.extensionMode = LambdaOptions::ExtensionMode::AUTO;
+    }
+
     return ArgumentParser::PARSE_OK;
 }
 
@@ -969,7 +1129,7 @@ parseCommandLine(LambdaIndexerOptions & options, int argc, char const ** argv)
     ArgumentParser parser("lambda_indexer");
 
     // Define usage line and long description.
-    addUsageLine(parser, "[\\fIOPTIONS\\fP] \\-d DATABASE.fasta\\fP");
+    addUsageLine(parser, "[\\fIOPTIONS\\fP] \\-d DATABASE.fasta [-i INDEX.lambda]\\fP");
 
     sharedSetup(parser);
 
@@ -983,21 +1143,20 @@ parseCommandLine(LambdaIndexerOptions & options, int argc, char const ** argv)
     setRequired(parser, "database");
     setValidValues(parser, "database", toCString(concat(getFileExtensions(SeqFileIn()), ' ')));
 
-    addOption(parser, ArgParseOption("s",
-        "segfile",
-        "SEG intervals for database"
-        "(optional).",
-        ArgParseArgument::INPUT_FILE));
-
-    setValidValues(parser, "segfile", "seg");
+//     addOption(parser, ArgParseOption("s",
+//         "segfile",
+//         "SEG intervals for database"
+//         "(optional).",
+//         ArgParseArgument::INPUT_FILE));
+//     setValidValues(parser, "segfile", "seg");
+//     hideOption(parser, "segfile"); // TODO remove completely
 
     addSection(parser, "Output Options");
-//     addOption(parser, ArgParseOption("o",
-//                                             "output",
-//                                             "Index of database sequences",
-//                                             ArgParseArgument::OUTPUT_FILE,
-//                                             "OUT"));
-//     setValidValues(parser, "output", "sa fm");
+    addOption(parser, ArgParseOption("i", "index",
+        "The output directory for the index files (defaults to \"DATABASE.lambda\").",
+        ArgParseArgument::INPUT_FILE,
+        "OUT"));
+    setValidValues(parser, "index", ".lambda");
 
     addOption(parser, ArgParseOption("di", "db-index-type",
         "Suffix array or full-text minute space.",
@@ -1121,7 +1280,7 @@ parseCommandLine(LambdaIndexerOptions & options, int argc, char const ** argv)
         return res;
 
     // Extract option values
-    getOptionValue(options.segFile, parser, "segfile");
+//     getOptionValue(options.segFile, parser, "segfile");
     getOptionValue(options.algo, parser, "algorithm");
     if ((options.algo == "mergesort") || (options.algo == "quicksort") || (options.algo == "quicksortbuckets"))
     {
@@ -1137,6 +1296,29 @@ parseCommandLine(LambdaIndexerOptions & options, int argc, char const ** argv)
     getOptionValue(buffer, parser, "truncate-ids");
     options.truncateIDs = (buffer == "on");
 
+
+    getOptionValue(options.dbFile, parser, "database");
+    if (isSet(parser, "index"))
+        getOptionValue(options.indexDir, parser, "index");
+    else
+        options.indexDir = options.dbFile + ".lambda";
+
+
+    if (fileExists(options.indexDir.c_str()))
+    {
+        std::cerr << "ERROR: An output directory already exists at " << options.indexDir << '\n'
+                  << "Remove it, or choose a different location.\n";
+        return ArgumentParser::PARSE_ERROR;
+    }
+    else
+    {
+        if (mkdir(options.indexDir.c_str(), S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH))
+        {
+            std::cerr << "ERROR: Cannot create output directory at " << options.indexDir << '\n';;
+            return ArgumentParser::PARSE_ERROR;
+        }
+    }
+
     return ArgumentParser::PARSE_OK;
 }
 
@@ -1147,13 +1329,13 @@ parseCommandLineShared(SharedOptions & options, ArgumentParser & parser)
     int buf = 0;
     std::string buffer;
 
-    getOptionValue(options.dbFile, parser, "database");
-
     getOptionValue(buffer, parser, "db-index-type");
     if (buffer == "sa")
-        options.dbIndexType = 0;
-    else // if fm
-        options.dbIndexType = 1;
+        options.dbIndexType = DbIndexType::SUFFIX_ARRAY;
+    else if (buffer == "bifm")
+        options.dbIndexType = DbIndexType::BI_FM_INDEX;
+    else
+        options.dbIndexType = DbIndexType::FM_INDEX;
 
     getOptionValue(buffer, parser, "program");
     if (buffer == "blastn")
@@ -1209,6 +1391,10 @@ parseCommandLineShared(SharedOptions & options, ArgumentParser & parser)
     return ArgumentParser::PARSE_OK;
 }
 
+// --------------------------------------------------------------------------
+// Function _alphName()
+// --------------------------------------------------------------------------
+
 constexpr const char *
 _alphName(AminoAcid const & /**/)
 {
@@ -1251,6 +1437,26 @@ _alphName(Dna5 const & /**/)
     return "dna5";
 }
 
+// --------------------------------------------------------------------------
+// Function _indexName()
+// --------------------------------------------------------------------------
+
+inline std::string
+_indexName(DbIndexType const t)
+{
+    switch (t)
+    {
+        case DbIndexType::SUFFIX_ARRAY:  return "suffix_array";
+        case DbIndexType::FM_INDEX:      return "fm_index";
+        case DbIndexType::BI_FM_INDEX:   return "bi_fm_index";
+    }
+    return "ERROR_UNKNOWN_INDEX_TYPE";
+}
+
+// --------------------------------------------------------------------------
+// Function printOptions()
+// --------------------------------------------------------------------------
+
 template <typename TLH>
 inline void
 printOptions(LambdaOptions const & options)
@@ -1269,7 +1475,7 @@ printOptions(LambdaOptions const & options)
     std::cout << "OPTIONS\n"
               << " INPUT\n"
               << "  query file:               " << options.queryFile << "\n"
-              << "  db file:                  " << options.dbFile << "\n"
+              << "  index directory:          " << options.indexDir << "\n"
               << "  db index type:            " << (TGH::indexIsFM
                                                     ? "FM-Index\n"
                                                     : "SA-Index\n")
@@ -1332,6 +1538,7 @@ printOptions(LambdaOptions const & options)
               << "  putative-duplicates:      " << (options.filterPutativeDuplicates
                                                     ? std::string("on")
                                                     : std::string("off")) << "\n"
+
               << " SCORING\n"
               << "  scoring scheme:           " << options.scoringMethod << "\n"
               << "  score-match:              " << (options.scoringMethod
@@ -1342,10 +1549,36 @@ printOptions(LambdaOptions const & options)
                                                     : std::to_string(options.misMatch)) << "\n"
               << "  score-gap:                " << options.gapExtend << "\n"
               << "  score-gap-open:           " << options.gapOpen << "\n"
-              << " EXTENSION\n"
+              << " EXTENSION\n";
+    switch (options.extensionMode)
+    {
+        case LambdaOptions::ExtensionMode::AUTO:
+            std::cout
+              << "  extensionMode:            auto (depends on query length)\n"
               << "  x-drop:                   " << options.xDropOff << "\n"
               << "  band:                     " << bandStr << "\n"
-              << " BUILD OPTIONS:\n"
+              << "  [depending on the automatically chosen mode x-drop or band might get disabled.\n";
+              break;
+        case LambdaOptions::ExtensionMode::XDROP:
+            std::cout
+              << "  extensionMode:            individual\n"
+              << "  x-drop:                   " << options.xDropOff << "\n"
+              << "  band:                     " << bandStr << "\n";
+            break;
+        case LambdaOptions::ExtensionMode::FULL_SERIAL:
+            std::cout
+              << "  extensionMode:            batch, but serialized\n"
+              << "  x-drop:                   not used\n"
+              << "  band:                     " << bandStr << "\n";
+            break;
+        case LambdaOptions::ExtensionMode::FULL_SIMD:
+            std::cout
+              << "  extensionMode:            batch with SIMD\n"
+              << "  x-drop:                   not used\n"
+              << "  band:                     not used\n";
+            break;
+    }
+    std::cout << " BUILD OPTIONS:\n"
               << "  cmake_build_type:         " << std::string(CMAKE_BUILD_TYPE) << "\n"
               << "  fastbuild:                "
     #if defined(FASTBUILD)
@@ -1371,6 +1604,20 @@ printOptions(LambdaOptions const & options)
     #else
               << "off\n"
     #endif
+              << "  lingaps_opt:              "
+    #if defined(LAMBDA_LINGAPS_OPT)
+              << "on\n"
+    #else
+              << "off\n"
+    #endif
+              << "  seqan_simd:               "
+    #if defined(SEQAN_SIMD_ENABLED) && defined(__AVX2__)
+              << "avx2\n"
+    #elif defined(SEQAN_SIMD_ENABLED) && defined(__SSE4_2__)
+              << "sse4\n"
+    #else
+              << "off\n"
+    #endif
               << "\n";
 }
 
diff --git a/src/output.hpp b/src/output.hpp
index 4c2016e..3dd199e 100644
--- a/src/output.hpp
+++ b/src/output.hpp
@@ -1,25 +1,20 @@
 // ==========================================================================
 //                                  lambda
 // ==========================================================================
-// Copyright (c) 2013-2015, Hannes Hauswedell, FU Berlin
+// Copyright (c) 2013-2016, Hannes Hauswedell <h2 @ fsfe.org>
+// Copyright (c) 2016, Knut Reinert and Freie Universität Berlin
 // All rights reserved.
 //
 // This file is part of Lambda.
 //
-// Lambda is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// (at your option) any later version.
+// Lambda is Free Software: you can redistribute it and/or modify it
+// under the terms found in the LICENSE[.md|.rst] file distributed
+// together with this file.
 //
 // Lambda is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 //
-// You should have received a copy of the GNU General Public License
-// along with Lambda.  If not, see <http://www.gnu.org/licenses/>.
-// ==========================================================================
-// Author: Hannes Hauswedell <hannes.hauswedell @ fu-berlin.de>
 // ==========================================================================
 // output.hpp: contains routines for file-writing
 // ==========================================================================
@@ -81,27 +76,26 @@ constexpr const std::array<std::pair<const char*, const char*>, 11> SamBamExtraT
 // ----------------------------------------------------------------------------
 
 // similar to _untranslatePositions() from the blast module
-template <typename TSequence1, typename TSequence2, typename TBlastMatch>
+template <typename TSequence1, typename TSequence2, typename TNum>
 inline void
 _untranslateSequence(TSequence1                     & target,
                      TSequence2               const & source,
-                     TBlastMatch              const & m)
+                     TNum                     const   qStart,
+                     TNum                     const   qEnd,
+                     int                      const   qFrameShift)
 {
-    if (m.qFrameShift >= 0)
+    if (qFrameShift >= 0)
     {
         target = infix(source,
-                       3 * m.qStart + std::abs(m.qFrameShift) - 1,
-                       3 * m.qEnd + std::abs(m.qFrameShift) - 1);
+                       3 * qStart + std::abs(qFrameShift) - 1,
+                       3 * qEnd + std::abs(qFrameShift) - 1);
     }
     else
     {
-        thread_local Dna5String buf;
-
-        buf = source;
-        reverseComplement(buf);
-        target = infix(buf,
-                       3 * m.qStart + std::abs(m.qFrameShift) - 1,
-                       3 * m.qEnd + std::abs(m.qFrameShift) - 1);
+        target = infix(source,
+                       length(source) - (3 * qEnd + std::abs(qFrameShift) - 1),
+                       length(source) - (3 * qStart + std::abs(qFrameShift) - 1));
+        reverseComplement(target);
     }
 }
 
@@ -116,26 +110,30 @@ blastMatchOneCigar(TCigar & cigar,
                    TLocalHolder const & lH)
 {
     using TCElem = typename Value<TCigar>::Type;
+    using TGlobalHolder = typename TLocalHolder::TGlobalHolder;
 
     SEQAN_ASSERT_EQ(length(m.alignRow0), length(m.alignRow1));
 
-    // hard clipping
-    unsigned leftClip   = m.qStart;
-    unsigned rightClip  = m.qEnd;
+    // translate positions into dna space
+    unsigned const transFac       = qIsTranslated(TGlobalHolder::blastProgram) ? 3 : 1;
+    // clips resulting from translation / frameshift are always hard clips
+    unsigned const leftFrameClip  = std::abs(m.qFrameShift) - 1;
+    unsigned const rightFrameClip = qIsTranslated(TGlobalHolder::blastProgram) ? (m.qLength - leftFrameClip) % 3 : 0;
+    // regular clipping from local alignment (regions outside match) can be hard or soft
+    unsigned const leftClip       = m.qStart * transFac;
+    unsigned const rightClip      = (length(source(m.alignRow0)) - m.qEnd) * transFac;
 
-    // translation factor
-    unsigned transFac   = 1;
-    if (qIsTranslated(lH.gH.blastProgram))
+    if (lH.options.samBamHardClip)
     {
-        transFac  = 3;
-        leftClip  = leftClip * 3 + std::abs(m.qFrameShift) - 1;
-        rightClip = rightClip * 3 + std::abs(m.qFrameShift) - 1;
+        if (leftFrameClip + leftClip > 0)
+            appendValue(cigar, TCElem('H', leftFrameClip + leftClip));
+    } else
+    {
+        if (leftFrameClip > 0)
+            appendValue(cigar, TCElem('H', leftFrameClip));
+        if (leftClip > 0)
+            appendValue(cigar, TCElem('S', leftClip));
     }
-    // we want distance to end
-    rightClip = m.qLength - rightClip;
-
-    if (leftClip > 0)
-        appendValue(cigar, TCElem('H', leftClip));
 
     for (unsigned i = 0, count = 0; i < length(m.alignRow0); /* incremented below */)
     {
@@ -170,8 +168,17 @@ blastMatchOneCigar(TCigar & cigar,
             appendValue(cigar, TCElem('M', count * transFac));
     }
 
-    if (rightClip > 0)
-        appendValue(cigar, TCElem('H', rightClip));
+    if (lH.options.samBamHardClip)
+    {
+        if (rightFrameClip + rightClip > 0)
+            appendValue(cigar, TCElem('H', rightFrameClip + rightClip));
+    } else
+    {
+        if (rightClip > 0)
+            appendValue(cigar, TCElem('S', rightClip));
+        if (rightFrameClip > 0)
+            appendValue(cigar, TCElem('H', rightFrameClip));
+    }
 
     if (m.qFrameShift < 0)
         reverse(cigar);
@@ -183,16 +190,37 @@ inline void
 blastMatchTwoCigar(TCigar & dnaCigar,
                    TCigar & protCigar,
                    TBlastMatch const & m,
-                   TLocalHolder const &)
+                   TLocalHolder const & lH)
 {
     using TCElem = typename Value<TCigar>::Type;
+    using TGlobalHolder = typename TLocalHolder::TGlobalHolder;
 
     SEQAN_ASSERT_EQ(length(m.alignRow0), length(m.alignRow1));
 
-    if (m.qStart > 0)
+    // clips resulting from translation / frameshift are always hard clips
+    unsigned const leftFrameClip  = std::abs(m.qFrameShift) - 1;            // in dna space
+    unsigned const rightFrameClip = (m.qLength - leftFrameClip) % 3;          // in dna space
+    // regular clipping from local alignment (regions outside match) can be hard or soft
+    unsigned const leftClip       = m.qStart;                               // in protein space
+    unsigned const rightClip      = length(source(m.alignRow0)) - m.qEnd;   // in protein space
+
+    if (lH.options.samBamHardClip)
+    {
+        if (leftFrameClip + leftClip > 0)
+            appendValue(dnaCigar, TCElem('H', leftFrameClip + 3 * leftClip));
+        if (leftClip > 0)
+            appendValue(protCigar, TCElem('H', leftClip));
+
+    } else
     {
-        appendValue(dnaCigar, TCElem('H', m.qStart * 3 + std::abs(m.qFrameShift) - 1));
-        appendValue(protCigar, TCElem('H', m.qStart));
+        if (leftFrameClip > 0)
+            appendValue(dnaCigar, TCElem('H', leftFrameClip));
+
+        if (leftClip > 0)
+        {
+            appendValue(dnaCigar, TCElem('S', 3 * leftClip));
+            appendValue(protCigar, TCElem('S', leftClip));
+        }
     }
 
     for (unsigned i = 0, count = 0; i < length(m.alignRow0); /* incremented below */)
@@ -237,11 +265,23 @@ blastMatchTwoCigar(TCigar & dnaCigar,
         }
     }
 
-    unsigned rightDnaClip = m.qLength - (m.qEnd * 3 + std::abs(m.qFrameShift) - 1);
-    if (rightDnaClip > 0)
+    if (lH.options.samBamHardClip)
+    {
+        if (rightFrameClip + rightClip > 0)
+            appendValue(dnaCigar, TCElem('H', rightFrameClip + 3 * rightClip));
+        if (rightClip > 0)
+            appendValue(protCigar, TCElem('H', rightClip));
+
+    } else
     {
-        appendValue(dnaCigar, TCElem('H', rightDnaClip));
-        appendValue(protCigar, TCElem('H', ((m.qLength - std::abs(m.qFrameShift) + 1) / 3) - m.qEnd));
+        if (rightClip > 0)
+        {
+            appendValue(dnaCigar, TCElem('S', 3 * rightClip));
+            appendValue(protCigar, TCElem('S', rightClip));
+        }
+
+        if (rightFrameClip > 0)
+            appendValue(dnaCigar, TCElem('H', rightFrameClip));
     }
 
     if (m.qFrameShift < 0)
@@ -263,7 +303,7 @@ myWriteHeader(TGH & globalHolder, TLambdaOptions const & options)
         context(globalHolder.outfile).fields = options.columns;
         auto & versionString = context(globalHolder.outfile).versionString;
         clear(versionString);
-        append(versionString, _programTagToString(globalHolder.blastProgram));
+        append(versionString, _programTagToString(TGH::blastProgram));
         append(versionString, " 2.2.26+ [created by LAMBDA");
         if (options.versionInformationToOutputFile)
         {
@@ -280,7 +320,7 @@ myWriteHeader(TGH & globalHolder, TLambdaOptions const & options)
         auto & subjIds          = contigNames(context);
 
         // set sequence lengths
-        if (sIsTranslated(globalHolder.blastProgram))
+        if (sIsTranslated(TGH::blastProgram))
         {
             //TODO can we get around a copy?
             subjSeqLengths = globalHolder.untransSubjSeqLengths;
@@ -288,7 +328,11 @@ myWriteHeader(TGH & globalHolder, TLambdaOptions const & options)
         {
             // compute lengths ultra-fast
             resize(subjSeqLengths, length(globalHolder.subjSeqs));
+#ifdef __clang__
+            SEQAN_OMP_PRAGMA(parallel for)
+#else
             SEQAN_OMP_PRAGMA(parallel for simd)
+#endif
             for (unsigned i = 0; i < length(subjSeqLengths); ++i)
                 subjSeqLengths[i] = globalHolder.subjSeqs.limits[i+1] - globalHolder.subjSeqs.limits[i];
         }
@@ -383,6 +427,7 @@ template <typename TLH, typename TRecord>
 inline void
 myWriteRecord(TLH & lH, TRecord const & record)
 {
+    using TGH = typename TLH::TGlobalHolder;
     if (lH.options.outFileFormat == 0) // BLAST
     {
         SEQAN_OMP_PRAGMA(critical(filewrite))
@@ -403,7 +448,7 @@ myWriteRecord(TLH & lH, TRecord const & record)
         for (auto & bamR : bamRecords)
         {
             // untranslate for sIsTranslated
-            if (sIsTranslated(lH.gH.blastProgram))
+            if (sIsTranslated(TGH::blastProgram))
             {
                 bamR.beginPos = mIt->sStart * 3 + std::abs(mIt->sFrameShift) - 1;
                 if (mIt->sFrameShift < 0)
@@ -430,16 +475,16 @@ myWriteRecord(TLH & lH, TRecord const & record)
             {
                 clear(protCigar);
                 // native protein
-                if ((lH.gH.blastProgram == BlastProgram::BLASTP) || (lH.gH.blastProgram == BlastProgram::TBLASTN))
+                if ((TGH::blastProgram == BlastProgram::BLASTP) || (TGH::blastProgram == BlastProgram::TBLASTN))
                     blastMatchOneCigar(protCigar, *mIt, lH);
-                else if (qIsTranslated(lH.gH.blastProgram)) // translated
+                else if (qIsTranslated(TGH::blastProgram)) // translated
                     blastMatchTwoCigar(bamR.cigar, protCigar, *mIt, lH);
                 else // BLASTN can't have protein sequence
                     blastMatchOneCigar(bamR.cigar, *mIt, lH);
             }
             else
             {
-                if ((lH.gH.blastProgram != BlastProgram::BLASTP) && (lH.gH.blastProgram != BlastProgram::TBLASTN))
+                if ((TGH::blastProgram != BlastProgram::BLASTP) && (TGH::blastProgram != BlastProgram::TBLASTN))
                     blastMatchOneCigar(bamR.cigar, *mIt, lH);
             }
             // we want to include the seq
@@ -448,26 +493,49 @@ myWriteRecord(TLH & lH, TRecord const & record)
             {
                 writeSeq = true;
             }
-            else if (lH.options.samBamSeq == 1)// only uniq sequences
+            else if ((lH.options.samBamSeq == 1))// && lH.options.samBamHardClip)// only uniq sequences
             {
                 decltype(mIt) mPrevIt = mIt - 1;
-                writeSeq = ((beginPosition(mIt->alignRow0) != beginPosition(mPrevIt->alignRow0)) ||
-                            (endPosition(mIt->alignRow0)) != endPosition(mPrevIt->alignRow0));
+                writeSeq = ((mIt->qFrameShift              != mPrevIt->qFrameShift) ||
+                            (beginPosition(mIt->alignRow0) != beginPosition(mPrevIt->alignRow0)) ||
+                            (endPosition(mIt->alignRow0)   != endPosition(mPrevIt->alignRow0)));
             }
-            if (writeSeq)
+
+            if (TGH::blastProgram == BlastProgram::BLASTN)
             {
-                // only dna sequences supported
-                if (lH.gH.blastProgram == BlastProgram::BLASTN)
-                    bamR.seq = infix(source(mIt->alignRow0),
-                                    beginPosition(mIt->alignRow0),
-                                    endPosition(mIt->alignRow0));
-                // untranslation is ok, too
-                else if (qIsTranslated(lH.gH.blastProgram))
-                    _untranslateSequence(bamR.seq,
-                                        lH.gH.untranslatedQrySeqs[mIt->_n_qId],
-                                        *mIt);
-                // else no sequence is available
+                if (lH.options.samBamHardClip)
+                {
+                    if (writeSeq)
+                        bamR.seq = infix(source(mIt->alignRow0),
+                                         beginPosition(mIt->alignRow0),
+                                         endPosition(mIt->alignRow0));
+                } else
+                {
+                    if (writeSeq)
+                        bamR.seq = source(mIt->alignRow0);
+                }
             }
+            else if (qIsTranslated(TGH::blastProgram))
+            {
+                if (lH.options.samBamHardClip)
+                {
+                    if (writeSeq)
+                        _untranslateSequence(bamR.seq,
+                                             lH.gH.untranslatedQrySeqs[mIt->_n_qId],
+                                             mIt->qStart,
+                                             mIt->qEnd,
+                                             mIt->qFrameShift);
+                } else
+                {
+                    if (writeSeq)
+                        _untranslateSequence(bamR.seq,
+                                             lH.gH.untranslatedQrySeqs[mIt->_n_qId],
+                                             decltype(length(source(mIt->alignRow0)))(0u),
+                                             length(source(mIt->alignRow0)),
+                                             mIt->qFrameShift);
+                }
+            } // else original query is protein and cannot be printed
+
 
             // custom tags
             //TODO untranslate?
@@ -506,17 +574,22 @@ myWriteRecord(TLH & lH, TRecord const & record)
                                int8_t(mIt->sFrameShift), 'c');
             if (lH.options.samBamTags[SamBamExtraTags<>::Q_AA_SEQ])
             {
-                if ((lH.gH.blastProgram == BlastProgram::BLASTN) || (!writeSeq))
+                if ((TGH::blastProgram == BlastProgram::BLASTN) || (!writeSeq))
                     appendTagValue(bamR.tags,
                                    std::get<0>(SamBamExtraTags<>::keyDescPairs[SamBamExtraTags<>::Q_AA_SEQ]),
                                    "*", 'Z');
-                else
+                else if (lH.options.samBamHardClip)
                     appendTagValue(bamR.tags,
                                    std::get<0>(SamBamExtraTags<>::keyDescPairs[SamBamExtraTags<>::Q_AA_SEQ]),
                                    infix(source(mIt->alignRow0),
                                          beginPosition(mIt->alignRow0),
                                          endPosition(mIt->alignRow0)),
                                    'Z');
+                else // full prot sequence
+                    appendTagValue(bamR.tags,
+                                   std::get<0>(SamBamExtraTags<>::keyDescPairs[SamBamExtraTags<>::Q_AA_SEQ]),
+                                   source(mIt->alignRow0),
+                                   'Z');
             }
             if (lH.options.samBamTags[SamBamExtraTags<>::Q_AA_CIGAR])
             {
diff --git a/src/radix_inplace.h b/src/radix_inplace.h
index 2471154..ff75edf 100644
--- a/src/radix_inplace.h
+++ b/src/radix_inplace.h
@@ -49,7 +49,7 @@
 #endif
 //TODO(h-2): for clang use std::experimenta::parallel if available
 
-namespace SEQAN_NAMESPACE_MAIN
+namespace seqan
 {
 
 // ==========================================================================
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 90b4a07..3b6e3cf 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,11 +1,21 @@
+# ===========================================================================
+#  Lambda tests
+# ===========================================================================
 
+cmake_minimum_required (VERSION 3.0.0)
 
-cmake_minimum_required (VERSION 2.8.2)
+enable_testing ()
+include (CTest)
 
-message (STATUS "Configuring tests")
+## only subset of tests
+if (LAMBDA_FASTBUILD)
+    set (PROGS blastp blastx)
+else ()
+    set (PROGS blastn blastp blastx tblastn tblastx)
+endif ()
 
 ## basic indexer tests
-foreach(PROG blastn blastp blastx tblastn tblastx)
+foreach(PROG ${PROGS})
     foreach(DI sa fm)
         add_test (NAME test_mkindex_${PROG}_${DI}
                   COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/maintests.sh
@@ -14,7 +24,7 @@ foreach(PROG blastn blastp blastx tblastn tblastx)
 endforeach()
 
 ## basic search tests
-foreach(PROG blastn blastp blastx tblastn tblastx)
+foreach(PROG ${PROGS})
     foreach(DI sa fm)
         foreach(FF m0 m8 m9 sam bam m9.gz sam.bz2)
             add_test (NAME test_search_${PROG}_${DI}_${FF}
@@ -23,6 +33,3 @@ foreach(PROG blastn blastp blastx tblastn tblastx)
         endforeach()
     endforeach()
 endforeach()
-
-## TODO remove files afterwards, remove folder hierarchy
-## only .fasta.gz and md5sums files are required
\ No newline at end of file
diff --git a/tests/search_test_outfile.md5sums.gz b/tests/search_test_outfile.md5sums.gz
index 47e24de..cbc6ba2 100644
Binary files a/tests/search_test_outfile.md5sums.gz and b/tests/search_test_outfile.md5sums.gz differ

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



More information about the debian-med-commit mailing list