[med-svn] [libbpp-seq-omics] 01/10: Imported Upstream version 2.1.0

Andreas Tille tille at debian.org
Wed Apr 13 14:56:39 UTC 2016


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

tille pushed a commit to branch master
in repository libbpp-seq-omics.

commit 23d8042ba1fa96304e7fb8ce1083023faafb0b03
Author: Andreas Tille <tille at debian.org>
Date:   Wed Apr 13 16:37:34 2016 +0200

    Imported Upstream version 2.1.0
---
 AUTHORS.txt                                        |   11 +
 CMakeLists.txt                                     |  187 ++
 COPYING.txt                                        |  505 ++++++
 ChangeLog                                          |  418 +++++
 Doxyfile                                           | 1889 ++++++++++++++++++++
 INSTALL.txt                                        |   12 +
 bpp-seq-omics.spec                                 |  186 ++
 debian/changelog                                   |   12 +
 debian/compat                                      |    1 +
 debian/control                                     |   25 +
 debian/copyright                                   |   66 +
 debian/libbpp-seq-omics-dev.install                |    3 +
 debian/libbpp-seq-omics1.install                   |    1 +
 debian/postinst                                    |   57 +
 debian/postrm                                      |   59 +
 debian/prerm                                       |   41 +
 debian/rules                                       |  122 ++
 debian/source/format                               |    1 +
 src/Bpp/Seq/Feature/FeatureReader.h                |   77 +
 src/Bpp/Seq/Feature/Gff/GffFeatureReader.cpp       |  152 ++
 src/Bpp/Seq/Feature/Gff/GffFeatureReader.h         |  154 ++
 src/Bpp/Seq/Feature/Gtf/GtfFeatureReader.cpp       |  144 ++
 src/Bpp/Seq/Feature/Gtf/GtfFeatureReader.h         |  121 ++
 src/Bpp/Seq/Feature/SequenceFeature.cpp            |   45 +
 src/Bpp/Seq/Feature/SequenceFeature.h              |  499 ++++++
 src/Bpp/Seq/Feature/SequenceFeatureTools.cpp       |  103 ++
 src/Bpp/Seq/Feature/SequenceFeatureTools.h         |   82 +
 src/Bpp/Seq/Io/Fastq.cpp                           |  111 ++
 src/Bpp/Seq/Io/Fastq.h                             |  138 ++
 src/Bpp/Seq/Io/Maf/AlignmentFilterMafIterator.cpp  |  465 +++++
 src/Bpp/Seq/Io/Maf/AlignmentFilterMafIterator.h    |  167 ++
 src/Bpp/Seq/Io/Maf/BlockLengthMafIterator.h        |   89 +
 src/Bpp/Seq/Io/Maf/BlockMergerMafIterator.cpp      |  168 ++
 src/Bpp/Seq/Io/Maf/BlockMergerMafIterator.h        |  117 ++
 src/Bpp/Seq/Io/Maf/BlockSizeMafIterator.h          |   89 +
 src/Bpp/Seq/Io/Maf/ChromosomeMafIterator.cpp       |   83 +
 src/Bpp/Seq/Io/Maf/ChromosomeMafIterator.h         |   95 +
 src/Bpp/Seq/Io/Maf/ConcatenateMafIterator.cpp      |  127 ++
 src/Bpp/Seq/Io/Maf/ConcatenateMafIterator.h        |   96 +
 src/Bpp/Seq/Io/Maf/DuplicateFilterMafIterator.cpp  |   92 +
 src/Bpp/Seq/Io/Maf/DuplicateFilterMafIterator.h    |   97 +
 src/Bpp/Seq/Io/Maf/EntropyFilterMafIterator.cpp    |  237 +++
 src/Bpp/Seq/Io/Maf/EntropyFilterMafIterator.h      |  107 ++
 src/Bpp/Seq/Io/Maf/FeatureExtractorMafIterator.cpp |  128 ++
 src/Bpp/Seq/Io/Maf/FeatureExtractorMafIterator.h   |  106 ++
 src/Bpp/Seq/Io/Maf/FeatureFilterMafIterator.cpp    |  198 ++
 src/Bpp/Seq/Io/Maf/FeatureFilterMafIterator.h      |  103 ++
 src/Bpp/Seq/Io/Maf/FullGapFilterMafIterator.cpp    |  112 ++
 src/Bpp/Seq/Io/Maf/FullGapFilterMafIterator.h      |   79 +
 src/Bpp/Seq/Io/Maf/IterationListener.cpp           |   75 +
 src/Bpp/Seq/Io/Maf/IterationListener.h             |  130 ++
 src/Bpp/Seq/Io/Maf/MafBlock.h                      |  253 +++
 src/Bpp/Seq/Io/Maf/MafIterator.cpp                 |   68 +
 src/Bpp/Seq/Io/Maf/MafIterator.h                   |  254 +++
 src/Bpp/Seq/Io/Maf/MafParser.cpp                   |  160 ++
 src/Bpp/Seq/Io/Maf/MafParser.h                     |   87 +
 src/Bpp/Seq/Io/Maf/MafSequence.cpp                 |   67 +
 src/Bpp/Seq/Io/Maf/MafSequence.h                   |  191 ++
 src/Bpp/Seq/Io/Maf/MafStatistics.cpp               |  204 +++
 src/Bpp/Seq/Io/Maf/MafStatistics.h                 |  467 +++++
 src/Bpp/Seq/Io/Maf/MaskFilterMafIterator.cpp       |  222 +++
 src/Bpp/Seq/Io/Maf/MaskFilterMafIterator.h         |  100 ++
 .../Seq/Io/Maf/OrphanSequenceFilterMafIterator.cpp |   88 +
 .../Seq/Io/Maf/OrphanSequenceFilterMafIterator.h   |  102 ++
 src/Bpp/Seq/Io/Maf/OutputAlignmentMafIterator.cpp  |   83 +
 src/Bpp/Seq/Io/Maf/OutputAlignmentMafIterator.h    |  138 ++
 src/Bpp/Seq/Io/Maf/OutputMafIterator.cpp           |  130 ++
 src/Bpp/Seq/Io/Maf/OutputMafIterator.h             |  100 ++
 src/Bpp/Seq/Io/Maf/QualityFilterMafIterator.cpp    |  236 +++
 src/Bpp/Seq/Io/Maf/QualityFilterMafIterator.h      |   99 +
 src/Bpp/Seq/Io/Maf/SequenceFilterMafIterator.cpp   |  107 ++
 src/Bpp/Seq/Io/Maf/SequenceFilterMafIterator.h     |  112 ++
 .../Seq/Io/Maf/SequenceStatisticsMafIterator.cpp   |   93 +
 src/Bpp/Seq/Io/Maf/SequenceStatisticsMafIterator.h |  107 ++
 src/Bpp/Seq/Io/Maf/SequenceStreamToMafIterator.cpp |   76 +
 src/Bpp/Seq/Io/Maf/SequenceStreamToMafIterator.h   |   90 +
 src/Bpp/Seq/Io/Maf/VcfOutputMafIterator.cpp        |  121 ++
 src/Bpp/Seq/Io/Maf/VcfOutputMafIterator.h          |  102 ++
 src/Bpp/Seq/Io/Maf/WindowSplitMafIterator.cpp      |  103 ++
 src/Bpp/Seq/Io/Maf/WindowSplitMafIterator.h        |   86 +
 src/CMakeLists.txt                                 |   99 +
 test/CMakeLists.txt                                |   46 +
 test/example.fastq                                 |   12 +
 test/example.gff                                   |   25 +
 test/test_fastq.cpp                                |   75 +
 test/test_gff.cpp                                  |   61 +
 86 files changed, 12546 insertions(+)

diff --git a/AUTHORS.txt b/AUTHORS.txt
new file mode 100644
index 0000000..91ac3f7
--- /dev/null
+++ b/AUTHORS.txt
@@ -0,0 +1,11 @@
+Julien Dutheil <julien.dutheil at univ-montp2.fr>
+Sylvain Gaillard <sylvain.gaillard at angers.inra.fr>
+Vincent Cahais
+
+Contributed code to Bio++ was enabled thanks to the following institutions and resources:
+
+2007 - 2010 Bioinformatics Research Center, University of Aarhus (Julien Dutheil).
+            Funded by European research Area on Plant Genomics (ERA-PG) ARelatives.
+2010 -      ISE-M UMR CNRS 5554 Université Montpellier 2 (Julien Dutheil)
+2010 -      ISE-M UMR CNRS 5554 Université Montpellier 2 (Vincent Cahais)
+2007 -      Genetics and Horticulture UMR INRA 1259 Angers-Nantes INRA Center (Sylvain Gaillard)
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..729e02a
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,187 @@
+# CMake script for Bio++ Sequence-Omics library
+# Author: Sylvain Gaillard and Julien Dutheil
+# Created: 30/07/2012
+
+# Global parameters
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(bpp-seq-omics CXX)
+IF(NOT CMAKE_BUILD_TYPE)
+  SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
+      "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
+      FORCE)
+ENDIF(NOT CMAKE_BUILD_TYPE)
+
+SET(CMAKE_CXX_FLAGS "-Wall -Weffc++ -Wshadow -Wconversion")
+IF(NOT NO_VIRTUAL_COV)
+  SET(NO_VIRTUAL_COV FALSE CACHE BOOL
+      "Disable covariant return type with virtual inheritance, for compilers that do not support it."
+      FORCE)
+ENDIF(NOT NO_VIRTUAL_COV)
+
+IF(NO_VIRTUAL_COV)
+  MESSAGE("-- Covariant return with virtual inheritance disabled.")
+  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNO_VIRTUAL_COV=1")
+ENDIF(NO_VIRTUAL_COV)
+
+IF(NOT NO_DEP_CHECK)
+  SET(NO_DEP_CHECK FALSE CACHE BOOL
+      "Disable dependencies check for building distribution only."
+      FORCE)
+ENDIF(NOT NO_DEP_CHECK)
+
+IF(NO_DEP_CHECK)
+  MESSAGE("-- Dependencies checking disabled. Only distribution can be built.")
+ELSE(NO_DEP_CHECK)
+
+# Libtool-like version number
+# CURRENT:REVISION:AGE => file.so.(C-A).A.R
+# current:  The most recent interface number that this library implements.
+# revision: The implementation number of the current interface.
+# age:      The difference between the newest and oldest interfaces that this
+#           library implements.
+# In other words, the library implements all the interface numbers in the
+# range from number current - age to current.
+SET(BPPSEQOMICS_VERSION_CURRENT "1")
+SET(BPPSEQOMICS_VERSION_REVISION "0")
+SET(BPPSEQOMICS_VERSION_AGE "0")
+
+# Effective version number computation
+math(EXPR BPPSEQOMICS_VERSION_MAJOR "${BPPSEQOMICS_VERSION_CURRENT} - ${BPPSEQOMICS_VERSION_AGE}")
+SET(BPPSEQOMICS_VERSION_MINOR ${BPPSEQOMICS_VERSION_AGE})
+SET(BPPSEQOMICS_VERSION_PATCH ${BPPSEQOMICS_VERSION_REVISION})
+SET(BPPSEQOMICS_VERSION "${BPPSEQOMICS_VERSION_MAJOR}.${BPPSEQOMICS_VERSION_MINOR}.${BPPSEQOMICS_VERSION_PATCH}")
+
+# Set the CMAKE_PREFIX_PATH for the find_library fonction when using non
+# standard install location
+IF(CMAKE_INSTALL_PREFIX)
+  SET(CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}" ${CMAKE_PREFIX_PATH})
+ENDIF(CMAKE_INSTALL_PREFIX)
+
+MACRO(IMPROVED_FIND_LIBRARY OUTPUT_LIBS lib_name include_to_find)
+  #start:
+  FIND_PATH(${lib_name}_INCLUDE_DIR ${include_to_find} )
+  SET(${lib_name}_NAMES ${lib_name} ${lib_name}lib ${lib_name}dll)
+  FIND_LIBRARY(${lib_name}_LIBRARY NAMES ${${lib_name}_NAMES} PATH_SUFFIXES lib${LIB_SUFFIX})
+
+  IF(${lib_name}_LIBRARY)
+    MESSAGE("-- Library ${lib_name} found here:")
+    MESSAGE("   includes : ${${lib_name}_INCLUDE_DIR}")
+    MESSAGE("   libraries: ${${lib_name}_LIBRARY}")
+  ELSE(${lib_name}_LIBRARY)
+    MESSAGE(FATAL_ERROR "${lib_name} required but not found.")
+  ENDIF(${lib_name}_LIBRARY)
+  
+  #add the dependency:
+  INCLUDE_DIRECTORIES(${${lib_name}_INCLUDE_DIR})
+  SET(${OUTPUT_LIBS} ${${OUTPUT_LIBS}} ${${lib_name}_LIBRARY})
+ENDMACRO(IMPROVED_FIND_LIBRARY)
+
+#Find the Bio++ libraries:
+IMPROVED_FIND_LIBRARY(LIBS bpp-core Bpp/Clonable.h)
+IMPROVED_FIND_LIBRARY(LIBS bpp-seq Bpp/Seq/Alphabet/Alphabet.h)
+
+# Subdirectories
+ADD_SUBDIRECTORY(src)
+
+# Doxygen
+FIND_PACKAGE(Doxygen)
+IF (DOXYGEN_FOUND)
+  ADD_CUSTOM_TARGET (apidoc cp Doxyfile ${CMAKE_BINARY_DIR}/Doxyfile-build
+    COMMAND echo "OUTPUT_DIRECTORY=${CMAKE_BINARY_DIR}" >> ${CMAKE_BINARY_DIR}/Doxyfile-build
+    COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile-build
+    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+  ADD_CUSTOM_TARGET (apidoc-stable cp Doxyfile ${CMAKE_BINARY_DIR}/Doxyfile-stable
+    COMMAND echo "OUTPUT_DIRECTORY=${CMAKE_BINARY_DIR}" >> ${CMAKE_BINARY_DIR}/Doxyfile-stable
+    COMMAND echo "HTML_HEADER=header.html" >> ${CMAKE_BINARY_DIR}/Doxyfile-stable
+    COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_BINARY_DIR}/Doxyfile-stable
+    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+ENDIF (DOXYGEN_FOUND)
+
+ENDIF(NO_DEP_CHECK)
+
+# Packager
+SET(CPACK_PACKAGE_NAME "libbpp-seq-omics")
+SET(CPACK_PACKAGE_VENDOR "Bio++ Development Team")
+SET(CPACK_PACKAGE_VERSION "2.1.0")
+SET(CPACK_PACKAGE_VERSION_MAJOR "2")
+SET(CPACK_PACKAGE_VERSION_MINOR "1")
+SET(CPACK_PACKAGE_VERSION_PATCH "0")
+SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Bio++ Sequence-Omics library")
+SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING.txt")
+SET(CPACK_RESOURCE_FILE_AUTHORS "${CMAKE_SOURCE_DIR}/AUTHORS.txt")
+SET(CPACK_RESOURCE_FILE_INSTALL "${CMAKE_SOURCE_DIR}/INSTALL.txt")
+SET(CPACK_SOURCE_GENERATOR "TGZ")
+SET(CPACK_SOURCE_IGNORE_FILES
+ "CMakeFiles"
+ "Makefile"
+ "_CPack_Packages"
+ "CMakeCache.txt"
+ ".*\\\\.cmake"
+ ".*\\\\.git"
+ ".*\\\\.gz"
+ ".*\\\\.deb"
+ ".*\\\\.rpm"
+ ".*\\\\.dmg"
+ ".*\\\\.sh"
+ ".*\\\\..*\\\\.swp"
+ "src/\\\\..*"
+ "src/libbpp*"
+ "debian/tmp"
+ "debian/libbpp.*/"
+ "debian/libbpp.*\\\\.so.*"
+ "debian/libbpp.*\\\\.a"
+ "debian/libbpp.*\\\\.substvars"
+ "debian/libbpp.*\\\\.debhelper"
+ "debian/debhelper\\\\.log"
+ "html"
+ "Seq.tag"
+ "Testing"
+ "build-stamp"
+ "install_manifest.txt"
+ "DartConfiguration.tcl"
+ ${CPACK_SOURCE_IGNORE_FILES}
+)
+IF (MACOS)
+  SET(CPACK_GENERATOR "Bundle")
+ENDIF()
+
+SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+SET(CPACK_DEBSOURCE_PACKAGE_FILE_NAME "lib${CMAKE_PROJECT_NAME}_${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.orig")
+INCLUDE(CPack)
+
+#This adds the 'dist' target
+ADD_CUSTOM_TARGET(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
+# 'clean' is not (yet) a first class target. However, we need to clean the directories before building the sources:
+IF("${CMAKE_GENERATOR}" MATCHES "Make")
+  ADD_CUSTOM_TARGET(make_clean
+  COMMAND ${CMAKE_MAKE_PROGRAM} clean
+  WORKING_DIRECTORY ${CMAKE_CURRENT_DIR}
+  )
+  ADD_DEPENDENCIES(dist make_clean)
+ENDIF()
+
+IF(NOT NO_DEP_CHECK)
+IF (UNIX)
+#This creates deb packages:
+ADD_CUSTOM_TARGET(origdist COMMAND cp ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz ../${CPACK_DEBSOURCE_PACKAGE_FILE_NAME}.tar.gz)
+ADD_DEPENDENCIES(origdist dist)
+ADD_CUSTOM_TARGET(deb dpkg-buildpackage -uc -us -i${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz)
+ADD_DEPENDENCIES(deb origdist)
+
+#This creates rpm packages:
+ADD_CUSTOM_TARGET(rpm rpmbuild -ta ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz)
+ADD_DEPENDENCIES(rpm dist)
+
+ENDIF()
+
+SET(CTEST_UPDATE_TYPE git)
+SET(UPDATE_COMMAND "git")
+SET(UPDATE_OPTIONS "")
+
+ENABLE_TESTING()
+INCLUDE(CTest)
+IF (BUILD_TESTING)
+  ADD_SUBDIRECTORY(test)
+ENDIF(BUILD_TESTING)
+
+ENDIF(NOT NO_DEP_CHECK)
diff --git a/COPYING.txt b/COPYING.txt
new file mode 100644
index 0000000..7e84b53
--- /dev/null
+++ b/COPYING.txt
@@ -0,0 +1,505 @@
+
+               CeCILL FREE SOFTWARE LICENSE AGREEMENT
+
+
+    Notice
+
+This Agreement is a Free Software license agreement that is the result
+of discussions between its authors in order to ensure compliance with
+the two main principles guiding its drafting:
+
+    * firstly, compliance with the principles governing the distribution
+      of Free Software: access to source code, broad rights granted to
+      users,
+    * secondly, the election of a governing law, French law, with which
+      it is conformant, both as regards the law of torts and
+      intellectual property law, and the protection that it offers to
+      both authors and holders of the economic rights over software.
+
+The authors of the CeCILL (for Ce[a] C[nrs] I[nria] L[logiciel] L[ibre])
+license are:
+
+Commissariat à l'Energie Atomique - CEA, a public scientific, technical
+and industrial establishment, having its principal place of business at
+31-33 rue de la Fédération, 75752 Paris cedex 15, France.
+
+Centre National de la Recherche Scientifique - CNRS, a public scientific
+and technological establishment, having its principal place of business
+at 3 rue Michel-Ange 75794 Paris cedex 16, France.
+
+Institut National de Recherche en Informatique et en Automatique -
+INRIA, a public scientific and technological establishment, having its
+principal place of business at Domaine de Voluceau, Rocquencourt, BP
+105, 78153 Le Chesnay cedex, France.
+
+
+    Preamble
+
+The purpose of this Free Software license agreement is to grant users
+the right to modify and redistribute the software governed by this
+license within the framework of an open source distribution model.
+
+The exercising of these rights is conditional upon certain obligations
+for users so as to preserve this status for all subsequent redistributions.
+
+In consideration of access to the source code and the rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty and the software's author, the holder of the
+economic rights, and the successive licensors only have limited liability.
+
+In this respect, the risks associated with loading, using, modifying
+and/or developing or reproducing the software by the user are brought to
+the user's attention, given its Free Software status, which may make it
+complicated to use, with the result that its use is reserved for
+developers and experienced professionals having in-depth computer
+knowledge. Users are therefore encouraged to load and test the
+Software's suitability as regards their requirements in conditions
+enabling the security of their systems and/or data to be ensured and,
+more generally, to use and operate it in the same conditions of
+security. This Agreement may be freely reproduced and published,
+provided it is not altered, and that no provisions are either added or
+removed herefrom.
+
+This Agreement may apply to any or all software for which the holder of
+the economic rights decides to submit the use thereof to its provisions.
+
+
+    Article 1 - DEFINITIONS
+
+For the purpose of this Agreement, when the following expressions
+commence with a capital letter, they shall have the following meaning:
+
+Agreement: means this license agreement, and its possible subsequent
+versions and annexes.
+
+Software: means the software in its Object Code and/or Source Code form
+and, where applicable, its documentation, "as is" when the Licensee
+accepts the Agreement.
+
+Initial Software: means the Software in its Source Code and possibly its
+Object Code form and, where applicable, its documentation, "as is" when
+it is first distributed under the terms and conditions of the Agreement.
+
+Modified Software: means the Software modified by at least one
+Contribution.
+
+Source Code: means all the Software's instructions and program lines to
+which access is required so as to modify the Software.
+
+Object Code: means the binary files originating from the compilation of
+the Source Code.
+
+Holder: means the holder(s) of the economic rights over the Initial
+Software.
+
+Licensee: means the Software user(s) having accepted the Agreement.
+
+Contributor: means a Licensee having made at least one Contribution.
+
+Licensor: means the Holder, or any other individual or legal entity, who
+distributes the Software under the Agreement.
+
+Contribution: means any or all modifications, corrections, translations,
+adaptations and/or new functions integrated into the Software by any or
+all Contributors, as well as any or all Internal Modules.
+
+Module: means a set of sources files including their documentation that
+enables supplementary functions or services in addition to those offered
+by the Software.
+
+External Module: means any or all Modules, not derived from the
+Software, so that this Module and the Software run in separate address
+spaces, with one calling the other when they are run.
+
+Internal Module: means any or all Module, connected to the Software so
+that they both execute in the same address space.
+
+GNU GPL: means the GNU General Public License version 2 or any
+subsequent version, as published by the Free Software Foundation Inc.
+
+Parties: mean both the Licensee and the Licensor.
+
+These expressions may be used both in singular and plural form.
+
+
+    Article 2 - PURPOSE
+
+The purpose of the Agreement is the grant by the Licensor to the
+Licensee of a non-exclusive, transferable and worldwide license for the
+Software as set forth in Article 5 hereinafter for the whole term of the 
+protection granted by the rights over said Software.
+
+
+    Article 3 - ACCEPTANCE
+
+3.1 The Licensee shall be deemed as having accepted the terms and
+conditions of this Agreement upon the occurrence of the first of the
+following events:
+
+    * (i) loading the Software by any or all means, notably, by
+      downloading from a remote server, or by loading from a physical
+      medium;
+    * (ii) the first time the Licensee exercises any of the rights
+      granted hereunder.
+
+3.2 One copy of the Agreement, containing a notice relating to the
+characteristics of the Software, to the limited warranty, and to the
+fact that its use is restricted to experienced users has been provided
+to the Licensee prior to its acceptance as set forth in Article 3.1
+hereinabove, and the Licensee hereby acknowledges that it has read and 
+understood it.
+
+
+    Article 4 - EFFECTIVE DATE AND TERM
+
+
+      4.1 EFFECTIVE DATE
+
+The Agreement shall become effective on the date when it is accepted by
+the Licensee as set forth in Article 3.1.
+
+
+      4.2 TERM
+
+The Agreement shall remain in force for the entire legal term of
+protection of the economic rights over the Software.
+
+
+    Article 5 - SCOPE OF RIGHTS GRANTED
+
+The Licensor hereby grants to the Licensee, who accepts, the following
+rights over the Software for any or all use, and for the term of the
+Agreement, on the basis of the terms and conditions set forth hereinafter.
+
+Besides, if the Licensor owns or comes to own one or more patents
+protecting all or part of the functions of the Software or of its
+components, the Licensor undertakes not to enforce the rights granted by
+these patents against successive Licensees using, exploiting or
+modifying the Software. If these patents are transferred, the Licensor
+undertakes to have the transferees subscribe to the obligations set
+forth in this paragraph.
+
+
+      5.1 RIGHT OF USE
+
+The Licensee is authorized to use the Software, without any limitation
+as to its fields of application, with it being hereinafter specified
+that this comprises:
+
+   1. permanent or temporary reproduction of all or part of the Software
+      by any or all means and in any or all form.
+
+   2. loading, displaying, running, or storing the Software on any or
+      all medium.
+
+   3. entitlement to observe, study or test its operation so as to
+      determine the ideas and principles behind any or all constituent
+      elements of said Software. This shall apply when the Licensee
+      carries out any or all loading, displaying, running, transmission
+      or storage operation as regards the Software, that it is entitled
+      to carry out hereunder.
+
+
+      5.2 ENTITLEMENT TO MAKE CONTRIBUTIONS
+
+The right to make Contributions includes the right to translate, adapt,
+arrange, or make any or all modifications to the Software, and the right
+to reproduce the resulting Software.
+
+The Licensee is authorized to make any or all Contributions to the
+Software provided that it includes an explicit notice that it is the
+author of said Contribution and indicates the date of the creation thereof.
+
+
+      5.3 RIGHT OF DISTRIBUTION
+
+In particular, the right of distribution includes the right to publish,
+transmit and communicate the Software to the general public on any or
+all medium, and by any or all means, and the right to market, either in
+consideration of a fee, or free of charge, one or more copies of the
+Software by any means.
+
+The Licensee is further authorized to distribute copies of the modified
+or unmodified Software to third parties according to the terms and
+conditions set forth hereinafter.
+
+
+        5.3.1 DISTRIBUTION OF SOFTWARE WITHOUT MODIFICATION
+
+The Licensee is authorized to distribute true copies of the Software in
+Source Code or Object Code form, provided that said distribution
+complies with all the provisions of the Agreement and is accompanied by:
+
+   1. a copy of the Agreement,
+
+   2. a notice relating to the limitation of both the Licensor's
+      warranty and liability as set forth in Articles 8 and 9,
+
+and that, in the event that only the Object Code of the Software is
+redistributed, the Licensee allows future Licensees unhindered access to
+the full Source Code of the Software by indicating how to access it, it
+being understood that the additional cost of acquiring the Source Code
+shall not exceed the cost of transferring the data.
+
+
+        5.3.2 DISTRIBUTION OF MODIFIED SOFTWARE
+
+When the Licensee makes a Contribution to the Software, the terms and
+conditions for the distribution of the Modified Software become subject
+to all the provisions of this Agreement.
+
+The Licensee is authorized to distribute the Modified Software, in
+Source Code or Object Code form, provided that said distribution
+complies with all the provisions of the Agreement and is accompanied by:
+
+   1. a copy of the Agreement,
+
+   2. a notice relating to the limitation of both the Licensor's
+      warranty and liability as set forth in Articles 8 and 9,
+
+and that, in the event that only the Object Code of the Modified
+Software is redistributed, the Licensee allows future Licensees
+unhindered access to the full Source Code of the Modified Software by
+indicating how to access it, it being understood that the additional
+cost of acquiring the Source Code shall not exceed the cost of
+transferring the data.
+
+
+        5.3.3 DISTRIBUTION OF EXTERNAL MODULES
+
+When the Licensee has developed an External Module, the terms and
+conditions of this Agreement do not apply to said External Module, that
+may be distributed under a separate license agreement.
+
+
+        5.3.4 COMPATIBILITY WITH THE GNU GPL
+
+The Licensee can include a code that is subject to the provisions of one
+of the versions of the GNU GPL in the Modified or unmodified Software,
+and distribute that entire code under the terms of the same version of
+the GNU GPL.
+
+The Licensee can include the Modified or unmodified Software in a code
+that is subject to the provisions of one of the versions of the GNU GPL,
+and distribute that entire code under the terms of the same version of
+the GNU GPL.
+
+
+    Article 6 - INTELLECTUAL PROPERTY
+
+
+      6.1 OVER THE INITIAL SOFTWARE
+
+The Holder owns the economic rights over the Initial Software. Any or
+all use of the Initial Software is subject to compliance with the terms
+and conditions under which the Holder has elected to distribute its work
+and no one shall be entitled to modify the terms and conditions for the
+distribution of said Initial Software.
+
+The Holder undertakes that the Initial Software will remain ruled at
+least by the current license, for the duration set forth in article 4.2.
+
+
+      6.2 OVER THE CONTRIBUTIONS
+
+A Licensee who develops a Contribution is the owner of the intellectual
+property rights over this Contribution as defined by applicable law.
+
+
+      6.3 OVER THE EXTERNAL MODULES
+
+A Licensee who develops an External Module is the owner of the
+intellectual property rights over this External Module as defined by
+applicable law and is free to choose the type of agreement that shall
+govern its distribution.
+
+
+      6.4 JOINT PROVISIONS
+
+The Licensee expressly undertakes:
+
+   1. not to remove, or modify, in any manner, the intellectual property
+      notices attached to the Software;
+
+   2. to reproduce said notices, in an identical manner, in the copies
+      of the Software modified or not.
+
+The Licensee undertakes not to directly or indirectly infringe the
+intellectual property rights of the Holder and/or Contributors on the
+Software and to take, where applicable, vis-à-vis its staff, any and all
+measures required to ensure respect of said intellectual property rights
+of the Holder and/or Contributors.
+
+
+    Article 7 - RELATED SERVICES
+
+7.1 Under no circumstances shall the Agreement oblige the Licensor to
+provide technical assistance or maintenance services for the Software.
+
+However, the Licensor is entitled to offer this type of services. The
+terms and conditions of such technical assistance, and/or such
+maintenance, shall be set forth in a separate instrument. Only the
+Licensor offering said maintenance and/or technical assistance services
+shall incur liability therefor.
+
+7.2 Similarly, any Licensor is entitled to offer to its licensees, under
+its sole responsibility, a warranty, that shall only be binding upon
+itself, for the redistribution of the Software and/or the Modified
+Software, under terms and conditions that it is free to decide. Said
+warranty, and the financial terms and conditions of its application,
+shall be subject of a separate instrument executed between the Licensor
+and the Licensee.
+
+
+    Article 8 - LIABILITY
+
+8.1 Subject to the provisions of Article 8.2, the Licensee shall be
+entitled to claim compensation for any direct loss it may have suffered
+from the Software as a result of a fault on the part of the relevant
+Licensor, subject to providing evidence thereof.
+
+8.2 The Licensor's liability is limited to the commitments made under
+this Agreement and shall not be incurred as a result of in particular:
+(i) loss due the Licensee's total or partial failure to fulfill its
+obligations, (ii) direct or consequential loss that is suffered by the
+Licensee due to the use or performance of the Software, and (iii) more
+generally, any consequential loss. In particular the Parties expressly
+agree that any or all pecuniary or business loss (i.e. loss of data,
+loss of profits, operating loss, loss of customers or orders,
+opportunity cost, any disturbance to business activities) or any or all
+legal proceedings instituted against the Licensee by a third party,
+shall constitute consequential loss and shall not provide entitlement to
+any or all compensation from the Licensor.
+
+
+    Article 9 - WARRANTY
+
+9.1 The Licensee acknowledges that the scientific and technical
+state-of-the-art when the Software was distributed did not enable all
+possible uses to be tested and verified, nor for the presence of
+possible defects to be detected. In this respect, the Licensee's
+attention has been drawn to the risks associated with loading, using,
+modifying and/or developing and reproducing the Software which are
+reserved for experienced users.
+
+The Licensee shall be responsible for verifying, by any or all means,
+the product's suitability for its requirements, its good working order,
+and for ensuring that it shall not cause damage to either persons or
+properties.
+
+9.2 The Licensor hereby represents, in good faith, that it is entitled
+to grant all the rights over the Software (including in particular the
+rights set forth in Article 5).
+
+9.3 The Licensee acknowledges that the Software is supplied "as is" by
+the Licensor without any other express or tacit warranty, other than
+that provided for in Article 9.2 and, in particular, without any warranty
+as to its commercial value, its secured, safe, innovative or relevant 
+nature.
+
+Specifically, the Licensor does not warrant that the Software is free
+from any error, that it will operate without interruption, that it will
+be compatible with the Licensee's own equipment and software
+configuration, nor that it will meet the Licensee's requirements.
+
+9.4 The Licensor does not either expressly or tacitly warrant that the
+Software does not infringe any third party intellectual property right
+relating to a patent, software or any other property right. Therefore,
+the Licensor disclaims any and all liability towards the Licensee
+arising out of any or all proceedings for infringement that may be
+instituted in respect of the use, modification and redistribution of the
+Software. Nevertheless, should such proceedings be instituted against
+the Licensee, the Licensor shall provide it with technical and legal
+assistance for its defense. Such technical and legal assistance shall be
+decided on a case-by-case basis between the relevant Licensor and the
+Licensee pursuant to a memorandum of understanding. The Licensor
+disclaims any and all liability as regards the Licensee's use of the
+name of the Software. No warranty is given as regards the existence of
+prior rights over the name of the Software or as regards the existence
+of a trademark.
+
+
+    Article 10 - TERMINATION
+
+10.1 In the event of a breach by the Licensee of its obligations
+hereunder, the Licensor may automatically terminate this Agreement
+thirty (30) days after notice has been sent to the Licensee and has
+remained ineffective.
+
+10.2 A Licensee whose Agreement is terminated shall no longer be
+authorized to use, modify or distribute the Software. However, any
+licenses that it may have granted prior to termination of the Agreement
+shall remain valid subject to their having been granted in compliance
+with the terms and conditions hereof.
+
+
+    Article 11 - MISCELLANEOUS
+
+
+      11.1 EXCUSABLE EVENTS
+
+Neither Party shall be liable for any or all delay, or failure to
+perform the Agreement, that may be attributable to an event of force
+majeure, an act of God or an outside cause, such as defective
+functioning or interruptions of the electricity or telecommunications
+networks, network paralysis following a virus attack, intervention by
+government authorities, natural disasters, water damage, earthquakes,
+fire, explosions, strikes and labor unrest, war, etc.
+
+11.2 Any Failure by either Party, on one or more occasions, to invoke
+one or more of the provisions hereof, shall under no circumstances be
+interpreted as being a waiver by the interested Party of its right to
+invoke said provision(s) subsequently.
+
+11.3 The Agreement cancels and replaces any or all previous agreements,
+whether written or oral, between the Parties and having the same
+purpose, and constitutes the entirety of the agreement between said
+Parties concerning said purpose. No supplement or modification to the
+terms and conditions hereof shall be effective as between the Parties
+unless it is made in writing and signed by their duly authorized
+representatives.
+
+11.4 In the event that one or more of the provisions hereof were to
+conflict with a current or future applicable act or legislative text,
+said act or legislative text shall prevail, and the Parties shall make
+the necessary amendments so as to comply with said act or legislative
+text. All other provisions shall remain effective. Similarly, invalidity
+of a provision of the Agreement, for any reason whatsoever, shall not
+cause the Agreement as a whole to be invalid.
+
+
+      11.5 LANGUAGE
+
+The Agreement is drafted in both French and English and both versions
+are deemed authentic.
+
+
+    Article 12 - NEW VERSIONS OF THE AGREEMENT
+
+12.1 Any person is authorized to duplicate and distribute copies of this
+Agreement.
+
+12.2 So as to ensure coherence, the wording of this Agreement is
+protected and may only be modified by the authors of the License, who
+reserve the right to periodically publish updates or new versions of the
+Agreement, each with a separate number. These subsequent versions may
+address new issues encountered by Free Software.
+
+12.3 Any Software distributed under a given version of the Agreement may
+only be subsequently distributed under the same version of the Agreement
+or a subsequent version, subject to the provisions of Article 5.3.4.
+
+
+    Article 13 - GOVERNING LAW AND JURISDICTION
+
+13.1 The Agreement is governed by French law. The Parties agree to
+endeavor to seek an amicable solution to any disagreements or disputes
+that may arise during the performance of the Agreement.
+
+13.2 Failing an amicable solution within two (2) months as from their
+occurrence, and unless emergency proceedings are necessary, the
+disagreements or disputes shall be referred to the Paris Courts having
+jurisdiction, by the more diligent Party.
+
+
+Version 2.0 dated 2005-05-21.
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..240f0aa
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,418 @@
+06/03/13 -*- Version 2.1.0 -*-
+
+05/02/13 Julien Dutheil
+* Added VCF export
+
+21/01/13 Julien Dutheil
+* Compiles with -Wconversion
+
+31/10/12 Julien Dutheil
+* Added SequenceStreamToMafIterator
+
+30/07/12 Julien Dutheil
+* Migrated files from bpp-seq to bpp-seq-omics.
+
+
+*** bpp-seq log copied here for information ***
+
+18/07/12 Julien Dutheil
+* Bug fixed in merge maf iterator, in case a sequence is missing in one of the two blocks.
+
+25/06/12 Julien Dutheil
+* Extended maf tools and reorganization of the code.
+* Extended GFF output.
+* New [] operator in SequenceFeatureSet.
+
+18/06/12 Julien Dutheil
+* Fixed bug in Maf parser: scores are now parsed correctly.
+
+08/03/12 Julien Dutheil
+* Added support for '*' character in proteins (stop codon)
+
+09/02/12 -*- Version 2.0.3 -*-
+
+16/01/12 Julien Dutheil
+* Bug #42 solved, new support for extended fasta parser in application tools.
+* Added contribution from Benoit Nabholz and Annabelle Haudry on 4-fold degenerated sites.
+
+06/01/12 Julien Dutheil
+* Added support for "!" state in nucleic alphabet, which can be either a gap or an unknown character.
+
+24/11/11 Julien Dutheil
+* Added SequenceWalker class and test.
+
+22/11/11 Sylvain Gaillard
+* Added support for FastQ
+
+21/11/11 Julien Dutheil
+* Added support for GFF3.
+
+21/11/11 Sylvain Gaillard
+* Bug #35 solved.
+
+18/11/11 Julien Dutheil
+* New MafIterators: SequenceStatistics and PairwiseSequenceStatistics.
+* Function SequenceTools::getPercentIdentity now allows to exclude gaps.
+
+15/09/11 Julien Dutheil
+* Merge function of SequenceWithAnnotation now also merges annotations properly.
+
+17/06/11 Julien Dutheil
+* Bug #39 solved.
+
+09/06/11 -*- Version 2.0.2 -*-
+
+08/06/11 Julien Dutheil
+* Fixed several Maf iterators.
+
+28/02/11 -*- Version 2.0.1 -*-
+
+* Fixed debian packaging. 
+
+07/02/11 -*- Version 2.0.0 -*-
+
+19/11/10 Julien Dutheil
+* Solved bug 0000016 (General comments not copied in containers).
+* A few more code cleaning.
+
+01/11/10 Julien Dutheil
+* Solved bug 0000005 (Clustal parser).
+* Added unit testing for sequence input format.
+* Solved bug 0000004 (Remove gap sites in SiteContainer).
+
+12/10/10 Benoît Nabholz
+* Added yeast mitochondrial codon alphabet and genetic code.
+
+20/09/10 Julien Dutheil
+* Reorganization of the code for version 2.0.
+
+06/09/10 Julien Dutheil
+* Added support for masked sequences in SequenceWithAnnotationTools and MafParser.
+
+05/09/10 Julien Dutheil
+* First draft of CaseMaskedAlphabet, for dealing with repeat-masked sequences for instance.
+
+21/07/10 Julien Dutheil
+* Added method hasSequence(name) in SequenceContainer interface.
+
+20/07/10 Julien Dutheil
+* New Sequence interface design.
+* Maf parser now reads quality scores if there are some.
+
+19/07/10 Julien Dutheil
+* New method isInit in CodonAlphabet.
+* New method getCDS in SequenceTools.
+
+28/04/10 Julien Dutheil
+* New MAF genome alignment parser.
+
+22/04/10 Sylvain Gaillard
+* Break SequenceTools interface:
+		- renamed invert -> getInvert
+		- renamed complement -> getComplement
+	now invert and complement methods deals with sequence ref
+		- New method invertComplement
+
+16/04/10 Julien Dutheil
+* New Stockholm sequence format (output only).
+* Refactoring of class ISequence2 => IAlignment + new interface OAlignment.
+
+24/03/10 -*- Version 1.7.0 -*-
+
+11/03/10 Julien Dutheil
+* Nexus format now deals with lower case keywords.
+
+17/12/09 Julien Dutheil
+* Code cleaning for VectorSiteContainer
+* New class CompressedVectorSiteContainer using less memory than
+  VectorSiteContainer, but more restricted.
+
+16/11/09 Sylvain Gaillard
+* No more "using namespace" in header files.
+
+04/11/09 Julien Dutheil
+* Remove SymbolListTools::randomizeContent to a more efficient SymbolList::shuffle
+method.
+
+12/10/09 Julien Dutheil
+* Now SeqLib compiles with -Weffc++ and -Wshadow without any warning :)
+
+22/09/09 Julien Dutheil
+* Finally added 'addSequence' method in SequenceContainer.
+* MapSequenceContainer now has a addSequence method that uses the name of the
+  sequence as a key by default.
+* Several methods in Sequence/SiteContainerTools are not templated anymore and
+  have been improved.
+
+09/09/09 Sylvain Gaillard
+* Fixed white space skip in Fasta sequence
+
+20/08/09 Julien Dutheil
+* Added config files for CMake.
+
+19/08/09 Sylvain Gaillard
+* Introduced 3 new interfaces IOSequenceStream, ISequenceStream and
+  OSequenceStream. These interfaces are intended to be used by IOFormat
+  dealing with Sequence and not SequenceContainers. They are actually
+  implemented by the Fasta class.
+
+17/08/09 Adam Smith
+* Bug fixed in DefaultAlphabet: unknow state is 37 not 38.
+
+04/08/09 Sylvain Gaillard
+* Introduced new classes for Alphabet States
+
+23/07/09 Sylvain Gaillard
+* Added SequenceTools::getPutativeHaplotypes
+
+22/07/09 Sylvain Gaillard
+* Added SequenceTools::getNumberOfUnresolvedSites
+* Updated SequenceTools::getNumberOfSites,
+	SequenceTools::getNumberOfCompleteSites and SequenceTools::removeGaps to be
+	Alphabet implementation independant.
+
+07/07/07 Julien Dutheil
+* Updated GranthamAAChemicalDistance, with a new signed, non-symmetric,
+	option.
+
+26/06/09 Sylvain Gaillard
+* Added new SequencePositionIterators classes.
+
+23/06/09 Julien Dutheil
+* Actualization of the Container classes: now returns references and not
+pointer. Several code updates, including copy contructors.
+
+17/06/09 Sylvain Gaillard (Glasgow Workshop)
+* Fix DNA/RNA/ProteicAlphabet::getAlias: works now with lower case states.
+* Fix SiteTools::isConstant test gap or unknown
+* Turning SequenceContainerTools::getFrequencies into void function.
+
+21/07/08 -*- Version 1.6.0 -*-
+
+28/05/09 Julien Dutheil
+* Added basic support for the Nexus format.
+
+22/05/09 Julien Dutheil
+* Improved Clustal format (solves bug found by Emmanuel M.)
+* SequenceApplicationTools uses the keyval syntax for format description.
+
+27/04/09 Julien Dutheil
+* Added site randomization method.
+
+28/02/09 Julien Dutheil
+* Added mutual information calculation.
+* Added pairwise counting methods.
+* Frequencies counting methods have been improved (avoid useless copy of maps).
+
+16/01/09 Julien Dutheil
+* max_gap_allowed option in SequenceApplicationTools is now a included bound:
+  0 or 0% will keep all complete sites, and 'n=number of sequences' or 100%
+	will keep all sites.
+
+13/01/09 Sylvain Gaillard
+* Little optimization in Fasta::write() method.
+
+12/01/09 Sylvain Gaillard
+* Added support for comments (HUPO-PSI like) in Fasta.
+
+08/01/09 Julien Dutheil
+* SequenceTools::reverse method has been deprecated in favor of the
+  SequenceTools::inverse method, of witch it is now an alias.
+
+07/01/09 Julien Dutheil
+* Code improvement in Vector containers.
+
+21/12/08 Julien Dutheil
+* Return type for clone() methods corrected (Sequence, Site, SiteContainer and derivated classes).
+* Bug fixed in SequenceApplicationTools::get[Sequence/Site]Container, phylip format.
+
+21/07/08 -*- Version 1.5.0 -*-
+
+05/12/08 Julien Dutheil
+* VectorSiteContainer::getSite() faster (more than 10 times faster on a ~500
+	sequences data set!)
+
+04/12/08 Julien Dutheil
+* Fixed missing redefinition of translate and reverse methods in class DNAToRNA.
+* Made inheritance virtual.
+
+01/12/08 Julien Dutheil
+* New methods getSupportedInts and getSupportedChars in Alphabet classes.
+
+18/11/08 Julien Dutheil
+* biopp-help-forum 91 (by Stephen Smith): Fasta, Mase, Clustal and Phylip now
+  have an option to turn off the name checking and decrease loading time.
+* biopp-help-forum 93 (by Stephen Smith): Phylip format now supports any
+ delimiter when reading/writing files in extended format.
+
+14/11/08 Sylvain Gaillard
+* New method SequenceTools::subtractHaplotype(Sequence, Sequence, string,
+  unsigned int).
+
+07/11/08 Julien Dutheil
+* New contructor in VectorSiteContainer now as a tag to disable position
+  checking, which can turn to be quite slow.
+
+06/11/08 Sylvain Gaillard
+* New class PhredPhd to read sequence from phd files produced by the phred
+  program
+* Removed an unused method in PhredPoly
+
+05/11/08 Sylvain Gaillard
+* New methods Alphabet::getGeneric(states) implemented in AbstractAlphabet,
+  DefaultAlphabet, DNA, RNA and ProteicAlphabet.
+* New alphabet exception CharStateNotSupportedException.
+* New class PhredPoly to read sequence from poly files produced by the phred
+  program.
+* Fixed heterozygous site read in PhredPoly.
+
+09/10/08 Julien Dutheil
+* New method SequenceTools::invert(Sequence).
+
+24/09/08 Bastien Boussau & Julien Dutheil
+* Memory leak fixed in Fasta and Mase readers.
+
+21/07/08 -*- Version 1.4.1 -*-
+
+26/06/08 Julien Dutheil
+* Bug fixed in Clustal format.
+
+20/04/08 Julien Dutheil
+* New interface ISequence2 for reading alignments.
+
+18/03/08 Julien Dutheil and Bastien Boussau
+* Bowker's test for homogeneity implemented in SequenceTools.
+
+08/02/08 Julien Dutheil
+* Bug fixed in VectorSequenceContainer: method addSequence is now virtual!
+  (thanks to Laurent Gueguen for pointing out this bug)!.
+
+07/02/08 Julien Dutheil
+* Added function isDNAAlphabet and isRNAAlphabet in AlphabetTools.
+* Bug fixed in getAlphabetFromSequence method.
+* Method getContent in Sequence and Site now outputs a reference.
+
+18/01/08 -*- Version 1.4.0 -*-
+
+09/01/08 Julien Dutheil
+* All classes included in the new 'bpp' namespace.
+
+06/11/07 Julien Dutheil
+* New function SequenceContainerTools::merge.
+
+02/10/07 Julien Dutheil
+* New class GenBank, enabling GenBank sequence format support for input.
+* Added new copy constructors from SequenceContainer in
+  Vector[Site/Sequence]Container.
+* New methods changeUnresolvedCharacterToGaps and changeGapsToUnknownCharacters in SymbolListTools.
+* Bug fixed in changeUnresolvedCharacterToGaps in SiteContainerTools.
+
+06/07/07 -*- Version 1.3.0 -*-
+
+12/06/07 Julien Dutheil
+* More tools in class alphabet (isGap, isUnresolved, etc.)
+* New class DistanceMatrix, previously in phyllib.
+* New similarity measures in SiteContainerTools.
+
+04/06/07 Julien Dutheil
+* New constructor from sequence names in VectorSiteContainer.
+
+01/06/07 Julien Dutheil
+* New method SiteContainerTools::boostrapSites to bootstrap an alignment.
+
+21/05/07 Julien Dutheil
+* New method SequenceContainerTools::getSequenceContainer to read non-aligned
+  sequences.
+
+04/05/07 Julien Dutheil
+* Bug fixed in global alignment with gap opening and extending penalties.
+* New generic score scheme.
+* Compatibility update (NumCalc)
+
+24/04/07 Benoît Nabholz & Julien Dutheil
+* GeneticCode classes can now translate unknow codons to unknown amino acids.
+
+02/04/07 Julien Dutheil
+* VIRTUAL_COV variable changed to NO_VIRTUAL_COV. configure.ac file updated.
+  => Default behaviour is now /really/ to use covariant return type with
+	virtual inheritence, even when importing the files in an IDE. To use the old
+	compilers behaviour, one must set the NO_VIRTUAL_COV preproc variable.
+* this modification also solves a problem with the old configure.ac which
+  was not correctly updated in version 1.2.0 :(
+* Bug fixed in SymbolListTools::getCounts.
+
+02/04/07 Julien Dutheil
+* New method getAlphabetIndex1() in class SimpleIndexDistance.
+
+24/02/07 Julien Dutheil
+* New pairwise alignment algorithm: gap opening and extending penalties.
+	
+22/02/07 Julien Dutheil
+* GeneticCode derivated classes now properly redefine the translate(Sequence&)
+	method.
+
+19/01/07 -*- Version 1.2.0 -*-
+
+19/01/07 Julien Dutheil
+* Functions AlphabetTools::getType() and StringSequenceTools::getAlphabetFromSequence() rewritten.
+* New DefaultNucleotideScore matrix.
+* New AAIndex1Entry and AAIndex2Entry classes which create AlphabetIndex1 and
+AlphabetIndex2 objects from AAIndex1 and AAIndex2 entries, respectively.
+
+18/12/06 Julien Dutheil
+* New alignment tools in SiteContainerTools, including the Needleman and
+Wunsch alogrithm.
+* BLOSUM50 matrix available.
+* Bug fixed in Sequence.h: method setContent is now properly redefined.
+* Bug fixed in ProteicAlphabet->getAbbr(int). The returned result is now
+correct!!!
+
+06/12/06 Julien Dutheil
+* DefaultAlphabet now accepts "." characters.
+* New AlphabetTools::isDefaultAlphabet(const Alphabet *) method.
+* New SiteContainerTools::resolveDottedAlignment(const Sitecontainer &, const Alphabet *) method.
+
+30/08/06 Julien Dutheil
+* Bug fixed in phylip sequential reader, + duplicated sequence in container
+now throws sequence name. (included in 1.1.1 release).
+
+28/08/06 -*- Version 1.1.1 -*-
+
+08/08/06 Julien Dutheil
+* Bug fixed in Phylip sequential read method.
+
+15/06/06 Julien Dutheil
+* Method changeGapsToUnknownCharacters() moved from SequenceContainerTools to
+SiteContainerTools, and is really faster!
+* New removeGapOnlySites() method in SiteContainerTools.
+* New method SiteTools::isGapOnly().
+* new 'sequence.max_gap_allowed' option in SequenceApplicationTools::getSitesToAnalyse().
+
+13/06/06 Julien Dutheil
+* Phylip sequential format improved, no more empty line between sequences
+needed.
+
+12/06/06 Julien Dutheil
+* SiteTools::isConstant() method now has a 'ignoreUnknown' option.
+
+01/01/06 Julien Dutheil
+* VectorSiteContainer and AlignedSequenceContainer now number sites from 1 (and not 0). 
+
+17/05/06 Benoît Nabholz, Sylvain Glémin & Julien Dutheil
+* Bug fixed in SiteContainerTools::getConsensus(), + SymbolListTools::getFrequencies() and getCounts() improved.
+
+15/05/06 Julien Dutheil
+* Bug fixed: Added getUnknownCharacterCode() method in DefaultAlphabet.
+
+09/05/06 Julien Dutheil
+* New AAChargeIndex class.
+* Bug fixed in SiteTools::hasUnknown(Site).
+
+18/04/06 -*- Version 1.1.0 -*-
+
+18/04/06 Julien Dutheil
+* New IOSequenceFactory class.
+
+06/04/06 Julien Dutheil
+* New () function operators defined on SequenceContainers.
+
diff --git a/Doxyfile b/Doxyfile
new file mode 100644
index 0000000..f28d234
--- /dev/null
+++ b/Doxyfile
@@ -0,0 +1,1889 @@
+# Doxyfile 1.8.3.1-20130209
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file 
+# that follow. The default is UTF-8 which is also the encoding used for all 
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the 
+# iconv built into libc) for the transcoding. See 
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or sequence of words) that should 
+# identify the project. Note that if you do not use Doxywizard you need 
+# to put quotes around the project name if it contains spaces.
+
+PROJECT_NAME           = bpp-seq-omics
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+
+PROJECT_NUMBER         = 2.1.0
+
+# Using the PROJECT_BRIEF tag one can provide an optional one line description 
+# for a project that appears at the top of each page and should give viewer 
+# a quick idea about the purpose of the project. Keep the description short.
+
+PROJECT_BRIEF          = 
+
+# With the PROJECT_LOGO tag one can specify an logo or icon that is 
+# included in the documentation. The maximum height of the logo should not 
+# exceed 55 pixels and the maximum width should not exceed 200 pixels. 
+# Doxygen will copy the logo to the output directory.
+
+PROJECT_LOGO           = 
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       = 
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of 
+# source files, where putting all generated files in the same directory would 
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, 
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English 
+# messages), Korean, Korean-en, Latvian, Lithuanian, Norwegian, Macedonian, Persian, 
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, 
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is 
+# used as the annotated text. Otherwise, the brief description is used as-is. 
+# If left blank, the following values are used ("$name" is automatically 
+# replaced with the name of the entity): "The $name class" "The $name widget" 
+# "The $name file" "is" "provides" "specifies" "contains" 
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       = 
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
+# inherited members of a class in the documentation of that class as if those 
+# members were ordinary class members. Constructors, destructors and assignment 
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip. Note that you specify absolute paths here, but also 
+# relative paths, which will be relative from the directory where doxygen is 
+# started.
+
+STRIP_FROM_PATH        = ./src/
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    = ./src/
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful if your file system 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like regular Qt-style comments 
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will 
+# interpret the first line (until the first dot) of a Qt-style 
+# comment as the brief description. If set to NO, the comments 
+# will behave just like regular Qt-style comments (thus requiring 
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
+# a new page for each member. If set to NO, the documentation of a member will 
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 2
+
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                = 
+
+# This tag can be used to specify a number of word-keyword mappings (TCL only). 
+# A mapping has the form "name=value". For example adding 
+# "class=itcl::class" will allow you to use the command class in the 
+# itcl::class meaning.
+
+TCL_SUBST              = 
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
+# sources only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
+# sources only. Doxygen will then generate output that is more tailored for 
+# Java. For instance, namespaces will be presented as packages, qualified 
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran 
+# sources only. Doxygen will then generate output that is more tailored for 
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL 
+# sources. Doxygen will then generate output that is tailored for 
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it 
+# parses. With this tag you can assign which parser to use for a given 
+# extension. Doxygen has a built-in mapping, but you can override or extend it 
+# using this tag. The format is ext=language, where ext is a file extension, 
+# and language is one of the parsers supported by doxygen: IDL, Java, 
+# Javascript, CSharp, C, C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, 
+# C++. For instance to make doxygen treat .inc files as Fortran files (default 
+# is PHP), and .f files as C (default is Fortran), use: inc=Fortran f=C. Note 
+# that for custom extensions you also need to set FILE_PATTERNS otherwise the 
+# files are not read by doxygen.
+
+EXTENSION_MAPPING      = 
+
+# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all 
+# comments according to the Markdown format, which allows for more readable 
+# documentation. See http://daringfireball.net/projects/markdown/ for details. 
+# The output of markdown processing is further processed by doxygen, so you 
+# can mix doxygen, HTML, and XML commands with Markdown formatting. 
+# Disable only in case of backward compatibilities issues.
+
+MARKDOWN_SUPPORT       = YES
+
+# When enabled doxygen tries to link words that correspond to documented classes, 
+# or namespaces to their corresponding documentation. Such a link can be 
+# prevented in individual cases by by putting a % sign in front of the word or 
+# globally by setting AUTOLINK_SUPPORT to NO.
+
+AUTOLINK_SUPPORT       = YES
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want 
+# to include (a tag file for) the STL sources as input, then you should 
+# set this tag to YES in order to let doxygen match functions declarations and 
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
+# func(std::string) {}). This also makes the inheritance and collaboration 
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = YES
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to 
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. 
+# Doxygen will parse them like normal C++ but will assume all classes use public 
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate 
+# getter and setter methods for a property. Setting this option to YES (the 
+# default) will make doxygen replace the get and set methods by a property in 
+# the documentation. This will only work if the methods are indeed getting or 
+# setting a simple type. If this is not the case, or you want to show the 
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and 
+# unions are shown inside the group in which they are included (e.g. using 
+# @ingroup) instead of on a separate page (for HTML and Man pages) or 
+# section (for LaTeX and RTF).
+
+INLINE_GROUPED_CLASSES = NO
+
+# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and 
+# unions with only public data fields or simple typedef fields will be shown 
+# inline in the documentation of the scope in which they are defined (i.e. file, 
+# namespace, or group documentation), provided this scope is documented. If set 
+# to NO (the default), structs, classes, and unions are shown on a separate 
+# page (for HTML and Man pages) or section (for LaTeX and RTF).
+
+INLINE_SIMPLE_STRUCTS  = NO
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum 
+# is documented as struct, union, or enum with the name of the typedef. So 
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct 
+# with name TypeT. When disabled the typedef will appear as a member of a file, 
+# namespace, or class. And the struct will be named TypeS. This can typically 
+# be useful for C code in case the coding convention dictates that all compound 
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to 
+# determine which symbols to keep in memory and which to flush to disk. 
+# When the cache is full, less often used symbols will be written to disk. 
+# For small to medium size projects (<1000 input files) the default value is 
+# probably good enough. For larger projects a too small cache size can cause 
+# doxygen to be busy swapping symbols to and from disk most of the time 
+# causing a significant performance penalty. 
+# If the system has enough physical memory increasing the cache will improve the 
+# performance by keeping more symbols in memory. Note that the value works on 
+# a logarithmic scale so increasing the size by one will roughly double the 
+# memory usage. The cache size is given by this formula: 
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, 
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+SYMBOL_CACHE_SIZE      = 0
+
+# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be 
+# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given 
+# their name and scope. Since this can be an expensive process and often the 
+# same symbol appear multiple times in the code, doxygen keeps a cache of 
+# pre-resolved symbols. If the cache is too small doxygen will become slower. 
+# If the cache is too large, memory is wasted. The cache size is given by this 
+# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, 
+# corresponding to a cache size of 2^16 = 65536 symbols.
+
+LOOKUP_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = YES
+
+# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal 
+# scope will be included in the documentation.
+
+EXTRACT_PACKAGE        = NO
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+
+EXTRACT_STATIC         = YES
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be 
+# extracted and appear in the documentation as a namespace called 
+# 'anonymous_namespace{file}', where file will be replaced with the base 
+# name of the file that contains the anonymous namespace. By default 
+# anonymous namespaces are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = YES
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen 
+# will list include files with double quotes in the documentation 
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen 
+# will sort the (brief and detailed) documentation of class members so that 
+# constructors and destructors are listed first. If set to NO (the default) 
+# the constructors will appear in the respective orders defined by 
+# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. 
+# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO 
+# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the 
+# hierarchy of group names into alphabetical order. If set to NO (the default) 
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. 
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to 
+# do proper type resolution of all parameters of a function it will reject a 
+# match between the prototype and the implementation of a member function even 
+# if there is only one candidate or it is obvious which candidate to choose 
+# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen 
+# will still accept a match between prototype and implementation in such cases.
+
+STRICT_PROTO_MATCHING  = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+
+GENERATE_TESTLIST      = NO
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+
+GENERATE_BUGLIST       = NO
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if section-label ... \endif 
+# and \cond section-label ... \endcond blocks.
+
+ENABLED_SECTIONS       = 
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or macro consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and macros in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page. 
+# This will remove the Files entry from the Quick Index and from the 
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the 
+# Namespaces page.  This will remove the Namespaces entry from the Quick Index 
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
+# doxygen should invoke to get the current version for each file (typically from 
+# the version control system). Doxygen will invoke the program by executing (via 
+# popen()) the command <command> <input-file>, where <command> is the value of 
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
+# provided by doxygen. Whatever the program writes to standard output 
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    = 
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed 
+# by doxygen. The layout file controls the global structure of the generated 
+# output files in an output format independent way. To create the layout file 
+# that represents doxygen's defaults, run doxygen with the -l option. 
+# You can optionally specify a file name after the option, if omitted 
+# DoxygenLayout.xml will be used as the name of the layout file.
+
+LAYOUT_FILE            = 
+
+# The CITE_BIB_FILES tag can be used to specify one or more bib files 
+# containing the references data. This must be a list of .bib files. The 
+# .bib extension is automatically appended if omitted. Using this command 
+# requires the bibtex tool to be installed. See also 
+# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style 
+# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this 
+# feature you need bibtex and perl available in the search path. Do not use 
+# file names with spaces, bibtex cannot handle them.
+
+CITE_BIB_FILES         = 
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# The WARN_NO_PARAMDOC option can be enabled to get warnings for 
+# functions that are documented, but have no documentation for their parameters 
+# or return value. If set to NO (the default) doxygen will only warn about 
+# wrong or incomplete parameter documentation, but not about the absence of 
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text. Optionally the format may contain 
+# $version, which will be replaced by the version of the file (if it could 
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+
+WARN_LOGFILE           = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+
+INPUT                  = src
+
+# This tag can be used to specify the character encoding of the source files 
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is 
+# also the default input encoding. Doxygen uses libiconv (or the iconv built 
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for 
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh 
+# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py 
+# *.f90 *.f *.for *.vhd *.vhdl
+
+FILE_PATTERNS          = *.h \
+                         *.cpp
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+
+RECURSIVE              = YES
+
+# The EXCLUDE tag can be used to specify files and/or directories that should be 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag. 
+# Note that relative paths are relative to the directory from which doxygen is 
+# run.
+
+EXCLUDE                = 
+
+# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or 
+# directories that are symbolic links (a Unix file system feature) are excluded 
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories. Note that the wildcards are matched 
+# against the file with absolute path, so to exclude all test directories 
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       = 
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 
+# (namespaces, classes, functions, etc.) that should be excluded from the 
+# output. The symbol name can be a fully qualified name, a word, or if the 
+# wildcard * is used, a substring. Examples: ANamespace, AClass, 
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        = 
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+
+EXAMPLE_PATH           = 
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+
+EXAMPLE_PATTERNS       = 
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+
+IMAGE_PATH             = 
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# ignored.
+
+INPUT_FILTER           = 
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis.  Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match.  The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty or if 
+# non of the patterns match the file name, INPUT_FILTER is applied.
+
+FILTER_PATTERNS        = 
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file 
+# pattern. A pattern will override the setting for FILTER_PATTERN (if any) 
+# and it is also possible to disable source filtering for a specific pattern 
+# using *.ext= (so without naming a filter). This option only has effect when 
+# FILTER_SOURCE_FILES is enabled.
+
+FILTER_SOURCE_PATTERNS = 
+
+# If the USE_MD_FILE_AS_MAINPAGE tag refers to the name of a markdown file that 
+# is part of the input, its contents will be placed on the main page (index.html). 
+# This can be useful if you have a project on for instance GitHub and want reuse 
+# the introduction page also for the doxygen output.
+
+USE_MDFILE_AS_MAINPAGE = 
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = YES
+
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C, C++ and Fortran comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = YES
+
+# If the REFERENCES_RELATION tag is set to YES 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = YES
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) 
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from 
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will 
+# link to the source code.  Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code 
+# will point to the HTML generated by the htags(1) tool instead of doxygen 
+# built-in source browser. The htags tool is part of GNU's global source 
+# tagging system (see http://www.gnu.org/software/global/global.html). You 
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header. Note that when using a custom header you are responsible  
+# for the proper inclusion of any scripts and style sheets that doxygen 
+# needs, which is dependent on the configuration options used. 
+# It is advised to generate a default header using "doxygen -w html 
+# header.html footer.html stylesheet.css YourConfigFile" and then modify 
+# that header. Note that the header is subject to change so you typically 
+# have to redo this when upgrading to a newer version of doxygen or when 
+# changing the value of configuration settings such as GENERATE_TREEVIEW!
+
+HTML_HEADER            = 
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+
+HTML_FOOTER            = 
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If left blank doxygen will 
+# generate a default style sheet. Note that it is recommended to use 
+# HTML_EXTRA_STYLESHEET instead of this one, as it is more robust and this 
+# tag will in the future become obsolete.
+
+HTML_STYLESHEET        = 
+
+# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional 
+# user-defined cascading style sheet that is included after the standard 
+# style sheets created by doxygen. Using this option one can overrule 
+# certain style aspects. This is preferred over using HTML_STYLESHEET 
+# since it does not replace the standard style sheet and is therefor more 
+# robust against future updates. Doxygen will copy the style sheet file to 
+# the output directory.
+
+HTML_EXTRA_STYLESHEET  = 
+
+# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or 
+# other source files which should be copied to the HTML output directory. Note 
+# that these files will be copied to the base HTML output directory. Use the 
+# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these 
+# files. In the HTML_STYLESHEET file, use the file name only. Also note that 
+# the files will be copied as-is; there are no commands or markers available.
+
+HTML_EXTRA_FILES       = 
+
+# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. 
+# Doxygen will adjust the colors in the style sheet and background images 
+# according to this color. Hue is specified as an angle on a colorwheel, 
+# see http://en.wikipedia.org/wiki/Hue for more information. 
+# For instance the value 0 represents red, 60 is yellow, 120 is green, 
+# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. 
+# The allowed range is 0 to 359.
+
+HTML_COLORSTYLE_HUE    = 220
+
+# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of 
+# the colors in the HTML output. For a value of 0 the output will use 
+# grayscales only. A value of 255 will produce the most vivid colors.
+
+HTML_COLORSTYLE_SAT    = 100
+
+# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to 
+# the luminance component of the colors in the HTML output. Values below 
+# 100 gradually make the output lighter, whereas values above 100 make 
+# the output darker. The value divided by 100 is the actual gamma applied, 
+# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, 
+# and 100 does not change the gamma.
+
+HTML_COLORSTYLE_GAMMA  = 80
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML 
+# page will contain the date and time when the page was generated. Setting 
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 
+# documentation will contain sections that can be hidden and shown after the 
+# page has loaded.
+
+HTML_DYNAMIC_SECTIONS  = YES
+
+# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of 
+# entries shown in the various tree structured indices initially; the user 
+# can expand and collapse entries dynamically later on. Doxygen will expand 
+# the tree to such a level that at most the specified number of entries are 
+# visible (unless a fully collapsed tree already exceeds this amount). 
+# So setting the number of entries 1 will produce a full collapsed tree by 
+# default. 0 is a special value representing an infinite number of entries 
+# and will result in a full expanded tree by default.
+
+HTML_INDEX_NUM_ENTRIES = 100
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files 
+# will be generated that can be used as input for Apple's Xcode 3 
+# integrated development environment, introduced with OSX 10.5 (Leopard). 
+# To create a documentation set, doxygen will generate a Makefile in the 
+# HTML output directory. Running make will produce the docset in that 
+# directory and running "make install" will install the docset in 
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find 
+# it at startup. 
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html 
+# for more information.
+
+GENERATE_DOCSET        = YES
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the 
+# feed. A documentation feed provides an umbrella under which multiple 
+# documentation sets from a single provider (such as a company or product suite) 
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Bio++ Sequence Library - Omics components"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that 
+# should uniquely identify the documentation set bundle. This should be a 
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen 
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = bpp.seq.omics
+
+# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely 
+# identify the documentation publisher. This should be a reverse domain-name 
+# style string, e.g. com.mycompany.MyDocSet.documentation.
+
+DOCSET_PUBLISHER_ID    = org.doxygen.Publisher
+
+# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
+
+DOCSET_PUBLISHER_NAME  = Publisher
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) 
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+
+CHM_FILE               = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING 
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file 
+# content.
+
+CHM_INDEX_ENCODING     = 
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and 
+# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated 
+# that can be used as input for Qt's qhelpgenerator to generate a 
+# Qt Compressed Help (.qch) of the generated HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can 
+# be used to specify the file name of the resulting .qch file. 
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               = 
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating 
+# Qt Help Project output. For more information please see 
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating 
+# Qt Help Project output. For more information please see 
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to 
+# add. For more information please see 
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   = 
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the 
+# custom filter to add. For more information please see 
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters"> 
+# Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  = 
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this 
+# project's 
+# filter section matches. 
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes"> 
+# Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  = 
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can 
+# be used to specify the location of Qt's qhelpgenerator. 
+# If non-empty doxygen will try to run qhelpgenerator on the generated 
+# .qhp file.
+
+QHG_LOCATION           = 
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files  
+# will be generated, which together with the HTML files, form an Eclipse help 
+# plugin. To install this plugin and make it available under the help contents 
+# menu in Eclipse, the contents of the directory containing the HTML and XML 
+# files needs to be copied into the plugins directory of eclipse. The name of 
+# the directory within the plugins directory should be the same as 
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before 
+# the help appears.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin 
+# the directory name containing the HTML and XML files should also have 
+# this name.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) 
+# at top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it. Since the tabs have the same information as the 
+# navigation tree you can set this option to NO if you already set 
+# GENERATE_TREEVIEW to YES.
+
+DISABLE_INDEX          = NO
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index 
+# structure should be generated to display hierarchical information. 
+# If the tag value is set to YES, a side panel will be generated 
+# containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). 
+# Windows users are probably better off using the HTML help feature. 
+# Since the tree basically has the same information as the tab index you 
+# could consider to set DISABLE_INDEX to NO when enabling this option.
+
+GENERATE_TREEVIEW      = YES
+
+# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values 
+# (range [0,1..20]) that doxygen will group on one line in the generated HTML 
+# documentation. Note that a value of 0 will completely suppress the enum 
+# values from appearing in the overview section.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open 
+# links to external symbols imported via tag files in a separate window.
+
+EXT_LINKS_IN_WINDOW    = NO
+
+# Use this tag to change the font size of Latex formulas included 
+# as images in the HTML documentation. The default is 10. Note that 
+# when you change the font size after a successful doxygen run you need 
+# to manually remove any form_*.png images from the HTML output directory 
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+# Use the FORMULA_TRANPARENT tag to determine whether or not the images 
+# generated for formulas are transparent PNGs. Transparent PNGs are 
+# not supported properly for IE 6.0, but are supported on all modern browsers. 
+# Note that when changing this option you need to delete any form_*.png files 
+# in the HTML output before the changes have effect.
+
+FORMULA_TRANSPARENT    = YES
+
+# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax 
+# (see http://www.mathjax.org) which uses client side Javascript for the 
+# rendering instead of using prerendered bitmaps. Use this if you do not 
+# have LaTeX installed or if you want to formulas look prettier in the HTML 
+# output. When enabled you may also need to install MathJax separately and 
+# configure the path to it using the MATHJAX_RELPATH option.
+
+USE_MATHJAX            = NO
+
+# When MathJax is enabled you can set the default output format to be used for 
+# thA MathJax output. Supported types are HTML-CSS, NativeMML (i.e. MathML) and 
+# SVG. The default value is HTML-CSS, which is slower, but has the best 
+# compatibility.
+
+MATHJAX_FORMAT         = HTML-CSS
+
+# When MathJax is enabled you need to specify the location relative to the 
+# HTML output directory using the MATHJAX_RELPATH option. The destination 
+# directory should contain the MathJax.js script. For instance, if the mathjax 
+# directory is located at the same level as the HTML output directory, then 
+# MATHJAX_RELPATH should be ../mathjax. The default value points to 
+# the MathJax Content Delivery Network so you can quickly see the result without 
+# installing MathJax.  However, it is strongly recommended to install a local 
+# copy of MathJax from http://www.mathjax.org before deployment.
+
+MATHJAX_RELPATH        = http://cdn.mathjax.org/mathjax/latest
+
+# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension 
+# names that should be enabled during MathJax rendering.
+
+MATHJAX_EXTENSIONS     = 
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box 
+# for the HTML output. The underlying search engine uses javascript 
+# and DHTML and should work on any modern browser. Note that when using 
+# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets 
+# (GENERATE_DOCSET) there is already a search function so this one should 
+# typically be disabled. For large projects the javascript based search engine 
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be 
+# implemented using a web server instead of a web client using Javascript. 
+# There are two flavours of web server based search depending on the 
+# EXTERNAL_SEARCH setting. When disabled, doxygen will generate a PHP script for 
+# searching and an index file used by the script. When EXTERNAL_SEARCH is 
+# enabled the indexing and searching needs to be provided by external tools. 
+# See the manual for details.
+
+SERVER_BASED_SEARCH    = NO
+
+# When EXTERNAL_SEARCH is enabled doxygen will no longer generate the PHP 
+# script for searching. Instead the search results are written to an XML file 
+# which needs to be processed by an external indexer. Doxygen will invoke an 
+# external search engine pointed to by the SEARCHENGINE_URL option to obtain 
+# the search results. Doxygen ships with an example indexer (doxyindexer) and 
+# search engine (doxysearch.cgi) which are based on the open source search engine 
+# library Xapian. See the manual for configuration details.
+
+EXTERNAL_SEARCH        = NO
+
+# The SEARCHENGINE_URL should point to a search engine hosted by a web server 
+# which will returned the search results when EXTERNAL_SEARCH is enabled. 
+# Doxygen ships with an example search engine (doxysearch) which is based on 
+# the open source search engine library Xapian. See the manual for configuration 
+# details.
+
+SEARCHENGINE_URL       = 
+
+# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed 
+# search data is written to a file for indexing by an external tool. With the 
+# SEARCHDATA_FILE tag the name of this file can be specified.
+
+SEARCHDATA_FILE        = searchdata.xml
+
+# When SERVER_BASED_SEARCH AND EXTERNAL_SEARCH are both enabled the 
+# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is 
+# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple 
+# projects and redirect the results back to the right project.
+
+EXTERNAL_SEARCH_ID     = 
+
+# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen 
+# projects other than the one defined by this configuration file, but that are 
+# all added to the same external search index. Each project needs to have a 
+# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id 
+# of to a relative location where the documentation can be found. 
+# The format is: EXTRA_SEARCH_MAPPINGS = id1=loc1 id2=loc2 ...
+
+EXTRA_SEARCH_MAPPINGS  = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name. 
+# Note that when enabling USE_PDFLATEX this option is only used for 
+# generating bitmaps for formulas in the HTML output, but not in the 
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, letter, legal and 
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         = amsmath
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           = 
+
+# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for 
+# the generated latex document. The footer should contain everything after 
+# the last chapter. If it is left blank doxygen will generate a 
+# standard footer. Notice: only use this tag if you know what you are doing!
+
+LATEX_FOOTER           = 
+
+# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images 
+# or other source files which should be copied to the LaTeX output directory. 
+# Note that the files will be copied as-is; there are no commands or markers 
+# available.
+
+LATEX_EXTRA_FILES      = 
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = NO
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include 
+# source code with syntax highlighting in the LaTeX output. 
+# Note that which sources are shown also depends on other settings 
+# such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE      = NO
+
+# The LATEX_BIB_STYLE tag can be used to specify the style to use for the 
+# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See 
+# http://en.wikipedia.org/wiki/BibTeX for more info.
+
+LATEX_BIB_STYLE        = plain
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load style sheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    = 
+
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    = 
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_SCHEMA             = 
+
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+
+XML_DTD                = 
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the DOCBOOK output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_DOCBOOK tag is set to YES Doxygen will generate DOCBOOK files 
+# that can be used to generate PDF.
+
+GENERATE_DOCBOOK       = NO
+
+# The DOCBOOK_OUTPUT tag is used to specify where the DOCBOOK pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in 
+# front of it. If left blank docbook will be used as the default path.
+
+DOCBOOK_OUTPUT         = docbook
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX = 
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# pointed to by INCLUDE_PATH will be searched when a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+
+INCLUDE_PATH           = 
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+
+INCLUDE_FILE_PATTERNS  = 
+
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+
+PREDEFINED             = 
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition that 
+# overrules the definition found in the source code.
+
+EXPAND_AS_DEFINED      = 
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all references to function-like macros 
+# that are alone on a line, have an all uppercase name, and do not end with a 
+# semicolon, because these will confuse the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles. For each 
+# tag file the location of the external documentation should be added. The 
+# format of a tag file without this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths 
+# or URLs. Note that each tag file must have a unique name (where the name does 
+# NOT include the path). If a tag file is not located in the directory in which 
+# doxygen is run, you must also specify the path to the tagfile here.
+
+TAGFILES               = ../bpp-core/BppCore.tag=../../bpp-core/html/ \
+                         ../bpp-seq/BppSeq.tag=../../bpp-seq/html
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       = BppSeqOmics.tag
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed 
+# in the related pages index. If set to NO, only the current project's 
+# pages will be listed.
+
+EXTERNAL_PAGES         = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
+# or super classes. Setting the tag to NO turns the diagrams off. Note that 
+# this option also works with HAVE_DOT disabled, but it is recommended to 
+# install and use dot, since it yields more powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc 
+# command. Doxygen will then run the mscgen tool (see 
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the 
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where 
+# the mscgen tool resides. If left empty the tool is assumed to be found in the 
+# default search path.
+
+MSCGEN_PATH            = 
+
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = YES
+
+# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is 
+# allowed to run in parallel. When set to 0 (the default) doxygen will 
+# base this on the number of processors available in the system. You can set it 
+# explicitly to a value larger than 0 to get control over the balance 
+# between CPU load and processing speed.
+
+DOT_NUM_THREADS        = 0
+
+# By default doxygen will use the Helvetica font for all dot files that 
+# doxygen generates. When you want a differently looking font you can specify 
+# the font name using DOT_FONTNAME. You need to make sure dot is able to find 
+# the font, which can be done by putting it in a standard location or by setting 
+# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the 
+# directory containing the font.
+
+DOT_FONTNAME           = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. 
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the Helvetica font. 
+# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to 
+# set the path where dot can find it.
+
+DOT_FONTPATH           = 
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+
+UML_LOOK               = NO
+
+# If the UML_LOOK tag is enabled, the fields and methods are shown inside 
+# the class node. If there are many fields or methods and many nodes the 
+# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS 
+# threshold limits the number of items for each type to make the size more 
+# managable. Set this to 0 for no limit. Note that the threshold may be 
+# exceeded by 50% before the limit is enforced.
+
+UML_LIMIT_NUM_FIELDS   = 10
+
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then 
+# doxygen will generate a call dependency graph for every global function 
+# or class method. Note that enabling this option will significantly increase 
+# the time of a run. So in most cases it will be better to enable call graphs 
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH             = NO
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then 
+# doxygen will generate a caller dependency graph for every global function 
+# or class method. Note that enabling this option will significantly increase 
+# the time of a run. So in most cases it will be better to enable caller 
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = NO
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES 
+# then doxygen will show the dependencies a directory has on other directories 
+# in a graphical way. The dependency relations are determined by the #include 
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are svg, png, jpg, or gif. 
+# If left blank png will be used. If you choose svg you need to set 
+# HTML_FILE_EXTENSION to xhtml in order to make the SVG files 
+# visible in IE 9+ (other browsers do not have this requirement).
+
+DOT_IMAGE_FORMAT       = png
+
+# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to 
+# enable generation of interactive SVG images that allow zooming and panning. 
+# Note that this requires a modern browser other than Internet Explorer. 
+# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you 
+# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files 
+# visible. Older versions of IE do not have SVG support.
+
+INTERACTIVE_SVG        = NO
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               = 
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+
+DOTFILE_DIRS           = 
+
+# The MSCFILE_DIRS tag can be used to specify one or more directories that 
+# contain msc files that are included in the documentation (see the 
+# \mscfile command).
+
+MSCFILE_DIRS           = 
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 
+# nodes that will be shown in the graph. If the number of nodes in a graph 
+# becomes larger than this value, doxygen will truncate the graph, which is 
+# visualized by representing a node as a red box. Note that doxygen if the 
+# number of direct children of the root node in a graph is already larger than 
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note 
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
+# graphs generated by dot. A depth value of 3 means that only nodes reachable 
+# from the root by following a path via at most 3 edges will be shown. Nodes 
+# that lay further from the root node will be omitted. Note that setting this 
+# option to 1 or 2 may greatly reduce the computation time needed for large 
+# code bases. Also note that the size of a graph can be further restricted by 
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
+# background. This is disabled by default, because dot on Windows does not 
+# seem to support this out of the box. Warning: Depending on the platform used, 
+# enabling this option may lead to badly anti-aliased labels on the edges of 
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
+# files in one run (i.e. multiple -o and -T options on the command line). This 
+# makes dot run faster, but since only newer versions of dot (>1.8.10) 
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = YES
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+
+DOT_CLEANUP            = YES
diff --git a/INSTALL.txt b/INSTALL.txt
new file mode 100644
index 0000000..c8859da
--- /dev/null
+++ b/INSTALL.txt
@@ -0,0 +1,12 @@
+This software needs cmake >= 2.6 to build.
+
+After installing cmake, run it with the following command:
+cmake -DCMAKE_INSTALL_PREFIX=[where to install, for instance /usr/local or $HOME/.local] .
+
+If available, you can also use ccmake instead of cmake for a more user-friendly interface.
+
+Then compile and install the software with
+make install
+
+You may also consider installing and using the software checkinstall for easier system administration.
+
diff --git a/bpp-seq-omics.spec b/bpp-seq-omics.spec
new file mode 100644
index 0000000..fbd9a28
--- /dev/null
+++ b/bpp-seq-omics.spec
@@ -0,0 +1,186 @@
+%define _basename bpp-seq-omics
+%define _version 2.1.0
+%define _release 1
+%define _prefix /usr
+
+URL: http://biopp.univ-montp2.fr/
+
+Name: %{_basename}
+Version: %{_version}
+Release: %{_release}
+License: CECILL-2.0
+Vendor: The Bio++ Project
+Source: http://biopp.univ-montp2.fr/repos/sources/%{_basename}-%{_version}.tar.gz
+Summary: Bio++ Sequence library: genomics components
+Group: Development/Libraries/C and C++
+Requires: bpp-core = %{_version}
+Requires: bpp-seq = %{_version}
+
+BuildRoot: %{_builddir}/%{_basename}-root
+BuildRequires: cmake >= 2.6.0
+BuildRequires: gcc-c++ >= 4.0.0
+BuildRequires: libbpp-core2 = %{_version}
+BuildRequires: libbpp-core-devel = %{_version}
+BuildRequires: libbpp-seq9 = %{_version}
+BuildRequires: libbpp-seq-devel = %{_version}
+
+AutoReq: yes
+AutoProv: yes
+
+%description
+This library contains the genomics components of the Bio++ sequence library.
+It is part of the Bio++ project.
+
+%package -n libbpp-seq-omics1
+Summary: Bio++ Sequence library: genomics components
+Group: Development/Libraries/C and C++
+
+%description -n libbpp-seq-omics1
+This library contains the genomics components of the Bio++ sequence library.
+It is part of the Bio++ project.
+
+%package -n libbpp-seq-omics-devel
+Summary: Bio++ Sequence library: genomics components
+Group: Development/Libraries/C and C++
+Requires: libbpp-seq-omics1 = %{_version}
+Requires: libbpp-seq9 = %{_version}
+Requires: libbpp-seq-devel = %{_version}
+Requires: libbpp-core2 = %{_version}
+Requires: libbpp-core-devel = %{_version}
+
+%description -n libbpp-seq-omics-devel
+The libbpp-seq-omics-devel package contains the header files and static libraries for
+building applications which use %{_basename}.
+
+%prep
+%setup -q
+
+%build
+CFLAGS="$RPM_OPT_FLAGS"
+CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=%{_prefix} -DBUILD_TESTING=OFF"
+if [ %{_lib} == 'lib64' ] ; then
+  CMAKE_FLAGS="$CMAKE_FLAGS -DLIB_SUFFIX=64"
+fi
+cmake $CMAKE_FLAGS .
+make
+
+%install
+make DESTDIR=$RPM_BUILD_ROOT install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post -n libbpp-seq-omics1 -p /sbin/ldconfig
+
+%post -n libbpp-seq-omics-devel
+createGeneric() {
+  echo "-- Creating generic include file: $1.all"
+  #Make sure we run into subdirectories first:
+  dirs=()
+  for file in "$1"/*
+  do
+    if [ -d "$file" ]
+    then
+      # Recursion:
+      dirs+=( "$file" )
+    fi
+  done
+  for dir in ${dirs[@]}
+  do
+    createGeneric $dir
+  done
+  #Now list all files, including newly created .all files:
+  if [ -f $1.all ]
+  then
+    rm $1.all
+  fi
+  dir=`basename $1`
+  for file in "$1"/*
+  do
+    if [ -f "$file" ] && ( [ "${file##*.}" == "h" ] || [ "${file##*.}" == "all" ] )
+    then
+      file=`basename $file`
+      echo "#include \"$dir/$file\"" >> $1.all
+    fi
+  done;
+}
+# Actualize .all files
+createGeneric %{_prefix}/include/Bpp
+exit 0
+
+%preun -n libbpp-seq-omics-devel
+removeGeneric() {
+  if [ -f $1.all ]
+  then
+    echo "-- Remove generic include file: $1.all"
+    rm $1.all
+  fi
+  for file in "$1"/*
+  do
+    if [ -d "$file" ]
+    then
+      # Recursion:
+      removeGeneric $file
+    fi
+  done
+}
+# Actualize .all files
+removeGeneric %{_prefix}/include/Bpp
+exit 0
+
+%postun -n libbpp-seq-omics1 -p /sbin/ldconfig
+
+%postun -n libbpp-seq-omics-devel
+createGeneric() {
+  echo "-- Creating generic include file: $1.all"
+  #Make sure we run into subdirectories first:
+  dirs=()
+  for file in "$1"/*
+  do
+    if [ -d "$file" ]
+    then
+      # Recursion:
+      dirs+=( "$file" )
+    fi
+  done
+  for dir in ${dirs[@]}
+  do
+    createGeneric $dir
+  done
+  #Now list all files, including newly created .all files:
+  if [ -f $1.all ]
+  then
+    rm $1.all
+  fi
+  dir=`basename $1`
+  for file in "$1"/*
+  do
+    if [ -f "$file" ] && ( [ "${file##*.}" == "h" ] || [ "${file##*.}" == "all" ] )
+    then
+      file=`basename $file`
+      echo "#include \"$dir/$file\"" >> $1.all
+    fi
+  done;
+}
+# Actualize .all files
+createGeneric %{_prefix}/include/Bpp
+exit 0
+
+%files -n libbpp-seq-omics1
+%defattr(-,root,root)
+%doc AUTHORS.txt COPYING.txt INSTALL.txt ChangeLog
+%{_prefix}/%{_lib}/lib*.so.*
+
+%files -n libbpp-seq-omics-devel
+%defattr(-,root,root)
+%doc AUTHORS.txt COPYING.txt INSTALL.txt ChangeLog
+%{_prefix}/%{_lib}/lib*.so
+%{_prefix}/%{_lib}/lib*.a
+%{_prefix}/include/*
+
+%changelog
+* Wed Mar 06 2013 Julien Dutheil <julien.dutheil at univ-montp2.fr> 2.1.0-1
+- Maf to VCF tool added as a MafIterator.
+* Tue Nov 06 2012 Julien Dutheil <julien.dutheil at univ-montp2.fr> 2.0.3-1
+- First draft of the spec file
+
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..ddba212
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,12 @@
+libbpp-seq-omics (2.1.0-1) unstable; urgency=low
+
+  * Maf to VCF tool added as a MafIterator.
+
+ -- Julien Dutheil <julien.dutheil at univ-montp2.fr>  Wed, 06 Mar 2013 14:34:00 +0100
+
+libbpp-seq-omics (2.0.3-1) unstable; urgency=low
+
+  * Initial release, forking from bpp-seq.
+
+ -- Julien Dutheil <julien.dutheil at univ-montp2.fr>  Tue, 06 Nov 2012 14:05:00 +0100
+
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..7ed6ff8
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+5
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..d2eda1d
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,25 @@
+Source: libbpp-seq-omics
+Section: libs
+Priority: optional
+Maintainer: Loic Dachary <loic at dachary.org>
+Uploaders: Julien Dutheil <julien.dutheil at univ-montp2.fr>
+Build-Depends: debhelper (>= 5), cmake (>= 2.6),
+  libbpp-seq-dev (>= 2.1.0)
+Standards-Version: 3.9.4
+
+Package: libbpp-seq-omics-dev
+Section: libdevel
+Architecture: any
+Depends: libbpp-seq-omics1 (= ${binary:Version}), ${misc:Depends},
+  libbpp-seq-dev (>= 2.1.0)
+Description: Bio++ Sequence library: genomics components.
+ Contains the Bio++ sequence classes dedicated to genomics.
+
+Package: libbpp-seq-omics1
+Section: libs
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends},
+  libbpp-seq9 (>= 2.1.0)
+Description: Bio++ Sequence library: genomics components.
+ Contains the Bio++ sequence classes dedicated to genomics.
+
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..071c61f
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,66 @@
+This package was debianized by Julien Dutheil <julien.dutheil at univ-montp2.fr> on
+Wed, 06 Mar 2013 14:34:00 +0100.
+
+It was downloaded from <http://biopp.univ-montp2.fr/Repositories/sources>
+
+Upstream Author: 
+
+    Julien Dutheil <julien.dutheil at univ-montp2.fr>
+
+Copyright: 
+
+    Copyright (C) 2013 Bio++ Development Team
+
+License:
+
+    This package 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 2 of the License, or
+    (at your option) any later version.
+ 
+    This package 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 package; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License can be found in `/usr/share/common-licenses/GPL'.
+
+The Debian packaging is (C) 2013, Julien Dutheil <julien.dutheil at univ-montp2.fr> and
+is licensed under the GPL, see above.
+
+The provided software is distributed under the CeCILL license:
+
+    This software is governed by the CeCILL license under French law and
+    abiding by the rules of distribution of free software.  You can  use, 
+    modify and/ or redistribute the software under the terms of the CeCILL
+    license as circulated by CEA, CNRS and INRIA at the following URL
+    "http://www.cecill.info". 
+
+    As a counterpart to the access to the source code and  rights to copy,
+    modify and redistribute granted by the license, users are provided only
+    with a limited warranty  and the software's author,  the holder of the
+    economic rights,  and the successive licensors  have only  limited
+    liability. 
+
+    In this respect, the user's attention is drawn to the risks associated
+    with loading,  using,  modifying and/or developing or reproducing the
+    software by the user in light of its specific status of free software,
+    that may mean  that it is complicated to manipulate,  and  that  also
+    therefore means  that it is reserved for developers  and  experienced
+    professionals having in-depth computer knowledge. Users are therefore
+    encouraged to load and test the software's suitability as regards their
+    requirements in conditions enabling the security of their systems and/or 
+    data to be ensured and,  more generally, to use and operate it in the 
+    same conditions as regards security. 
+
+    The fact that you are presently reading this means that you have had
+    knowledge of the CeCILL license and that you accept its terms.
+    
+The complete text of the license may be found here:
+http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
+
diff --git a/debian/libbpp-seq-omics-dev.install b/debian/libbpp-seq-omics-dev.install
new file mode 100644
index 0000000..7d74f2b
--- /dev/null
+++ b/debian/libbpp-seq-omics-dev.install
@@ -0,0 +1,3 @@
+debian/tmp/usr/include/*
+debian/tmp/usr/lib/lib*.a
+debian/tmp/usr/lib/lib*.so
diff --git a/debian/libbpp-seq-omics1.install b/debian/libbpp-seq-omics1.install
new file mode 100644
index 0000000..c45ebcf
--- /dev/null
+++ b/debian/libbpp-seq-omics1.install
@@ -0,0 +1 @@
+debian/tmp/usr/lib/lib*.so.*
diff --git a/debian/postinst b/debian/postinst
new file mode 100755
index 0000000..cff89b1
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,57 @@
+#! /bin/bash
+
+# Abort if any command returns an error value
+set -e
+
+createGeneric() {
+  echo "-- Creating generic include file: $1.all"
+  #Make sure we run into subdirectories first:
+  dirs=()
+  for file in "$1"/*
+  do
+    if [ -d "$file" ]
+    then
+      # Recursion:
+      dirs+=( "$file" )
+    fi
+  done
+  for dir in ${dirs[@]}
+  do
+    createGeneric $dir
+  done
+  #Now list all files, including newly created .all files:
+  if [ -f $1.all ]
+  then
+    rm $1.all
+  fi
+  dir=`basename $1`
+  for file in "$1"/*
+  do
+    if [ -f "$file" ] && ( [ "${file##*.}" == "h" ] || [ "${file##*.}" == "all" ] )
+    then
+      file=`basename $file`
+      echo "#include \"$dir/$file\"" >> $1.all
+    fi
+  done;
+}
+
+case "$1" in
+  configure)
+    # Actualize .all files
+    createGeneric /usr/include/Bpp
+  ;;
+  abort-upgrade|abort-remove|abort-deconfigure)
+    echo "$1"
+  ;;
+  *)
+    echo "postinst called with unknown argument \`\$1'" >&2
+    exit 0
+  ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/postrm b/debian/postrm
new file mode 100755
index 0000000..744f8b1
--- /dev/null
+++ b/debian/postrm
@@ -0,0 +1,59 @@
+#! /bin/bash
+
+# Abort if any command returns an error value
+set -e
+
+createGeneric() {
+  echo "-- Creating generic include file: $1.all"
+  #Make sure we run into subdirectories first:
+  dirs=()
+  for file in "$1"/*
+  do
+    if [ -d "$file" ]
+    then
+      # Recursion:
+      dirs+=( "$file" )
+    fi
+  done
+  for dir in ${dirs[@]}
+  do
+    createGeneric $dir
+  done
+  #Now list all files, including newly created .all files:
+  if [ -f $1.all ]
+  then
+    rm $1.all
+  fi
+  dir=`basename $1`
+  for file in "$1"/*
+  do
+    if [ -f "$file" ] && ( [ "${file##*.}" == "h" ] || [ "${file##*.}" == "all" ] )
+    then
+      file=`basename $file`
+      echo "#include \"$dir/$file\"" >> $1.all
+    fi
+  done;
+}
+
+case "$1" in
+  remove)
+    # Automatically added by dh_makeshlibs
+    ldconfig
+    # Actualize .all files
+    createGeneric /usr/include/Bpp
+  ;;
+  purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
+    echo $1
+  ;;
+  *)
+    echo "postrm called with unknown argument \`\$1'" >&2
+    exit 0
+  ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/prerm b/debian/prerm
new file mode 100755
index 0000000..8fab52e
--- /dev/null
+++ b/debian/prerm
@@ -0,0 +1,41 @@
+#! /bin/bash
+
+# Abort if any command returns an error value
+set -e
+
+removeGeneric() {
+  if [ -f $1.all ]
+  then
+    echo "-- Remove generic include file: $1.all"
+    rm $1.all
+  fi
+  for file in "$1"/*
+  do
+    if [ -d "$file" ]
+    then
+      # Recursion:
+      removeGeneric $file
+    fi
+  done
+}
+
+case "$1" in
+  remove|upgrade|deconfigure)
+    # Actualize .all files
+    removeGeneric /usr/include/Bpp
+  ;;
+  failed-upgrade)
+    echo "$1"
+  ;;
+  *)
+    echo "prerm called with unknown argument \`$1'" >&2
+    exit 1
+  ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..34313ef
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,122 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# 24/01/10 Modification for use with CMake by Julien Dutheil.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+	CFLAGS += -O0
+else
+	CFLAGS += -O2
+endif
+
+# shared library versions
+version=`ls src/lib*.so.* | \
+ awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'`
+major=`ls src/lib*.so.* | \
+ awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'`
+
+configure:
+	cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=OFF .
+
+config.status: configure
+	dh_testdir
+
+build: build-arch build-indep
+build-arch: build-stamp
+build-indep: build-stamp
+build-stamp:  config.status
+	dh_testdir
+
+	# Add here commands to compile the package.
+	$(MAKE)
+
+	touch $@
+
+clean:
+	dh_testdir
+	dh_testroot
+
+	# Add here commands to clean up after the build process.
+	[ ! -f Makefile ] || $(MAKE) clean;
+	[ ! -f Makefile ] || rm Makefile;
+	[ ! -f src/Makefile ] || rm src/Makefile;
+	[ ! -f test/Makefile ] || rm test/Makefile;
+	rm -f config.sub config.guess
+	rm -f build-stamp
+	rm -f CMakeCache.txt
+	rm -f *.cmake
+	rm -f src/*.cmake
+	rm -f test/*.cmake
+	rm -rf CMakeFiles
+	rm -rf src/CMakeFiles
+	rm -rf test/CMakeFiles
+	rm -rf _CPack_Packages
+	rm -rf Testing
+	rm -f DartConfiguration.tcl
+
+	dh_clean 
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_prep 
+	dh_installdirs
+
+	# Add here commands to install the package into debian/tmp
+	$(MAKE) DESTDIR=$(CURDIR)/debian/tmp install
+
+
+# Build architecture-independent files here.
+binary-indep: build install
+# We have nothing to do by default.
+
+# Build architecture-dependent files here.
+binary-arch: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs ChangeLog
+	dh_installdocs
+	dh_installexamples
+	dh_install
+#	dh_installmenu
+#	dh_installdebconf	
+#	dh_installlogrotate
+#	dh_installemacsen
+#	dh_installpam
+#	dh_installmime
+#	dh_installinit
+#	dh_installcron
+#	dh_installinfo
+	dh_installman
+	dh_link
+	dh_strip
+	dh_compress
+	dh_fixperms
+#	dh_perl
+#	dh_python
+	dh_makeshlibs
+	dh_installdeb
+	dh_shlibdeps
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install 
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/src/Bpp/Seq/Feature/FeatureReader.h b/src/Bpp/Seq/Feature/FeatureReader.h
new file mode 100644
index 0000000..6466b4f
--- /dev/null
+++ b/src/Bpp/Seq/Feature/FeatureReader.h
@@ -0,0 +1,77 @@
+//
+// File: FeatureReader.h
+// Created by: Julien Dutheil
+// Created on: Thu Nov 22 2012
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _FEATUREREADER_H_
+#define _FEATUREREADER_H_
+
+#include "SequenceFeature.h"
+
+//From bpp-core:
+#include <Bpp/Exceptions.h>
+
+//From the STL:
+#include <string>
+#include <vector>
+
+namespace bpp {
+
+/**
+ * @brief Interface for feature readers.
+ *
+ * @author Julien Dutheil, Sylvain Gaillard
+ */
+class FeatureReader
+{
+  public:
+    FeatureReader() {}
+    virtual ~FeatureReader() {}
+
+  public:
+    virtual bool hasMoreFeature() const = 0;
+    virtual const BasicSequenceFeature nextFeature() throw (Exception) = 0;
+    virtual void getAllFeatures(SequenceFeatureSet& features) = 0;
+    virtual void getFeaturesOfType(const std::string& type, SequenceFeatureSet& features) = 0;
+    virtual void getFeaturesOfSequence(const std::string& seqId, SequenceFeatureSet& features) = 0;
+   
+};
+
+} //end of namespace bpp
+
+#endif //_FEATUREREADER_H_
+
diff --git a/src/Bpp/Seq/Feature/Gff/GffFeatureReader.cpp b/src/Bpp/Seq/Feature/Gff/GffFeatureReader.cpp
new file mode 100644
index 0000000..9031e68
--- /dev/null
+++ b/src/Bpp/Seq/Feature/Gff/GffFeatureReader.cpp
@@ -0,0 +1,152 @@
+//
+// File: GffFeatureReader.cpp
+// Created by: Julien Dutheil
+// Created on: Mon Nov 21 2011
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "GffFeatureReader.h"
+
+//From bpp-core:
+#include <Bpp/Text/StringTokenizer.h>
+#include <Bpp/Text/TextTools.h>
+#include <Bpp/Text/KeyvalTools.h>
+#include <Bpp/Numeric/VectorTools.h>
+
+//From the STL:
+#include <string>
+#include <iostream>
+
+using namespace bpp;
+using namespace std;
+
+const std::string GffFeatureReader::GFF_PHASE = "GFF_PHASE";
+const std::string GffFeatureReader::GFF_NAME = "Name";
+const std::string GffFeatureReader::GFF_ALIAS = "GFF_ALIAS";
+const std::string GffFeatureReader::GFF_PARENT = "Parent";
+const std::string GffFeatureReader::GFF_TARGET = "Target";
+const std::string GffFeatureReader::GFF_GAP = "Gap";
+const std::string GffFeatureReader::GFF_DERIVES_FROM = "GFF_DERIVES_FROM";
+const std::string GffFeatureReader::GFF_NOTE = "Note";
+const std::string GffFeatureReader::GFF_DBXREF = "Dbxref";
+const std::string GffFeatureReader::GFF_ONTOLOGY_TERM = "Ontology_term";
+const std::string GffFeatureReader::GFF_IS_CIRCULAR = "Is_circular";
+
+
+void GffFeatureReader::getNextLine_() {
+  nextLine_ = "";
+  while (TextTools::isEmpty(nextLine_) || nextLine_.size() < 2 || nextLine_[0] == '#') {
+    if (input_->eof()) {
+      nextLine_ = "";
+      return;
+    }
+    getline(*input_, nextLine_);
+  }
+}
+
+const BasicSequenceFeature GffFeatureReader::nextFeature() throw (Exception)
+{
+  if (!hasMoreFeature())
+    throw Exception("GffFeatureReader::nextFeature(). No more feature in file.");
+  
+  //Parse current line:
+  StringTokenizer st(nextLine_, "\t");
+  if (st.numberOfRemainingTokens() != 9)
+    throw Exception("GffFeatureReader::nextFeature(). Wrong GFF3 file format: should have 9 tab delimited columns.");
+  
+  //if ok, we can parse each column:
+  string seqId       = st.nextToken();
+  string source      = st.nextToken();
+  string type        = st.nextToken();
+  unsigned int start = TextTools::to<unsigned int>(st.nextToken()) - 1;
+  unsigned int end   = TextTools::to<unsigned int>(st.nextToken());
+  double score       = TextTools::to<double>(st.nextToken());
+  string strand      = st.nextToken();
+  string phase       = st.nextToken();
+  string attrDesc    = st.nextToken();
+  map<string, string> attributes;
+  KeyvalTools::multipleKeyvals(attrDesc, attributes, ";", false);
+  string id = attributes["ID"];
+  BasicSequenceFeature feature(id, seqId, source, type, start, end, strand[0], score);
+  
+  //Set phase attributes:
+  if (phase != ".") feature.setAttribute(GFF_PHASE, phase);
+
+  //now check additional attributes:
+  for (map<string, string>::iterator it = attributes.begin(); it != attributes.end(); ++it) {
+    if (it->first != "ID")
+      feature.setAttribute(it->first, it->second); //We accept all attributes, even if they are not standard.
+  }
+  
+  //Read the next line:
+  getNextLine_();
+
+  return feature;
+}
+
+std::string GffFeatureReader::toString(const bpp::SequenceFeature& f) {
+  std::vector< std::string > v;
+  std::vector< std::string > attr;
+  std::set< std::string > attrNames = f.getAttributeList();
+  v.push_back(f.getSequenceId());
+  v.push_back(f.getSource());
+  v.push_back(f.getType());
+  v.push_back(bpp::TextTools::toString(f.getStart() + 1));
+  v.push_back(bpp::TextTools::toString(f.getEnd()));
+  v.push_back(bpp::TextTools::toString(f.getScore()));
+  if (f.isStranded()) {
+    if (f.isNegativeStrand()) {
+    v.push_back("-");
+    } else {
+    v.push_back("+");
+    }
+  } else {
+    v.push_back(".");
+  }
+  if (f.getAttribute(GFF_PHASE) == "") {
+    v.push_back(".");
+  } else {
+    v.push_back(f.getAttribute(GFF_PHASE));
+  }
+  
+  if (f.getId() != "") {
+    attr.push_back("ID=" + f.getId());
+  }
+  for (std::set< std::string >::iterator it = attrNames.begin() ; it != attrNames.end() ; it++) {
+    attr.push_back(*it + "=" + f.getAttribute(*it));
+  }
+  v.push_back(bpp::VectorTools::paste(attr, ";"));
+  return bpp::VectorTools::paste(v, "\t");
+}
diff --git a/src/Bpp/Seq/Feature/Gff/GffFeatureReader.h b/src/Bpp/Seq/Feature/Gff/GffFeatureReader.h
new file mode 100644
index 0000000..3400e68
--- /dev/null
+++ b/src/Bpp/Seq/Feature/Gff/GffFeatureReader.h
@@ -0,0 +1,154 @@
+//
+// File: GffFeatureReader.h
+// Created by: Julien Dutheil
+// Created on: Mon Nov 21 2011
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _GFFFEATUREREADER_H_
+#define _GFFFEATUREREADER_H_
+
+#include "../SequenceFeature.h"
+#include "../FeatureReader.h"
+
+//From bpp-core:
+#include <Bpp/Exceptions.h>
+
+//From the STL:
+#include <string>
+#include <vector>
+
+namespace bpp {
+
+/**
+ * @brief A simple reader implementing the Gene Finding Feature format.
+ *
+ * The reference norm in use is the one of GFF3 http://www.sequenceontology.org/gff3.shtml .
+ * This class is a "beta" class, and may undeavour interface changes in the future.
+ *
+ * Note that in GFF, coordinates are [a, b] 1-based. They will therefore be converted to [a, b[ 0-based,
+ * as specified for the SequenceFeature object.
+ *
+ * @author Julien Dutheil, Sylvain Gaillard
+ */
+class GffFeatureReader:
+  public virtual FeatureReader
+{
+  public:
+    static const std::string GFF_STRAND;
+    static const std::string GFF_PHASE;
+    static const std::string GFF_NAME;
+    static const std::string GFF_ALIAS;
+    static const std::string GFF_PARENT;
+    static const std::string GFF_TARGET;
+    static const std::string GFF_GAP;
+    static const std::string GFF_DERIVES_FROM;
+    static const std::string GFF_NOTE;
+    static const std::string GFF_DBXREF;
+    static const std::string GFF_ONTOLOGY_TERM;
+    static const std::string GFF_IS_CIRCULAR;
+
+  private:
+    std::istream* input_;
+    std::string nextLine_;
+
+  public:
+    GffFeatureReader(std::istream& input):
+      input_(&input), nextLine_()
+    {
+      getNextLine_();
+    }
+
+  private:
+    GffFeatureReader(const GffFeatureReader& reader): input_(0), nextLine_() {}
+    GffFeatureReader& operator=(const GffFeatureReader& reader) { return *this; }
+
+  public:
+    bool hasMoreFeature() const { return nextLine_ != ""; }
+    const BasicSequenceFeature nextFeature() throw (Exception);
+
+    void getAllFeatures(SequenceFeatureSet& features) {
+      while (hasMoreFeature()) {
+        features.addFeature(nextFeature());
+      }
+    }
+    void getFeaturesOfType(const std::string& type, SequenceFeatureSet& features) {
+      while (hasMoreFeature()) {
+        BasicSequenceFeature feature = nextFeature();
+        if (feature.getType() == type)
+          features.addFeature(feature);
+      }
+    }
+    void getFeaturesOfSequence(const std::string& seqId, SequenceFeatureSet& features) {
+      while (hasMoreFeature()) {
+        BasicSequenceFeature feature = nextFeature();
+        if (feature.getSequenceId() == seqId)
+          features.addFeature(feature);
+      }
+    }
+
+    /**
+     * @param f A sequence feature.
+     * @return A string describing the feature, in GFF format.
+     */
+    static std::string toString(const bpp::SequenceFeature& f);
+    
+    /**
+     * @brief Out put a string description of a feature to a stream.
+     *
+     * A end of line character will be appended after the description.
+     *
+     * @param f A sequence feature.
+     * @param out An output stream.
+     */
+    static void toString(const bpp::SequenceFeature& f, std::ostream& out) {
+      out << toString(f) << std::endl;
+    }
+
+    static void toString(const bpp::SequenceFeatureSet& fs, std::ostream& out) {
+      for (unsigned int i = 0; i < fs.getNumberOfFeatures(); ++i) {
+        toString(fs[i], out);
+      }
+    }
+
+  private:
+    void getNextLine_();
+
+};
+
+} //end of namespace bpp
+
+#endif //_GFFFEATUREREADER_H_
+
diff --git a/src/Bpp/Seq/Feature/Gtf/GtfFeatureReader.cpp b/src/Bpp/Seq/Feature/Gtf/GtfFeatureReader.cpp
new file mode 100644
index 0000000..1bb0c94
--- /dev/null
+++ b/src/Bpp/Seq/Feature/Gtf/GtfFeatureReader.cpp
@@ -0,0 +1,144 @@
+//
+// File: GtfFeatureReader.cpp
+// Created by: Sylvain Gaillard
+// Created on: Fry Jan 27 2012
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "GtfFeatureReader.h"
+
+//From bpp-core:
+#include <Bpp/Text/StringTokenizer.h>
+#include <Bpp/Text/TextTools.h>
+#include <Bpp/Text/KeyvalTools.h>
+
+//From the STL:
+#include <string>
+#include <iostream>
+
+using namespace bpp;
+using namespace std;
+
+const std::string GtfFeatureReader::GTF_PHASE = "GTF_PHASE";
+const std::string GtfFeatureReader::GTF_GENE_ID = "gene_id";
+const std::string GtfFeatureReader::GTF_TRANSCRIPT_ID = "transcript_id";
+
+void GtfFeatureReader::getNextLine_() {
+  nextLine_ = "";
+  // Remove comments
+  /*
+    todo: remove characters between # and end-of-line taking care of double quotes
+  */
+  while (TextTools::isEmpty(nextLine_) || nextLine_.size() < 2 || nextLine_[0] == '#') {
+    if (input_->eof()) {
+      nextLine_ = "";
+      return;
+    }
+    getline(*input_, nextLine_);
+  }
+}
+
+const BasicSequenceFeature GtfFeatureReader::nextFeature() throw (Exception)
+{
+  if (!hasMoreFeature())
+    throw Exception("GtfFeatureReader::nextFeature(). No more feature in file.");
+  
+  //Parse current line:
+  StringTokenizer st(nextLine_, "\t");
+  if (st.numberOfRemainingTokens() != 9)
+    throw Exception("GtfFeatureReader::nextFeature(). Wrong GTF file format: should have 9 tab delimited columns.");
+  
+  //if ok, we can parse each column:
+  std::string seqId       = st.nextToken();
+  std::string source      = st.nextToken();
+  std::string type        = st.nextToken();
+  unsigned int start      = TextTools::to<unsigned int>(st.nextToken()) - 1;
+  unsigned int end        = TextTools::to<unsigned int>(st.nextToken());
+  double score            = TextTools::to<double>(st.nextToken());
+  std::string strand      = st.nextToken();
+  std::string phase       = st.nextToken();
+  std::string attrDesc    = st.nextToken();
+  std::map<string, string> attributes;
+  bpp::StringTokenizer st1(attrDesc, ";");
+  while (st1.hasMoreToken()) {
+    std::string item(bpp::TextTools::removeSurroundingWhiteSpaces(st1.nextToken()));
+    std::string::size_type idx = item.find_first_of(' ');
+    std::string key(item.substr(0, idx));
+    std::string value(item.substr(idx));
+    // remove first "
+    while (
+        value.size() > 0 
+        && (
+          value[0] == '"' 
+          || bpp::TextTools::isWhiteSpaceCharacter(value[0])
+          )
+        ) {
+      value.erase(value.begin());
+    }
+    // remove last "
+    while (
+        value.size() > 0 
+        && (
+          value[value.size() - 1] == '"' 
+          || bpp::TextTools::isWhiteSpaceCharacter(value[value.size() - 1])
+          )
+        ) {
+      value.erase(value.end() - 1);
+    }
+    attributes[key] = value;
+    //std::cout << "[" << key << "] = [" << value << "]" << std::endl;
+  }
+  //KeyvalTools::multipleKeyvals(attrDesc, attributes, ";", false);
+  //std::string id = attributes["ID"];
+  std::string id = "";
+  BasicSequenceFeature feature(id, seqId, source, type, start, end, strand[0], score);
+  
+  //Set phase attributes:
+  phase = bpp::TextTools::removeSurroundingWhiteSpaces(phase);
+  if (phase != ".") feature.setAttribute(GTF_PHASE, phase);
+
+  //now check additional attributes:
+  for (std::map<std::string, std::string>::iterator it = attributes.begin(); it != attributes.end(); ++it) {
+    feature.setAttribute(it->first, it->second); //We accept all attributes, even if they are not standard.
+    //std::cout << "[" << it->first << "] = [" << it->second << "]" << std::endl;
+    //std::cout << "phase: " << phase << std::endl;
+  }
+  
+  //Read the next line:
+  getNextLine_();
+
+  return feature;
+}
+
diff --git a/src/Bpp/Seq/Feature/Gtf/GtfFeatureReader.h b/src/Bpp/Seq/Feature/Gtf/GtfFeatureReader.h
new file mode 100644
index 0000000..9600dc4
--- /dev/null
+++ b/src/Bpp/Seq/Feature/Gtf/GtfFeatureReader.h
@@ -0,0 +1,121 @@
+//
+// File: GtfFeatureReader.h
+// Created by: Sylvain Gaillard
+// Created on: Fry Jan 27 2012
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (January 27, 2012)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _GTFFEATUREREADER_H_
+#define _GTFFEATUREREADER_H_
+
+#include "../SequenceFeature.h"
+#include "../FeatureReader.h"
+
+//From bpp-core:
+#include <Bpp/Exceptions.h>
+
+//From the STL:
+#include <string>
+#include <vector>
+
+namespace bpp {
+
+/**
+ * @brief A simple reader implementing the Gene Transfer Format.
+ *
+ * The reference norm in use is the one of GTF2.2 http://mblab.wustl.edu/GTF22.html .
+ * This class is a "beta" class, and may undeavour interface changes in the future.
+ *
+ * Note that in GTF, coordinates are [a, b] 1-based. They will therefore be converted to [a, b[ 0-based,
+ * as specified for the SequenceFeature object.
+ *
+ * @author Sylvain Gaillard
+ */
+class GtfFeatureReader:
+  public virtual FeatureReader
+{
+  public:
+    static const std::string GTF_PHASE;
+    static const std::string GTF_GENE_ID;
+    static const std::string GTF_TRANSCRIPT_ID;
+
+  private:
+    std::istream* input_;
+    std::string nextLine_;
+
+  public:
+    GtfFeatureReader(std::istream& input):
+      input_(&input), nextLine_()
+    {
+      getNextLine_();
+    }
+
+  private:
+    GtfFeatureReader(const GtfFeatureReader& reader): input_(0), nextLine_() {}
+    GtfFeatureReader& operator=(const GtfFeatureReader& reader) { return *this; }
+
+  public:
+    bool hasMoreFeature() const { return nextLine_ != ""; }
+    const BasicSequenceFeature nextFeature() throw (Exception);
+
+    void getAllFeatures(SequenceFeatureSet& features) {
+      while (hasMoreFeature()) {
+        features.addFeature(nextFeature());
+      }
+    }
+    void getFeaturesOfType(const std::string& type, SequenceFeatureSet& features) {
+      while (hasMoreFeature()) {
+        BasicSequenceFeature feature = nextFeature();
+        if (feature.getType() == type)
+          features.addFeature(feature);
+      }
+    }
+    void getFeaturesOfSequence(const std::string& seqId, SequenceFeatureSet& features) {
+      while (hasMoreFeature()) {
+        BasicSequenceFeature feature = nextFeature();
+        if (feature.getSequenceId() == seqId)
+          features.addFeature(feature);
+      }
+    }
+
+  private:
+    void getNextLine_();
+
+};
+
+} //end of namespace bpp
+
+#endif //_GTFFEATUREREADER_H_
+
diff --git a/src/Bpp/Seq/Feature/SequenceFeature.cpp b/src/Bpp/Seq/Feature/SequenceFeature.cpp
new file mode 100644
index 0000000..51b5046
--- /dev/null
+++ b/src/Bpp/Seq/Feature/SequenceFeature.cpp
@@ -0,0 +1,45 @@
+//
+// File: SequenceFeature.cpp
+// Created by: Julien Dutheil
+// Created on: Mon Nov 21 2011
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "SequenceFeature.h"
+
+using namespace bpp;
+
+const std::string SequenceFeature::NO_ATTRIBUTE_SET = "";
+
diff --git a/src/Bpp/Seq/Feature/SequenceFeature.h b/src/Bpp/Seq/Feature/SequenceFeature.h
new file mode 100644
index 0000000..b652a0f
--- /dev/null
+++ b/src/Bpp/Seq/Feature/SequenceFeature.h
@@ -0,0 +1,499 @@
+//
+// File: SequenceFeature.h
+// Created by: Julien Dutheil
+// Created on: Mon Nov 21 2011
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _SEQUENCEFEATURE_H_
+#define _SEQUENCEFEATURE_H_
+
+//From the STL:
+#include <string>
+#include <map>
+#include <set>
+#include <algorithm>
+
+//From bpp-core:
+#include <Bpp/Clonable.h>
+#include <Bpp/Numeric/Range.h>
+
+/**
+ * @mainpage
+ *
+ * @par
+ * The bpp-seq-omics library adds 'omics' components to the bpp-seq library.
+ * These components notably include the bpp::SequenceFeature class, for storing generic sequence features and their coordinates.
+ * Parsers are provided for loading such features from a bpp::Gff file for instance, as well as tools for extracting the corresponding sequences (bpp::SequenceFeatureTools).
+ *
+ * @par
+ * Next-Generation Sequencing data are also supported, with the bpp::Fastq parser, which instanciates bpp::SequenceWithQuality objects.
+ * Genome alignments can be efficiently analyzed via the bpp::MafParser class and a large range of bpp::MafIterator classes.
+ * Genome alignment blocks are stored in bpp::MafBlock instances, which are containers of bpp::MafSequence objects with their corresponding genome coordinates.
+ */
+
+namespace bpp
+{
+
+/**
+ * @brief a coordinate range on a sequence.
+ * Stores coordinates as a Range<size_t> object,
+ * but also keep the strand information.
+ */
+class SeqRange:
+  public Range<size_t>
+{
+  private:
+    char strand_;
+
+  public:
+    /**
+     * @param a First position
+     * @param b Second position
+     * @param strand The strand information. Can take one of the four values: '+' for positive strand, '-' for negative, '.' if not stranded or '?' if strandedness is relevant but unknown.
+     */
+    SeqRange(size_t a, size_t b, char strand = '.'):
+      Range<size_t>(a, b), strand_(strand) {
+        if (strand != '+' && strand != '-' && strand != '?' && strand != '.')
+          strand_ = '.';
+    }
+
+    SeqRange* clone() const { return new SeqRange(*this); }
+
+  public:
+    virtual char getStrand() const { return strand_; }
+
+    virtual bool isNegativeStrand() const { return strand_ == '-'; }
+    virtual bool isStranded() const { return strand_ == '+' || strand_ == '-'; }
+    virtual void invert() {
+      if (isStranded()) {
+        if (isNegativeStrand()) {
+          strand_ = '+';
+        } else {
+          strand_ = '-';
+        }
+      }
+    }
+
+};
+
+/**
+ * @brief The base interface for sequence features.
+ *
+ * This interface provides the most generic information common to all features, that is:
+ * - sequence reference
+ * - procedure used to generate the information
+ * - start and end positions. Coordinates are 0-based, of type [a,b[, so that if a==b,
+ * the annotation is considered empty. A one-character annotation is then noted as start=12(included),end=13(excluded) for instance.
+ *
+ * Subclasses inheriting this interface provide specialisations for various types of annotations.
+ * Depending on the file format of annotations, not all types of annotations may be supported.
+ *
+ * @author Julien Dutheil
+ */
+class SequenceFeature:
+  public virtual Clonable
+{
+  public:
+    static const std::string NO_ATTRIBUTE_SET;
+
+  public:
+    virtual SequenceFeature* clone() const = 0;
+
+  public:
+    /**
+     * @return The id of this feature.
+     */
+    virtual const std::string& getId() const = 0;
+    /**
+     * @param id A std::string representing the id.
+     */
+    virtual void setId(const std::string& id) = 0;
+
+    /**
+     * @return The id of the sequence on which this feature is based.
+     */
+    virtual const std::string& getSequenceId() const = 0;
+    /**
+     * @param id A std::string representing the id of the reference.
+     */
+    virtual void setSequenceId(const std::string& id) = 0;
+
+    /**
+     * @return A text intended to describe the algorithm or procedure used to generate the feature.
+     */
+    virtual const std::string& getSource() const = 0;
+    /**
+     * @param source A std::string representing the source of the feature.
+     */
+    virtual void setSource(const std::string& source) = 0;
+
+    /**
+     * @return A text describing the type of feature. Depending on the format, it can be restricted (for example, mRNA), or any text can be supplied (for example TFXX binding site).
+     */
+    virtual const std::string& getType() const = 0;
+    /**
+     * @param type A std::string representing the type of this feature.
+     */
+    virtual void setType(const std::string& type) = 0;
+
+    /**
+     * @return The starting position of the feature, 0-based, included.
+     */
+    virtual const size_t getStart() const = 0;
+
+    /**
+     * @return The ending position of the feature, 0-based, excluded.
+     */
+    virtual const size_t getEnd() const = 0;
+
+    /**
+     * @return True if the feature is stranded.
+     */
+    virtual bool isStranded() const = 0;
+
+    /**
+     * @return True if the sequence is coded on the negative strand. False if it is on the positive one or unknown.
+     */
+    virtual bool isNegativeStrand() const = 0;
+
+    /**
+     * Change the orientation of the feature.
+     */
+    virtual void invert() = 0;
+
+    /**
+     * @return Coordinates as a Range object.
+     */
+    virtual SeqRange getRange() const = 0;
+
+    /**
+     * @return True if the features overlap.
+     */
+    virtual bool overlap(const SequenceFeature& feat) const = 0;
+    
+    /**
+     * @return The score associated to the feature (eg, an E-value or a P-value).
+     */
+    virtual const double& getScore() const = 0;
+    /**
+     * @param score A double representing the score of this feature.
+     */
+    virtual void setScore(double score) = 0;
+
+    /**
+     * @param  attribute The name of the attribute to retrieve.
+     * @return The attribute with specified name (read only).
+     */
+    virtual const std::string& getAttribute(const std::string& attribute) const = 0;
+    
+    /**
+     * @param  attribute The name of the attribute to retrieve.
+     * @return The attribute with specified name.
+     */
+    virtual std::string& getAttribute(const std::string& attribute) = 0;
+
+    /**
+     * @return The list of all attributes available.
+     */
+    virtual std::set< std::string > getAttributeList() const = 0;
+    
+    /**
+     * @brief Set the value of an attribute.
+     *
+     * @param attribute The name of the attribute to set.
+     * @param value     The value of the attribute to set.
+     */
+    virtual void setAttribute(const std::string& attribute, const std::string& value) = 0;
+
+    /**
+     * @param attribute The name of the attribute to be removed.
+     */
+    virtual void removeAttribute(const std::string& attribute) = 0;
+
+};
+
+/**
+ * @brief A very simple implementation of the SequenceFeature class.
+ *
+ * It uses a hash map for storing attributes.
+ */
+class BasicSequenceFeature:
+  public SequenceFeature
+{
+  protected:
+    std::string id_;
+    std::string sequenceId_;
+    std::string source_;
+    std::string type_;
+    SeqRange range_;
+    double score_;
+    mutable std::map<std::string, std::string> attributes_;
+    //SequenceFeatureSet subFeatures_;
+
+  public:
+    BasicSequenceFeature(
+        const std::string& id,
+        const std::string& seqId,
+        const std::string& source,
+        const std::string& type,
+        size_t start,
+        size_t end,
+        char strand,
+        double score = -1):
+      id_(id), sequenceId_(seqId), source_(source),
+      type_(type), range_(start, end, strand), score_(score),
+      attributes_()
+      //attributes_(), subFeatures_()
+    {}
+
+    virtual BasicSequenceFeature* clone() const { return new BasicSequenceFeature(*this); }
+
+  public:
+    const std::string& getId() const { return id_; }
+    void setId(const std::string& id) { id_ = id; }
+    const std::string& getSequenceId() const { return sequenceId_; }
+    void setSequenceId(const std::string& sid) { sequenceId_ = sid; }
+    const std::string& getSource() const { return source_; }
+    void setSource(const std::string& source) { source_ = source; }
+    const std::string& getType() const { return type_; }
+    void setType(const std::string& type) { type_ = type; }
+    const size_t getStart() const { return range_.begin(); }
+    const size_t getEnd() const { return range_.end(); }
+    bool isStranded() const { return range_.isStranded(); }
+    bool isNegativeStrand() const { return range_.isNegativeStrand(); }
+    void invert() {
+      range_.invert();
+    }
+    const double& getScore() const { return score_; }
+    void setScore(double score) { score_ = score; }
+
+    const std::string& getAttribute(const std::string& attribute) const {
+      std::map<std::string, std::string>::iterator it = attributes_.find(attribute);
+      if (it != attributes_.end())
+        return it->second;
+      else
+        return NO_ATTRIBUTE_SET;
+    }
+    
+    std::string& getAttribute(const std::string& attribute) {
+      return attributes_[attribute];
+    }
+    
+    void setAttribute(const std::string& attribute, const std::string& value) {
+      attributes_[attribute] = value;
+    }
+
+    std::set< std::string > getAttributeList() const {
+      std::set< std::string > d;
+      for (std::map<std::string, std::string>::iterator it = attributes_.begin() ; it != attributes_.end() ; it++) {
+        d.insert(it->first);
+      }
+      return d;
+    }
+
+    void removeAttribute(const std::string& attribute) {
+      std::map<std::string, std::string>::iterator it = attributes_.find(attribute);
+      if (it != attributes_.end()) {
+        attributes_.erase(it);
+      }
+    }
+
+    SeqRange getRange() const {
+      return SeqRange(range_);
+    }
+
+    bool overlap(const SequenceFeature& feat) const {
+      if (feat.getSequenceId() == sequenceId_) {
+        return range_.overlap(feat.getRange());
+      }
+      return false;
+    }
+
+    //const SequenceFeatureSet& getSubFeatures() const { return subFeatures; }
+    //SequenceFeatureSet& getSubFeatures() { return subFeatures; }
+
+};
+
+/**
+ * @brief A simple ensemble of sequence features.
+ *
+ * This class is at a draft stage, and further improvements are expected, notably
+ * to allow proper indexation, nested features, etc.
+ *
+ * For now, it is mostly a vector of feature object, stored as pointers.
+ * A few functions are provided for convenience.
+ *
+ * @author Julien Dutheil
+ */
+class SequenceFeatureSet
+{
+  private:
+    std::vector<SequenceFeature*> features_;
+
+  public:
+    SequenceFeatureSet(): features_() {};
+
+    virtual ~SequenceFeatureSet() { clear(); }
+
+    SequenceFeatureSet(const SequenceFeatureSet& sfs):
+      features_()
+    {
+      for (std::vector<SequenceFeature*>::const_iterator it = sfs.features_.begin();
+          it != sfs.features_.end();
+          ++it) {
+        features_.push_back((**it).clone());
+      }
+    }
+    SequenceFeatureSet& operator=(const SequenceFeatureSet& sfs)
+    {
+      clear();
+      for (std::vector<SequenceFeature*>::const_iterator it = sfs.features_.begin();
+          it != sfs.features_.end();
+          ++it) {
+        features_.push_back((**it).clone());
+      }
+      return *this;
+    }
+
+  public:
+    /**
+     * @brief Delete all features in this set.
+     */
+    void clear()
+    {
+      for (std::vector<SequenceFeature*>::iterator it = features_.begin();
+          it != features_.end();
+          ++it) {
+        delete *it;
+      }
+      features_.clear();
+    }
+
+    /**
+     * @param i The index of the feature.
+     * @return A reference toward the feature.
+     */
+    const SequenceFeature& getFeature(size_t i) const {
+      return *features_[i];
+    }
+
+    /**
+     * @param i The index of the feature.
+     * @return A reference toward the feature.
+     * @see getFeature(size_t i)
+     */
+    const SequenceFeature& operator[](size_t i) const {
+      return *features_[i];
+    }
+
+    /**
+     * @return The number of features in this set.
+     */
+    size_t getNumberOfFeatures() const { return features_.size(); }
+
+    /**
+     * @brief Add a feature to the container. The feature will be copied and the copy owned by the container.
+     *
+     * @param feature The feature to add to the container.
+     */
+    void addFeature(const SequenceFeature& feature) {
+      features_.push_back(feature.clone());
+    }
+
+    /**
+     * @return A set containing all sequences ids in this set.
+     */
+    std::set<std::string> getSequences() const {
+      std::set<std::string> seqIds;
+      for (std::vector<SequenceFeature*>::const_iterator it = features_.begin();
+          it != features_.end();
+          ++it) {
+        seqIds.insert((**it).getSequenceId());
+      }
+      return seqIds;
+    }
+
+    /**
+     * @return A set containing all feature type in this set.
+     */
+    std::set<std::string> getTypes() const {
+      std::set<std::string> types;
+      for (std::vector<SequenceFeature*>::const_iterator it = features_.begin();
+          it != features_.end();
+          ++it) {
+        types.insert((**it).getType());
+      }
+      return types;
+    }
+
+    /**
+     * @brief Get all coordinates of features for a given source.
+     * All ranges are added to a RangeCollection container, as SeqRange objects.
+     * @param seqId The name of the sequence id to consider.
+     * @param coords [out] a container where to add the coordinates of each feature.
+     */
+    void fillRangeCollectionForSequence(const std::string& seqId, RangeCollection<size_t>& coords) const {
+      for (std::vector<SequenceFeature*>::const_iterator it = features_.begin();
+          it != features_.end();
+          ++it) {
+        if ((**it).getSequenceId() == seqId) {
+          coords.addRange((**it).getRange());
+        }
+      }
+    }
+
+    /**
+     * @param types The feature type.
+     * @return A new set with all features of a given type.
+     */
+    SequenceFeatureSet* getSubsetForType(const std::vector<std::string>& types) const {
+      SequenceFeatureSet* subset = new SequenceFeatureSet();
+      for (std::vector<SequenceFeature*>::const_iterator it = features_.begin();
+          it != features_.end();
+          ++it) {
+        if (std::find(types.begin(), types.end(), (**it).getType()) != types.end()) {
+          subset->addFeature(**it);
+        }
+      }
+      return subset;
+    }
+
+};
+
+} //end of namespace bpp
+
+#endif //_SEQUENCEFEATURE_H_
+
diff --git a/src/Bpp/Seq/Feature/SequenceFeatureTools.cpp b/src/Bpp/Seq/Feature/SequenceFeatureTools.cpp
new file mode 100644
index 0000000..cd89876
--- /dev/null
+++ b/src/Bpp/Seq/Feature/SequenceFeatureTools.cpp
@@ -0,0 +1,103 @@
+//
+// File: SequenceFeatureTools.h
+// Created by: Julien Dutheil
+// Created on: Mon Jul 30 2012
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "SequenceFeatureTools.h"
+
+//From bpp-seq:
+#include <Bpp/Seq/SequenceTools.h> 
+#include <Bpp/Seq/Alphabet/StandardCodonAlphabet.h>
+#include <Bpp/Seq/Alphabet/AlphabetTools.h>
+#include <Bpp/Seq/Alphabet/AlphabetExceptions.h>
+
+//From STL
+#include <vector>
+
+using namespace bpp;
+
+/******************************************************************************/
+
+Sequence* SequenceFeatureTools::extract(const Sequence& seq, const SeqRange& range)
+{
+  if (range.end() > seq.size())
+    throw IndexOutOfBoundsException ("SequenceTools::extract: Invalid upper bound", range.end(), 0, seq.size());
+  Sequence* sout = SequenceTools::subseq(seq, range.begin(), range.end() - 1);
+  if (range.isNegativeStrand()) {
+    SequenceTools::invertComplement(*sout);
+  }
+  return sout;
+}
+
+/******************************************************************************/
+
+unsigned int SequenceFeatureTools::getOrfs(const Sequence& seq, SequenceFeatureSet& featSet) {
+  if (! AlphabetTools::isNucleicAlphabet(seq.getAlphabet())) {
+    throw AlphabetException("SequenceFeatureTools::getOrfs: Sequence alphabet must be nucleic!", seq.getAlphabet());
+  }
+  unsigned int orfCpt = 0;
+  StandardCodonAlphabet codonAlpha(dynamic_cast<const NucleicAlphabet*>(seq.getAlphabet()));
+  std::vector< std::vector<size_t> > starts(3), stops(3);
+  size_t phase = 0;
+  for (size_t p = 0 ; p < seq.size() - 2 ; p++) {
+    phase = p % 3;
+    if (codonAlpha.isInit(codonAlpha.getCodon(seq.getValue(p), seq.getValue(p + 1), seq.getValue(p + 2)))) {
+      starts[phase].push_back(p);
+      //std::cerr << "Start: " << p << " (" << phase << ")" << std::endl;
+    } else if (codonAlpha.isStop(codonAlpha.getCodon(seq.getValue(p), seq.getValue(p + 1), seq.getValue(p + 2)))) {
+      stops[phase].push_back(p);
+      //std::cerr << "Stop:  " << p << " (" << phase << ")" << std::endl;
+    }
+  }
+  for (size_t i = 0 ; i < 3 ; ++i) {
+    std::vector< size_t >::iterator start(starts[i].begin()), stop(stops[i].begin());
+    while (stop != stops[i].end() && start != starts[i].end()) {
+      if (*stop < *start) {
+        stop++;
+      } else {
+        orfCpt++;
+        //std::cerr << "ORF:  " << *start << " - " << *stop + 2 << " (" << i << ")" << std::endl;
+        bpp::BasicSequenceFeature feat("", seq.getName(), "Bio++", "CDS", *start, *stop + 2, '+');
+        featSet.addFeature(feat);
+        start++;
+      }
+    }
+  }
+  return orfCpt;
+}
+
+/******************************************************************************/
diff --git a/src/Bpp/Seq/Feature/SequenceFeatureTools.h b/src/Bpp/Seq/Feature/SequenceFeatureTools.h
new file mode 100644
index 0000000..cb32c80
--- /dev/null
+++ b/src/Bpp/Seq/Feature/SequenceFeatureTools.h
@@ -0,0 +1,82 @@
+//
+// File: SequenceFeatureTools.h
+// Created by: Julien Dutheil
+// Created on: Mon Jul 30 2012
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _SEQUENCEFEATURETOOLS_H_
+#define _SEQUENCEFEATURETOOLS_H_
+
+#include "SequenceFeature.h"
+
+//From bpp-seq:
+#include <Bpp/Seq/Sequence.h>
+
+namespace bpp {
+
+class SequenceFeatureTools
+{
+  public:
+    /**
+     * @brief Extract a sub-sequence given a SeqRange.
+     *
+     * The sub-sequence is revese-complemented if SeqRange is in negative
+     * strand.
+     *
+     * @param seq The Sequence to trunc.
+     * @param range The SeqRange to extract.
+     * @return A new Sequence object with the given subsequence oriented
+     * according to the SeqRange.
+     * @author Sylvain Gaillard
+     */
+    static Sequence* extract(const Sequence& seq, const SeqRange& range);
+
+    /**
+     * @brief Get ORF features for a Sequence.
+     *
+     * @param seq The Sequence where to find ORF. Must be a nucleic sequence.
+     * @param featSet A SequenceFeatureSet to fill with the annotations.
+     * @return The number of ORF found.
+     * @author Sylvain Gaillard
+     */
+    static unsigned int getOrfs(const Sequence& seq, SequenceFeatureSet& featSet);
+
+};
+
+} //end of namespace bpp
+
+#endif //_SEQUENCEFEATURETOOLS_H_
+
diff --git a/src/Bpp/Seq/Io/Fastq.cpp b/src/Bpp/Seq/Io/Fastq.cpp
new file mode 100644
index 0000000..89cd2be
--- /dev/null
+++ b/src/Bpp/Seq/Io/Fastq.cpp
@@ -0,0 +1,111 @@
+// 
+// File:    Fastq.cpp
+// Author:  Sylvain Gaillard
+// Created: 22/11/2011 09:56:29
+// 
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (November 22, 2011)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "Fastq.h"
+#include <Bpp/Seq/SequenceWithQuality.h>
+
+#include <typeinfo>
+
+using namespace bpp;
+
+bool Fastq::nextSequence(std::istream& input, Sequence& seq) const throw (Exception) {
+  if (input && ! input.eof()) {
+    //SequenceWithQuality& sq;
+    std::string buffer;
+    while (TextTools::isEmpty(buffer) && !input.eof()) {
+      getline(input, buffer);
+    }
+    if (input.eof()) { // We hit the end of the file
+      return false;
+    }
+    // first line: seq name
+    if (buffer[0] == '@') {
+      seq.setName(std::string(buffer.begin() + 1, buffer.end()));
+    }
+    // second line: seq
+    getline(input, buffer);
+    seq.setContent(buffer);
+    // third line: seq name (again)
+    getline(input, buffer);
+    if (repeatName()) {
+      std::string secName = std::string(buffer.begin() + 1, buffer.end());
+      if (secName != seq.getName()) {
+        throw Exception("Names are not equivalent for sequence(@ line) and quality (+ line)");
+      }
+    }
+    // fourth line: quality
+    getline(input, buffer);
+    try {
+      SequenceWithQuality& sq = dynamic_cast<SequenceWithQuality&>(seq);
+      for (size_t i = 0 ; i < buffer.size() ; i++) {
+        sq.setQuality(i, static_cast<int>(buffer[i]));
+      }
+    } catch (...) {
+    }
+    return true;
+  }
+  return false;
+}
+
+/******************************************************************************/
+
+void Fastq::writeSequence(std::ostream& output, const Sequence& seq) const throw (Exception)
+{
+  std::string qual(seq.size(), static_cast<char>(33));
+  try {
+    const SequenceWithQuality& sq = dynamic_cast<const SequenceWithQuality&>(seq);
+    for (size_t i = 0 ; i < sq.size() ; i++) {
+      char q = static_cast<char>(sq.getQuality(i));
+      if (q < 33 || q > 126) {
+        throw BadIntegerException("Quality must lie between 33 and 126", q);
+      }
+      qual[i] = q;
+    }
+  } catch (const std::bad_cast& e) {
+    throw Exception("seq must be a SequenceWithQuality object");
+  }
+  output << "@" << seq.getName() << std::endl;
+  output << seq.toString() << std::endl;
+  output << "+";
+  if (repeatName()) {
+    output << seq.getName();
+  }
+  output << std::endl;
+  output << qual << std::endl;
+}
diff --git a/src/Bpp/Seq/Io/Fastq.h b/src/Bpp/Seq/Io/Fastq.h
new file mode 100644
index 0000000..bfb362c
--- /dev/null
+++ b/src/Bpp/Seq/Io/Fastq.h
@@ -0,0 +1,138 @@
+// 
+// File:    Fastq.h
+// Author:  Sylvain Gaillard
+// Created: 22/11/2011 09:56:24
+// 
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (November 22, 2011)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _BPP_SEQ_IO_FASTQ_H_
+#define _BPP_SEQ_IO_FASTQ_H_
+
+#include <string>
+#include <Bpp/Seq/Io/ISequenceStream.h>
+#include <Bpp/Seq/Io/OSequenceStream.h>
+#include <Bpp/Seq/Sequence.h>
+#include <Bpp/Seq/SequenceWithQuality.h>
+
+namespace bpp
+{
+  /**
+   * @brief The fastq sequence file format.
+   *
+   * @author Sylvain Gaillard
+   */
+  class Fastq:
+    public virtual ISequenceStream,
+    public virtual OSequenceStream
+  {
+    private:
+      bool repeatName_;
+
+    public:
+      /**
+       * @brief Build a new Fastq object.
+       *
+       * @param repName Tell if the names in the file is repeated (tested
+       * on input) or must be repeated (for output).
+       */
+      Fastq(bool repName = false): repeatName_(repName) {}
+
+      // Class destructor
+      virtual ~Fastq() {}
+
+    public:
+      /**
+       * @name The IOSequence interface.
+       *
+       * @{
+       */
+      const std::string getFormatName() const { return "FASTQ file"; }
+      const std::string getFormatDescription() const {
+        return "Sequence with quality";
+      }
+      const std::string getDataType() const { return "Sequence with quality"; }
+      /** @} */
+      bool repeatName() const { return repeatName_; }
+      void repeatName(bool yn) { repeatName_ = yn; }
+
+      /**
+       * @name The ISequenceStream interface.
+       *
+       * @{
+       */
+      /**
+       * @copydoc bpp::ISequenceStream::nextSequence()
+       * @author Sylvain Gaillard
+       *
+       * @par Usage
+       *
+       * @code
+       * // Creating a SequenceWithQuality object
+       * DNA alpha;
+       * SequenceWithQuality seq(&alpha);
+       * 
+       * // Create a FastQ parser
+       * Fastq fq;
+       *
+       * // Opening the file
+       * std::ifstream in("reads.fastq");
+       *
+       * // Read the sequences
+       * while (fq.nextSequence(in, seq)) {
+       *   // ... do something with the sequence ...
+       * }
+       *
+       * // Close the file
+       * in.close();
+       * @endcode
+       */
+      bool nextSequence(std::istream& input, Sequence& seq) const throw (Exception);
+      /** @} */
+
+      /**
+       * @name The OSequenceStream interface.
+       *
+       * @{
+       */
+      /**
+       * @copydoc OSequenceStream::writeSequence()
+       * @author Sylvain Gaillard
+       */
+      void writeSequence(std::ostream& output, const Sequence& seq) const throw (Exception);
+      /** @} */
+  };
+}
+
+#endif // _BPP_SEQ_IO_FASTQ_H_
diff --git a/src/Bpp/Seq/Io/Maf/AlignmentFilterMafIterator.cpp b/src/Bpp/Seq/Io/Maf/AlignmentFilterMafIterator.cpp
new file mode 100644
index 0000000..a5c4d21
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/AlignmentFilterMafIterator.cpp
@@ -0,0 +1,465 @@
+//
+// File: AlignmentFilterMafIterator.cpp
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "AlignmentFilterMafIterator.h"
+
+using namespace bpp;
+
+//From the STL:
+#include <string>
+#include <numeric>
+
+using namespace std;
+
+MafBlock* AlignmentFilterMafIterator::analyseCurrentBlock_() throw (Exception)
+{
+  if (blockBuffer_.size() == 0) {
+    //Else there is no more block in the buffer, we need to parse more:
+    do {
+      MafBlock* block = iterator_->nextBlock();
+      if (!block) return 0; //No more block.
+    
+      //Parse block.
+      int gap = AlphabetTools::DNA_ALPHABET.getGapCharacterCode();
+      int unk = AlphabetTools::DNA_ALPHABET.getUnknownCharacterCode();
+      size_t nr;
+      size_t nc = static_cast<size_t>(block->getNumberOfSites());
+
+      vector< vector<int> > aln;
+      if (missingAsGap_) {
+        nr = species_.size();
+        aln.resize(nr);
+        for (size_t i = 0; i < nr; ++i) {
+          if (block->hasSequenceForSpecies(species_[i]))
+            aln[i] = block->getSequenceForSpecies(species_[i]).getContent();
+          else {
+            aln[i].resize(nc); 
+            fill(aln[i].begin(), aln[i].end(), gap);
+          } 
+        }
+      } else {
+        vector<string> speciesSet = VectorTools::vectorIntersection(species_, block->getSpeciesList());
+        nr = speciesSet.size();
+        aln.resize(nr);
+        for (size_t i = 0; i < nr; ++i) {
+          aln[i] = block->getSequenceForSpecies(species_[i]).getContent();
+        }
+      }
+
+
+
+
+      //First we create a mask:
+      vector<size_t> pos;
+      vector<int> col(nr);
+      //Reset window:
+      window_.clear();
+      //Init window:
+      size_t i;
+      if (nc < windowSize_)
+        throw Exception("AlignmentFilterMafIterator::analyseCurrentBlock_. Block is smaller than window size: " + TextTools::toString(nc));
+      for (i = 0; i < windowSize_; ++i) {
+        for (size_t j = 0; j < nr; ++j) {
+          col[j] = aln[j][i];
+        }
+        window_.push_back(col);
+      }
+      //Slide window:
+      if (verbose_) {
+        ApplicationTools::message->endLine();
+        ApplicationTools::displayTask("Sliding window for alignment filter", true);
+      }
+      while (i + step_ < nc) {
+        if (verbose_)
+          ApplicationTools::displayGauge(i - windowSize_, nc - windowSize_ - 1, '>');
+        //Evaluate current window:
+        unsigned int sumGap = 0;
+        double sumEnt = 0;
+        for (size_t u = 0; u < window_.size(); ++u) {
+          for (size_t v = 0; v < window_[u].size(); ++v) {
+            if (window_[u][v] == gap || window_[u][v] == unk) {
+              sumGap++;
+            }
+            col[v] = window_[u][v];
+            if (col[v] == unk) col[v] = gap;
+          }
+          sumEnt += VectorTools::shannonDiscrete<int, double>(col) / log(5.);
+        }
+        if (sumGap > maxGap_ && (sumEnt / static_cast<double>(windowSize_)) > maxEnt_) {
+          if (pos.size() == 0) {
+            pos.push_back(i - windowSize_);
+            pos.push_back(i);
+          } else {
+            if (i - windowSize_ < pos[pos.size() - 1]) {
+              pos[pos.size() - 1] = i; //Windows are overlapping and we extend previous region
+            } else { //This is a new region
+              pos.push_back(i - windowSize_);
+              pos.push_back(i);
+            }
+          }
+        }
+      
+        //Move forward:
+        for (size_t k = 0; k < step_; ++k) {
+          for (size_t j = 0; j < nr; ++j) {
+            col[j] = aln[j][i];
+          }
+          window_.push_back(col);
+          window_.pop_front();
+          ++i;
+        }
+      }
+      
+      //Evaluate last window:
+      unsigned int sumGap = 0;
+      double sumEnt = 0;
+      for (size_t u = 0; u < window_.size(); ++u) {
+        for (size_t v = 0; v < window_[u].size(); ++v) {
+          if (window_[u][v] == gap || window_[u][v] == unk) {
+            sumGap++;
+          }
+          col[v] = window_[u][v];
+          if (col[v] == unk) col[v] = gap;
+        }
+        sumEnt += VectorTools::shannonDiscrete<int, double>(col) / log(5.);
+      }
+      if (sumGap > maxGap_ && (sumEnt / static_cast<double>(windowSize_)) > maxEnt_) {
+        if (pos.size() == 0) {
+          pos.push_back(i - windowSize_);
+          pos.push_back(i);
+        } else {
+          if (i - windowSize_ <= pos[pos.size() - 1]) {
+            pos[pos.size() - 1] = i; //Windows are overlapping and we extend previous region
+          } else { //This is a new region
+            pos.push_back(i - windowSize_);
+            pos.push_back(i);
+          }
+        }
+      } 
+      if (verbose_)
+        ApplicationTools::displayTaskDone();
+    
+      //Now we remove regions with two many gaps, using a sliding window:
+      if (pos.size() == 0) {
+        blockBuffer_.push_back(block);
+        if (logstream_) {
+          (*logstream_ << "ALN CLEANER: block " << block->getDescription() << " is clean and kept as is.").endLine();
+        }
+      } else if (pos.size() == 2 && pos.front() == 0 && pos.back() == block->getNumberOfSites()) {
+        //Everything is removed:
+        if (logstream_) {
+          (*logstream_ << "ALN CLEANER: block " << block->getDescription() << " was entirely removed. Tried to get the next one.").endLine();
+        }
+      } else {
+        if (logstream_) {
+          (*logstream_ << "ALN CLEANER: block " << block->getDescription() << " with size "<< block->getNumberOfSites() << " will be split into " << (pos.size() / 2 + 1) << " blocks.").endLine();
+        }
+        if (verbose_) {
+          ApplicationTools::message->endLine();
+          ApplicationTools::displayTask("Spliting block", true);
+        }
+        for (i = 0; i < pos.size(); i+=2) {
+          if (verbose_)
+            ApplicationTools::displayGauge(i, pos.size() - 2, '=');
+          if (logstream_) {
+            (*logstream_ << "ALN CLEANER: removing region (" << pos[i] << ", " << pos[i+1] << ") from block " << block->getDescription() << ".").endLine();
+          }
+          if (pos[i] > 0) {
+            MafBlock* newBlock = new MafBlock();
+            newBlock->setScore(block->getScore());
+            newBlock->setPass(block->getPass());
+            for (size_t j = 0; j < block->getNumberOfSequences(); ++j) {
+              MafSequence* subseq;
+              if (i == 0) {
+                subseq = block->getSequence(j).subSequence(0, pos[i]);
+              } else {
+                subseq = block->getSequence(j).subSequence(pos[i - 1], pos[i] - pos[i - 1]);
+              }
+              newBlock->addSequence(*subseq);
+              delete subseq;
+            }
+            blockBuffer_.push_back(newBlock);
+          }
+        
+          if (keepTrashedBlocks_) {
+            MafBlock* outBlock = new MafBlock();
+            outBlock->setScore(block->getScore());
+            outBlock->setPass(block->getPass());
+            for (size_t j = 0; j < block->getNumberOfSequences(); ++j) {
+              MafSequence* outseq = block->getSequence(j).subSequence(pos[i], pos[i + 1] - pos[i]);
+              outBlock->addSequence(*outseq);
+              delete outseq;
+            } 
+            trashBuffer_.push_back(outBlock);
+          }
+        }
+        //Add last block:
+        if (pos[pos.size() - 1] < block->getNumberOfSites()) {
+          MafBlock* newBlock = new MafBlock();
+          newBlock->setScore(block->getScore());
+          newBlock->setPass(block->getPass());
+          for (size_t j = 0; j < block->getNumberOfSequences(); ++j) {
+            MafSequence* subseq;
+            subseq = block->getSequence(j).subSequence(pos[pos.size() - 1], block->getNumberOfSites() - pos[pos.size() - 1]);
+            newBlock->addSequence(*subseq);
+            delete subseq;
+          }
+          blockBuffer_.push_back(newBlock);
+        }
+        if (verbose_)
+          ApplicationTools::displayTaskDone();
+
+        delete block;
+      }
+    } while (blockBuffer_.size() == 0);
+  }
+
+  MafBlock* block = blockBuffer_.front();
+  blockBuffer_.pop_front();
+  return block;
+}
+
+MafBlock* AlignmentFilter2MafIterator::analyseCurrentBlock_() throw (Exception)
+{
+  if (blockBuffer_.size() == 0) {
+    //Else there is no more block in the buffer, we need to parse more:
+    do {
+      MafBlock* block = iterator_->nextBlock();
+      if (!block) return 0; //No more block.
+    
+      //Parse block.
+      int gap = AlphabetTools::DNA_ALPHABET.getGapCharacterCode();
+      int unk = AlphabetTools::DNA_ALPHABET.getUnknownCharacterCode();
+      size_t nr;
+      size_t nc = static_cast<size_t>(block->getNumberOfSites());
+
+      vector< vector<int> > aln;
+      if (missingAsGap_) {
+        nr = species_.size();
+        aln.resize(nr);
+        for (size_t i = 0; i < nr; ++i) {
+          if (block->hasSequenceForSpecies(species_[i]))
+            aln[i] = block->getSequenceForSpecies(species_[i]).getContent();
+          else {
+            aln[i].resize(nc); 
+            fill(aln[i].begin(), aln[i].end(), gap);
+          } 
+        }
+      } else {
+        vector<string> speciesSet = VectorTools::vectorIntersection(species_, block->getSpeciesList());
+        nr = speciesSet.size();
+        aln.resize(nr);
+        for (size_t i = 0; i < nr; ++i) {
+          aln[i] = block->getSequenceForSpecies(species_[i]).getContent();
+        }
+      }
+      //First we create a mask:
+      vector<size_t> pos;
+      vector<bool> col(nr);
+      //Reset window:
+      window_.clear();
+      //Init window:
+      size_t i;
+      for (i = 0; i < windowSize_; ++i) {
+        for (size_t j = 0; j < nr; ++j) {
+          col[j] = (aln[j][i] == gap || aln[j][i] == unk);
+        }
+        window_.push_back(col);
+      }
+      //Slide window:
+      if (verbose_) {
+        ApplicationTools::message->endLine();
+        ApplicationTools::displayTask("Sliding window for alignment filter", true);
+      }
+      while (i + step_ < nc) {
+        if (verbose_)
+          ApplicationTools::displayGauge(i - windowSize_, nc - windowSize_ - 1, '>');
+        //Evaluate current window:
+        unsigned int count = 0;
+        bool posIsGap = true;
+        for (size_t u = 0; u < window_.size(); ++u) {
+          unsigned int partialCount = 0;
+          if (!posIsGap || (u > 0 && window_[u] != window_[u - 1])) {
+            for (size_t v = 0; v < window_[u].size(); ++v)
+              if (window_[u][v]) partialCount++;
+            if (partialCount > maxGap_) {
+              count++;
+              posIsGap = true;
+            } else {
+              posIsGap = false;
+            }
+          }
+        }
+        if (count > maxPos_) {
+          if (pos.size() == 0) {
+            pos.push_back(i - windowSize_);
+            pos.push_back(i);
+          } else {
+            if (i - windowSize_ < pos[pos.size() - 1]) {
+              pos[pos.size() - 1] = i; //Windows are overlapping and we extend previous region
+            } else { //This is a new region
+              pos.push_back(i - windowSize_);
+              pos.push_back(i);
+            }
+          }
+        }
+      
+        //Move forward:
+        for (size_t k = 0; k < step_; ++k) {
+          for (size_t j = 0; j < nr; ++j) {
+            col[j] = (aln[j][i] == gap || aln[j][i] == unk);
+          }
+          window_.push_back(col);
+          window_.pop_front();
+          ++i;
+        }
+      }
+
+      //Evaluate last window:
+      unsigned int count = 0;
+      bool posIsGap = true;
+      for (size_t u = 0; u < window_.size(); ++u) {
+        unsigned int partialCount = 0;
+        if (!posIsGap || (u > 0 && window_[u] != window_[u - 1])) {
+          for (size_t v = 0; v < window_[u].size(); ++v)
+            if (window_[u][v]) partialCount++;
+          if (partialCount > maxGap_) {
+            count++;
+            posIsGap = true;
+          } else {
+            posIsGap = false;
+          }
+        }
+      }
+      if (count > maxPos_) {
+        if (pos.size() == 0) {
+          pos.push_back(i - windowSize_);
+          pos.push_back(i);
+        } else {
+          if (i - windowSize_ <= pos[pos.size() - 1]) {
+            pos[pos.size() - 1] = i; //Windows are overlapping and we extend previous region
+          } else { //This is a new region
+            pos.push_back(i - windowSize_);
+            pos.push_back(i);
+          }
+        }
+      } 
+      if (verbose_)
+        ApplicationTools::displayTaskDone();
+    
+      //Now we remove regions with two many gaps, using a sliding window:
+      if (pos.size() == 0) {
+        blockBuffer_.push_back(block);
+        if (logstream_) {
+          (*logstream_ << "ALN CLEANER: block " << block->getDescription() << " is clean and kept as is.").endLine();
+        }
+      } else if (pos.size() == 2 && pos.front() == 0 && pos.back() == block->getNumberOfSites()) {
+        //Everything is removed:
+        if (logstream_) {
+          (*logstream_ << "ALN CLEANER: block " << block->getDescription() << " was entirely removed. Tried to get the next one.").endLine();
+        }
+      } else {
+        if (logstream_) {
+          (*logstream_ << "ALN CLEANER: block " << block->getDescription() << " with size "<< block->getNumberOfSites() << " will be split into " << (pos.size() / 2 + 1) << " blocks.").endLine();
+        }
+        if (verbose_) {
+          ApplicationTools::message->endLine();
+          ApplicationTools::displayTask("Spliting block", true);
+        }
+        for (i = 0; i < pos.size(); i+=2) {
+          if (verbose_)
+            ApplicationTools::displayGauge(i, pos.size() - 2, '=');
+          if (logstream_) {
+            (*logstream_ << "ALN CLEANER: removing region (" << pos[i] << ", " << pos[i+1] << ") from block " << block->getDescription() << ".").endLine();
+          }
+          if (pos[i] > 0) {
+            MafBlock* newBlock = new MafBlock();
+            newBlock->setScore(block->getScore());
+            newBlock->setPass(block->getPass());
+            for (size_t j = 0; j < block->getNumberOfSequences(); ++j) {
+              MafSequence* subseq;
+              if (i == 0) {
+                subseq = block->getSequence(j).subSequence(0, pos[i]);
+              } else {
+                subseq = block->getSequence(j).subSequence(pos[i - 1], pos[i] - pos[i - 1]);
+              }
+              newBlock->addSequence(*subseq);
+              delete subseq;
+            }
+            blockBuffer_.push_back(newBlock);
+          }
+        
+          if (keepTrashedBlocks_) {
+            MafBlock* outBlock = new MafBlock();
+            outBlock->setScore(block->getScore());
+            outBlock->setPass(block->getPass());
+            for (size_t j = 0; j < block->getNumberOfSequences(); ++j) {
+              MafSequence* outseq = block->getSequence(j).subSequence(pos[i], pos[i + 1] - pos[i]);
+              outBlock->addSequence(*outseq);
+              delete outseq;
+            } 
+            trashBuffer_.push_back(outBlock);
+          }
+        }
+        //Add last block:
+        if (pos[pos.size() - 1] < block->getNumberOfSites()) {
+          MafBlock* newBlock = new MafBlock();
+          newBlock->setScore(block->getScore());
+          newBlock->setPass(block->getPass());
+          for (size_t j = 0; j < block->getNumberOfSequences(); ++j) {
+            MafSequence* subseq;
+            subseq = block->getSequence(j).subSequence(pos[pos.size() - 1], block->getNumberOfSites() - pos[pos.size() - 1]);
+            newBlock->addSequence(*subseq);
+            delete subseq;
+          }
+          blockBuffer_.push_back(newBlock);
+        }
+        if (verbose_)
+          ApplicationTools::displayTaskDone();
+
+        delete block;
+      }
+    } while (blockBuffer_.size() == 0);
+  }
+
+  MafBlock* block = blockBuffer_.front();
+  blockBuffer_.pop_front();
+  return block;
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/AlignmentFilterMafIterator.h b/src/Bpp/Seq/Io/Maf/AlignmentFilterMafIterator.h
new file mode 100644
index 0000000..2f83f70
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/AlignmentFilterMafIterator.h
@@ -0,0 +1,167 @@
+//
+// File: AlignmentFilterMafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _ALIGNMENTFILTERMAFITERATOR_H_
+#define _ALIGNMENTFILTERMAFITERATOR_H_
+
+#include "MafIterator.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief Filter maf blocks to remove ambiguously aligned or non-informative regions.
+ *
+ * Regions with a too high proportion of gaps, unknown character or high entropy in a set of species will be removed,
+ * and blocks adjusted accordingly. 
+ *
+ * The total entropy of a window is defined as @f$ \frac{\sum_i {E(5)}_i}{w} @f$ where @f$E(5)_i at f$ is the shannon entropy of site i, computed using a logarithm of base 5, and w is the window size.
+ * As a result, the total entropy is normalized so that it falls between 0 and 1. A logarithm of base 5 is used to account for the fact that gaps are considered as a state.
+ *
+ * In case a sequence from the list is missing, it can be either ignored or counted as a full sequence of gaps.
+ */
+class AlignmentFilterMafIterator:
+  public AbstractFilterMafIterator,
+  public virtual MafTrashIterator
+{
+  private:
+    std::vector<std::string> species_;
+    unsigned int windowSize_;
+    unsigned int step_;
+    unsigned int maxGap_;
+    double maxEnt_;
+    std::deque<MafBlock*> blockBuffer_;
+    std::deque<MafBlock*> trashBuffer_;
+    std::deque< std::vector<int> > window_;
+    bool keepTrashedBlocks_;
+    bool missingAsGap_;
+
+  public:
+    AlignmentFilterMafIterator(MafIterator* iterator,
+        const std::vector<std::string>& species,
+        unsigned int windowSize,
+        unsigned int step,
+        unsigned int maxGap,
+        double maxEnt,
+        bool keepTrashedBlocks,
+        bool missingAsGap) :
+      AbstractFilterMafIterator(iterator),
+      species_(species),
+      windowSize_(windowSize),
+      step_(step),
+      maxGap_(maxGap),
+      maxEnt_(maxEnt),
+      blockBuffer_(),
+      trashBuffer_(),
+      window_(species.size()),
+      keepTrashedBlocks_(keepTrashedBlocks),
+      missingAsGap_(missingAsGap)
+    {}
+
+  public:
+    MafBlock* nextRemovedBlock() throw (Exception) {
+      if (trashBuffer_.size() == 0) return 0;
+      MafBlock* block = trashBuffer_.front();
+      trashBuffer_.pop_front();
+      return block;
+    }
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception);
+};
+
+/**
+ * @brief Filter maf blocks to remove ambiguously aligned or non-informative regions.
+ *
+ * This iterators offers a different algorithm than AlignmentFilterMafIterator.
+ * It takes two parameters: g=maxGap and n=maxPos. Windows with more than n positions containing each of them more than g=maxPos gaps will be discarded.
+ * In addition, consecutives patterns are only counted once.
+ * In case a sequence from the list is missing, it can be either ignored or counted as a full sequence of gaps.
+ */
+class AlignmentFilter2MafIterator:
+  public AbstractFilterMafIterator,
+  public virtual MafTrashIterator
+{
+  private:
+    std::vector<std::string> species_;
+    unsigned int windowSize_;
+    unsigned int step_;
+    unsigned int maxGap_;
+    unsigned int maxPos_;
+    std::deque<MafBlock*> blockBuffer_;
+    std::deque<MafBlock*> trashBuffer_;
+    std::deque< std::vector<bool> > window_;
+    bool keepTrashedBlocks_;
+    bool missingAsGap_;
+
+  public:
+    AlignmentFilter2MafIterator(MafIterator* iterator, const std::vector<std::string>& species, unsigned int windowSize, unsigned int step, unsigned int maxGap, unsigned int maxPos, bool keepTrashedBlocks, bool missingAsGap) :
+      AbstractFilterMafIterator(iterator),
+      species_(species),
+      windowSize_(windowSize),
+      step_(step),
+      maxGap_(maxGap),
+      maxPos_(maxPos),
+      blockBuffer_(),
+      trashBuffer_(),
+      window_(species.size()),
+      keepTrashedBlocks_(keepTrashedBlocks),
+      missingAsGap_(missingAsGap)
+    {}
+
+  public:
+    MafBlock* nextRemovedBlock() throw (Exception) {
+      if (trashBuffer_.size() == 0) return 0;
+      MafBlock* block = trashBuffer_.front();
+      trashBuffer_.pop_front();
+      return block;
+    }
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception);
+
+};
+
+} // end of namespace bpp.
+
+#endif //_ALIGNMENTFILTERMAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/BlockLengthMafIterator.h b/src/Bpp/Seq/Io/Maf/BlockLengthMafIterator.h
new file mode 100644
index 0000000..0cb1153
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/BlockLengthMafIterator.h
@@ -0,0 +1,89 @@
+//
+// File: BlockLengthMafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _BLOCKLENGTHMAFITERATOR_H_
+#define _BLOCKLENGTHMAFITERATOR_H_
+
+#include "MafIterator.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief Filter maf blocks to keep only the ones with a minimum number of sites.
+ */
+class BlockLengthMafIterator:
+  public AbstractFilterMafIterator
+{
+  private:
+    size_t minLength_;
+
+  public:
+    BlockLengthMafIterator(MafIterator* iterator, size_t minLength) :
+      AbstractFilterMafIterator(iterator),
+      minLength_(minLength)
+    {}
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception) {
+      bool test;
+      do {
+        currentBlock_ = iterator_->nextBlock();
+        if (!currentBlock_) break;
+        test = (currentBlock_->getNumberOfSites() < minLength_);
+        if (test) {
+          if (logstream_) {
+            (*logstream_ << "BLOCK LENGTH FILTER: block " << currentBlock_->getDescription() << " with size " << currentBlock_->getNumberOfSites() << " was discarded.").endLine();
+          }
+          delete currentBlock_;
+          currentBlock_ = 0;
+        }
+      } while (test);
+      return currentBlock_;
+    }
+
+};
+
+} // end of namespace bpp.
+
+#endif //_BLOCKLENGTHMAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/BlockMergerMafIterator.cpp b/src/Bpp/Seq/Io/Maf/BlockMergerMafIterator.cpp
new file mode 100644
index 0000000..3c1930f
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/BlockMergerMafIterator.cpp
@@ -0,0 +1,168 @@
+//
+// File: BlockMergerMafIterator.cpp
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "BlockMergerMafIterator.h"
+
+using namespace bpp;
+
+//From the STL:
+#include <string>
+#include <numeric>
+
+using namespace std;
+
+MafBlock* BlockMergerMafIterator::analyseCurrentBlock_() throw (Exception)
+{
+  if (!incomingBlock_) return 0;
+  currentBlock_  = incomingBlock_;
+  incomingBlock_ = iterator_->nextBlock();
+  while (incomingBlock_) {
+    size_t globalSpace = 0;
+    for (size_t i = 0; i < species_.size(); ++i) {
+      try {
+        const MafSequence* seq1 = &currentBlock_->getSequenceForSpecies(species_[i]); 
+        const MafSequence* seq2 = &incomingBlock_->getSequenceForSpecies(species_[i]);
+        if (!seq1->hasCoordinates() || !seq2->hasCoordinates())
+          throw Exception("BlockMergerMafIterator::nextBlock. Species '" + species_[i] + "' is missing coordinates in at least one block.");
+
+        if (seq1->stop() >= seq2->start())
+          return currentBlock_;
+        size_t space = seq2->start() - seq1->stop() - 1;
+        if (space > maxDist_)
+          return currentBlock_;
+        if (i == 0)
+          globalSpace = space;
+        else {
+          if (space != globalSpace)
+            return currentBlock_;
+        }
+        if (seq1->getChromosome() != seq2->getChromosome()
+         || VectorTools::contains(ignoreChrs_, seq1->getChromosome())
+         || VectorTools::contains(ignoreChrs_, seq2->getChromosome())
+         || seq1->getStrand() != seq2->getStrand()
+         || seq1->getSrcSize() != seq2->getSrcSize())
+        {
+          //There is a syntheny break in this sequence, so we do not merge the blocks.
+          return currentBlock_;
+        }
+      } catch (SequenceNotFoundException& snfe) {
+        //At least one block does not contain the sequence.
+        //We don't merge the blocks:
+        return currentBlock_;
+      }
+    }
+    //We merge the two blocks:
+    if (logstream_) {
+      (*logstream_ << "BLOCK MERGER: merging two consecutive blocks.").endLine();
+    }
+    vector<string> sp1 = currentBlock_->getSpeciesList();
+    vector<string> sp2 = incomingBlock_->getSpeciesList();
+    vector<string> allSp = VectorTools::unique(VectorTools::vectorUnion(sp1, sp2));
+    //We need to create a new MafBlock:
+    MafBlock* mergedBlock = new MafBlock();
+    //We average the score and pass values:
+    unsigned int p1 = currentBlock_->getPass();
+    unsigned int p2 = incomingBlock_->getPass();
+    if (p1 == p2) mergedBlock->setPass(p1);
+    double s1 = currentBlock_->getScore();
+    double n1 = static_cast<double>(currentBlock_->getNumberOfSites());
+    double s2 = incomingBlock_->getScore();
+    double n2 = static_cast<double>(incomingBlock_->getNumberOfSites());
+    mergedBlock->setScore((s1 * n1 + s2 * n2) / (n1 + n2));
+
+    //Now fill the new block:
+    for (size_t i = 0; i < allSp.size(); ++i) {
+      auto_ptr<MafSequence> seq;
+      try {
+        seq.reset(new MafSequence(currentBlock_->getSequenceForSpecies(allSp[i])));
+
+        //Check is there is a second sequence:
+        try {
+          auto_ptr<MafSequence> tmp(new MafSequence(incomingBlock_->getSequenceForSpecies(allSp[i])));
+          string ref1 = seq->getDescription(), ref2 = tmp->getDescription();
+          //Add spacer if needed:
+          if (globalSpace > 0) {
+            if (logstream_) {
+              (*logstream_ << "BLOCK MERGER: a spacer of size " << globalSpace <<" is inserted in sequence for species " << allSp[i] << ".").endLine();
+            }
+            seq->append(vector<int>(globalSpace, AlphabetTools::DNA_ALPHABET.getUnknownCharacterCode()));
+          }
+          if (seq->getChromosome() != tmp->getChromosome()) {
+            seq->setChromosome(seq->getChromosome() + "-" + tmp->getChromosome());
+            seq->removeCoordinates();
+          }
+          if (seq->getStrand() != tmp->getStrand()) {
+            seq->setStrand('?');
+            seq->removeCoordinates();
+          }
+          if (seq->getName() != tmp->getName())
+            tmp->setName(seq->getName()); //force name conversion to prevent exception in 'merge'.
+          seq->merge(*tmp);
+          if (logstream_) {
+            (*logstream_ << "BLOCK MERGER: merging " << ref1 << " with " << ref2 << " into " << seq->getDescription()).endLine();
+          }
+        } catch (SequenceNotFoundException& snfe2) {
+          //There was a first sequence, we just extend it:
+          string ref1 = seq->getDescription();
+          seq->setToSizeR(seq->size() + incomingBlock_->getNumberOfSites() + globalSpace);
+          if (logstream_) {
+            (*logstream_ << "BLOCK MERGER: extending " << ref1 << " with " << incomingBlock_->getNumberOfSites() << " gaps on the right.").endLine();
+          }
+        }
+      } catch (SequenceNotFoundException& snfe1) {
+        //There must be a second sequence then:
+        seq.reset(new MafSequence(incomingBlock_->getSequenceForSpecies(allSp[i])));
+        string ref2 = seq->getDescription();
+        seq->setToSizeL(seq->size() + currentBlock_->getNumberOfSites() + globalSpace);
+        if (logstream_) {
+          (*logstream_ << "BLOCK MERGER: adding " << ref2 << " and extend it with " << currentBlock_->getNumberOfSites() << " gaps on the left.").endLine();
+        }
+      }
+      mergedBlock->addSequence(*seq);
+    }
+    //Cleaning stuff:
+    delete currentBlock_;
+    delete incomingBlock_;
+    currentBlock_ = mergedBlock;
+    //We check if we can also merge the next block:
+    incomingBlock_ = iterator_->nextBlock();
+  }
+  return currentBlock_;
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/BlockMergerMafIterator.h b/src/Bpp/Seq/Io/Maf/BlockMergerMafIterator.h
new file mode 100644
index 0000000..21a6f38
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/BlockMergerMafIterator.h
@@ -0,0 +1,117 @@
+//
+// File: BlockMergerMafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _BLOCKMERGERMAFITERATOR_H_
+#define _BLOCKMERGERMAFITERATOR_H_
+
+#include "MafIterator.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief Merge blocks if some of their sequences are contiguous.
+ *
+ * The user specifies the focus species. Sequences that are not in this set will
+ * be automatically merged and their coordinates removed.
+ * The scores, if any, will be averaged for the block, weighted by the corresponding block sizes.
+ * The pass value will be removed if it is different for the two blocks.
+ * It is possible to define a maximum distance for the merging. Setting a distance of zero implies that the blocks
+ * have to be exactly contiguous. Alternatively, the appropriate number of 'N' will be inserted in all species.
+ * All species however have to be distant of the exact same amount.
+ */
+class BlockMergerMafIterator:
+  public AbstractFilterMafIterator
+{
+  private:
+    std::vector<std::string> species_;
+    MafBlock* incomingBlock_;
+    std::vector<std::string> ignoreChrs_; //These chromsomes will never be merged (ex: 'Un').
+    unsigned int maxDist_;
+
+  public:
+    BlockMergerMafIterator(MafIterator* iterator, const std::vector<std::string>& species, unsigned int maxDist = 0) :
+      AbstractFilterMafIterator(iterator),
+      species_(species),
+      incomingBlock_(0),
+      ignoreChrs_(),
+      maxDist_(maxDist)
+    {
+      incomingBlock_ = iterator->nextBlock();
+    }
+
+  private:
+    BlockMergerMafIterator(const BlockMergerMafIterator& iterator) :
+      AbstractFilterMafIterator(0),
+      species_(iterator.species_),
+      incomingBlock_(iterator.incomingBlock_),
+      ignoreChrs_(iterator.ignoreChrs_),
+      maxDist_(iterator.maxDist_)
+    {}
+    
+    BlockMergerMafIterator& operator=(const BlockMergerMafIterator& iterator)
+    {
+      species_       = iterator.species_;
+      incomingBlock_ = iterator.incomingBlock_;
+      ignoreChrs_    = iterator.ignoreChrs_;
+      maxDist_       = iterator.maxDist_;
+      return *this;
+    }
+
+  public:
+    /**
+     * brief Add a chromosome that should be ignored to the list.
+     * @param chr The name of the chromosome to be ignored.
+     */
+    void ignoreChromosome(const std::string& chr) {
+      ignoreChrs_.push_back(chr);
+    }
+  
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception);
+
+};
+
+} // end of namespace bpp.
+
+#endif //_BLOCKMERGERMAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/BlockSizeMafIterator.h b/src/Bpp/Seq/Io/Maf/BlockSizeMafIterator.h
new file mode 100644
index 0000000..35e2066
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/BlockSizeMafIterator.h
@@ -0,0 +1,89 @@
+//
+// File: BlockSizeMafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _BLOCKSIZEMAFITERATOR_H_
+#define _BLOCKSIZEMAFITERATOR_H_
+
+#include "MafIterator.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief Filter maf blocks to keep only the ones with a minimum number of species.
+ */
+class BlockSizeMafIterator:
+  public AbstractFilterMafIterator
+{
+  private:
+    unsigned int minSize_;
+
+  public:
+    BlockSizeMafIterator(MafIterator* iterator, unsigned int minSize) :
+      AbstractFilterMafIterator(iterator),
+      minSize_(minSize)
+    {}
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception) {
+      bool test;
+      do {
+        currentBlock_ = iterator_->nextBlock();
+        if (!currentBlock_) break;
+        test = (currentBlock_->getNumberOfSequences() < minSize_);
+        if (test) {
+          if (logstream_) {
+            (*logstream_ << "BLOCK SIZE FILTER: block " << currentBlock_->getDescription() << " with size " << currentBlock_->getNumberOfSites() << " was discarded.").endLine();
+          }
+          delete currentBlock_;
+          currentBlock_ = 0;
+        }
+      } while (test);
+      return currentBlock_;
+    }
+
+};
+
+} // end of namespace bpp.
+
+#endif //_BLOCKSIZEMAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/ChromosomeMafIterator.cpp b/src/Bpp/Seq/Io/Maf/ChromosomeMafIterator.cpp
new file mode 100644
index 0000000..f9f433f
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/ChromosomeMafIterator.cpp
@@ -0,0 +1,83 @@
+//
+// File: ChromosomeMafIterator.cpp
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "ChromosomeMafIterator.h"
+
+using namespace bpp;
+
+//From the STL:
+#include <string>
+#include <numeric>
+
+using namespace std;
+
+MafBlock* ChromosomeMafIterator::analyseCurrentBlock_() throw (Exception)
+{
+  currentBlock_ = iterator_->nextBlock();
+  while (currentBlock_) {
+    bool foundRef = false;
+    string chr = "";
+    for (size_t i = 0; i < currentBlock_->getNumberOfSequences() && !foundRef; ++i) {
+      string species = currentBlock_->getSequence(i).getSpecies(); 
+      if (species == ref_) {
+        foundRef = true;
+        chr = currentBlock_->getSequence(i).getChromosome();
+      }
+    }
+    if (!foundRef) {
+      if (logstream_) {
+        (*logstream_ << "CHROMOSOME FILTER: block does not contain reference species and was removed.").endLine();
+      }
+      delete currentBlock_;
+    } else if (chr != chr_) {
+      if (logstream_) {
+        (*logstream_ << "CHROMOSOME FILTER: reference species without queried chromosome was removed.").endLine();
+      }
+      delete currentBlock_;
+    } else {
+      return currentBlock_;
+    }
+
+    //Look for the next block:
+    currentBlock_ = iterator_->nextBlock();
+  }
+  
+  return currentBlock_;
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/ChromosomeMafIterator.h b/src/Bpp/Seq/Io/Maf/ChromosomeMafIterator.h
new file mode 100644
index 0000000..0276e58
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/ChromosomeMafIterator.h
@@ -0,0 +1,95 @@
+//
+// File: ChromosomeMafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _CHROMOSOMEMAFITERATOR_H_
+#define _CHROMOSOMEMAFITERATOR_H_
+
+#include "MafIterator.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief Filter maf blocks to keep only the block corresponding to one chromosome (of a reference sequence).
+ */
+class ChromosomeMafIterator:
+  public AbstractFilterMafIterator
+{
+  private:
+    std::string ref_;
+    std::string chr_;
+
+  public:
+    /**
+     * @param iterator The input iterator.
+     * @param reference The reference species name.
+     * @param chr the chromosome name to filter.
+     */
+    ChromosomeMafIterator(MafIterator* iterator, const std::string& reference, const std::string& chr) :
+      AbstractFilterMafIterator(iterator),
+      ref_(reference),
+      chr_(chr)
+    {}
+
+  private:
+    ChromosomeMafIterator(const ChromosomeMafIterator& iterator) :
+      AbstractFilterMafIterator(0),
+      ref_(iterator.ref_),
+      chr_(iterator.chr_)
+    {}
+    
+    ChromosomeMafIterator& operator=(const ChromosomeMafIterator& iterator)
+    {
+      ref_ = iterator.ref_;
+      chr_ = iterator.chr_;
+      return *this;
+    }
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception);
+
+};
+
+} // end of namespace bpp.
+
+#endif //_CHROMOSOMEMAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/ConcatenateMafIterator.cpp b/src/Bpp/Seq/Io/Maf/ConcatenateMafIterator.cpp
new file mode 100644
index 0000000..933b6b1
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/ConcatenateMafIterator.cpp
@@ -0,0 +1,127 @@
+//
+// File: ConcatenateMafIterator.cpp
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "ConcatenateMafIterator.h"
+
+using namespace bpp;
+
+//From the STL:
+#include <string>
+#include <numeric>
+
+using namespace std;
+
+MafBlock* ConcatenateMafIterator::analyseCurrentBlock_() throw (Exception)
+{
+  if (!incomingBlock_) return 0;
+  currentBlock_  = incomingBlock_;
+  incomingBlock_ = iterator_->nextBlock();
+  while (incomingBlock_) {
+    if (currentBlock_->getNumberOfSites() >= minimumSize_) {
+      return currentBlock_;
+    }
+    //We merge the two blocks:
+    vector<string> sp1 = currentBlock_->getSpeciesList();
+    vector<string> sp2 = incomingBlock_->getSpeciesList();
+    vector<string> allSp = VectorTools::unique(VectorTools::vectorUnion(sp1, sp2));
+    //We need to create a new MafBlock:
+    MafBlock* mergedBlock = new MafBlock();
+    //We average the score and pass values:
+    unsigned int p1 = currentBlock_->getPass();
+    unsigned int p2 = incomingBlock_->getPass();
+    if (p1 == p2) mergedBlock->setPass(p1);
+    double s1 = currentBlock_->getScore();
+    double n1 = static_cast<double>(currentBlock_->getNumberOfSites());
+    double s2 = incomingBlock_->getScore();
+    double n2 = static_cast<double>(incomingBlock_->getNumberOfSites());
+    mergedBlock->setScore((s1 * n1 + s2 * n2) / (n1 + n2));
+
+    //Now fill the new block:
+    for (size_t i = 0; i < allSp.size(); ++i) {
+      auto_ptr<MafSequence> seq;
+      try {
+        seq.reset(new MafSequence(currentBlock_->getSequenceForSpecies(allSp[i])));
+
+        //Check is there is a second sequence:
+        try {
+          auto_ptr<MafSequence> tmp(new MafSequence(incomingBlock_->getSequenceForSpecies(allSp[i])));
+          string ref1 = seq->getDescription(), ref2 = tmp->getDescription();
+          if (seq->getChromosome() != tmp->getChromosome()) {
+            seq->setChromosome("fus");
+            seq->removeCoordinates();
+          }
+          if (seq->getStrand() != tmp->getStrand()) {
+            seq->setStrand('?');
+            seq->removeCoordinates();
+          }
+          if (seq->getName() != tmp->getName())
+            tmp->setName(seq->getName()); //force name conversion to prevent exception in 'merge'.
+          seq->merge(*tmp);
+          if (logstream_) {
+            (*logstream_ << "BLOCK CONCATENATE: merging " << ref1 << " with " << ref2 << " into " << seq->getDescription()).endLine();
+          }
+        } catch (SequenceNotFoundException& snfe2) {
+          //There was a first sequence, we just extend it:
+          string ref1 = seq->getDescription();
+          seq->setToSizeR(seq->size() + incomingBlock_->getNumberOfSites());
+          if (logstream_) {
+            (*logstream_ << "BLOCK CONCATENATE: extending " << ref1 << " with " << incomingBlock_->getNumberOfSites() << " gaps on the right.").endLine();
+          }
+        }
+      } catch (SequenceNotFoundException& snfe1) {
+        //There must be a second sequence then:
+        seq.reset(new MafSequence(incomingBlock_->getSequenceForSpecies(allSp[i])));
+        string ref2 = seq->getDescription();
+        seq->setToSizeL(seq->size() + currentBlock_->getNumberOfSites());
+        if (logstream_) {
+          (*logstream_ << "BLOCK CONCATENATE: adding " << ref2 << " and extend it with " << currentBlock_->getNumberOfSites() << " gaps on the left.").endLine();
+        }
+      }
+      mergedBlock->addSequence(*seq);
+    }
+    //Cleaning stuff:
+    delete currentBlock_;
+    delete incomingBlock_;
+    currentBlock_ = mergedBlock;
+    //We check if we can also merge the next block:
+    incomingBlock_ = iterator_->nextBlock();
+  }
+  return currentBlock_;
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/ConcatenateMafIterator.h b/src/Bpp/Seq/Io/Maf/ConcatenateMafIterator.h
new file mode 100644
index 0000000..6c35619
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/ConcatenateMafIterator.h
@@ -0,0 +1,96 @@
+//
+// File: ConcatenateMafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _CONCATENATEMAFITERATOR_H_
+#define _CONCATENATEMAFITERATOR_H_
+
+#include "MafIterator.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief Concatenate blocks up to a certain size.
+ *
+ * Blocks are appended regardless of their coordinates, to form concatenated blocks of at least a given number of positions.
+ * The scores, if any, will be averaged for the block, weighted by the corresponding block sizes.
+ * The pass value will be removed if it is different for the blocks.
+ */
+class ConcatenateMafIterator:
+  public AbstractFilterMafIterator
+{
+  private:
+    MafBlock* incomingBlock_;
+    unsigned int minimumSize_;
+
+  public:
+    ConcatenateMafIterator(MafIterator* iterator, unsigned int minimumSize) :
+      AbstractFilterMafIterator(iterator),
+      incomingBlock_(0),
+      minimumSize_(minimumSize)
+    {
+      incomingBlock_ = iterator->nextBlock();
+    }
+
+  private:
+    ConcatenateMafIterator(const ConcatenateMafIterator& iterator) :
+      AbstractFilterMafIterator(0),
+      incomingBlock_(iterator.incomingBlock_),
+      minimumSize_(iterator.minimumSize_)
+    {}
+    
+    ConcatenateMafIterator& operator=(const ConcatenateMafIterator& iterator)
+    {
+      incomingBlock_ = iterator.incomingBlock_;
+      minimumSize_ = iterator.minimumSize_;
+      return *this;
+    }
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception);
+
+};
+
+} // end of namespace bpp.
+
+#endif //_CONCATENATEMAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/DuplicateFilterMafIterator.cpp b/src/Bpp/Seq/Io/Maf/DuplicateFilterMafIterator.cpp
new file mode 100644
index 0000000..c286dc2
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/DuplicateFilterMafIterator.cpp
@@ -0,0 +1,92 @@
+//
+// File: DuplicateFilterMafIterator.cpp
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "DuplicateFilterMafIterator.h"
+
+using namespace bpp;
+
+//From the STL:
+#include <string>
+#include <numeric>
+
+using namespace std;
+
+MafBlock* DuplicateFilterMafIterator::analyseCurrentBlock_() throw (Exception)
+{
+  currentBlock_ = iterator_->nextBlock();
+  while (currentBlock_) {
+    bool foundRef = false;
+    string chr = "";
+    char strand = '+';
+    size_t start = 0;
+    size_t stop  = 0;
+    for (size_t i = 0; i < currentBlock_->getNumberOfSequences() && !foundRef; ++i) {
+      string species = currentBlock_->getSequence(i).getSpecies(); 
+      if (species == ref_) {
+        foundRef = true;
+        chr    = currentBlock_->getSequence(i).getChromosome();
+        strand = currentBlock_->getSequence(i).getStrand();
+        start  = currentBlock_->getSequence(i).start();
+        stop   = currentBlock_->getSequence(i).stop();
+      }
+    }
+    if (!foundRef) {
+      if (logstream_) {
+        (*logstream_ << "DUPLICATE FILTER: block does not contain reference species and was removed.").endLine();
+      }
+      delete currentBlock_;
+    } else {
+      size_t occurrence = blocks_[chr][strand][start][stop]++;
+      if (occurrence > 0) {
+        if (logstream_) {
+          (*logstream_ << "DUPLICATE FILTER: sequence in reference species was found in a previous block. New block was removed.").endLine();
+        }
+        delete currentBlock_;
+      } else {
+        return currentBlock_;
+      }
+    }
+
+    //Look for the next block:
+    currentBlock_ = iterator_->nextBlock();
+  }
+  
+  return currentBlock_;
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/DuplicateFilterMafIterator.h b/src/Bpp/Seq/Io/Maf/DuplicateFilterMafIterator.h
new file mode 100644
index 0000000..c16c218
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/DuplicateFilterMafIterator.h
@@ -0,0 +1,97 @@
+//
+// File: DuplicateFilterMafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _DUPLICATEFILTERMAFITERATOR_H_
+#define _DUPLICATEFILTERMAFITERATOR_H_
+
+#include "MafIterator.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief Filter maf blocks to remove duplicated blocks, according to a reference sequence).
+ */
+class DuplicateFilterMafIterator:
+  public AbstractFilterMafIterator
+{
+  private:
+    std::string ref_;
+    /**
+     * Contains the list of 'seen' block, as [chr][strand][start][stop]
+     */
+    std::map< std::string, std::map< char, std::map< size_t, std::map< size_t, size_t > > > > blocks_;
+
+  public:
+    /**
+     * @param iterator The input iterator.
+     * @param reference The reference species name.
+     */
+    DuplicateFilterMafIterator(MafIterator* iterator, const std::string& reference) :
+      AbstractFilterMafIterator(iterator),
+      ref_(reference),
+      blocks_()
+    {}
+
+  private:
+    DuplicateFilterMafIterator(const DuplicateFilterMafIterator& iterator) :
+      AbstractFilterMafIterator(0),
+      ref_(iterator.ref_),
+      blocks_(iterator.blocks_)
+    {}
+    
+    DuplicateFilterMafIterator& operator=(const DuplicateFilterMafIterator& iterator)
+    {
+      ref_    = iterator.ref_;
+      blocks_ = iterator.blocks_;
+      return *this;
+    }
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception);
+
+};
+
+} // end of namespace bpp.
+
+#endif //_DUPLICATEFILTERMAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/EntropyFilterMafIterator.cpp b/src/Bpp/Seq/Io/Maf/EntropyFilterMafIterator.cpp
new file mode 100644
index 0000000..73dbdd3
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/EntropyFilterMafIterator.cpp
@@ -0,0 +1,237 @@
+//
+// File: EntropyFilterMafIterator.cpp
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "EntropyFilterMafIterator.h"
+
+using namespace bpp;
+
+//From the STL:
+#include <string>
+#include <numeric>
+
+using namespace std;
+
+MafBlock* EntropyFilterMafIterator::analyseCurrentBlock_() throw (Exception)
+{
+  if (blockBuffer_.size() == 0) {
+    //Else there is no more block in the buffer, we need to parse more:
+    do {
+      MafBlock* block = iterator_->nextBlock();
+      if (!block) return 0; //No more block.
+    
+      //Parse block.
+      int gap = AlphabetTools::DNA_ALPHABET.getGapCharacterCode();
+      //unused for now
+      //int unk = AlphabetTools::DNA_ALPHABET.getUnknownCharacterCode();
+      size_t nr;
+      size_t nc = static_cast<size_t>(block->getNumberOfSites());
+
+      vector< vector<int> > aln;
+      if (missingAsGap_ && !ignoreGaps_) {
+        nr = species_.size();
+        aln.resize(nr);
+        for (size_t i = 0; i < nr; ++i) {
+          if (block->hasSequenceForSpecies(species_[i]))
+            aln[i] = block->getSequenceForSpecies(species_[i]).getContent();
+          else {
+            aln[i].resize(nc); 
+            fill(aln[i].begin(), aln[i].end(), gap);
+          } 
+        }
+      } else {
+        vector<string> speciesSet = VectorTools::vectorIntersection(species_, block->getSpeciesList());
+        nr = speciesSet.size();
+        aln.resize(nr);
+        for (size_t i = 0; i < nr; ++i) {
+          aln[i] = block->getSequenceForSpecies(species_[i]).getContent();
+        }
+      }
+      //First we create a mask:
+      vector<size_t> pos;
+      //Reset window:
+      window_.clear();
+      //Init window:
+      size_t i;
+      for (i = 0; i < windowSize_; ++i) {
+        vector<int> col;
+        for (size_t j = 0; j < nr; ++j) {
+          int x = aln[j][i];
+          if (x != gap || !ignoreGaps_)
+            col.push_back(x);
+        }
+        double entropy = VectorTools::shannonDiscrete<int, double>(col) / log(5.);
+        window_.push_back(entropy > maxEnt_ ? 1 : 0);
+      }
+      //Slide window:
+      if (verbose_) {
+        ApplicationTools::message->endLine();
+        ApplicationTools::displayTask("Sliding window for entropy filter", true);
+      }
+      while (i + step_ < nc) {
+        if (verbose_)
+          ApplicationTools::displayGauge(i - windowSize_, nc - windowSize_ - 1, '>');
+        //Evaluate current window:
+        unsigned int count = std::accumulate(window_.begin(), window_.end(), 0);
+        if (count > maxPos_) {
+          if (pos.size() == 0) {
+            pos.push_back(i - windowSize_);
+            pos.push_back(i);
+          } else {
+            if (i - windowSize_ < pos[pos.size() - 1]) {
+              pos[pos.size() - 1] = i; //Windows are overlapping and we extend previous region
+            } else { //This is a new region
+              pos.push_back(i - windowSize_);
+              pos.push_back(i);
+            }
+          }
+        }
+      
+        //Move forward:
+        for (size_t k = 0; k < step_; ++k) {
+          vector<int> col;
+          for (size_t j = 0; j < nr; ++j) {
+            int x = aln[j][i];
+            if (x != gap || !ignoreGaps_)
+              col.push_back(x);
+          }
+          double entropy = VectorTools::shannonDiscrete<int, double>(col) / log(5.);
+          window_.push_back(entropy > maxEnt_ ? 1 : 0);
+          window_.pop_front();
+          ++i;
+        }
+      }
+
+      //Evaluate last window:
+      unsigned int count = std::accumulate(window_.begin(), window_.end(), 0);
+      if (count > maxPos_) {
+        if (pos.size() == 0) {
+          pos.push_back(i - windowSize_);
+          pos.push_back(i);
+        } else {
+          if (i - windowSize_ <= pos[pos.size() - 1]) {
+            pos[pos.size() - 1] = i; //Windows are overlapping and we extend previous region
+          } else { //This is a new region
+            pos.push_back(i - windowSize_);
+            pos.push_back(i);
+          }
+        }
+      } 
+      if (verbose_)
+        ApplicationTools::displayTaskDone();
+    
+      //Now we remove regions with two many gaps, using a sliding window:
+      if (pos.size() == 0) {
+        blockBuffer_.push_back(block);
+        if (logstream_) {
+          (*logstream_ << "ENTROPY CLEANER: block " << block->getDescription() << " is clean and kept as is.").endLine();
+        }
+      } else if (pos.size() == 2 && pos.front() == 0 && pos.back() == block->getNumberOfSites()) {
+        //Everything is removed:
+        if (logstream_) {
+          (*logstream_ << "ENTROPY CLEANER: block " << block->getDescription() << " was entirely removed. Tried to get the next one.").endLine();
+        }
+      } else {
+        if (logstream_) {
+          (*logstream_ << "ALN CLEANER: block " << block->getDescription() << " with size "<< block->getNumberOfSites() << " will be split into " << (pos.size() / 2 + 1) << " blocks.").endLine();
+        }
+        if (verbose_) {
+          ApplicationTools::message->endLine();
+          ApplicationTools::displayTask("Spliting block", true);
+        }
+        for (i = 0; i < pos.size(); i+=2) {
+          if (verbose_)
+            ApplicationTools::displayGauge(i, pos.size() - 2, '=');
+          if (logstream_) {
+            (*logstream_ << "ENTROPY CLEANER: removing region (" << pos[i] << ", " << pos[i+1] << ") from block " << block->getDescription() << ".").endLine();
+          }
+          if (pos[i] > 0) {
+            MafBlock* newBlock = new MafBlock();
+            newBlock->setScore(block->getScore());
+            newBlock->setPass(block->getPass());
+            for (size_t j = 0; j < block->getNumberOfSequences(); ++j) {
+              MafSequence* subseq;
+              if (i == 0) {
+                subseq = block->getSequence(j).subSequence(0, pos[i]);
+              } else {
+                subseq = block->getSequence(j).subSequence(pos[i - 1], pos[i] - pos[i - 1]);
+              }
+              newBlock->addSequence(*subseq);
+              delete subseq;
+            }
+            blockBuffer_.push_back(newBlock);
+          }
+        
+          if (keepTrashedBlocks_) {
+            MafBlock* outBlock = new MafBlock();
+            outBlock->setScore(block->getScore());
+            outBlock->setPass(block->getPass());
+            for (size_t j = 0; j < block->getNumberOfSequences(); ++j) {
+              MafSequence* outseq = block->getSequence(j).subSequence(pos[i], pos[i + 1] - pos[i]);
+              outBlock->addSequence(*outseq);
+              delete outseq;
+            } 
+            trashBuffer_.push_back(outBlock);
+          }
+        }
+        //Add last block:
+        if (pos[pos.size() - 1] < block->getNumberOfSites()) {
+          MafBlock* newBlock = new MafBlock();
+          newBlock->setScore(block->getScore());
+          newBlock->setPass(block->getPass());
+          for (size_t j = 0; j < block->getNumberOfSequences(); ++j) {
+            MafSequence* subseq;
+            subseq = block->getSequence(j).subSequence(pos[pos.size() - 1], block->getNumberOfSites() - pos[pos.size() - 1]);
+            newBlock->addSequence(*subseq);
+            delete subseq;
+          }
+          blockBuffer_.push_back(newBlock);
+        }
+        if (verbose_)
+          ApplicationTools::displayTaskDone();
+
+        delete block;
+      }
+    } while (blockBuffer_.size() == 0);
+  }
+
+  MafBlock* block = blockBuffer_.front();
+  blockBuffer_.pop_front();
+  return block;
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/EntropyFilterMafIterator.h b/src/Bpp/Seq/Io/Maf/EntropyFilterMafIterator.h
new file mode 100644
index 0000000..2b38476
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/EntropyFilterMafIterator.h
@@ -0,0 +1,107 @@
+//
+// File: EntropyMafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _ENTROPYFILTERMAFITERATOR_H_
+#define _ENTROPYFILTERMAFITERATOR_H_
+
+#include "MafIterator.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief Filter maf blocks highly divergent regions.
+ *
+ * This iterators takes two parameters: g=maxEnt and n=maxPos. Windows with more than n positions with a entropy higher than maxEnt will be discarded.
+ * In addition, consecutives patterns are only counted once.
+ * In case a sequence from the list is missing, it can be either ignored or counted as a full sequence of gaps.
+ */
+class EntropyFilterMafIterator:
+  public AbstractFilterMafIterator,
+  public virtual MafTrashIterator
+{
+  private:
+    std::vector<std::string> species_;
+    unsigned int windowSize_;
+    unsigned int step_;
+    double maxEnt_;
+    unsigned int maxPos_;
+    std::deque<MafBlock*> blockBuffer_;
+    std::deque<MafBlock*> trashBuffer_;
+    std::deque<unsigned int> window_;
+    bool keepTrashedBlocks_;
+    bool missingAsGap_;
+    bool ignoreGaps_;
+
+  public:
+    EntropyFilterMafIterator(MafIterator* iterator, const std::vector<std::string>& species, unsigned int windowSize, unsigned int step, double maxEnt, unsigned int maxPos, bool keepTrashedBlocks, bool missingAsGap, bool ignoreGaps) :
+      AbstractFilterMafIterator(iterator),
+      species_(species),
+      windowSize_(windowSize),
+      step_(step),
+      maxEnt_(maxEnt),
+      maxPos_(maxPos),
+      blockBuffer_(),
+      trashBuffer_(),
+      window_(species.size()),
+      keepTrashedBlocks_(keepTrashedBlocks),
+      missingAsGap_(missingAsGap),
+      ignoreGaps_(ignoreGaps)
+    {}
+
+  public:
+    MafBlock* nextRemovedBlock() throw (Exception) {
+      if (trashBuffer_.size() == 0) return 0;
+      MafBlock* block = trashBuffer_.front();
+      trashBuffer_.pop_front();
+      return block;
+    }
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception);
+
+};
+
+} // end of namespace bpp.
+
+#endif //_ENTROPYFILTERMAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/FeatureExtractorMafIterator.cpp b/src/Bpp/Seq/Io/Maf/FeatureExtractorMafIterator.cpp
new file mode 100644
index 0000000..1b9b2e8
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/FeatureExtractorMafIterator.cpp
@@ -0,0 +1,128 @@
+//
+// File: FeatureExtractorMafIterator.cpp
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "FeatureExtractorMafIterator.h"
+
+//From bpp-seq:
+#include <Bpp/Seq/SequenceWalker.h>
+
+using namespace bpp;
+
+//From the STL:
+#include <string>
+#include <numeric>
+
+using namespace std;
+
+MafBlock* FeatureExtractor::analyseCurrentBlock_() throw (Exception)
+{
+  if (blockBuffer_.size() == 0) {
+    //Unless there is no more block in the buffer, we need to parse more:
+    START:
+    MafBlock* block = iterator_->nextBlock();
+    if (!block) return 0; //No more block.
+
+    //Check if the block contains the reference species:
+    if (!block->hasSequenceForSpecies(refSpecies_))
+      goto START;
+
+    //Get the feature ranges for this block:
+    const MafSequence& refSeq = block->getSequenceForSpecies(refSpecies_);
+    //first check if there is one (for now we assume that features refer to the chromosome or contig name, with implicit species):
+    std::map<std::string, RangeSet<size_t> >::iterator mr = ranges_.find(refSeq.getChromosome());
+    if (mr == ranges_.end())
+      goto START;
+        
+    RangeSet<size_t> ranges = mr->second;
+    if (completeOnly_)
+      ranges.filterWithin(Range<size_t>(refSeq.start(), refSeq.stop()));
+    else  
+      ranges.restrictTo(Range<size_t>(refSeq.start(), refSeq.stop()));
+    if (ranges.isEmpty())
+      goto START;
+
+    //We will need to convert to alignment positions, using a sequence walker:
+    SequenceWalker walker(refSeq);
+
+    //Now creates all blocks for all ranges:
+    if (verbose_) {
+      ApplicationTools::message->endLine();
+      ApplicationTools::displayTask("Extracting annotations", true);
+    }
+    if (logstream_) {
+      (*logstream_ << "FEATURE EXTRACTOR: extracting " << ranges.getSet().size() << " features from block " << block->getDescription() << ".").endLine();
+    }
+
+    size_t i = 0;
+    for (set<Range<size_t>*>::iterator it = ranges.getSet().begin();
+        it !=  ranges.getSet().end();
+        ++it)
+    {
+      if (verbose_) {
+        ApplicationTools::displayGauge(i++, ranges.getSet().size() - 1, '=');
+      }
+      MafBlock* newBlock = new MafBlock();
+      newBlock->setScore(block->getScore());
+      newBlock->setPass(block->getPass());
+      for (size_t j = 0; j < block->getNumberOfSequences(); ++j) {
+        auto_ptr<MafSequence> subseq;
+        size_t a = walker.getAlignmentPosition((**it).begin() - refSeq.start());
+        size_t b = walker.getAlignmentPosition((**it).end() - refSeq.start() - 1);
+        subseq.reset(block->getSequence(j).subSequence(a, b - a + 1));
+        if (!ignoreStrand_) {
+          if (dynamic_cast<SeqRange*>(*it)->isNegativeStrand()) {
+            SequenceTools::invertComplement(*subseq);
+          }
+        }
+        newBlock->addSequence(*subseq);
+      }
+      blockBuffer_.push_back(newBlock);
+    }
+        
+    if (verbose_)
+      ApplicationTools::displayTaskDone();
+
+    delete block;
+  }
+
+  MafBlock* nxtBlock = blockBuffer_.front();
+  blockBuffer_.pop_front();
+  return nxtBlock;
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/FeatureExtractorMafIterator.h b/src/Bpp/Seq/Io/Maf/FeatureExtractorMafIterator.h
new file mode 100644
index 0000000..48e9f74
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/FeatureExtractorMafIterator.h
@@ -0,0 +1,106 @@
+//
+// File: FeatureExtractorMafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _FEATUREEXTRACTORMAFITERATOR_H_
+#define _FEATUREEXTRACTORMAFITERATOR_H_
+
+#include "MafIterator.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief Extract alignments corresponding to sequence features given as a vector of SequenceFeature objects.
+ *
+ * The resulting blocks will contain the specified annotated regions.
+ * Note that this iterator is not the opposite of FeatureFilterMafIterator,
+ * as overlapping features will all be extracted. This iterator may therefore results
+ * in duplication of original data.
+ */
+class FeatureExtractor:
+  public AbstractFilterMafIterator
+{
+  private:
+    std::string refSpecies_;
+    bool completeOnly_;
+    bool ignoreStrand_;
+    std::deque<MafBlock*> blockBuffer_;
+    std::map<std::string, RangeSet<size_t> > ranges_;
+
+  public:
+    /**
+     * @brief Build a new FeatureExtractor iterator.
+     *
+     * @param iterator The input iterator
+     * @param refSpecies The reference species for feature coordinates
+     * @param complete Tell if features should be extracted only if they can be extracted in full
+     * @param features The set of features to extract
+     * @param ignoreStrand If true, features will be extracted 'as is', without being reversed in case they are on the negative strand.
+     */
+    FeatureExtractor(MafIterator* iterator, const std::string& refSpecies, const SequenceFeatureSet& features, bool complete = false, bool ignoreStrand = false) :
+      AbstractFilterMafIterator(iterator),
+      refSpecies_(refSpecies),
+      completeOnly_(complete),
+      ignoreStrand_(ignoreStrand),
+      blockBuffer_(),
+      ranges_()
+    {
+      //Build ranges:
+      std::set<std::string> seqIds = features.getSequences();
+      for (std::set<std::string>::iterator it = seqIds.begin();
+          it != seqIds.end();
+          ++it) {
+        {
+          features.fillRangeCollectionForSequence(*it, ranges_[*it]);
+        }
+      }
+    }
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception);
+
+};
+
+} // end of namespace bpp.
+
+#endif //_FEATUREEXTRACTORMAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/FeatureFilterMafIterator.cpp b/src/Bpp/Seq/Io/Maf/FeatureFilterMafIterator.cpp
new file mode 100644
index 0000000..578ed83
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/FeatureFilterMafIterator.cpp
@@ -0,0 +1,198 @@
+//
+// File: FeatureFilterMafIterator.cpp
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "FeatureFilterMafIterator.h"
+
+using namespace bpp;
+
+//From the STL:
+#include <string>
+#include <numeric>
+
+using namespace std;
+
+MafBlock* FeatureFilterMafIterator::analyseCurrentBlock_() throw (Exception)
+{
+  if (blockBuffer_.size() == 0) {
+    //Unless there is no more block in the buffer, we need to parse more:
+    do {
+      MafBlock* block = iterator_->nextBlock();
+      if (!block) return 0; //No more block.
+
+      //Check if the block contains the reference species:
+      if (!block->hasSequenceForSpecies(refSpecies_)) {
+        if (logstream_) {
+          (*logstream_ << "FEATURE FILTER: block " << block->getDescription() << " does not contain the reference species and was kept as is.").endLine(); 
+        }
+        return block;
+      }
+
+      //Get the feature ranges for this block:
+      const MafSequence& refSeq = block->getSequenceForSpecies(refSpecies_);
+      //first check if there is one (for now we assume that features refer to the chromosome or contig name, with implicit species):
+      std::map<std::string, MultiRange<size_t> >::iterator mr = ranges_.find(refSeq.getChromosome());
+      if (mr == ranges_.end()) {
+        if (logstream_) {
+          (*logstream_ << "FEATURE FILTER: block " << block->getDescription() << " does not contain any feature and was kept as is.").endLine(); 
+        }
+        return block;
+      }
+      //else
+      MultiRange<size_t> mRange = mr->second;
+      mRange.restrictTo(Range<size_t>(refSeq.start(), refSeq.stop() + 1));
+      if (mRange.isEmpty()) {
+        if (logstream_) {
+          (*logstream_ << "FEATURE FILTER: block " << block->getDescription() << " does not contain any feature and was kept as is.").endLine(); 
+        }
+        return block;
+      }
+      std::vector<size_t> tmp = mRange.getBounds(); 
+      std::deque<size_t> refBounds(tmp.begin(), tmp.end()); 
+
+      //Now extract corresponding alignments. We use the range to split the original block.
+      //Only thing to watch out is the coordinates, refering to the ref species...
+      //A good idea is then to convert those with respect to the given block:
+
+      int gap = refSeq.getAlphabet()->getGapCharacterCode();
+      long int refPos = static_cast<long int>(refSeq.start()) - 1;
+      std::vector<size_t> pos;
+      if (verbose_) {
+        ApplicationTools::message->endLine();
+        ApplicationTools::displayTask("Removing features", true);
+      }
+      for (size_t alnPos = 0; alnPos < refSeq.size() && refBounds.size() > 0; ++alnPos) {
+        if (verbose_)
+          ApplicationTools::displayGauge(alnPos, refSeq.size() - 1, '>');
+        if (refSeq[alnPos] != gap) {
+          refPos++;
+          //check if this position is a bound:
+          if (refBounds.front() == static_cast<size_t>(refPos)) {
+            pos.push_back(alnPos);
+            refBounds.pop_front();
+          }
+        }
+      }
+      if (verbose_)
+        ApplicationTools::displayTaskDone();
+
+      //Check if the last bound matches the end of the alignment:
+      if (refBounds.size() > 0 && refBounds.front() == refSeq.stop() + 1) {
+        pos.push_back(refSeq.size());
+        refBounds.pop_front();
+      }
+
+      if (refBounds.size() > 0) {
+        VectorTools::print(vector<size_t>(refBounds.begin(), refBounds.end()));
+        throw Exception("FeatureFilterMafIterator::nextBlock(). An error occurred here, " + TextTools::toString(refBounds.size()) + " coordinates are left... this is most likely a bug, please report!");
+      }
+
+      //Next step is simply to split the black according to the translated coordinates:
+      if (pos.size() == 2 && pos.front() == 0 && pos.back() == block->getNumberOfSites()) {
+        //Everything is removed:
+        if (logstream_) {
+          (*logstream_ << "FEATURE FILTER: block " << block->getDescription() << " was entirely removed. Tried to get the next one.").endLine();
+        }
+      } else {
+        if (logstream_) {
+          (*logstream_ << "FEATURE FILTER: block " << block->getDescription() << " with size "<< block->getNumberOfSites() << " will be split into " << (pos.size() / 2 + 1) << " blocks.").endLine();
+        }
+        if (verbose_) {
+          ApplicationTools::displayTask("Spliting block", true);
+        }
+        for (size_t i = 0; i < pos.size(); i+=2) {
+          if (verbose_)
+            ApplicationTools::displayGauge(i, pos.size() - 2, '=');
+          if (logstream_) {
+            (*logstream_ << "FEATURE FILTER: removing region (" << pos[i] << ", " << pos[i+1] << ") from block " << block->getDescription() << ".").endLine();
+          }
+          if (pos[i] > 0) {
+            MafBlock* newBlock = new MafBlock();
+            newBlock->setScore(block->getScore());
+            newBlock->setPass(block->getPass());
+            for (size_t j = 0; j < block->getNumberOfSequences(); ++j) {
+              MafSequence* subseq;
+              if (i == 0) {
+                subseq = block->getSequence(j).subSequence(0, pos[i]);
+              } else {
+                subseq = block->getSequence(j).subSequence(pos[i - 1], pos[i] - pos[i - 1]);
+              }
+              newBlock->addSequence(*subseq);
+              delete subseq;
+            }
+            blockBuffer_.push_back(newBlock);
+          }
+        
+          if (keepTrashedBlocks_) {
+            MafBlock* outBlock = new MafBlock();
+            outBlock->setScore(block->getScore());
+            outBlock->setPass(block->getPass());
+            for (size_t j = 0; j < block->getNumberOfSequences(); ++j) {
+              MafSequence* outseq = block->getSequence(j).subSequence(pos[i], pos[i + 1] - pos[i]);
+              outBlock->addSequence(*outseq);
+              delete outseq;
+            } 
+            trashBuffer_.push_back(outBlock);
+          }
+        }
+        //Add last block:
+        if (pos.back() < block->getNumberOfSites()) {
+          MafBlock* newBlock = new MafBlock();
+          newBlock->setScore(block->getScore());
+          newBlock->setPass(block->getPass());
+          for (size_t j = 0; j < block->getNumberOfSequences(); ++j) {
+            MafSequence* subseq;
+            subseq = block->getSequence(j).subSequence(pos[pos.size() - 1], block->getNumberOfSites() - pos[pos.size() - 1]);
+            newBlock->addSequence(*subseq);
+            delete subseq;
+          }
+          blockBuffer_.push_back(newBlock);
+        }
+        if (verbose_)
+          ApplicationTools::displayTaskDone();
+
+        delete block;
+      }
+    } while (blockBuffer_.size() == 0);
+  }
+
+  MafBlock* nxtBlock = blockBuffer_.front();
+  blockBuffer_.pop_front();
+  return nxtBlock;
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/FeatureFilterMafIterator.h b/src/Bpp/Seq/Io/Maf/FeatureFilterMafIterator.h
new file mode 100644
index 0000000..e90bb2f
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/FeatureFilterMafIterator.h
@@ -0,0 +1,103 @@
+//
+// File: FeatureFilterMafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _FEATUREFILTERMAFITERATOR_H_
+#define _FEATUREFILTERMAFITERATOR_H_
+
+#include "MafIterator.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief Remove from alignment all positions that fall within any feature from a list given as a SequenceFeatureSet object.
+ *
+ * Removed regions are outputed as a trash iterator.
+ */
+class FeatureFilterMafIterator:
+  public AbstractFilterMafIterator,
+  public MafTrashIterator
+{
+  private:
+    std::string refSpecies_;
+    std::deque<MafBlock*> blockBuffer_;
+    std::deque<MafBlock*> trashBuffer_;
+    bool keepTrashedBlocks_;
+    std::map<std::string, MultiRange<size_t> > ranges_;
+
+  public:
+    FeatureFilterMafIterator(MafIterator* iterator, const std::string& refSpecies, const SequenceFeatureSet& features, bool keepTrashedBlocks) :
+      AbstractFilterMafIterator(iterator),
+      refSpecies_(refSpecies),
+      blockBuffer_(),
+      trashBuffer_(),
+      keepTrashedBlocks_(keepTrashedBlocks),
+      ranges_()
+    {
+      //Build ranges:
+      std::set<std::string> seqIds = features.getSequences();
+      for (std::set<std::string>::iterator it = seqIds.begin();
+          it != seqIds.end();
+          ++it) {
+        {
+          features.fillRangeCollectionForSequence(*it, ranges_[*it]);
+        }
+      }
+    }
+
+  public:
+    MafBlock* nextRemovedBlock() throw (Exception) {
+      if (trashBuffer_.size() == 0) return 0;
+      MafBlock* block = trashBuffer_.front();
+      trashBuffer_.pop_front();
+      return block;
+    }
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception);
+
+};
+
+} // end of namespace bpp.
+
+#endif //_FEATUREFILTERMAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/FullGapFilterMafIterator.cpp b/src/Bpp/Seq/Io/Maf/FullGapFilterMafIterator.cpp
new file mode 100644
index 0000000..ca0297d
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/FullGapFilterMafIterator.cpp
@@ -0,0 +1,112 @@
+//
+// File: FullGapFilterMafIterator.cpp
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "FullGapFilterMafIterator.h"
+
+//From bpp-seq
+#include <Bpp/Seq/Container/VectorSiteContainer.h>
+#include <Bpp/Seq/SiteTools.h>
+
+using namespace bpp;
+
+//From the STL:
+#include <string>
+#include <numeric>
+
+using namespace std;
+
+MafBlock* FullGapFilterMafIterator::analyseCurrentBlock_() throw (Exception)
+{
+  MafBlock* block = iterator_->nextBlock();
+  if (!block) return 0;
+
+  //We create a copy of the ingroup alignement for better efficiency:
+  VectorSiteContainer vsc(&AlphabetTools::DNA_ALPHABET);
+  for (size_t i = 0; i < species_.size(); ++i) {
+    vsc.addSequence(block->getSequence(i));
+  }
+  //Now check the positions that are only made of gaps:
+  if (verbose_) {
+    ApplicationTools::message->endLine();
+    ApplicationTools::displayTask("Cleaning block for gap sites", true);
+  }
+  size_t n = block->getNumberOfSites();
+  vector <size_t> start;
+  vector <unsigned int> count;
+  bool test = false;
+  for (size_t i = 0; i < n; ++i) {
+    const Site* site = &vsc.getSite(i);
+    if (SiteTools::isGapOnly(*site)) {
+      if (test) {
+        count[count.size() - 1]++;
+      } else {
+        start.push_back(i);
+        count.push_back(1);
+        test = true;
+      }
+    } else {
+      test = false;
+    }
+  }
+  //Now remove blocks:
+  size_t totalRemoved = 0;
+  for(size_t i = start.size(); i > 0; --i) {
+    if (verbose_)
+      ApplicationTools::displayGauge(start.size() - i, start.size() - 1, '=');
+    block->getAlignment().deleteSites(start[i - 1], count[i - 1]);
+    totalRemoved += count[i - 1];
+  }
+  if (verbose_)
+    ApplicationTools::displayTaskDone();
+  
+  //Correct coordinates:
+  if (totalRemoved > 0) {
+    for (size_t i = 0; i < block->getNumberOfSequences(); ++i) {
+      const MafSequence* seq = &block->getSequence(i);
+      if (!VectorTools::contains(species_, seq->getSpecies())) {
+        block->removeCoordinatesFromSequence(i);
+      }
+    }
+  }
+  if (logstream_) {
+    (*logstream_ << "FULL GAP CLEANER: " << totalRemoved << " positions have been removed.").endLine();
+  }
+  return block;
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/FullGapFilterMafIterator.h b/src/Bpp/Seq/Io/Maf/FullGapFilterMafIterator.h
new file mode 100644
index 0000000..14015b8
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/FullGapFilterMafIterator.h
@@ -0,0 +1,79 @@
+//
+// File: FullGapFilterMafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _FULLGAPFILTERMAFITERATOR_H_
+#define _FULLGAPFILTERMAFITERATOR_H_
+
+#include "MafIterator.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief Filter maf blocks to remove in each block the positions made only of gaps.
+ *
+ * The subset of species that should be examined is given as input. The coordinates of these
+ * species will not be altered as only gap positions are removed. Other species however may be
+ * altered as they might not have gap in the removed position. The coordinates for these species
+ * will therefore be removed as they do not make sense anymore.
+ */
+class FullGapFilterMafIterator:
+  public AbstractFilterMafIterator
+{
+  private:
+    std::vector<std::string> species_;
+
+  public:
+    FullGapFilterMafIterator(MafIterator* iterator, const std::vector<std::string>& species) :
+      AbstractFilterMafIterator(iterator),
+      species_(species)
+    {}
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception);
+
+};
+
+} // end of namespace bpp.
+
+#endif //_FULLGAPFILTERMAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/IterationListener.cpp b/src/Bpp/Seq/Io/Maf/IterationListener.cpp
new file mode 100644
index 0000000..5e58ef4
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/IterationListener.cpp
@@ -0,0 +1,75 @@
+//
+// File: IterationListener.cpp
+// Authors: Julien Dutheil
+// Created: Wed Jun 27 2012
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2012)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "IterationListener.h"
+
+// From the STL:
+#include <vector>
+
+using namespace std;
+using namespace bpp;
+
+void CsvStatisticsOutputIterationListener::iterationStarts()
+{
+  const vector<string>& header = statsIterator_->getResultsColumnNames();
+  *output_ << "Chr" << sep_ << "Start" << sep_ << "Stop";
+  for (size_t i = 0; i < header.size(); ++i) {
+    *output_ << sep_ << header[i];
+  }
+  output_->endLine();
+}
+
+void CsvStatisticsOutputIterationListener::iterationMoves(const MafBlock& currentBlock)
+{
+  const vector<double>& values = statsIterator_->getResults();
+  if (currentBlock.hasSequenceForSpecies(refSpecies_)) {
+    const MafSequence& refSeq = currentBlock.getSequenceForSpecies(refSpecies_);
+    if (refSeq.hasCoordinates()) 
+      *output_ << refSeq.getChromosome() << sep_ << refSeq.start() << sep_ << refSeq.stop();
+    else
+      *output_ << "NA" << sep_ << "NA" << sep_ << "NA";
+  } else {
+    *output_ << "NA" << sep_ << "NA" << sep_ << "NA";
+  }
+  for (size_t i = 0; i < values.size(); ++i) {
+    *output_ << sep_ << values[i];
+  }
+  output_->endLine();
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/IterationListener.h b/src/Bpp/Seq/Io/Maf/IterationListener.h
new file mode 100644
index 0000000..a6e2b9e
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/IterationListener.h
@@ -0,0 +1,130 @@
+//
+// File: IterationListener.h
+// Authors: Julien Dutheil
+// Created: Wed Jun 27 2012
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2012)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _ITERATIONLISTENER_H_
+#define _ITERATIONLISTENER_H_
+
+#include "MafIterator.h"
+#include "SequenceStatisticsMafIterator.h"
+
+namespace bpp {
+
+/**
+ * @brief Listener which enable to catch events when parsing a Maf file.
+ */
+class IterationListener
+{
+  public:
+    virtual ~IterationListener() {}
+
+  public:
+    virtual void iterationStarts() = 0;
+    virtual void iterationMoves(const MafBlock& currentBlock) = 0;
+    virtual void iterationStops() = 0;
+};
+
+/**
+ * @brief Iteration listener that works with a SequenceStatisticsMafIterator,
+ * enabling output of results in a file (partial implementation, format-independent)
+ */
+class AbstractStatisticsOutputIterationListener:
+  public virtual IterationListener
+{
+  protected:
+    SequenceStatisticsMafIterator* statsIterator_;
+
+
+  public:
+    AbstractStatisticsOutputIterationListener(SequenceStatisticsMafIterator* iterator):
+      statsIterator_(iterator) {}
+    
+    AbstractStatisticsOutputIterationListener(const AbstractStatisticsOutputIterationListener& listener):
+      statsIterator_(listener.statsIterator_) {}
+    
+    AbstractStatisticsOutputIterationListener& operator=(const AbstractStatisticsOutputIterationListener& listener)
+    {
+      statsIterator_ = listener.statsIterator_;
+      return *this;
+    }
+
+    virtual ~AbstractStatisticsOutputIterationListener() {}
+
+};
+
+/**
+ * @brief Iteration listener that works with a SequenceStatisticsMafIterator,
+ * enabling output of results in a file in CSv format
+ */
+class CsvStatisticsOutputIterationListener:
+  public AbstractStatisticsOutputIterationListener
+{
+  private:
+    OutputStream* output_;
+    std::string sep_;
+    std::string refSpecies_;
+
+  public:
+    CsvStatisticsOutputIterationListener(SequenceStatisticsMafIterator* iterator, const std::string& refSpecies, OutputStream* output, const std::string& sep = "\t"):
+      AbstractStatisticsOutputIterationListener(iterator), output_(output), sep_(sep), refSpecies_(refSpecies) {}
+    
+    CsvStatisticsOutputIterationListener(const CsvStatisticsOutputIterationListener& listener):
+      AbstractStatisticsOutputIterationListener(listener), output_(listener.output_), sep_(listener.sep_), refSpecies_(listener.refSpecies_) {}
+    
+    CsvStatisticsOutputIterationListener& operator=(const CsvStatisticsOutputIterationListener& listener)
+    {
+      AbstractStatisticsOutputIterationListener::operator=(listener);
+      output_ = listener.output_;
+      sep_ = listener.sep_;
+      refSpecies_ = listener.refSpecies_;
+      return *this;
+    }
+
+    virtual ~CsvStatisticsOutputIterationListener() {}
+
+  public:
+    virtual void iterationStarts();
+    virtual void iterationMoves(const MafBlock& currentBlock);
+    virtual void iterationStops() {}
+  
+};
+
+} //end of namespace bpp.
+
+#endif //_ITERATIONLISTENER_H_
+
diff --git a/src/Bpp/Seq/Io/Maf/MafBlock.h b/src/Bpp/Seq/Io/Maf/MafBlock.h
new file mode 100644
index 0000000..67cabdb
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/MafBlock.h
@@ -0,0 +1,253 @@
+//
+// File: MafBlock.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _MAFBLOCK_H_
+#define _MAFBLOCK_H_
+
+#include "MafSequence.h"
+#include <Bpp/Seq/Container/AlignedSequenceContainer.h>
+
+#include <Bpp/Clonable.h>
+
+namespace bpp {
+
+/**
+ * @brief A synteny block data structure, the basic unit of a MAF alignement file.
+ *
+ * This class basically contains a AlignedSequenceContainer made of MafSequence objects.
+ */
+class MafBlock:
+  public virtual Clonable
+{
+  private:
+    double score_;
+    unsigned int pass_;
+    AlignedSequenceContainer alignment_;
+    std::map<std::string, Clonable*> properties_;
+
+  public:
+    MafBlock() :
+      score_(log(0)),
+      pass_(0),
+      alignment_(&AlphabetTools::DNA_ALPHABET),
+      properties_()
+    {}
+
+    MafBlock(const MafBlock& block):
+      score_(block.score_),
+      pass_(block.pass_),
+      alignment_(block.alignment_),
+      properties_()
+    {
+      std::map<std::string, Clonable*>::const_iterator it;
+      for (it = block.properties_.begin(); it != block.properties_.end(); ++it) {
+        properties_[it->first] = it->second->clone();
+      }
+    }
+
+    MafBlock& operator=(const MafBlock& block)
+    {
+      score_     = block.score_;
+      pass_      = block.pass_;
+      alignment_ = block.alignment_;
+      deleteProperties_();
+      std::map<std::string, Clonable*>::const_iterator it;
+      for (it = block.properties_.begin(); it != block.properties_.end(); ++it) {
+        properties_[it->first] = it->second->clone();
+      }
+      return *this;
+    }
+
+    MafBlock* clone() const { return new MafBlock(*this); }
+
+    virtual ~MafBlock() { deleteProperties_(); }
+
+  public:
+    void setScore(double score) { score_ = score; }
+    void setPass(unsigned int pass) { pass_ = pass; }
+    
+    double getScore() const { return score_; }
+    unsigned int getPass() const { return pass_; }
+
+    AlignedSequenceContainer& getAlignment() { return alignment_; }
+    const AlignedSequenceContainer& getAlignment() const { return alignment_; }
+
+    size_t getNumberOfSequences() const { return alignment_.getNumberOfSequences(); }
+    
+    size_t getNumberOfSites() const { return alignment_.getNumberOfSites(); }
+
+    void addSequence(const MafSequence& sequence) { alignment_.addSequence(sequence, false); }
+
+    bool hasSequence(const std::string& name) const {
+      return getAlignment().hasSequence(name);
+    }
+
+    const MafSequence& getSequence(const std::string& name) const throw (SequenceNotFoundException) {
+      return dynamic_cast<const MafSequence&>(getAlignment().getSequence(name));
+    }
+
+    const MafSequence& getSequence(size_t i) const throw (IndexOutOfBoundsException) {
+      return dynamic_cast<const MafSequence&>(getAlignment().getSequence(i));
+    }
+
+    bool hasSequenceForSpecies(const std::string& species) const {
+      for (size_t i = 0; i < getNumberOfSequences(); ++i) {
+        const MafSequence& seq = getSequence(i);
+        if (seq.getSpecies() == species)
+          return true;
+      }
+      return false;
+    }
+
+    //Return the first sequence with the species name.
+    const MafSequence& getSequenceForSpecies(const std::string& species) const throw (SequenceNotFoundException) {
+      for (size_t i = 0; i < getNumberOfSequences(); ++i) {
+        const MafSequence& seq = getSequence(i);
+        if (seq.getSpecies() == species)
+          return seq;
+      }
+      throw SequenceNotFoundException("MafBlock::getSequenceForSpecies. No sequence with the given species name in this block.", species);
+    }
+
+    //Return all sequences with the species name.
+    std::vector<const MafSequence*> getSequencesForSpecies(const std::string& species) const throw (SequenceNotFoundException) {
+      std::vector<const MafSequence*> selection;
+      for (size_t i = 0; i < getNumberOfSequences(); ++i) {
+        const MafSequence* seq = &getSequence(i);
+        if (seq->getSpecies() == species)
+          selection.push_back(seq);
+      }
+      return selection;
+    }
+
+    /**
+     * @return The species names for all sequencies in the container.
+     */
+    std::vector<std::string> getSpeciesList() const {
+      std::vector<std::string> lst;
+      for (size_t i = 0; i < getNumberOfSequences(); ++i) {
+        lst.push_back(getSequence(i).getSpecies());
+      }
+      return lst;
+    }
+
+    void removeCoordinatesFromSequence(size_t i) throw (IndexOutOfBoundsException) {
+      //This is a bit of a trick, but avoid useless recopies.
+      //It is safe here because the AlignedSequenceContainer is fully encapsulated.
+      //It would not work if a VectorSiteContainer was used.
+      const_cast<MafSequence&>(getSequence(i)).removeCoordinates();
+    }
+
+    std::string getDescription() const {
+      std::string desc;
+      desc += TextTools::toString(getNumberOfSequences()) + "x" + TextTools::toString(getNumberOfSites());
+      return desc;
+    }
+
+    /**
+     * @return True or False, if data are associated to the given property.
+     * @param property The name of the property to look for.
+     */
+    bool hasProperty(const std::string& property) const
+    {
+      std::map<std::string, Clonable*>::const_iterator it = properties_.find(property);
+      return it != properties_.end();
+    }
+
+    /**
+     * @brief Get the data associated to a query property.
+     *
+     * @param property The property to look for.
+     * @return The data associated to the given property.
+     * @throw Exception if no data is associated to the given property.
+     */
+    const Clonable& getProperty(const std::string& property) const throw (Exception)
+    {
+      std::map<std::string, Clonable*>::const_iterator it = properties_.find(property);
+      if (it == properties_.end())
+        throw Exception("MafBlock::getProperty. No data for property: " + property + " in block.");
+      return *it->second;
+    }
+
+    /**
+     * @brief Delete the data associated to a query property.
+     *
+     * @param property The property to look for.
+     * @throw Exception if no data is associated to the given property.
+     */
+    void deleteProperty(const std::string& property) throw (Exception)
+    {
+      std::map<std::string, Clonable*>::iterator it = properties_.find(property);
+      if (it == properties_.end())
+        throw Exception("MafBlock::deleteProperty. No data for property: " + property + " in block.");
+      delete it->second;
+      properties_.erase(it);
+    }
+
+    /**
+     * @brief Set the data associated to a query property.
+     *
+     * An existing data associated to this property will be deleted and replaced by the new one.
+     * @param property The property to look for.
+     * @param data The data to associate to this property.
+     * @throw Exception if the pointer toward the input data is NULL.
+     */
+    void setProperty(const std::string& property, Clonable* data) throw (Exception) 
+    {
+      if (!data)
+        throw Exception("MafBlock::setProperty. Pointer to data is NULL.");
+      if (hasProperty(property))
+        deleteProperty(property);
+      properties_[property] = data;
+    }
+
+  private:
+    void deleteProperties_()
+    {
+      std::map<std::string, Clonable*>::iterator it;
+      for (it = properties_.begin(); it != properties_.end(); ++it) {
+        delete it->second;
+      }
+      properties_.clear();
+    }
+};
+
+} // end of namespace bpp.
+
+#endif //_MAFBLOCK_H_
diff --git a/src/Bpp/Seq/Io/Maf/MafIterator.cpp b/src/Bpp/Seq/Io/Maf/MafIterator.cpp
new file mode 100644
index 0000000..614cda8
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/MafIterator.cpp
@@ -0,0 +1,68 @@
+//
+// File: MafIterator.cpp
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "MafIterator.h"
+#include "IterationListener.h"
+
+using namespace bpp;
+
+//From the STL:
+#include <string>
+#include <numeric>
+
+using namespace std;
+
+void AbstractMafIterator::fireIterationStartSignal_() {
+  for (std::vector<IterationListener*>::iterator it = iterationListeners_.begin(); it != iterationListeners_.end(); ++it) {
+    (*it)->iterationStarts();
+  }
+}
+
+void AbstractMafIterator::fireIterationMoveSignal_(const MafBlock& currentBlock) {
+  for (std::vector<IterationListener*>::iterator it = iterationListeners_.begin(); it != iterationListeners_.end(); ++it) {
+    (*it)->iterationMoves(currentBlock);
+  }
+}
+
+void AbstractMafIterator::fireIterationStopSignal_() {
+  for (std::vector<IterationListener*>::iterator it = iterationListeners_.begin(); it != iterationListeners_.end(); ++it) {
+    (*it)->iterationStops();
+  }
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/MafIterator.h b/src/Bpp/Seq/Io/Maf/MafIterator.h
new file mode 100644
index 0000000..0b4dc0e
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/MafIterator.h
@@ -0,0 +1,254 @@
+//
+// File: MafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _MAFITERATOR_H_
+#define _MAFITERATOR_H_
+
+#include "MafBlock.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+//Forward declaration:
+class IterationListener;
+
+/**
+ * @brief Interface to loop over maf alignment blocks.
+ */
+class MafIterator
+{
+  public:
+    virtual ~MafIterator() {}
+
+  public:
+    /**
+     * @brief Get the next available alignment block.
+     *
+     * @return A maf alignment block, or a null pointer if no more block is available.
+     */
+    virtual MafBlock* nextBlock() throw (Exception) = 0;
+
+    virtual bool isVerbose() const = 0;
+    
+    virtual void setVerbose(bool yn) = 0;
+    
+    virtual void addIterationListener(IterationListener* listener) = 0;
+    
+
+};
+
+/**
+ * @brief Partial implementation of the MafIterator interface.
+ *
+ * This implements the listener parts.
+ */
+class AbstractMafIterator:
+  public virtual MafIterator
+{
+  protected:
+    std::vector<IterationListener*> iterationListeners_;
+    bool started_;
+    bool verbose_;
+
+  public:
+    AbstractMafIterator(): iterationListeners_(), started_(false), verbose_(true) {}
+    
+    virtual ~AbstractMafIterator() {}
+
+  public:
+    void addIterationListener(IterationListener* listener) {
+      iterationListeners_.push_back(listener);
+    }
+
+    MafBlock* nextBlock() throw (Exception) {
+      if (!started_) {
+        fireIterationStartSignal_();
+        started_ = true;
+      }
+      MafBlock* block = analyseCurrentBlock_();
+      if (block)
+        fireIterationMoveSignal_(*block);
+      else
+        fireIterationStopSignal_();
+      return block;
+    }
+    
+    bool isVerbose() const { return verbose_; }
+    void setVerbose(bool yn) { verbose_ = yn; }
+
+  protected:
+    virtual MafBlock* analyseCurrentBlock_() = 0;
+    virtual void fireIterationStartSignal_();
+    virtual void fireIterationMoveSignal_(const MafBlock& currentBlock);
+    virtual void fireIterationStopSignal_();
+
+};
+
+/**
+ * @brief Interface to loop over removed blocks of a maf alignment.
+ */
+class MafTrashIterator
+{
+  public:
+    virtual ~MafTrashIterator() {}
+
+  public:
+    /**
+     * @brief Get the next available removed alignment block.
+     *
+     * @return A maf alignment block, or a null pointer if no more block is available.
+     */
+    virtual MafBlock* nextRemovedBlock() throw (Exception) = 0;
+    
+};
+
+
+/**
+ * @brief Helper class for developping filter for maf blocks.
+ */
+class AbstractFilterMafIterator:
+  public AbstractMafIterator
+{
+  protected:
+    MafIterator* iterator_;
+    MafBlock* currentBlock_;
+    OutputStream* logstream_;
+
+  public:
+    AbstractFilterMafIterator(MafIterator* iterator) :
+      AbstractMafIterator(),
+      iterator_(iterator), currentBlock_(0),
+      logstream_(ApplicationTools::message) {}
+
+  private:
+    AbstractFilterMafIterator(const AbstractFilterMafIterator& it):
+      AbstractMafIterator(it), 
+      iterator_(it.iterator_), currentBlock_(0),
+      logstream_(it.logstream_) {}
+
+    AbstractFilterMafIterator& operator=(const AbstractFilterMafIterator& it) {
+      AbstractMafIterator::operator=(it);
+      currentBlock_ = 0;
+      iterator_  = it.iterator_;
+      logstream_ = it.logstream_;
+      return *this;
+    }
+
+  public:
+    void setLogStream(OutputStream* logstream) { logstream_ = logstream; }
+
+};
+
+
+class TrashIteratorAdapter:
+  public AbstractMafIterator
+{
+  private:
+    MafTrashIterator* iterator_;
+
+  public:
+    TrashIteratorAdapter(MafTrashIterator* iterator) :
+      iterator_(iterator) {}
+
+  private:
+    TrashIteratorAdapter(const TrashIteratorAdapter& iterator) :
+      iterator_(iterator.iterator_) {}
+    
+    TrashIteratorAdapter& operator=(const TrashIteratorAdapter& iterator) {
+      iterator_ = iterator.iterator_;
+      return *this;
+    }
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception) {
+      return iterator_->nextRemovedBlock();
+    }
+};
+
+
+/**
+ * @brief This special iterator synchronizes two adaptors.
+ *
+ * It takes as input a main iterator and a secondary one. The nextBlock method of the secondary iterator will be
+ * called immediately after the one of the primary one. The resulting block of the main iterator will be forwarded,
+ * while the one of the secondary iterator will be destroyed.
+ */
+class MafIteratorSynchronizer:
+  public AbstractFilterMafIterator
+{
+  private:
+    MafIterator* secondaryIterator_;
+
+  public:
+    MafIteratorSynchronizer(MafIterator* primaryIterator, MafIterator* secondaryIterator) :
+      AbstractFilterMafIterator(primaryIterator), secondaryIterator_(secondaryIterator)
+    {}
+
+  private:
+    MafIteratorSynchronizer(const MafIteratorSynchronizer& iterator) :
+      AbstractFilterMafIterator(0),
+      secondaryIterator_(iterator.secondaryIterator_)
+    {}
+    
+    MafIteratorSynchronizer& operator=(const MafIteratorSynchronizer& iterator)
+    {
+      secondaryIterator_ = iterator.secondaryIterator_;
+      return *this;
+    }
+
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception) {
+      currentBlock_ = iterator_->nextBlock();
+      MafBlock* secondBlock = secondaryIterator_->nextBlock();
+      if (secondBlock)
+        delete secondBlock;
+      return currentBlock_;
+    }
+
+};
+
+
+} // end of namespace bpp.
+
+#endif //_MAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/MafParser.cpp b/src/Bpp/Seq/Io/Maf/MafParser.cpp
new file mode 100644
index 0000000..4043d51
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/MafParser.cpp
@@ -0,0 +1,160 @@
+//
+// File: MafParser.cpp
+// Authors: Julien Dutheil
+// Created: Tue Apr 27 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "MafParser.h"
+#include <Bpp/Seq/SequenceWithQuality.h>
+#include <Bpp/Seq/SequenceWithAnnotationTools.h>
+#include <Bpp/Text/TextTools.h>
+#include <Bpp/Text/KeyvalTools.h>
+
+using namespace std;
+using namespace bpp;
+
+MafBlock* MafParser::analyseCurrentBlock_() throw (Exception)
+{
+  MafBlock* block = 0;
+
+  string line;
+  bool test = true;
+  MafSequence* currentSequence = 0;
+  while (test)
+  {
+    if (stream_->eof()) return 0;
+    getline(*stream_, line, '\n');
+    if (TextTools::isEmpty(line))
+    {
+      if (firstBlock_)
+        continue;
+      if (currentSequence) {
+        //Add previous sequence:
+        block->addSequence(*currentSequence); //The sequence is copied in the container.
+        delete currentSequence;
+      }
+
+      //end of paragraph
+      test = false;
+    }
+    else if (line[0] == 'a')
+    {
+      if (currentSequence) {
+        //Add previous sequence:
+        block->addSequence(*currentSequence); //The sequence is copied in the container.
+        delete currentSequence;
+      }
+      
+      //New block.
+      block = new MafBlock();
+      firstBlock_ = false;
+
+      map<string, string> args;
+      if (line.size() > 2)
+      {
+        KeyvalTools::multipleKeyvals(line.substr(2), args, " ");
+
+        if (args.find("score") != args.end())
+          block->setScore(TextTools::toDouble(args["score"]));
+    
+        if (args.find("pass") != args.end())
+          block->setPass(TextTools::to<unsigned int>(args["pass"]));
+      }
+    }
+    else if (line[0] == 's')
+    {
+      StringTokenizer st(line);
+      st.nextToken(); //The 's' tag
+      string src = st.nextToken();
+      unsigned int start = TextTools::to<unsigned int>(st.nextToken());
+      unsigned int size = TextTools::to<unsigned int>(st.nextToken());
+      string tmp = st.nextToken();
+      if (tmp.size() != 1)
+        throw Exception("MafAlignmentParser::nextBlock. Strand specification is incorrect, should be only one character long, found " + TextTools::toString(tmp.size()) + ".");
+      char strand = tmp[0];
+
+      unsigned int srcSize = TextTools::to<unsigned int>(st.nextToken());
+      if (currentSequence) {
+        //Add previous sequence:
+        block->addSequence(*currentSequence); //The sequence is copied in the container.
+        delete currentSequence;
+      }
+      const string seq = st.nextToken();
+      currentSequence = new MafSequence(src, seq, start, strand, srcSize);
+      if (currentSequence->getGenomicSize() != size)
+        throw Exception("MafAlignmentParser::nextBlock. Sequence found (" + src + ") does not match specified size: " + TextTools::toString(currentSequence->getGenomicSize()) + ", should be " + TextTools::toString(size) + ".");
+      
+      //Add mask:
+      if (mask_) {
+        vector<bool> mask(currentSequence->size());
+        for (unsigned int i = 0; i < mask.size(); ++i) {
+          mask[i] = cmAlphabet_.isMasked(seq[i]);
+        }
+        currentSequence->addAnnotation(new SequenceMask(mask));
+      }
+    }
+    else if (line[0] == 'q')
+    {
+      if (!currentSequence)
+        throw Exception("MafAlignmentParser::nextBlock(). Quality scores found, but there is currently no sequence!");
+      StringTokenizer st(line);
+      st.nextToken(); //The 'q' tag
+      string name = st.nextToken();
+      if (name != currentSequence->getName())
+        throw Exception("MafAlignmentParser::nextBlock(). Quality scores found, but with a different name from the previous sequence: " + name + ", should be " + currentSequence->getName() + ".");
+      string qstr = st.nextToken();
+      //Now parse the score string:
+      SequenceQuality* seqQual = new SequenceQuality(qstr.size());
+      for (unsigned int i = 0; i < qstr.size(); ++i) {
+        char c = qstr[i];
+        if (c == '-') {
+          seqQual->setScore(i, -1);
+        } else if (c == '0' || c == '1' || c == '2' || c== '3' || c == '4' || c == '5' || c == '6' || c == '7' || c == '8' || c == '9') {
+          seqQual->setScore(i, c - '0');
+        } else if (c == 'F' || c == 'f') { //Finished
+          seqQual->setScore(i, 10);
+        } else if (c == '?' || c == '.') {
+          seqQual->setScore(i, -2);
+        } else {
+          throw Exception("MafAlignmentParser::nextBlock(). Unvalid quality score: " + TextTools::toString(c) + ". Should be 0-9, F or '-'.");
+        }
+      }
+      currentSequence->addAnnotation(seqQual);
+    }
+  }
+  return block;
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/MafParser.h b/src/Bpp/Seq/Io/Maf/MafParser.h
new file mode 100644
index 0000000..54475a2
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/MafParser.h
@@ -0,0 +1,87 @@
+//
+// File: MafParser.h
+// Authors: Julien Dutheil
+// Created: Tue Apr 27 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _MAFPARSER_H_
+#define _MAFPARSER_H_
+
+#include "MafIterator.h"
+#include <Bpp/Seq/Alphabet/CaseMaskedAlphabet.h>
+
+//From the STL:
+#include <iostream>
+
+namespace bpp {
+
+/**
+ * @brief MAF file parser.
+ * 
+ * This class parses synteny blocks from Maf file.
+ *
+ * The MAF format is documented on the UCSC Genome Browser website:
+ * <a href="http://genome.ucsc.edu/FAQ/FAQformat.html#format5">http://genome.ucsc.edu/FAQ/FAQformat.html#format5</a>
+ *
+ * @author Julien Dutheil
+ */
+class MafParser:
+  public AbstractMafIterator
+{
+  private:
+    std::istream* stream_;
+    bool mask_;
+    CaseMaskedAlphabet cmAlphabet_;
+    bool firstBlock_;
+
+  public:
+    MafParser(std::istream* stream, bool parseMask = false) :
+      stream_(stream), mask_(parseMask), cmAlphabet_(&AlphabetTools::DNA_ALPHABET), firstBlock_(true) {}
+
+  private:
+    //Recopy is forbidden!
+    MafParser(const MafParser& maf): stream_(0), mask_(maf.mask_), cmAlphabet_(&AlphabetTools::DNA_ALPHABET), firstBlock_(maf.firstBlock_) {}
+    MafParser& operator=(const MafParser& maf) { stream_ = 0; mask_ = maf.mask_; firstBlock_ = maf.firstBlock_; return *this; }
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception);
+
+};
+
+} // end of namespace bpp.
+
+#endif //_MAFPARSER_H_
+
diff --git a/src/Bpp/Seq/Io/Maf/MafSequence.cpp b/src/Bpp/Seq/Io/Maf/MafSequence.cpp
new file mode 100644
index 0000000..6aebf5a
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/MafSequence.cpp
@@ -0,0 +1,67 @@
+//
+// File: MafSequence.cpp
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "MafSequence.h"
+
+//From the STL:
+#include <string>
+
+using namespace bpp;
+using namespace std;
+
+MafSequence* MafSequence::subSequence(size_t startAt, size_t length) const
+{
+  string subseq = toString().substr(startAt, length);
+  size_t begin = begin_;
+  if (hasCoordinates_) {
+    for (unsigned int i = 0; i < startAt; ++i) {
+      if (! getAlphabet()->isGap(operator[](i))) begin++;
+    }
+  }
+  MafSequence* newSeq = new MafSequence(getName(), subseq, begin, strand_, srcSize_);
+  if (!hasCoordinates_)
+    newSeq->removeCoordinates();
+  vector<string> anno = getAnnotationTypes();
+  for (size_t i = 0; i < anno.size(); ++i) {
+    newSeq->addAnnotation(getAnnotation(anno[i]).getPartAnnotation(startAt, length));
+  }
+  return newSeq;
+}
+
+
diff --git a/src/Bpp/Seq/Io/Maf/MafSequence.h b/src/Bpp/Seq/Io/Maf/MafSequence.h
new file mode 100644
index 0000000..dc4bf4a
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/MafSequence.h
@@ -0,0 +1,191 @@
+//
+// File: MafSequence.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _MAFSEQUENCE_H_
+#define _MAFSEQUENCE_H_
+
+#include "../../Feature/SequenceFeature.h"
+
+#include <Bpp/Seq/SequenceWithAnnotation.h>
+#include <Bpp/Seq/Alphabet/AlphabetTools.h>
+#include <Bpp/Seq/SequenceTools.h>
+
+namespace bpp {
+
+/**
+ * @brief A sequence class which is used to store data from MAF files.
+ * 
+ * It extends the SequenceWithAnnotation class to store MAF-specific features,
+ * like the chromosome position. The sequence is its own listener,
+ * and recomputes its "genomic" site by using the SequenceTools::getNumberOfSites
+ * function when a content modification is performed.
+ * Tags like begin and stop, hovever, have to be set by hand.
+ *
+ * A MAF sequence is necessarily a DNA sequence.
+ */
+class MafSequence:
+  public SequenceWithAnnotation
+{
+  private:
+    bool         hasCoordinates_;
+    size_t begin_;
+    std::string  species_;
+    std::string  chromosome_;
+    char         strand_;
+    size_t size_;
+    size_t srcSize_;
+
+  public:
+    MafSequence():
+      SequenceWithAnnotation(&AlphabetTools::DNA_ALPHABET), hasCoordinates_(false), begin_(0), species_(""), chromosome_(""), strand_(0), size_(0), srcSize_(0)
+    {
+      size_ = 0;
+    }
+
+    MafSequence(const std::string& name, const std::string& sequence, bool parseName = true):
+      SequenceWithAnnotation(name, sequence, &AlphabetTools::DNA_ALPHABET), hasCoordinates_(false), begin_(0), species_(""), chromosome_(""), strand_(0), size_(0), srcSize_(0)
+    {
+      size_ = SequenceTools::getNumberOfSites(*this);
+      if (parseName)
+        splitNameIntoSpeciesAndChromosome(name, species_, chromosome_);
+    }
+
+    MafSequence(const std::string& name, const std::string& sequence, size_t begin, char strand, size_t srcSize, bool parseName = true) :
+      SequenceWithAnnotation(name, sequence, &AlphabetTools::DNA_ALPHABET), hasCoordinates_(true), begin_(begin), species_(""), chromosome_(""), strand_(strand), size_(0), srcSize_(srcSize)
+    {
+      size_ = SequenceTools::getNumberOfSites(*this);
+      if (parseName)
+        splitNameIntoSpeciesAndChromosome(name, species_, chromosome_);
+    }
+
+    MafSequence* clone() const { return new MafSequence(*this); }
+
+    ~MafSequence() {}
+
+  public:
+    bool hasCoordinates() const { return hasCoordinates_; }
+
+    void removeCoordinates() { hasCoordinates_ = false; begin_ = 0; }
+
+    size_t start() const throw (Exception) { 
+      if (hasCoordinates_) return begin_;
+      else throw Exception("MafSequence::start(). Sequence " + getName() + " does not have coordinates.");
+    }
+
+    size_t stop() const { 
+      if (hasCoordinates_) return begin_ + size_ - 1;
+      else throw Exception("MafSequence::stop(). Sequence " + getName() + " does not have coordinates.");
+    }
+
+    Range<size_t> getRange() const {
+      if (hasCoordinates_) return Range<size_t>(start(), stop());
+      else throw Exception("MafSequence::getRange(). Sequence " + getName() + " does not have coordinates.");
+    }
+
+    void setName(const std::string& name) {
+      try {
+        splitNameIntoSpeciesAndChromosome(name, species_, chromosome_);
+      } catch (Exception& e) {
+        species_ = "";
+        chromosome_ = "";
+      }
+      SequenceWithAnnotation::setName(name);
+    }
+
+    static void splitNameIntoSpeciesAndChromosome(const std::string& name, std::string& species, std::string& chr) {
+      size_t pos = name.find(".");
+      if (pos != std::string::npos) {
+        chr     = name.substr(pos + 1);
+        species = name.substr(0, pos);
+      } else {
+        throw Exception("MafSequence::splitNameIntospeciesAndChromosome(). Invalid sequence name: " + name);
+      }
+    }
+
+    const std::string& getSpecies() const { return species_; }
+    
+    const std::string& getChromosome() const { return chromosome_; }
+    
+    char getStrand() const { return strand_; }
+    
+    size_t getGenomicSize() const { return size_; }
+    
+    size_t getSrcSize() const { return srcSize_; }
+    
+    void setStart(size_t begin) { begin_ = begin; hasCoordinates_ = true; }
+    
+    void setChromosome(const std::string& chr) {
+      chromosome_ = chr;
+      SequenceWithAnnotation::setName(species_ + "." + chromosome_);
+    }
+    
+    void setSpecies(const std::string& species) {
+      species_ = species;
+      SequenceWithAnnotation::setName(species_ + "." + chromosome_);
+    }
+    
+    void setStrand(char s) { strand_ = s; }
+    
+    void setSrcSize(size_t srcSize) { srcSize_ = srcSize; }
+  
+    std::string getDescription() const { return getName() + strand_ + ":" + (hasCoordinates_ ? TextTools::toString(start()) + "-" + TextTools::toString(stop()) : "?-?"); }
+  
+    /**
+     * @brief Extract a sub-sequence.
+     *
+     * @return A subsequence.
+     * @param startAt Begining of sub-sequence.
+     * @param length  the length of the sub-sequence.
+     */
+    MafSequence* subSequence(size_t startAt, size_t length) const;
+    
+  private:
+    void beforeSequenceChanged(const SymbolListEditionEvent& event) {}
+    void afterSequenceChanged(const SymbolListEditionEvent& event) { size_ = SequenceTools::getNumberOfSites(*this); }
+    void beforeSequenceInserted(const SymbolListInsertionEvent& event) {}
+    void afterSequenceInserted(const SymbolListInsertionEvent& event) { size_ = SequenceTools::getNumberOfSites(*this); }
+    void beforeSequenceDeleted(const SymbolListDeletionEvent& event) {}
+    void afterSequenceDeleted(const SymbolListDeletionEvent& event) { size_ = SequenceTools::getNumberOfSites(*this); }
+    void beforeSequenceSubstituted(const SymbolListSubstitutionEvent& event) {}
+    void afterSequenceSubstituted(const SymbolListSubstitutionEvent& event) {}
+};
+
+} // end of namespace bpp.
+
+#endif //_MAFSEQUENCE_H_
diff --git a/src/Bpp/Seq/Io/Maf/MafStatistics.cpp b/src/Bpp/Seq/Io/Maf/MafStatistics.cpp
new file mode 100644
index 0000000..f0194a5
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/MafStatistics.cpp
@@ -0,0 +1,204 @@
+//
+// File: MafStatistics.cpp
+// Authors: Julien Dutheil
+// Created: Mon Jun 25 2012
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "MafStatistics.h"
+#include <Bpp/Seq/Container/SequenceContainerTools.h>
+#include <Bpp/Seq/Container/VectorSiteContainer.h>
+#include <Bpp/Seq/SiteTools.h>
+
+//From bpp-core:
+#include <Bpp/Numeric/NumConstants.h>
+
+//From the STL:
+#include <cmath>
+#include <map>
+
+using namespace bpp;
+using namespace std;
+
+void PairwiseDivergenceMafStatistics::compute(const MafBlock& block)
+{
+  vector<const MafSequence*> seqs1 = block.getSequencesForSpecies(species1_);
+  vector<const MafSequence*> seqs2 = block.getSequencesForSpecies(species2_);
+  if (seqs1.size() > 1 || seqs2.size() > 1)
+    throw Exception("PairwiseDivergenceMafStatistics::compute. Duplicated sequence for species " + species1_ + "or " + species2_ + ".");
+  if (seqs1.size() == 0 || seqs2.size() == 0)
+    result_.setValue(NumConstants::NaN());
+  else
+    result_.setValue(100. - SequenceTools::getPercentIdentity(*seqs1[0], *seqs2[0], true));
+}
+
+vector<string> CharacterCountsMafStatistics::getSupportedTags() const
+{
+  vector<string> tags;
+  for (int i = 0; i < static_cast<int>(alphabet_->getSize()); ++i) {
+    tags.push_back(alphabet_->intToChar(i));
+  }
+  tags.push_back("Gap");
+  tags.push_back("Unresolved");
+
+  return tags;
+}
+
+void CharacterCountsMafStatistics::compute(const MafBlock& block)
+{
+  std::map<int, int> counts;
+  SequenceContainerTools::getCounts(block.getAlignment(), counts); 
+  for (int i = 0; i < static_cast<int>(alphabet_->getSize()); ++i) {
+    result_.setValue(alphabet_->intToChar(i), counts[i]);
+  }
+  result_.setValue("Gap", counts[alphabet_->getGapCharacterCode()]);
+  double countUnres = 0;
+  for (map<int, int>::iterator it = counts.begin(); it != counts.end(); ++it) {
+    if (alphabet_->isUnresolved(it->first))
+      countUnres += it->second;
+  }
+  result_.setValue("Unresolved", countUnres);
+}
+
+SiteContainer* AbstractSpeciesSelectionMafStatistics::getSiteContainer(const MafBlock& block)
+{
+  VectorSiteContainer* alignment = new VectorSiteContainer(block.getAlignment().getAlphabet());
+  for (size_t i = 0; i < species_.size(); ++i) {
+    if (block.hasSequenceForSpecies(species_[i])) {
+      vector<const MafSequence*> selection = block.getSequencesForSpecies(species_[i]);
+      for (size_t j = 0; j < selection.size(); ++j) {
+        alignment->addSequence(*selection[j]);
+      }
+    }
+  }
+  return alignment;
+}
+
+vector<string> SiteFrequencySpectrumMafStatistics::getSupportedTags() const
+{
+  vector<string> tags;
+  for (size_t i = 0; i < categorizer_.getNumberOfCategories(); ++i) {
+    tags.push_back("Bin" + TextTools::toString(i + 1)); 
+  }
+  tags.push_back("Unresolved");
+  tags.push_back("Saturated");
+  tags.push_back("Ignored");
+  return tags;
+}
+
+void SiteFrequencySpectrumMafStatistics::compute(const MafBlock& block)
+{
+  unsigned int nbUnresolved = 0;
+  unsigned int nbSaturated = 0;
+  unsigned int nbIgnored = 0;
+  counts_.assign(categorizer_.getNumberOfCategories(), 0);
+  int state;
+  auto_ptr<SiteContainer> alignment(getSiteContainer(block));
+  if (alignment->getNumberOfSequences() > 0) {
+    for (size_t i = 0; i < block.getNumberOfSites(); ++i) {
+      //Note: we do not rely on SiteTool::getCounts as it would be unefficient to count everything.
+      const Site& site = alignment->getSite(i);
+      map<int, unsigned int> counts;
+      for (unsigned int j = 0; j < site.size(); ++j) {
+        state = site[j];
+        if (alphabet_->isGap(state) || alphabet_->isUnresolved(state)) {
+          nbUnresolved++;
+          break;
+        } else {
+          counts[state]++;
+          if (counts.size() > 2) {
+            nbSaturated++;
+            break;
+          }
+        }
+      }
+      if (counts.size() > 0) {
+        //Determine frequency class:
+        double count;
+        if (counts.size() == 1) {
+          count = 0;
+        } else {
+          map<int, unsigned int>::iterator it = counts.begin();
+          unsigned int count1 = it->second;
+          it++;
+          unsigned int count2 = it->second;
+          count = min(count1, count2);
+        }
+        try {
+          counts_[categorizer_.getCategory(count) - 1]++;
+        } catch (OutOfRangeException& oof) {
+          nbIgnored++;
+        }
+      }
+    }
+  }
+  result_.setValue("Unresolved", nbUnresolved);
+  result_.setValue("Saturated", nbSaturated);
+  result_.setValue("Ignored", nbIgnored);
+  for (size_t i = 0; i < counts_.size(); ++i) {
+    result_.setValue("Bin" + TextTools::toString(i + 1), counts_[i]);
+  }
+}
+
+vector<string> SiteMafStatistics::getSupportedTags() const
+{
+  vector<string> tags;
+  tags.push_back("NbWithoutGap");
+  tags.push_back("NbComplete");
+  tags.push_back("NbParsimonyInformative");
+  return tags;
+}
+
+void SiteMafStatistics::compute(const MafBlock& block)
+{
+  auto_ptr<SiteContainer> alignment(getSiteContainer(block));
+  unsigned int nbNg = 0;
+  unsigned int nbCo = 0;
+  unsigned int nbPi = 0;
+  if (alignment->getNumberOfSequences() > 0) {
+    for (unsigned int i = 0; i < alignment->getNumberOfSites(); ++i) {
+      if (!SiteTools::hasGap(alignment->getSite(i)))
+        nbNg++;
+      if (SiteTools::isComplete(alignment->getSite(i)))
+        nbCo++;
+      if (SiteTools::isParsimonyInformativeSite(alignment->getSite(i)))
+        nbPi++;
+    }
+  }
+  result_.setValue("NbWithoutGap", nbNg);
+  result_.setValue("NbComplete", nbCo);
+  result_.setValue("NbParsimonyInformative", nbPi);
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/MafStatistics.h b/src/Bpp/Seq/Io/Maf/MafStatistics.h
new file mode 100644
index 0000000..cbb52ca
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/MafStatistics.h
@@ -0,0 +1,467 @@
+//
+// File: MafStatistics.h
+// Authors: Julien Dutheil
+// Created: Mon Jun 25 2012
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2012)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _MAFSTATISTICS_H_
+#define _MAFSTATISTICS_H_
+
+#include "MafBlock.h"
+
+//From bpp-core:
+#include <Bpp/Utils/MapTools.h>
+
+//From the STL:
+#include <map>
+#include <string>
+
+namespace bpp {
+
+/**
+ * @brief General interface for storing statistical results.
+ *
+ * This interface will most likely be extended in the future...
+ *
+ * @author Julien Dutheil
+ * @see MafStatistics
+ */
+class MafStatisticsResult
+{
+  protected:
+    mutable std::map<std::string, double> values_;
+
+  public:
+    MafStatisticsResult(): values_() {}
+    virtual ~MafStatisticsResult() {}
+
+  public:
+    virtual double getValue(const std::string& tag) const throw (Exception) {
+      std::map<std::string, double>::iterator it = values_.find(tag);
+      if (it != values_.end())
+        return it->second;
+      else
+        throw Exception("MafStatisticsResult::getValue(). No value found for tag: " + tag + ".");
+    }
+    /**
+     * @brief Associate a value to a certain tag. Any existing tag will be overwritten
+     *
+     * @param tag The name of the value to associate.
+     * @param value The value to associate to the tag.
+     */
+    virtual void setValue(const std::string& tag, double value) throw (Exception) { values_[tag] = value; }
+
+    /**
+     * @return A boolean saying whether a value is available for the given tag.
+     * @param tag The name of the value to associate.
+     */
+    virtual bool hasValue(const std::string& tag) const {
+      return (values_.find(tag) != values_.end()); 
+    }
+
+    /**
+     * @return A vector with all available tags.
+     */
+    std::vector<std::string> getAvailableTags() const { return MapTools::getKeys(values_); }
+};
+
+/**
+ * @brief A simple maf statistics result, with only one value.
+ */
+class SimpleMafStatisticsResult:
+  public virtual MafStatisticsResult
+{
+  private:
+    std::string name_;
+
+  public:
+    SimpleMafStatisticsResult(const std::string& name): MafStatisticsResult(), name_(name) {
+      setValue(name, 0);
+    }
+    virtual ~SimpleMafStatisticsResult() {}
+
+  public:
+    virtual double getValue() const { return values_[name_]; }
+
+    /**
+     * @brief Associate a value to a certain tag. Any existing tag will be overwritten
+     *
+     * @param tag The name of the value to associate.
+     * @param value The value to associate to the tag.
+     */
+    virtual void setValue(const std::string& tag, double value) throw (Exception) {
+      if (tag == name_)
+        values_[tag] = value;
+      else
+        throw Exception("SimpleMafStatisticsResult::setValue(). Unvalid tag name: " + tag + ".");
+    }
+    
+    virtual void setValue(double value) { values_[name_] = value; }
+
+};
+
+/**
+ * @brief General interface for computing statistics based on a Maf block.
+ *
+ * @author Julien Dutheil
+ * @see MafBlock
+ */
+class MafStatistics
+{
+  public:
+    MafStatistics() {}
+    virtual ~MafStatistics() {}
+
+  public:
+    virtual std::string getShortName() const = 0;
+    virtual std::string getFullName() const = 0;
+    virtual const MafStatisticsResult& getResult() const = 0;
+    virtual void compute(const MafBlock& block) = 0;
+
+    /**
+     * @return A vector with all available tags.
+     */
+    virtual std::vector<std::string> getSupportedTags() const = 0;
+
+};
+
+/**
+ * @brief Partial implementation of MafStatistics, for convenience.
+ */
+class AbstractMafStatistics:
+  public virtual MafStatistics
+{
+  protected:
+    MafStatisticsResult result_;
+
+  public:
+    AbstractMafStatistics(): result_() {}
+    virtual ~AbstractMafStatistics() {}
+
+  public:
+    const MafStatisticsResult& getResult() const { return result_; }
+};
+
+/**
+ * @brief Partial implementation of MafStatistics, for convenience.
+ */
+class AbstractMafStatisticsSimple:
+  public MafStatistics
+{
+  protected:
+    SimpleMafStatisticsResult result_;
+
+  public:
+    AbstractMafStatisticsSimple(const std::string& name): result_(name) {}
+    virtual ~AbstractMafStatisticsSimple() {}
+
+  public:
+    const SimpleMafStatisticsResult& getResult() const { return result_; }
+    std::vector<std::string> getSupportedTags() const { return result_.getAvailableTags(); }
+};
+
+/**
+ * @brief Computes the pairwise divergence for a pair of sequences in a maf block.
+ */
+class PairwiseDivergenceMafStatistics:
+  public AbstractMafStatisticsSimple
+{
+  private:
+    std::string species1_;
+    std::string species2_;
+
+  public:
+    PairwiseDivergenceMafStatistics(const std::string& species1, const std::string& species2):
+      AbstractMafStatisticsSimple("Divergence"), species1_(species1), species2_(species2) {}
+
+    ~PairwiseDivergenceMafStatistics() {}
+
+  public:
+    std::string getShortName() const { return "Div." + species1_ + "-" + species2_; }
+    std::string getFullName() const { return "Pairwise divergence between " + species1_ + " and " + species2_ + "."; }
+    void compute(const MafBlock& block);
+
+};
+
+/**
+ * @brief Computes the number of sequences in a maf block.
+ */
+class BlockSizeMafStatistics:
+  public AbstractMafStatisticsSimple
+{
+  public:
+    BlockSizeMafStatistics(): AbstractMafStatisticsSimple("BlockSize") {}
+    ~BlockSizeMafStatistics() {}
+
+  public:
+    std::string getShortName() const { return "BlockSize"; }
+    std::string getFullName() const { return "Number of sequences."; }
+    void compute(const MafBlock& block) {
+      result_.setValue(static_cast<double>(block.getNumberOfSequences()));
+    }
+};
+
+/**
+ * @brief Computes the number of columns in a maf block.
+ */
+class BlockLengthMafStatistics:
+  public AbstractMafStatisticsSimple
+{
+  public:
+    BlockLengthMafStatistics(): AbstractMafStatisticsSimple("BlockLength") {}
+    ~BlockLengthMafStatistics() {}
+
+  public:
+    std::string getShortName() const { return "BlockLength"; }
+    std::string getFullName() const { return "Number of sites."; }
+    void compute(const MafBlock& block) {
+      result_.setValue(static_cast<double>(block.getNumberOfSites()));
+    }
+};
+
+/**
+ * @brief Retrieve the sequence length (number of nucleotides) for a given species in a maf block.
+ *
+ * If no sequence is found for the current block, 0 is returned.
+ * If several sequences are found for a given species, an exception is thrown.
+ */
+class SequenceLengthMafStatistics:
+  public AbstractMafStatisticsSimple
+{
+  private:
+    std::string species_;
+
+  public:
+    SequenceLengthMafStatistics(const std::string& species): AbstractMafStatisticsSimple("BlockSize"), species_(species) {}
+    ~SequenceLengthMafStatistics() {}
+
+  public:
+    std::string getShortName() const { return "SequenceLengthFor" + species_; }
+    std::string getFullName() const { return "Sequence length for species " + species_; }
+    void compute(const MafBlock& block) {
+      std::vector<const MafSequence*> seqs = block.getSequencesForSpecies(species_);
+      if (seqs.size() == 0)
+        result_.setValue(0.);
+      else if (seqs.size() == 1)
+        result_.setValue(static_cast<double>(SequenceTools::getNumberOfSites(*seqs[0])));
+      else
+        throw Exception("SequenceLengthMafStatistics::compute. More than one sequence found for species " + species_ + " in current block.");
+    }
+};
+
+
+/**
+ * @brief Retrieves the alignment score of a maf block.
+ */
+class AlignmentScoreMafStatistics:
+  public AbstractMafStatisticsSimple
+{
+  public:
+    AlignmentScoreMafStatistics(): AbstractMafStatisticsSimple("AlnScore") {}
+    ~AlignmentScoreMafStatistics() {}
+
+  public:
+    std::string getShortName() const { return "AlnScore"; }
+    std::string getFullName() const { return "Alignment score."; }
+    void compute(const MafBlock& block) {
+      result_.setValue(block.getScore());
+    }
+};
+
+/**
+ * @brief Compute the base frequencies of a maf block.
+ *
+ * For each block, provides the following numbers (with their corresponding tags):
+ * - A: total counts of A
+ * - C: total counts of C
+ * - G: total counts of G
+ * - T [or U]: total counts of T/U
+ * - Gap: total counts of gaps
+ * - Unresolved: total counts of unresolved characters
+ * The sum of all characters should equal BlockSize x BlockLength 
+ */
+class CharacterCountsMafStatistics:
+  public AbstractMafStatistics
+{
+  private:
+    const Alphabet* alphabet_;
+
+  public:
+    CharacterCountsMafStatistics(const Alphabet* alphabet): AbstractMafStatistics(), alphabet_(alphabet) {}
+    CharacterCountsMafStatistics(const CharacterCountsMafStatistics& stats):
+      AbstractMafStatistics(stats), alphabet_(stats.alphabet_) {}
+    CharacterCountsMafStatistics& operator=(const CharacterCountsMafStatistics& stats) {
+      AbstractMafStatistics::operator=(stats);
+      alphabet_ = stats.alphabet_;
+      return *this;
+    }
+
+    virtual ~CharacterCountsMafStatistics() {}
+
+  public:
+    std::string getShortName() const { return "Count"; }
+    std::string getFullName() const { return "Character counts."; }
+    void compute(const MafBlock& block);
+    std::vector<std::string> getSupportedTags() const;
+};
+
+
+/**
+ * @brief Partial implementation of MafStatistics for method working on a subset of species, in a site-wise manner.
+ *
+ * This class stores a seleciton of species and create for each block the corresponding SiteContainer.
+ */
+class AbstractSpeciesSelectionMafStatistics:
+  public virtual MafStatistics
+{
+  private:
+    std::vector<std::string> species_;
+
+  public:
+    AbstractSpeciesSelectionMafStatistics(const std::vector<std::string>& species):
+      species_(species) {}
+
+  protected:
+    SiteContainer* getSiteContainer(const MafBlock& block);
+
+};
+
+
+/**
+ * @brief Compute the Site Frequency Spectrum of a maf block.
+ *
+ * The ancestral states are considered as unknown, so that 10000 and 11110 sites are treated equally.
+ */
+class SiteFrequencySpectrumMafStatistics:
+  public AbstractMafStatistics,
+  public AbstractSpeciesSelectionMafStatistics
+{
+  private:
+    class Categorizer {
+      private:
+        std::vector<double> bounds_;
+
+      public:
+        Categorizer(const std::vector<double>& bounds): bounds_(bounds) {
+          std::sort(bounds_.begin(), bounds_.end());
+        }
+
+      public:
+        size_t getNumberOfCategories() const { return (bounds_.size() - 1); }
+
+        //Category numbers start at 1!
+        size_t getCategory(double value) const throw (OutOfRangeException) {
+          if (value < bounds_[0])
+            throw OutOfRangeException("SiteFrequencySpectrumMafStatistics::Categorizer::getCategory.", value, *bounds_.begin(), *bounds_.rbegin());
+          for (size_t i = 1; i < bounds_.size(); ++i) {
+            if (value < bounds_[i])
+              return i;
+          }
+          throw OutOfRangeException("SiteFrequencySpectrumMafStatistics::Categorizer::getCategory.", value, *bounds_.begin(), *bounds_.rbegin());
+        }
+    };
+
+  private:
+    const Alphabet* alphabet_;
+    Categorizer categorizer_;
+    std::vector<unsigned int> counts_;
+
+  public:
+    SiteFrequencySpectrumMafStatistics(const Alphabet* alphabet, const std::vector<double>& bounds, const std::vector<std::string>& ingroup):
+      AbstractMafStatistics(),
+      AbstractSpeciesSelectionMafStatistics(ingroup),
+      alphabet_(alphabet),
+      categorizer_(bounds),
+      counts_(bounds.size() - 1)
+    {}
+
+    SiteFrequencySpectrumMafStatistics(const SiteFrequencySpectrumMafStatistics& stats):
+      AbstractMafStatistics(),
+      AbstractSpeciesSelectionMafStatistics(stats),
+      alphabet_(stats.alphabet_),
+      categorizer_(stats.categorizer_),
+      counts_(stats.counts_)
+    {}
+
+    SiteFrequencySpectrumMafStatistics& operator=(const SiteFrequencySpectrumMafStatistics& stats) {
+      AbstractMafStatistics::operator=(stats);
+      AbstractSpeciesSelectionMafStatistics::operator=(stats);
+      alphabet_    = stats.alphabet_;
+      categorizer_ = stats.categorizer_;
+      counts_      = stats.counts_;
+      return *this;
+    }
+
+    virtual ~SiteFrequencySpectrumMafStatistics() {}
+
+  public:
+    std::string getShortName() const { return "SiteFrequencySpectrum"; }
+    std::string getFullName() const { return "Site frequency spectrum."; }
+    void compute(const MafBlock& block);
+    std::vector<std::string> getSupportedTags() const;
+};
+
+/**
+ * @brief Compute a few site statistics in a maf block.
+ *
+ * Computed statistics include:
+ * - Number of sites without gaps
+ * - Number of complete sites (no gap, no unresolved)
+ * - Number of parsimony informative sites
+ */
+class SiteMafStatistics:
+  public AbstractMafStatistics,
+  public AbstractSpeciesSelectionMafStatistics
+{
+  public:
+    SiteMafStatistics(const std::vector<std::string>& species):
+      AbstractMafStatistics(),
+      AbstractSpeciesSelectionMafStatistics(species)
+    {}
+
+    virtual ~SiteMafStatistics() {}
+
+  public:
+    std::string getShortName() const { return "SiteStatistics"; }
+    std::string getFullName() const { return "Site statistics."; }
+    void compute(const MafBlock& block);
+    std::vector<std::string> getSupportedTags() const;
+};
+
+} // end of namespace bpp
+
+#endif //_MAFSTATISTICS_H_
+
diff --git a/src/Bpp/Seq/Io/Maf/MaskFilterMafIterator.cpp b/src/Bpp/Seq/Io/Maf/MaskFilterMafIterator.cpp
new file mode 100644
index 0000000..0f1f02c
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/MaskFilterMafIterator.cpp
@@ -0,0 +1,222 @@
+//
+// File: MaskFilterMafIterator.cpp
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "MaskFilterMafIterator.h"
+
+//Fomr bpp-seq:
+#include <Bpp/Seq/SequenceWithAnnotationTools.h>
+
+using namespace bpp;
+
+//From the STL:
+#include <string>
+#include <numeric>
+
+using namespace std;
+
+MafBlock* MaskFilterMafIterator::analyseCurrentBlock_() throw (Exception)
+{
+  if (blockBuffer_.size() == 0) {
+    do {
+      //Else there is no more block in the buffer, we need parse more:
+      MafBlock* block = iterator_->nextBlock();
+      if (!block) return 0; //No more block.
+    
+      //Parse block.
+      vector< vector<bool> > aln;
+      for (size_t i = 0; i < species_.size(); ++i) {
+        const MafSequence* seq = &block->getSequenceForSpecies(species_[i]);
+        if (seq->hasAnnotation(SequenceMask::MASK)) {
+          aln.push_back(dynamic_cast<const SequenceMask&>(seq->getAnnotation(SequenceMask::MASK)).getMask());
+        }
+      }
+      size_t nr = aln.size();
+      size_t nc = block->getNumberOfSites();
+      //First we create a mask:
+      vector<size_t> pos;
+      vector<bool> col(nr);
+      //Reset window:
+      window_.clear();
+      //Init window:
+      size_t i;
+      for (i = 0; i < windowSize_; ++i) {
+        for (size_t j = 0; j < nr; ++j) {
+          col[j] = aln[j][i];
+        }
+        window_.push_back(col);
+      }
+      //Slide window:
+      if (verbose_) {
+        ApplicationTools::message->endLine();
+        ApplicationTools::displayTask("Sliding window for mask filter", true);
+      }
+      while (i + step_ < nc) {
+        if (verbose_)
+          ApplicationTools::displayGauge(i - windowSize_, nc - windowSize_ - 1, '>');
+        //Evaluate current window:
+        unsigned int sum = 0;
+        for (size_t u = 0; u < window_.size(); ++u)
+          for (size_t v = 0; v < window_[u].size(); ++v)
+            if (window_[u][v]) sum++;
+        if (sum > maxMasked_) {
+          if (pos.size() == 0) {
+            pos.push_back(i - windowSize_);
+            pos.push_back(i);
+          } else {
+            if (i - windowSize_ <= pos[pos.size() - 1]) {
+              pos[pos.size() - 1] = i; //Windows are overlapping and we extend previous region
+            } else { //This is a new region
+              pos.push_back(i - windowSize_);
+              pos.push_back(i);
+            }
+          }
+        }
+      
+        //Move forward:
+        for (size_t k = 0; k < step_; ++k) {
+          for (size_t j = 0; j < nr; ++j) {
+            col[j] = aln[j][i];
+          }  
+          window_.push_back(col);
+          window_.pop_front();
+          ++i;
+        }
+      }
+
+      //Evaluate last window:
+      unsigned int sum = 0;
+      for (size_t u = 0; u < window_.size(); ++u)
+        for (size_t v = 0; v < window_[u].size(); ++v)
+          if (window_[u][v]) sum++;
+      if (sum > maxMasked_) {
+        if (pos.size() == 0) {
+          pos.push_back(i - windowSize_);
+          pos.push_back(i);
+        } else {
+          if (i - windowSize_ < pos[pos.size() - 1]) {
+            pos[pos.size() - 1] = i; //Windows are overlapping and we extend previous region
+          } else { //This is a new region
+            pos.push_back(i - windowSize_);
+            pos.push_back(i);
+          }
+        }
+      }
+      if (verbose_)
+        ApplicationTools::displayTaskDone();
+    
+      //Now we remove regions with two many gaps, using a sliding window:
+      if (pos.size() == 0) {
+        blockBuffer_.push_back(block);
+        if (logstream_) {
+          (*logstream_ << "MASK CLEANER: block is clean and kept as is.").endLine();
+        }
+      } else if (pos.size() == 2 && pos.front() == 0 && pos.back() == block->getNumberOfSites()) {
+        //Everything is removed:
+        if (logstream_) {
+          (*logstream_ << "MASK CLEANER: block was entirely removed. Tried to get the next one.").endLine();
+        }
+      } else {
+        if (logstream_) {
+          (*logstream_ << "MASK CLEANER: block with size "<< block->getNumberOfSites() << " will be split into " << (pos.size() / 2 + 1) << " blocks.").endLine();
+        }
+        if (verbose_) {
+          ApplicationTools::message->endLine();
+          ApplicationTools::displayTask("Spliting block", true);
+        }
+        for (i = 0; i < pos.size(); i+=2) {
+          if (verbose_)
+            ApplicationTools::displayGauge(i, pos.size() - 2, '=');
+          if (logstream_) {
+            (*logstream_ << "MASK CLEANER: removing region (" << pos[i] << ", " << pos[i+1] << ") from block.").endLine();
+          }
+          if (pos[i] > 0) {
+            MafBlock* newBlock = new MafBlock();
+            newBlock->setScore(block->getScore());
+            newBlock->setPass(block->getPass());
+            for (size_t j = 0; j < block->getNumberOfSequences(); ++j) {
+              MafSequence* subseq;
+              if (i == 0) {
+                subseq = block->getSequence(j).subSequence(0, pos[i]);
+              } else {
+                subseq = block->getSequence(j).subSequence(pos[i - 1], pos[i] - pos[i - 1]);
+              }
+              newBlock->addSequence(*subseq);
+              delete subseq;
+            }
+            blockBuffer_.push_back(newBlock);
+          }
+          
+          if (keepTrashedBlocks_) {
+            MafBlock* outBlock = new MafBlock();
+            outBlock->setScore(block->getScore());
+            outBlock->setPass(block->getPass());
+            for (size_t j = 0; j < block->getNumberOfSequences(); ++j) {
+              MafSequence* outseq = block->getSequence(j).subSequence(pos[i], pos[i + 1] - pos[i]);
+              outBlock->addSequence(*outseq);
+              delete outseq;
+            } 
+            trashBuffer_.push_back(outBlock);
+          }
+        }
+        //Add last block:
+        if (pos[pos.size() - 1] < block->getNumberOfSites()) {
+          MafBlock* newBlock = new MafBlock();
+          newBlock->setScore(block->getScore());
+          newBlock->setPass(block->getPass());
+          for (size_t j = 0; j < block->getNumberOfSequences(); ++j) {
+            MafSequence* subseq;
+            subseq = block->getSequence(j).subSequence(pos[pos.size() - 1], block->getNumberOfSites() - pos[pos.size() - 1]);
+            newBlock->addSequence(*subseq);
+            delete subseq;
+          }
+          blockBuffer_.push_back(newBlock);
+        }
+        if (verbose_)
+          ApplicationTools::displayTaskDone();
+
+        delete block;
+      }  
+    } while (blockBuffer_.size() == 0);
+  }
+
+  MafBlock* block = blockBuffer_.front();
+  blockBuffer_.pop_front();
+  return block;
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/MaskFilterMafIterator.h b/src/Bpp/Seq/Io/Maf/MaskFilterMafIterator.h
new file mode 100644
index 0000000..5d6aa03
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/MaskFilterMafIterator.h
@@ -0,0 +1,100 @@
+//
+// File: MaskFilterMafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _MASKFILTERMAFITERATOR_H_
+#define _MASKFILTERMAFITERATOR_H_
+
+#include "MafIterator.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief Filter maf blocks to remove regions with masked positions.
+ *
+ * Regions with a too high proportion of masked position in a set of species will be removed,
+ * and blocks adjusted accordingly. 
+ */
+class MaskFilterMafIterator:
+  public AbstractFilterMafIterator,
+  public MafTrashIterator
+{
+  private:
+    std::vector<std::string> species_;
+    unsigned int windowSize_;
+    unsigned int step_;
+    unsigned int maxMasked_;
+    std::deque<MafBlock*> blockBuffer_;
+    std::deque<MafBlock*> trashBuffer_;
+    std::deque< std::vector<bool> > window_;
+    bool keepTrashedBlocks_;
+
+  public:
+    MaskFilterMafIterator(MafIterator* iterator, const std::vector<std::string>& species, unsigned int windowSize, unsigned int step, unsigned int maxMasked, bool keepTrashedBlocks) :
+      AbstractFilterMafIterator(iterator),
+      species_(species),
+      windowSize_(windowSize),
+      step_(step),
+      maxMasked_(maxMasked),
+      blockBuffer_(),
+      trashBuffer_(),
+      window_(species.size()),
+      keepTrashedBlocks_(keepTrashedBlocks)
+    {}
+
+  public:
+    MafBlock* nextRemovedBlock() throw (Exception) {
+      if (trashBuffer_.size() == 0) return 0;
+      MafBlock* block = trashBuffer_.front();
+      trashBuffer_.pop_front();
+      return block;
+    }
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception);
+
+};
+
+} // end of namespace bpp.
+
+#endif //_MASKFILTERMAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/OrphanSequenceFilterMafIterator.cpp b/src/Bpp/Seq/Io/Maf/OrphanSequenceFilterMafIterator.cpp
new file mode 100644
index 0000000..359fe2f
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/OrphanSequenceFilterMafIterator.cpp
@@ -0,0 +1,88 @@
+//
+// File: OrphanSequenceFilterMafIterator.cpp
+// Authors: Julien Dutheil
+// Created: Mon Mar 11 2013
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2013)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "OrphanSequenceFilterMafIterator.h"
+
+using namespace bpp;
+
+//From the STL:
+#include <string>
+#include <numeric>
+
+using namespace std;
+
+MafBlock* OrphanSequenceFilterMafIterator::analyseCurrentBlock_() throw (Exception)
+{
+  currentBlock_ = iterator_->nextBlock();
+  while (currentBlock_) {
+    map<string, unsigned int> counts;
+    for (size_t i = 0; i < currentBlock_->getNumberOfSequences(); ++i) {
+      string species = currentBlock_->getSequence(i).getSpecies(); 
+      counts[species]++;
+    }
+    bool test = counts.size() <= species_.size();
+    if (test) {
+      //We have to check that the species are the right one:
+      bool loseCrit = false;
+      bool strictCrit = true;
+      bool duplicate = false;
+      for (size_t i = 0; i < species_.size() && !duplicate; ++i) {
+        map<string, unsigned int>::iterator it = counts.find(species_[i]);
+        if (it != counts.end()) {
+          loseCrit = true;
+          if (rmDuplicates_ && it->second > 1) {
+            //Duplicated sequences, block is discarded if asked to...
+            duplicate = true;
+          }
+        } else {
+          strictCrit = false;
+        }
+      }
+      if (!duplicate) { //No duplicate found or duplicates are kept
+        if (strictCrit || (!strict_ && loseCrit))
+          return currentBlock_;
+      }
+    }
+    //Otherwise there is at least one extra species, we get the next block...
+    currentBlock_ = iterator_->nextBlock();
+  }
+  
+  return currentBlock_;
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/OrphanSequenceFilterMafIterator.h b/src/Bpp/Seq/Io/Maf/OrphanSequenceFilterMafIterator.h
new file mode 100644
index 0000000..0bda4f5
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/OrphanSequenceFilterMafIterator.h
@@ -0,0 +1,102 @@
+//
+// File: OrphanSequenceFilterMafIterator.h
+// Authors: Julien Dutheil
+// Created: Mon Mar 11 2013
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2013)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _ORPHANSEQUENCEFILTERMAFITERATOR_H_
+#define _ORPHANSEQUENCEFILTERMAFITERATOR_H_
+
+#include "MafIterator.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief Filter maf blocks to keep a the ones which display a specified combination of species.
+ *
+ * This filter is typically used to retrieve "orphan" sequences, that is sequences only present in one (set of) species.
+ */
+class OrphanSequenceFilterMafIterator:
+  public AbstractFilterMafIterator
+{
+  private:
+    std::vector<std::string> species_;
+    bool strict_;
+    bool rmDuplicates_;
+
+  public:
+    /**
+     * @param iterator The input iterator.
+     * @param species The list of species names to be retained.
+     * @param strict If true, then block that do not contain all  of the specified species will be discarded.
+     * @param rmDuplicates If true, block that contain more than one instance for at least one species will be discarded.
+     */
+    OrphanSequenceFilterMafIterator(MafIterator* iterator, const std::vector<std::string>& species, bool strict = false, bool keep = false, bool rmDuplicates = false) :
+      AbstractFilterMafIterator(iterator),
+      species_(species),
+      strict_(strict),
+      rmDuplicates_(rmDuplicates)
+    {}
+
+  private:
+    OrphanSequenceFilterMafIterator(const OrphanSequenceFilterMafIterator& iterator) :
+      AbstractFilterMafIterator(0),
+      species_(iterator.species_),
+      strict_(iterator.strict_),
+      rmDuplicates_(iterator.rmDuplicates_)
+    {}
+    
+    OrphanSequenceFilterMafIterator& operator=(const OrphanSequenceFilterMafIterator& iterator)
+    {
+      species_       = iterator.species_;
+      strict_        = iterator.strict_;
+      rmDuplicates_  = iterator.rmDuplicates_;
+      return *this;
+    }
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception);
+
+};
+
+} // end of namespace bpp.
+
+#endif //_ORPHANSEQUENCEFILTERMAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/OutputAlignmentMafIterator.cpp b/src/Bpp/Seq/Io/Maf/OutputAlignmentMafIterator.cpp
new file mode 100644
index 0000000..94e086d
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/OutputAlignmentMafIterator.cpp
@@ -0,0 +1,83 @@
+//
+// File: OutputAlignmentMafIterator.cpp
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "OutputAlignmentMafIterator.h"
+
+//From bpp-seq:
+#include <Bpp/Seq/Container/SequenceContainerTools.h>
+
+using namespace bpp;
+
+//From the STL:
+#include <string>
+#include <numeric>
+
+using namespace std;
+
+MafBlock* OutputAlignmentMafIterator::analyseCurrentBlock_() throw (Exception)
+{
+  MafBlock* block = iterator_->nextBlock();
+  if (block) {
+    if (output_) {
+      writeBlock(*output_, *block);
+    } else {
+      string file = file_;
+      TextTools::replaceAll(file, "%i", TextTools::toString(++currentBlockIndex_));
+      std::ofstream output(file.c_str(), ios::out);
+      writeBlock(output, *block);
+    }
+  }
+  return block;
+}
+
+void OutputAlignmentMafIterator::writeBlock(std::ostream& out, const MafBlock& block) const {
+  //First get alignment:
+  AlignedSequenceContainer aln(&AlphabetTools::DNA_ALPHABET);
+  //We cannot copy directly the container because we want to convert from MafSequence to BasicSequence (needed for renaiming):
+  SequenceContainerTools::convertContainer<AlignedSequenceContainer, AlignedSequenceContainer, BasicSequence>(block.getAlignment(), aln);
+  //Format sequence names:
+  vector<string> names(aln.getNumberOfSequences());
+  for (unsigned int i = 0; i < aln.getNumberOfSequences(); ++i) {
+    const MafSequence& mafseq = block.getSequence(i);
+    names[i] = mafseq.getSpecies() + "-" + mafseq.getChromosome() + "(" + mafseq.getStrand() + ")/" + TextTools::toString(mafseq.start() + 1) + "-" + TextTools::toString(mafseq.stop() + 1);
+  }
+  aln.setSequencesNames(names);
+  writer_->writeAlignment(out, aln);
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/OutputAlignmentMafIterator.h b/src/Bpp/Seq/Io/Maf/OutputAlignmentMafIterator.h
new file mode 100644
index 0000000..d1c2d4e
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/OutputAlignmentMafIterator.h
@@ -0,0 +1,138 @@
+//
+// File: OutputAlignmentMafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _OUTPUTALIGNMENTMAFITERATOR_H_
+#define _OUTPUTALIGNMENTMAFITERATOR_H_
+
+#include "MafIterator.h"
+
+//From bpp-seq:
+#include <Bpp/Seq/Io/OSequence.h>
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief This iterator forward the iterator given as input after having printed its content to an alignment file.
+ * The syntax for ENSEMBL meta data is used.
+ */
+class OutputAlignmentMafIterator:
+  public AbstractFilterMafIterator
+{
+  private:
+    std::ostream* output_;
+    std::string file_;
+    bool mask_;
+    std::auto_ptr<OAlignment> writer_;
+    unsigned int currentBlockIndex_;
+
+  public:
+    /**
+     * @brief Creates a new OutputAlignmentMafIterator object.
+     *
+     * All block will be printed as separate alignment, yet one after the other on the stream.
+     * Be aware that not all format will recognize the resulting file as a multiple alignment file (Mase and Clustal will for instance, not Fasta).
+     * @param iterator The input iterator
+     * @param out A pointer toward the output stream. The stream will not be own by this instance, and will not be copied neither destroyed.
+     * @param writer A pointer toward an alignment writer object which specifies the format to use when writing sequences.
+     * The underlying object will be own by this instance, and destroyed when this object is deleted.
+     * @param mask Tell if sequences should be printed masked (if applicable).
+     */
+    OutputAlignmentMafIterator(MafIterator* iterator, std::ostream* out, OAlignment* writer, bool mask = true) :
+      AbstractFilterMafIterator(iterator), output_(out), file_(), mask_(mask), writer_(writer), currentBlockIndex_(1)
+    {
+      if (!writer)
+        throw Exception("OutputAlignmentMafIterator (constructor 1): sequence writer should not be a NULL pointer!");
+    }
+
+    /**
+     * @brief Creates a new OutputAlignmentMafIterator object.
+     *
+     * All block will be printed as separate alignment, yet one after the other on the stream.
+     * Be aware that not all format will recognize the resulting file as a multiple alignment file (Mase and Clustal will for instance, not Fasta).
+     * @param iterator The input iterator
+     * @param file A string describing the path to the output files. Each block will be written to a distinct file.
+     * If "file" is a fixed string, it will only contain the last block. Using the %i code in the file name allows to generate one file per block, %i denoting the block index.
+     * @param writer A pointer toward an alignment writer object which specifies the format to use when writing sequences.
+     * The underlying object will be own by this instance, and destroyed when this object is deleted.
+     * @param mask Tell if sequences should be printed masked (if applicable).
+     */
+    OutputAlignmentMafIterator(MafIterator* iterator, const std::string& file, OAlignment* writer, bool mask = true) :
+      AbstractFilterMafIterator(iterator), output_(0), file_(file), mask_(mask), writer_(writer), currentBlockIndex_(1)
+    {
+      if (!writer)
+        throw Exception("OutputAlignmentMafIterator (constructor 2): sequence writer should not be a NULL pointer!");
+    }
+
+    ~OutputAlignmentMafIterator() {}
+
+  private:
+    OutputAlignmentMafIterator(const OutputAlignmentMafIterator& iterator) :
+      AbstractFilterMafIterator(0),
+      output_(iterator.output_),
+      file_(iterator.file_),
+      mask_(iterator.mask_),
+      writer_(),
+      currentBlockIndex_(iterator.currentBlockIndex_)
+    {}
+    
+    OutputAlignmentMafIterator& operator=(const OutputAlignmentMafIterator& iterator)
+    {
+      output_ = iterator.output_;
+      file_   = iterator.file_;
+      mask_   = iterator.mask_;
+      writer_.release();
+      currentBlockIndex_ = iterator.currentBlockIndex_;
+      return *this;
+    }
+
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception);
+
+    void writeBlock(std::ostream& out, const MafBlock& block) const;
+};
+
+} // end of namespace bpp.
+
+#endif //_OUTPUTALIGNMENTMAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/OutputMafIterator.cpp b/src/Bpp/Seq/Io/Maf/OutputMafIterator.cpp
new file mode 100644
index 0000000..6c9d305
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/OutputMafIterator.cpp
@@ -0,0 +1,130 @@
+//
+// File: OutputMafIterator.cpp
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "OutputMafIterator.h"
+
+//From bpp-seq:
+#include <Bpp/Seq/SequenceWithAnnotationTools.h>
+#include <Bpp/Seq/SequenceWithQuality.h>
+
+using namespace bpp;
+
+//From the STL:
+#include <string>
+#include <numeric>
+
+using namespace std;
+
+void OutputMafIterator::writeHeader(std::ostream& out) const
+{
+  out << "##maf version=1 program=Bio++" << endl << "#" << endl;
+  //There are more options in the header that we may want to support...
+}
+
+void OutputMafIterator::writeBlock(std::ostream& out, const MafBlock& block) const
+{
+  out << "a";
+  if (! isinf(block.getScore()))
+    out << " score=" << block.getScore();
+  if (block.getPass() > 0)
+    out << " pass=" << block.getPass();
+  out << endl;
+  
+  //Now we write sequences. First need to count characters for aligning blocks:
+  size_t mxcSrc = 0, mxcStart = 0, mxcSize = 0, mxcSrcSize = 0;
+  for (size_t i = 0; i < block.getNumberOfSequences(); i++) {
+    const MafSequence* seq = &block.getSequence(i);
+    size_t start = 0; //Maybe we should output sthg else here?
+    if (seq->hasCoordinates())
+      start = seq->start();
+    mxcSrc     = max(mxcSrc    , seq->getName().size());
+    mxcStart   = max(mxcStart  , TextTools::toString(start).size());
+    mxcSize    = max(mxcSize   , TextTools::toString(seq->getGenomicSize()).size());
+    mxcSrcSize = max(mxcSrcSize, TextTools::toString(seq->getSrcSize()).size());
+  }
+  //Now print each sequence:
+  for (size_t i = 0; i < block.getNumberOfSequences(); i++) {
+    const MafSequence* seq = &block.getSequence(i);
+    out << "s ";
+    out << TextTools::resizeRight(seq->getName(), mxcSrc, ' ') << " ";
+    size_t start = 0; //Maybe we should output sthg else here?
+    if (seq->hasCoordinates())
+      start = seq->start();
+    out << TextTools::resizeLeft(TextTools::toString(start), mxcStart, ' ') << " ";
+    out << TextTools::resizeLeft(TextTools::toString(seq->getGenomicSize()), mxcSize, ' ') << " ";
+    out << seq->getStrand() << " ";
+    out << TextTools::resizeLeft(TextTools::toString(seq->getSrcSize()), mxcSrcSize, ' ') << " ";
+    //Shall we write the sequence as masked?
+    string seqstr = seq->toString();
+    if (mask_ && seq->hasAnnotation(SequenceMask::MASK)) {
+      const SequenceMask* mask = &dynamic_cast<const SequenceMask&>(seq->getAnnotation(SequenceMask::MASK));
+      for (size_t j = 0; j < seqstr.size(); ++j) {
+        char c = ((*mask)[j] ? static_cast<char>(tolower(static_cast<int>(seqstr[j]))) : seqstr[j]);
+        out << c;
+      }
+    } else {
+      out << seqstr;
+    }
+    out << endl;
+    //Write quality scores if any:
+    if (mask_ && seq->hasAnnotation(SequenceQuality::QUALITY_SCORE)) {
+      const SequenceQuality* qual = &dynamic_cast<const SequenceQuality&>(seq->getAnnotation(SequenceQuality::QUALITY_SCORE));
+      out << "q ";
+      out << TextTools::resizeRight(seq->getName(), mxcSrc + mxcStart + mxcSize + mxcSrcSize + 5, ' ') << " ";
+      string qualStr;
+      for (size_t j = 0; j < seq->size(); ++j) {
+        int s = (*qual)[j];
+        if (s == -1) {
+          qualStr += "-";
+        } else if (s == -2) {
+          qualStr += "?";
+        } else if (s >=0 && s < 10) {
+          qualStr += TextTools::toString(s);
+        } else if (s == 10) {
+          qualStr += "F";
+        } else {
+          throw Exception("MafAlignmentParser::writeBlock. Unsuported score value: " + TextTools::toString(s));
+        }
+      }
+      out << qualStr << endl;
+    }
+  }
+  out << endl;
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/OutputMafIterator.h b/src/Bpp/Seq/Io/Maf/OutputMafIterator.h
new file mode 100644
index 0000000..4d168e2
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/OutputMafIterator.h
@@ -0,0 +1,100 @@
+//
+// File: OutputMafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _OUTPUTMAFITERATOR_H_
+#define _OUTPUTMAFITERATOR_H_
+
+#include "MafIterator.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief This iterator forward the iterator given as input after having printed its content to a file.
+ */
+class OutputMafIterator:
+  public AbstractFilterMafIterator
+{
+  private:
+    std::ostream* output_;
+    bool mask_;
+
+  public:
+    OutputMafIterator(MafIterator* iterator, std::ostream* out, bool mask = true) :
+      AbstractFilterMafIterator(iterator), output_(out), mask_(mask)
+    {
+      if (output_)
+        writeHeader(*output_);
+    }
+
+  private:
+    OutputMafIterator(const OutputMafIterator& iterator) :
+      AbstractFilterMafIterator(0),
+      output_(iterator.output_),
+      mask_(iterator.mask_)
+    {}
+    
+    OutputMafIterator& operator=(const OutputMafIterator& iterator)
+    {
+      output_ = iterator.output_;
+      mask_   = iterator.mask_;
+      return *this;
+    }
+
+
+  public:
+    MafBlock* analyseCurrentBlock_() throw (Exception) {
+      currentBlock_ = iterator_->nextBlock();
+      if (output_ && currentBlock_)
+        writeBlock(*output_, *currentBlock_);
+      return currentBlock_;
+    }
+
+  private:
+    void writeHeader(std::ostream& out) const;
+    void writeBlock(std::ostream& out, const MafBlock& block) const;
+};
+
+} // end of namespace bpp.
+
+#endif //_OUTPUTMAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/QualityFilterMafIterator.cpp b/src/Bpp/Seq/Io/Maf/QualityFilterMafIterator.cpp
new file mode 100644
index 0000000..105140c
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/QualityFilterMafIterator.cpp
@@ -0,0 +1,236 @@
+//
+// File: QualityFilterMafIterator.cpp
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "QualityFilterMafIterator.h"
+
+//From bpp-seq:
+#include <Bpp/Seq/SequenceWithQuality.h>
+
+using namespace bpp;
+
+//From the STL:
+#include <string>
+#include <numeric>
+
+using namespace std;
+
+MafBlock* QualityFilterMafIterator::analyseCurrentBlock_() throw (Exception)
+{
+  if (blockBuffer_.size() == 0) {
+    do {
+      //Else there is no more block in the buffer, we need parse more:
+      MafBlock* block = iterator_->nextBlock();
+      if (!block) return 0; //No more block.
+    
+      //Parse block.
+      vector< vector<int> > aln;
+      for (size_t i = 0; i < species_.size(); ++i) {
+        const MafSequence* seq = &block->getSequenceForSpecies(species_[i]);
+        if (seq->hasAnnotation(SequenceQuality::QUALITY_SCORE)) {
+          aln.push_back(dynamic_cast<const SequenceQuality&>(seq->getAnnotation(SequenceQuality::QUALITY_SCORE)).getScores());
+        }
+      }
+      if (aln.size() != species_.size()) {
+        blockBuffer_.push_back(block);
+        if (logstream_) {
+          (*logstream_ << "QUAL CLEANER: block is missing quality score for at least one species and will therefore not be filtered.").endLine();
+        }
+        //NB here we could decide to discard the block instead!
+      } else {
+        size_t nr = aln.size();
+        size_t nc = block->getNumberOfSites();
+        //First we create a mask:
+        vector<size_t> pos;
+        vector<int> col(nr);
+        //Reset window:
+        window_.clear();
+        //Init window:
+        size_t i;
+        for (i = 0; i < windowSize_; ++i) {
+          for (size_t j = 0; j < nr; ++j) {
+            col[j] = aln[j][i];
+          }
+          window_.push_back(col);
+        }
+        //Slide window:
+        if (verbose_) {
+          ApplicationTools::message->endLine();
+          ApplicationTools::displayTask("Sliding window for quality filter", true);
+        }
+        while (i + step_ < nc) {
+          if (verbose_)
+            ApplicationTools::displayGauge(i - windowSize_, nc - windowSize_ - 1, '>');
+          //Evaluate current window:
+          double mean = 0;
+          double n = static_cast<double>(aln.size() * windowSize_);
+          for (size_t u = 0; u < window_.size(); ++u)
+            for (size_t v = 0; v < window_[u].size(); ++v) {
+              mean += (window_[u][v] > 0 ? static_cast<double>(window_[u][v]) : 0.);
+              if (window_[u][v] == -1) n--;
+            }
+          if (n > 0 && (mean / n) < minQual_) {
+            if (pos.size() == 0) {
+              pos.push_back(i - windowSize_);
+              pos.push_back(i);
+            } else {
+              if (i - windowSize_ <= pos[pos.size() - 1]) {
+                pos[pos.size() - 1] = i; //Windows are overlapping and we extend previous region
+              } else { //This is a new region
+                pos.push_back(i - windowSize_);
+                pos.push_back(i);
+              }
+            }
+          }
+      
+          //Move forward:
+          for (size_t k = 0; k < step_; ++k) {
+            for (size_t j = 0; j < nr; ++j) {
+              col[j] = aln[j][i];
+            }  
+            window_.push_back(col);
+            window_.pop_front();
+            ++i;
+          }
+        }
+
+        //Evaluate last window:
+        double mean = 0;
+        double n = static_cast<double>(aln.size() * windowSize_);
+        for (size_t u = 0; u < window_.size(); ++u)
+          for (size_t v = 0; v < window_[u].size(); ++v) {
+            mean += (window_[u][v] > 0 ? static_cast<double>(window_[u][v]) : 0.);
+            if (window_[u][v] == -1) n--;
+          }
+        if (n > 0 && (mean / n) < minQual_) {
+          if (pos.size() == 0) {
+            pos.push_back(i - windowSize_);
+            pos.push_back(i);
+          } else {
+            if (i - windowSize_ < pos[pos.size() - 1]) {
+              pos[pos.size() - 1] = i; //Windows are overlapping and we extend previous region
+            } else { //This is a new region
+              pos.push_back(i - windowSize_);
+              pos.push_back(i);
+            }
+          }
+        }
+        if (verbose_)
+          ApplicationTools::displayTaskDone();
+    
+        //Now we remove regions with two many gaps, using a sliding window:
+        if (pos.size() == 0) {
+          blockBuffer_.push_back(block);
+          if (logstream_) {
+            (*logstream_ << "QUAL CLEANER: block is clean and kept as is.").endLine();
+          }
+        } else if (pos.size() == 2 && pos.front() == 0 && pos.back() == block->getNumberOfSites()) {
+          //Everything is removed:
+          if (logstream_) {
+            (*logstream_ << "QUAL CLEANER: block was entirely removed. Tried to get the next one.").endLine();
+          }
+        } else {
+          if (logstream_) {
+            (*logstream_ << "QUAL CLEANER: block with size "<< block->getNumberOfSites() << " will be split into " << (pos.size() / 2 + 1) << " blocks.").endLine();
+          }
+          if (verbose_) {
+            ApplicationTools::message->endLine();
+            ApplicationTools::displayTask("Spliting block", true);
+          }
+          for (i = 0; i < pos.size(); i+=2) {
+            if (verbose_)
+              ApplicationTools::displayGauge(i, pos.size() - 2, '=');
+            if (logstream_) {
+              (*logstream_ << "QUAL CLEANER: removing region (" << pos[i] << ", " << pos[i+1] << ") from block.").endLine();
+            }
+            if (pos[i] > 0) {
+              MafBlock* newBlock = new MafBlock();
+              newBlock->setScore(block->getScore());
+              newBlock->setPass(block->getPass());
+              for (size_t j = 0; j < block->getNumberOfSequences(); ++j) {
+                MafSequence* subseq;
+                if (i == 0) {
+                  subseq = block->getSequence(j).subSequence(0, pos[i]);
+                } else {
+                  subseq = block->getSequence(j).subSequence(pos[i - 1], pos[i] - pos[i - 1]);
+                }
+                newBlock->addSequence(*subseq);
+                delete subseq;
+              }
+              blockBuffer_.push_back(newBlock);
+            }
+           
+            if (keepTrashedBlocks_) {
+              MafBlock* outBlock = new MafBlock();
+              outBlock->setScore(block->getScore());
+              outBlock->setPass(block->getPass());
+              for (size_t j = 0; j < block->getNumberOfSequences(); ++j) {
+                MafSequence* outseq = block->getSequence(j).subSequence(pos[i], pos[i + 1] - pos[i]);
+                outBlock->addSequence(*outseq);
+                delete outseq;
+              } 
+              trashBuffer_.push_back(outBlock);
+            }
+          }
+          //Add last block:
+          if (pos[pos.size() - 1] < block->getNumberOfSites()) {
+            MafBlock* newBlock = new MafBlock();
+            newBlock->setScore(block->getScore());
+            newBlock->setPass(block->getPass());
+            for (size_t j = 0; j < block->getNumberOfSequences(); ++j) {
+              MafSequence* subseq;
+              subseq = block->getSequence(j).subSequence(pos[pos.size() - 1], block->getNumberOfSites() - pos[pos.size() - 1]);
+              newBlock->addSequence(*subseq);
+              delete subseq;
+            }
+            blockBuffer_.push_back(newBlock);
+          }
+          if (verbose_)
+            ApplicationTools::displayTaskDone();
+
+          delete block;
+        }
+      }
+    } while (blockBuffer_.size() == 0);
+  }
+
+  MafBlock* block = blockBuffer_.front();
+  blockBuffer_.pop_front();
+  return block;
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/QualityFilterMafIterator.h b/src/Bpp/Seq/Io/Maf/QualityFilterMafIterator.h
new file mode 100644
index 0000000..c905d28
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/QualityFilterMafIterator.h
@@ -0,0 +1,99 @@
+//
+// File: QualityFilterMafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _QUALITYFILTERMAFITERATOR_H_
+#define _QUALITYFILTERMAFITERATOR_H_
+
+#include "MafIterator.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief Filter maf blocks to remove regions with low quality.
+ *
+ * Regions with a too low average quality in a set of species will be removed,
+ * and blocks adjusted accordingly. 
+ */
+class QualityFilterMafIterator:
+  public AbstractFilterMafIterator,
+  public MafTrashIterator
+{
+  private:
+    std::vector<std::string> species_;
+    unsigned int windowSize_;
+    unsigned int step_;
+    unsigned int minQual_;
+    std::deque<MafBlock*> blockBuffer_;
+    std::deque<MafBlock*> trashBuffer_;
+    std::deque< std::vector<int> > window_;
+    bool keepTrashedBlocks_;
+
+  public:
+    QualityFilterMafIterator(MafIterator* iterator, const std::vector<std::string>& species, unsigned int windowSize, unsigned int step, unsigned int minQual, bool keepTrashedBlocks) :
+      AbstractFilterMafIterator(iterator),
+      species_(species),
+      windowSize_(windowSize),
+      step_(step),
+      minQual_(minQual),
+      blockBuffer_(),
+      trashBuffer_(),
+      window_(species.size()),
+      keepTrashedBlocks_(keepTrashedBlocks)
+    {}
+
+  public:
+    MafBlock* nextRemovedBlock() throw (Exception) {
+      if (trashBuffer_.size() == 0) return 0;
+      MafBlock* block = trashBuffer_.front();
+      trashBuffer_.pop_front();
+      return block;
+    }
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception);
+};
+
+} // end of namespace bpp.
+
+#endif //_QUALITYFILTERMAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/SequenceFilterMafIterator.cpp b/src/Bpp/Seq/Io/Maf/SequenceFilterMafIterator.cpp
new file mode 100644
index 0000000..929a594
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/SequenceFilterMafIterator.cpp
@@ -0,0 +1,107 @@
+//
+// File: SequenceFilterMafIterator.cpp
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "SequenceFilterMafIterator.h"
+
+using namespace bpp;
+
+//From the STL:
+#include <string>
+#include <numeric>
+
+using namespace std;
+
+MafBlock* SequenceFilterMafIterator::analyseCurrentBlock_() throw (Exception)
+{
+  currentBlock_ = iterator_->nextBlock();
+  while (currentBlock_) {
+    map<string, unsigned int> counts;
+    for (size_t i = currentBlock_->getNumberOfSequences(); i > 0; --i) {
+      string species = currentBlock_->getSequence(i-1).getSpecies(); 
+      if (!VectorTools::contains(species_, species)) {
+        if (logstream_) {
+          (*logstream_ << "SEQUENCE FILTER: remove sequence '" << species << "' from current block " << currentBlock_->getDescription() << ".").endLine();
+        }
+        if (!keep_) {
+          currentBlock_->getAlignment().deleteSequence(i - 1);
+        }
+      } else {
+        counts[species]++;
+      }
+    }
+    bool test = currentBlock_->getNumberOfSequences() == 0;
+    //Avoid a memory leak:
+    if (test) {
+      if (logstream_) {
+        (*logstream_ << "SEQUENCE FILTER: block " << currentBlock_->getDescription() << " is now empty. Try to get the next one.").endLine();
+      }
+      delete currentBlock_;
+    } else {
+      test = strict_ && (counts.size() != species_.size());
+      if (test) {
+        if (logstream_) {
+          (*logstream_ << "SEQUENCE FILTER: block " << currentBlock_->getDescription() << " does not contain all species and will be ignored. Try to get the next one.").endLine();
+        }
+        delete currentBlock_;
+      } else {
+        if (rmDuplicates_) {
+          test = false;
+          map<string, unsigned int>::iterator it;
+          for (it = counts.begin(); it != counts.end() && !(test = it->second > 1); it++) {}
+          if (test) {
+            if (logstream_) {
+              (*logstream_ << "SEQUENCE FILTER: block " << currentBlock_->getDescription() << " has two sequences for species '" << it->first << "' and will be ignored. Try to get the next one.").endLine();
+            }
+            delete currentBlock_;
+          } else {
+            return currentBlock_;
+          }
+        } else {
+          return currentBlock_;
+        }
+      }
+    }
+
+    //Look for the next block:
+    currentBlock_ = iterator_->nextBlock();
+  }
+  
+  return currentBlock_;
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/SequenceFilterMafIterator.h b/src/Bpp/Seq/Io/Maf/SequenceFilterMafIterator.h
new file mode 100644
index 0000000..b9974d7
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/SequenceFilterMafIterator.h
@@ -0,0 +1,112 @@
+//
+// File: SequenceFilterMafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _SEQUENCEFILTERMAFITERATOR_H_
+#define _SEQUENCEFILTERMAFITERATOR_H_
+
+#include "MafIterator.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief Filter maf blocks to keep a subset of sequences, given their name.
+ * this filter can also be used to filter block which contain a certain set of sequences.
+ *
+ * Typical usage:
+ * - strict=yes, keep=no: extract the species from the list, only if all of them are present in a block.
+ * - strict=no, keep=no: extract the species from the list, at least the one which are there.
+ * - strict=yes, keep=yes: filter blocks to retain only the ones that contain at least all species from the list.
+ * Blocks that are empty after the filtering are removed.
+ */
+class SequenceFilterMafIterator:
+  public AbstractFilterMafIterator
+{
+  private:
+    std::vector<std::string> species_;
+    bool strict_;
+    bool keep_;
+    bool rmDuplicates_;
+
+  public:
+    /**
+     * @param iterator The input iterator.
+     * @param species The list of species names to be retained.
+     * @param strict If true, then block that do not contain all species will be discarded.
+     * @param keep If true, sequences not in the selection will be kept.
+     * @param rmDuplicates If true, block that contain more than one instance for at least one species will be discarded.
+     */
+    SequenceFilterMafIterator(MafIterator* iterator, const std::vector<std::string>& species, bool strict = false, bool keep = false, bool rmDuplicates = false) :
+      AbstractFilterMafIterator(iterator),
+      species_(species),
+      strict_(strict),
+      keep_(keep),
+      rmDuplicates_(rmDuplicates)
+    {}
+
+  private:
+    SequenceFilterMafIterator(const SequenceFilterMafIterator& iterator) :
+      AbstractFilterMafIterator(0),
+      species_(iterator.species_),
+      strict_(iterator.strict_),
+      keep_(iterator.keep_),
+      rmDuplicates_(iterator.rmDuplicates_)
+    {}
+    
+    SequenceFilterMafIterator& operator=(const SequenceFilterMafIterator& iterator)
+    {
+      species_       = iterator.species_;
+      strict_        = iterator.strict_;
+      keep_          = iterator.keep_;
+      rmDuplicates_  = iterator.rmDuplicates_;
+      return *this;
+    }
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception);
+
+};
+
+} // end of namespace bpp.
+
+#endif //_SEQUENCEFILTERMAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/SequenceStatisticsMafIterator.cpp b/src/Bpp/Seq/Io/Maf/SequenceStatisticsMafIterator.cpp
new file mode 100644
index 0000000..df487c9
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/SequenceStatisticsMafIterator.cpp
@@ -0,0 +1,93 @@
+//
+// File: SequenceStatisticsMafIterator.cpp
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "SequenceStatisticsMafIterator.h"
+
+using namespace bpp;
+
+//From the STL:
+#include <string>
+#include <numeric>
+
+using namespace std;
+
+SequenceStatisticsMafIterator::SequenceStatisticsMafIterator(MafIterator* iterator, const std::vector<MafStatistics*> statistics) :
+  AbstractFilterMafIterator(iterator),
+  statistics_(statistics),
+  results_(),
+  names_()
+{
+  string name;
+  for (size_t i = 0; i < statistics_.size(); ++i) {
+    name = statistics_[i]->getShortName();
+    vector<string> tags = statistics_[i]->getSupportedTags();
+    if (tags.size() > 1) {
+      for (size_t j = 0; j < tags.size(); ++j) {
+        names_.push_back(name + "." + tags[j]);
+      }
+    } else {
+      names_.push_back(name);
+    }
+  }
+  results_.resize(names_.size());
+}
+
+MafBlock* SequenceStatisticsMafIterator::analyseCurrentBlock_() throw (Exception)
+{
+  vector<string> tags;
+  currentBlock_ = iterator_->nextBlock();
+  if (currentBlock_) {
+    size_t k = 0;
+    for (size_t i = 0; i < statistics_.size(); ++i) {
+      statistics_[i]->compute(*currentBlock_);
+      const MafStatisticsResult& result = statistics_[i]->getResult();
+      tags = statistics_[i]->getSupportedTags();
+      for (size_t j = 0; j < tags.size(); ++j) {
+        if (result.hasValue(tags[j])) {
+          results_[k] = result.getValue(tags[j]);
+        } else {
+          results_[k] = NumConstants::NaN();
+        }
+        k++;
+      }
+    }
+  }
+  return currentBlock_;
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/SequenceStatisticsMafIterator.h b/src/Bpp/Seq/Io/Maf/SequenceStatisticsMafIterator.h
new file mode 100644
index 0000000..e60ffba
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/SequenceStatisticsMafIterator.h
@@ -0,0 +1,107 @@
+//
+// File: SequenceStatisticsMafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _SEQUENCESTATISTICSMAFITERATOR_H_
+#define _SEQUENCESTATISTICSMAFITERATOR_H_
+
+#include "MafIterator.h"
+#include "MafStatistics.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief Compute a series of sequence statistics for each block.
+ *
+ * Computed statistics are stored into a vector of double, which can be retrieved as well as statistics names.
+ * Listeners can be set up to automatically analyse or write the output after iterations are over.
+ *
+ * The current implementation focuses on speed and memory efificiency, as it only stores in memory the current results of the statistics.
+ * The only drawback of this, is that disk access might be high when writing the results,
+ * although appropriate buffering should most likely circumvent the issue.
+ * The code is easily extensible, however, to enable storage of all results into a matrix,
+ * with writing only once at the end of iterations.
+ */
+class SequenceStatisticsMafIterator:
+  public AbstractFilterMafIterator
+{
+  private:
+    std::vector<MafStatistics*> statistics_;
+    std::vector<double> results_;
+    std::vector<std::string> names_;
+
+  public:
+    /**
+     * @param iterator The input iterator.
+     * @param statistics A vector of pointers toward MafStatistics, tobe computed simultaneously for each maf block.
+     */
+    SequenceStatisticsMafIterator(MafIterator* iterator, const std::vector<MafStatistics*> statistics);
+
+  private:
+    SequenceStatisticsMafIterator(const SequenceStatisticsMafIterator& iterator) :
+      AbstractFilterMafIterator(0),
+      statistics_(iterator.statistics_),
+      results_(iterator.results_),
+      names_(iterator.names_)
+    {}
+    
+    SequenceStatisticsMafIterator& operator=(const SequenceStatisticsMafIterator& iterator)
+    {
+      statistics_ = iterator.statistics_;
+      results_ = iterator.results_;
+      names_ = iterator.names_;
+      return *this;
+    }
+
+  public:
+    const std::vector<double>& getResults() const { return results_; }
+    const std::vector<std::string>& getResultsColumnNames() const { return names_; }
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception);
+
+};
+
+} // end of namespace bpp.
+
+#endif //_SEQUENCESTATISTICSMAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/SequenceStreamToMafIterator.cpp b/src/Bpp/Seq/Io/Maf/SequenceStreamToMafIterator.cpp
new file mode 100644
index 0000000..1c722dd
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/SequenceStreamToMafIterator.cpp
@@ -0,0 +1,76 @@
+//
+// File: MafAlignmentParser.h
+// Authors: Julien Dutheil
+// Created: Tue Apr 27 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "SequenceStreamToMafIterator.h"
+#include <Bpp/Text/TextTools.h>
+#include <Bpp/Text/StringTokenizer.h>
+
+using namespace std;
+using namespace bpp;
+
+MafBlock* SequenceStreamToMafIterator::analyseCurrentBlock_() throw (Exception)
+{
+  auto_ptr<MafBlock> block(new MafBlock());
+
+  MafSequence mafSeq;
+  if (stream_->eof()) return 0;
+  
+  seqStream_->nextSequence(*stream_, mafSeq);
+  //Check if sequence name contains meta information:
+  string meta = mafSeq.getName();
+  StringTokenizer st(meta, ":");
+  if (st.numberOfRemainingTokens() == 5) {
+    string species = st.nextToken();
+    string chr     = st.nextToken();
+    unsigned int start   = TextTools::to<unsigned int>(st.nextToken());
+    if (!zeroBasedCoords_)
+      start--;
+    string strand  = st.nextToken();
+    unsigned int length  = TextTools::to<unsigned int>(st.nextToken());
+    mafSeq.setName(species + "." + chr);
+    mafSeq.setStrand(strand[0]);
+    mafSeq.setStart(start);
+    if (mafSeq.size() != length)
+      throw Exception("SequenceStreamToMafIterator::analyseCurrentBlock_. Sequence size does not match its header specification: expected " + TextTools::toString(length) + " and found " + TextTools::toString(mafSeq.size()));
+  }
+  block->addSequence(mafSeq);
+
+  return block.release();
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/SequenceStreamToMafIterator.h b/src/Bpp/Seq/Io/Maf/SequenceStreamToMafIterator.h
new file mode 100644
index 0000000..b2c5cd5
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/SequenceStreamToMafIterator.h
@@ -0,0 +1,90 @@
+//
+// File: SequenceStreamToMafIterator.h
+// Authors: Julien Dutheil
+// Created: Wed Oct 31 2012
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2012)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _SEQUENCESTREAMTOMAFITERATOR_H_
+#define _SEQUENCESTREAMTOMAFITERATOR_H_
+
+#include "MafIterator.h"
+#include <Bpp/Seq/Alphabet/CaseMaskedAlphabet.h>
+#include <Bpp/Seq/Io/ISequenceStream.h>
+
+//From the STL:
+#include <iostream>
+#include <memory>
+
+namespace bpp {
+
+/**
+ * @brief A MafIterator built from a sequence stream.
+ *
+ * Each block will contain one sequence from the original file.
+ * 
+ * @author Julien Dutheil
+ */
+class SequenceStreamToMafIterator:
+  public AbstractMafIterator
+{
+  private:
+    std::auto_ptr<ISequenceStream> seqStream_;
+    std::istream* stream_;
+    bool zeroBasedCoords_;
+    bool firstBlock_;
+
+  public:
+    SequenceStreamToMafIterator(ISequenceStream* seqStream, std::istream* stream, bool parseMask = false, bool zeroBasedCoordinates = true) :
+      seqStream_(seqStream), stream_(stream), zeroBasedCoords_(zeroBasedCoordinates), firstBlock_(true) {}
+
+  private:
+    //Recopy is forbidden!
+    SequenceStreamToMafIterator(const SequenceStreamToMafIterator& ss2mi):
+      seqStream_(0), stream_(0), zeroBasedCoords_(ss2mi.zeroBasedCoords_), firstBlock_(ss2mi.firstBlock_) {}
+    SequenceStreamToMafIterator& operator=(const SequenceStreamToMafIterator& ss2mi) {
+      seqStream_.reset(); stream_ = 0; zeroBasedCoords_ = ss2mi.zeroBasedCoords_; firstBlock_ = ss2mi.firstBlock_;
+      return *this;
+    }
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception);
+
+};
+
+} // end of namespace bpp.
+
+#endif //_SEQUENCESTREAMTOMAFITERATOR_H_
+
diff --git a/src/Bpp/Seq/Io/Maf/VcfOutputMafIterator.cpp b/src/Bpp/Seq/Io/Maf/VcfOutputMafIterator.cpp
new file mode 100644
index 0000000..6a5cd6d
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/VcfOutputMafIterator.cpp
@@ -0,0 +1,121 @@
+//
+// File: VcfOutputMafIterator.cpp
+// Authors: Julien Dutheil
+// Created: Tue Jan 05 2013
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "VcfOutputMafIterator.h"
+
+//From bpp-seq:
+#include <Bpp/Seq/SequenceWithAnnotationTools.h>
+#include <Bpp/Seq/SequenceWithQuality.h>
+#include <Bpp/Seq/Container/VectorSiteContainer.h>
+#include <Bpp/Seq/SiteTools.h>
+
+using namespace bpp;
+
+//From the STL:
+#include <string>
+#include <numeric>
+#include <ctime>
+
+using namespace std;
+
+void VcfOutputMafIterator::writeHeader(std::ostream& out) const
+{
+  time_t t = time(0); // get current time
+  struct tm* ct = localtime(&t);
+  out << "##fileformat=VCFv4.0" << endl;
+  out << "##fileDate=" << (ct->tm_year + 1900) << (ct->tm_mon + 1) << ct->tm_mday << endl;
+  out << "##source=Bio++" << endl;  
+  out << "##FILTER=<ID=gap,Description=\"At least one sequence contains a gap\">" << endl;
+  out << "##FILTER=<ID=unk,Description=\"At least one sequence contains an unresolved character\">" << endl;
+  //There are more options in the header that we may want to support...
+
+  //Now write the header line:
+  out << "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO" << endl;
+}
+
+void VcfOutputMafIterator::writeBlock(std::ostream& out, const MafBlock& block) const
+{
+  const MafSequence& refSeq = block.getSequenceForSpecies(refSpecies_);
+  string chr = refSeq.getChromosome();
+  size_t offset = refSeq.start();
+  int gap = refSeq.getAlphabet()->getGapCharacterCode();
+  string chars = "";
+  for (int i = 0; i < static_cast<int>(AlphabetTools::DNA_ALPHABET.getNumberOfTypes()); ++i)
+    chars += AlphabetTools::DNA_ALPHABET.intToChar(i);
+  VectorSiteContainer sites(block.getAlignment());
+  //Now we look all sites for SNPs:
+  for (size_t i = 0; i < sites.getNumberOfSites(); i++) {
+    if (refSeq[i] == gap)
+      continue;
+    string filter = "";
+    if (SiteTools::hasGap(sites.getSite(i))) {
+      filter = "gap";
+    }
+    if (SiteTools::hasUnknown(sites.getSite(i))) {
+      if (filter != "")
+        filter += ",";
+      filter += "unk";
+    }
+    if (filter == "")
+      filter = "PASS";
+      
+    map<int, size_t> counts;
+    SiteTools::getCounts(sites.getSite(i), counts);
+    int ref = refSeq[i];
+    string alt = "";
+    string ac = "";
+    for (int x = 0; x < 4; ++x) {
+      if (x != ref) {
+        size_t f = counts[x];
+        if (f > 0) {
+          if (alt != "") {
+            alt += ",";
+            ac += ",";
+          }
+          alt += TextTools::toString<char>(chars[x]);
+          ac += TextTools::toString(f);
+        }
+      }
+    }
+    if (ac != "") {
+      out << chr << "\t" << (offset + i + 1) << "\t.\t" << chars[refSeq[i]] << "\t" << alt << "\t.\t" << filter << "\tAC=" << ac << endl;
+    }
+  }
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/VcfOutputMafIterator.h b/src/Bpp/Seq/Io/Maf/VcfOutputMafIterator.h
new file mode 100644
index 0000000..7f34292
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/VcfOutputMafIterator.h
@@ -0,0 +1,102 @@
+//
+// File: VcfOutputMafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Jan 05 2013
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _VCFOUTPUTMAFITERATOR_H_
+#define _VCFOUTPUTMAFITERATOR_H_
+
+#include "MafIterator.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief This iterator performs a simple SNP call from the MAF blocks, and outputs the results in the Variant Call Format (VCF).
+ *
+ * Only substitutions are supported for now.
+ */
+class VcfOutputMafIterator:
+  public AbstractFilterMafIterator
+{
+  private:
+    std::ostream* output_;
+    std::string refSpecies_;
+
+  public:
+    VcfOutputMafIterator(MafIterator* iterator, std::ostream* out, const std::string& reference) :
+      AbstractFilterMafIterator(iterator), output_(out), refSpecies_(reference)
+    {
+      if (output_)
+        writeHeader(*output_);
+    }
+
+  private:
+    VcfOutputMafIterator(const VcfOutputMafIterator& iterator) :
+      AbstractFilterMafIterator(0),
+      output_(iterator.output_),
+      refSpecies_(iterator.refSpecies_)
+    {}
+    
+    VcfOutputMafIterator& operator=(const VcfOutputMafIterator& iterator)
+    {
+      output_ = iterator.output_;
+      refSpecies_ = iterator.refSpecies_;
+      return *this;
+    }
+
+
+  public:
+    MafBlock* analyseCurrentBlock_() throw (Exception) {
+      currentBlock_ = iterator_->nextBlock();
+      if (output_ && currentBlock_)
+        writeBlock(*output_, *currentBlock_);
+      return currentBlock_;
+    }
+
+  private:
+    void writeHeader(std::ostream& out) const;
+    void writeBlock(std::ostream& out, const MafBlock& block) const;
+};
+
+} // end of namespace bpp.
+
+#endif //_VCFOUTPUTMAFITERATOR_H_
diff --git a/src/Bpp/Seq/Io/Maf/WindowSplitMafIterator.cpp b/src/Bpp/Seq/Io/Maf/WindowSplitMafIterator.cpp
new file mode 100644
index 0000000..b06536d
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/WindowSplitMafIterator.cpp
@@ -0,0 +1,103 @@
+//
+// File: WindowSplitMafIterator.cpp
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include "WindowSplitMafIterator.h"
+
+using namespace bpp;
+
+//From the STL:
+#include <string>
+#include <numeric>
+
+using namespace std;
+
+const short WindowSplitMafIterator::RAGGED_LEFT = 0;
+const short WindowSplitMafIterator::RAGGED_RIGHT = 1;
+const short WindowSplitMafIterator::CENTER = 2;
+const short WindowSplitMafIterator::ADJUST= 3;
+
+MafBlock* WindowSplitMafIterator::analyseCurrentBlock_() throw (Exception)
+{
+  while (blockBuffer_.size() == 0) {
+    //Build a new series of windows:
+    MafBlock* block = iterator_->nextBlock();
+    if (!block) return 0; //No more block.
+
+    size_t pos = 0;
+    size_t size = windowSize_;
+    size_t bSize = block->getNumberOfSites();
+
+    switch (align_) {
+      case (RAGGED_RIGHT) : { pos = bSize % windowSize_; break; }
+      case (CENTER)       : { pos = (bSize % windowSize_) / 2; break; }
+      case (ADJUST)       : {
+          size_t x = bSize / windowSize_;
+          if (x == 0) size = bSize;
+          else        size = bSize / x;
+          break;
+        }               
+      default             : { }
+    }
+    //cout << "Effective size: " << size << endl;
+    for(size_t i = pos; i + size < bSize; i += size) {
+      MafBlock* newBlock = new MafBlock();
+      newBlock->setScore(block->getScore());
+      newBlock->setPass(block->getPass());
+      if (align_ == ADJUST) {
+        if (bSize - (i + size) > 0 && bSize - (i + size) < size) {
+          //cout << "Old size: " << size;
+          size = bSize - i; //Adjust for last block because of rounding.
+                            //this should not increase size by more than 1!
+          //cout << " => new size: " << size << endl;
+        }
+      }
+      for (unsigned int j = 0; j < block->getNumberOfSequences(); ++j) {
+        auto_ptr<MafSequence> subseq(block->getSequence(j).subSequence(i, size));
+        newBlock->addSequence(*subseq);
+      }
+      blockBuffer_.push_back(newBlock);
+    }
+    delete block;
+  }
+ 
+  MafBlock* nxtBlock = blockBuffer_.front();
+  blockBuffer_.pop_front();
+  return nxtBlock;
+}
+
diff --git a/src/Bpp/Seq/Io/Maf/WindowSplitMafIterator.h b/src/Bpp/Seq/Io/Maf/WindowSplitMafIterator.h
new file mode 100644
index 0000000..b904ce8
--- /dev/null
+++ b/src/Bpp/Seq/Io/Maf/WindowSplitMafIterator.h
@@ -0,0 +1,86 @@
+//
+// File: WindowSplitMafIterator.h
+// Authors: Julien Dutheil
+// Created: Tue Sep 07 2010
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (2010)
+
+This software is a computer program whose purpose is to provide classes
+for sequences analysis.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#ifndef _WINDOWSPLITMAFITERATOR_H_
+#define _WINDOWSPLITMAFITERATOR_H_
+
+#include "MafIterator.h"
+
+//From the STL:
+#include <iostream>
+#include <string>
+#include <deque>
+
+namespace bpp {
+
+/**
+ * @brief Splits block into windows of given sizes.
+ */
+class WindowSplitMafIterator:
+  public AbstractFilterMafIterator
+{
+  private:
+    unsigned int windowSize_;
+    short align_;
+    std::deque<MafBlock*> blockBuffer_;
+
+  public:
+    static const short RAGGED_LEFT;
+    static const short RAGGED_RIGHT;
+    static const short CENTER;
+    static const short ADJUST;
+
+  public:
+    WindowSplitMafIterator(MafIterator* iterator, unsigned int windowSize, short splitOption = CENTER) throw (Exception):
+      AbstractFilterMafIterator(iterator),
+      windowSize_(windowSize), align_(splitOption), blockBuffer_()
+    {
+      if (splitOption != RAGGED_LEFT && splitOption != RAGGED_RIGHT
+          && splitOption != CENTER && splitOption != ADJUST)
+        throw Exception("WindowSplitMafIterator: unvalid split option: " + splitOption);
+    }
+
+  private:
+    MafBlock* analyseCurrentBlock_() throw (Exception);
+
+};
+
+} // end of namespace bpp.
+
+#endif //_WINDOWSPLITMAFITERATOR_H_
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..a1ed253
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,99 @@
+# CMake script for Bio++ Sequence Library
+# Author: Sylvain Gaillard and Julien Dutheil
+# Created: 30/07/2012
+
+# File list
+SET(CPP_FILES
+  Bpp/Seq/Io/Fastq.cpp
+  Bpp/Seq/Io/Maf/MafParser.cpp
+  Bpp/Seq/Io/Maf/SequenceStreamToMafIterator.cpp
+  Bpp/Seq/Io/Maf/MafIterator.cpp
+  Bpp/Seq/Io/Maf/SequenceFilterMafIterator.cpp
+  Bpp/Seq/Io/Maf/OrphanSequenceFilterMafIterator.cpp
+  Bpp/Seq/Io/Maf/ChromosomeMafIterator.cpp
+  Bpp/Seq/Io/Maf/DuplicateFilterMafIterator.cpp
+  Bpp/Seq/Io/Maf/BlockMergerMafIterator.cpp
+  Bpp/Seq/Io/Maf/ConcatenateMafIterator.cpp
+  Bpp/Seq/Io/Maf/FullGapFilterMafIterator.cpp
+  Bpp/Seq/Io/Maf/AlignmentFilterMafIterator.cpp
+  Bpp/Seq/Io/Maf/EntropyFilterMafIterator.cpp
+  Bpp/Seq/Io/Maf/MaskFilterMafIterator.cpp
+  Bpp/Seq/Io/Maf/QualityFilterMafIterator.cpp
+  Bpp/Seq/Io/Maf/FeatureFilterMafIterator.cpp
+  Bpp/Seq/Io/Maf/FeatureExtractorMafIterator.cpp
+  Bpp/Seq/Io/Maf/OutputMafIterator.cpp
+  Bpp/Seq/Io/Maf/OutputAlignmentMafIterator.cpp
+  Bpp/Seq/Io/Maf/VcfOutputMafIterator.cpp
+  Bpp/Seq/Io/Maf/SequenceStatisticsMafIterator.cpp
+  Bpp/Seq/Io/Maf/WindowSplitMafIterator.cpp
+  Bpp/Seq/Io/Maf/MafSequence.cpp
+  Bpp/Seq/Io/Maf/MafStatistics.cpp
+  Bpp/Seq/Io/Maf/IterationListener.cpp
+  Bpp/Seq/Feature/SequenceFeature.cpp
+  Bpp/Seq/Feature/SequenceFeatureTools.cpp
+  Bpp/Seq/Feature/Gff/GffFeatureReader.cpp
+  Bpp/Seq/Feature/Gtf/GtfFeatureReader.cpp
+  )
+
+SET(H_FILES
+  Bpp/Seq/Io/Fastq.h
+  Bpp/Seq/Io/Maf/MafSequence.h
+  Bpp/Seq/Io/Maf/MafParser.h
+  Bpp/Seq/Io/Maf/SequenceStreamToMafIterator.h
+  Bpp/Seq/Io/Maf/MafIterator.h
+  Bpp/Seq/Io/Maf/BlockLengthMafIterator.h
+  Bpp/Seq/Io/Maf/BlockSizeMafIterator.h
+  Bpp/Seq/Io/Maf/SequenceFilterMafIterator.h
+  Bpp/Seq/Io/Maf/OrphanSequenceFilterMafIterator.h
+  Bpp/Seq/Io/Maf/ChromosomeMafIterator.h
+  Bpp/Seq/Io/Maf/DuplicateFilterMafIterator.h
+  Bpp/Seq/Io/Maf/BlockMergerMafIterator.h
+  Bpp/Seq/Io/Maf/ConcatenateMafIterator.h
+  Bpp/Seq/Io/Maf/FullGapFilterMafIterator.h
+  Bpp/Seq/Io/Maf/AlignmentFilterMafIterator.h
+  Bpp/Seq/Io/Maf/EntropyFilterMafIterator.h
+  Bpp/Seq/Io/Maf/MaskFilterMafIterator.h
+  Bpp/Seq/Io/Maf/QualityFilterMafIterator.h
+  Bpp/Seq/Io/Maf/FeatureFilterMafIterator.h
+  Bpp/Seq/Io/Maf/FeatureExtractorMafIterator.h
+  Bpp/Seq/Io/Maf/OutputMafIterator.h
+  Bpp/Seq/Io/Maf/OutputAlignmentMafIterator.h
+  Bpp/Seq/Io/Maf/VcfOutputMafIterator.h
+  Bpp/Seq/Io/Maf/SequenceStatisticsMafIterator.h
+  Bpp/Seq/Io/Maf/WindowSplitMafIterator.h
+  Bpp/Seq/Io/Maf/MafStatistics.h
+  Bpp/Seq/Io/Maf/IterationListener.h
+  Bpp/Seq/Feature/SequenceFeature.h
+  Bpp/Seq/Feature/SequenceFeatureTools.h
+  Bpp/Seq/Feature/FeatureReader.h
+  Bpp/Seq/Feature/Gff/GffFeatureReader.h
+  Bpp/Seq/Feature/Gtf/GtfFeatureReader.h
+  )
+
+# Build the static lib
+ADD_LIBRARY(bppseqomics-static STATIC ${CPP_FILES})
+SET_TARGET_PROPERTIES(bppseqomics-static
+  PROPERTIES OUTPUT_NAME bpp-seq-omics
+  CLEAN_DIRECT_OUTPUT 1
+  )
+TARGET_LINK_LIBRARIES(bppseqomics-static ${LIBS})
+
+# Build the shared lib
+ADD_LIBRARY(bppseqomics-shared SHARED ${CPP_FILES})
+SET_TARGET_PROPERTIES(bppseqomics-shared
+  PROPERTIES OUTPUT_NAME bpp-seq-omics
+  CLEAN_DIRECT_OUTPUT 1
+  VERSION ${BPPSEQOMICS_VERSION}
+  SOVERSION ${BPPSEQOMICS_VERSION_MAJOR}
+  )
+TARGET_LINK_LIBRARIES(bppseqomics-shared ${LIBS})
+
+# Install libs
+INSTALL(TARGETS bppseqomics-static bppseqomics-shared DESTINATION lib${LIB_SUFFIX})
+
+# Install headers
+INSTALL(DIRECTORY Bpp/ DESTINATION include/Bpp FILES_MATCHING PATTERN "*.h")
+
+# Generate generic include files (.all)
+INSTALL(CODE "EXECUTE_PROCESS(COMMAND ${CMAKE_SOURCE_DIR}/genIncludes.sh ${CMAKE_PREFIX_PATH}/include/Bpp)")
+
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
new file mode 100644
index 0000000..ede9d50
--- /dev/null
+++ b/test/CMakeLists.txt
@@ -0,0 +1,46 @@
+# CMake script for bpp-seq unit tests
+# Author: Julien Dutheil
+# Created: 30/07/2012
+
+MACRO(TEST_FIND_LIBRARY OUTPUT_LIBS lib_name include_to_find)
+  #start:
+  FIND_PATH(${lib_name}_INCLUDE_DIR ${include_to_find})
+
+  SET(${lib_name}_NAMES ${lib_name} ${lib_name}.lib ${lib_name}.dll)
+  FIND_LIBRARY(${lib_name}_LIBRARY NAMES ${${lib_name}_NAMES})
+  IF(${lib_name}_LIBRARY)
+    MESSAGE("-- Library ${lib_name} found here:")
+    MESSAGE("   includes: ${${lib_name}_INCLUDE_DIR}")
+    MESSAGE("   dynamic libraries: ${${lib_name}_LIBRARY}")
+    MESSAGE(WARNING "Library ${lib_name} is already installed in the system tree. Test will be built against it. This may lead to unexpected results. You may want to do 'make install' before 'make test', or remove the installed version.")
+  ELSE()
+    SET(${lib_name}_LIBRARY "-L../src -lbpp-seq-omics")
+    SET(${lib_name}_INCLUDE_DIR "../src/")
+  ENDIF()
+  INCLUDE_DIRECTORIES(${${lib_name}_INCLUDE_DIR})
+  SET(${OUTPUT_LIBS} ${${OUTPUT_LIBS}} ${${lib_name}_LIBRARY})
+ENDMACRO(TEST_FIND_LIBRARY)
+
+#Find the bpp-seq(-omics) library library:
+TEST_FIND_LIBRARY(LIBS bpp-seq-omics Bpp/Seq/Feature/SequenceFeature.h)
+
+ADD_EXECUTABLE(test_gff test_gff.cpp)
+TARGET_LINK_LIBRARIES(test_gff ${LIBS})
+ADD_TEST(test_gff "test_gff")
+
+ADD_EXECUTABLE(test_fastq test_fastq.cpp)
+TARGET_LINK_LIBRARIES(test_fastq ${LIBS})
+ADD_TEST(test_fastq "test_fastq")
+
+IF(UNIX)
+  SET_PROPERTY(TEST test_gff test_fastq PROPERTY ENVIRONMENT "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}:../src")
+ENDIF()
+
+IF(APPLE)
+  SET_PROPERTY(TEST test_gff test_fastq PROPERTY ENVIRONMENT "DYLD_LIBRARY_PATH=$ENV{DYLD_LIBRARY_PATH}:../src")
+ENDIF()
+
+IF(WIN32)
+  SET(ENV{PATH} "$ENV{PATH};..\\src")
+ENDIF()
+
diff --git a/test/example.fastq b/test/example.fastq
new file mode 100644
index 0000000..0f67574
--- /dev/null
+++ b/test/example.fastq
@@ -0,0 +1,12 @@
+ at EAS54_6_R1_2_1_413_324
+CCCTTCTTGTCTTCAGCGTTTCTCC
++
+;;3;;;;;;;;;;;;7;;;;;;;88
+ at EAS54_6_R1_2_1_540_792
+TTGGCAGGCCAAGGCCGATGGATCA
++
+;;;;;;;;;;;7;;;;;-;;;3;83
+ at EAS54_6_R1_2_1_443_348
+GTTGCTTCTGGCGTGGGTGGGGGGG
++EAS54_6_R1_2_1_443_348
+;;;;;;;;;;;9;7;;.7;393333
diff --git a/test/example.gff b/test/example.gff
new file mode 100644
index 0000000..0f129a4
--- /dev/null
+++ b/test/example.gff
@@ -0,0 +1,25 @@
+##gff-version	3
+##sequence-region	ctg123	1	1497228	
+ctg123	.	gene	1000	9000	.	+	.	ID=gene00001;Name=EDEN
+ctg123	.	TF_binding_site	1000	1012	.	+	.	ID=tfbs00001;Parent=gene00001
+ctg123	.	mRNA	1050	9000	.	+	.	ID=mRNA00001;Parent=gene00001;Name=EDEN.1
+ctg123	.	mRNA	1050	9000	.	+	.	ID=mRNA00002;Parent=gene00001;Name=EDEN.2
+ctg123	.	mRNA	1300	9000	.	+	.	ID=mRNA00003;Parent=gene00001;Name=EDEN.3
+ctg123	.	exon	1300	1500	.	+	.	ID=exon00001;Parent=mRNA00003
+ctg123	.	exon	1050	1500	.	+	.	ID=exon00002;Parent=mRNA00001,mRNA00002
+ctg123	.	exon	3000	3902	.	+	.	ID=exon00003;Parent=mRNA00001,mRNA00003
+ctg123	.	exon	5000	5500	.	+	.	ID=exon00004;Parent=mRNA00001,mRNA00002,mRNA00003
+ctg123	.	exon	7000	9000	.	+	.	ID=exon00005;Parent=mRNA00001,mRNA00002,mRNA00003
+ctg123	.	CDS	1201	1500	.	+	0	ID=cds00001;Parent=mRNA00001;Name=edenprotein.1
+ctg123	.	CDS	3000	3902	.	+	0	ID=cds00001;Parent=mRNA00001;Name=edenprotein.1
+ctg123	.	CDS	5000	5500	.	+	0	ID=cds00001;Parent=mRNA00001;Name=edenprotein.1
+ctg123	.	CDS	7000	7600	.	+	0	ID=cds00001;Parent=mRNA00001;Name=edenprotein.1
+ctg123	.	CDS	1201	1500	.	+	0	ID=cds00002;Parent=mRNA00002;Name=edenprotein.2
+ctg123	.	CDS	5000	5500	.	+	0	ID=cds00002;Parent=mRNA00002;Name=edenprotein.2
+ctg123	.	CDS	7000	7600	.	+	0	ID=cds00002;Parent=mRNA00002;Name=edenprotein.2
+ctg123	.	CDS	3301	3902	.	+	0	ID=cds00003;Parent=mRNA00003;Name=edenprotein.3
+ctg123	.	CDS	5000	5500	.	+	1	ID=cds00003;Parent=mRNA00003;Name=edenprotein.3
+ctg123	.	CDS	7000	7600	.	+	1	ID=cds00003;Parent=mRNA00003;Name=edenprotein.3
+ctg123	.	CDS	3391	3902	.	+	0	ID=cds00004;Parent=mRNA00003;Name=edenprotein.4
+ctg123	.	CDS	5000	5500	.	+	1	ID=cds00004;Parent=mRNA00003;Name=edenprotein.4
+ctg123	.	CDS	7000	7600	.	+	1	ID=cds00004;Parent=mRNA00003;Name=edenprotein.4
diff --git a/test/test_fastq.cpp b/test/test_fastq.cpp
new file mode 100644
index 0000000..f54f965
--- /dev/null
+++ b/test/test_fastq.cpp
@@ -0,0 +1,75 @@
+// 
+// File:    test_fastq.cpp
+// Author:  Sylvain Gaillard
+// Created: 22/11/2011 11:29:16
+// 
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (November 22, 2011)
+
+This software is a computer program whose purpose is to provide classes
+for numerical calculus. This file is part of the Bio++ project.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include <Bpp/Numeric/VectorTools.h>
+#include <Bpp/Seq/Io/Fastq.h>
+#include <Bpp/Seq/SequenceWithQuality.h>
+#include <Bpp/Seq/Alphabet/DNA.h>
+
+#include <iostream>
+#include <fstream>
+
+using namespace bpp;
+
+int main () {
+  try {
+    std::string filename = "example.fastq";
+    std::ifstream input(filename.c_str(), std::ios::in);
+    if (!input) {
+      std::cerr << "Could not open " << filename << std::endl;
+      return 1;
+    }
+    Fastq fq;
+    const Alphabet* alpha = new DNA();
+    SequenceWithQuality seq("", "", alpha);
+    while (fq.nextSequence(input, seq)) {
+      std::cout << seq.getName() << " " << seq.size();
+      std::cout << " " << VectorTools::min(seq.getQualities()) - 33;
+      std::cout << " " << VectorTools::max(seq.getQualities()) - 33;
+      std::cout << std::endl;
+      fq.repeatName(true);
+      fq.writeSequence(std::cout, seq);
+      fq.repeatName(false);
+    }
+    return 0;
+  } catch (std::exception& ex) {
+    std::cerr << ex.what() << std::endl;
+    return 1;
+  }
+}
diff --git a/test/test_gff.cpp b/test/test_gff.cpp
new file mode 100644
index 0000000..8f59758
--- /dev/null
+++ b/test/test_gff.cpp
@@ -0,0 +1,61 @@
+//
+// File: test_gff.cpp
+// Created by: Julien Dutheil
+// Created on: Mon Nov 21 14:31 2011
+//
+
+/*
+Copyright or © or Copr. Bio++ Development Team, (November 17, 2004)
+
+This software is a computer program whose purpose is to provide classes
+for numerical calculus. This file is part of the Bio++ project.
+
+This software is governed by the CeCILL  license under French law and
+abiding by the rules of distribution of free software.  You can  use, 
+modify and/ or redistribute the software under the terms of the CeCILL
+license as circulated by CEA, CNRS and INRIA at the following URL
+"http://www.cecill.info". 
+
+As a counterpart to the access to the source code and  rights to copy,
+modify and redistribute granted by the license, users are provided only
+with a limited warranty  and the software's author,  the holder of the
+economic rights,  and the successive licensors  have only  limited
+liability. 
+
+In this respect, the user's attention is drawn to the risks associated
+with loading,  using,  modifying and/or developing or reproducing the
+software by the user in light of its specific status of free software,
+that may mean  that it is complicated to manipulate,  and  that  also
+therefore means  that it is reserved for developers  and  experienced
+professionals having in-depth computer knowledge. Users are therefore
+encouraged to load and test the software's suitability as regards their
+requirements in conditions enabling the security of their systems and/or 
+data to be ensured and,  more generally, to use and operate it in the 
+same conditions as regards security. 
+
+The fact that you are presently reading this means that you have had
+knowledge of the CeCILL license and that you accept its terms.
+*/
+
+#include <Bpp/Seq/Feature/Gff/GffFeatureReader.h>
+
+#include <iostream>
+#include <fstream>
+
+using namespace bpp;
+using namespace std;
+
+int main() {
+  try {
+  ifstream input("example.gff", ios::in);
+  GffFeatureReader reader(input);
+  while (reader.hasMoreFeature()) {
+    BasicSequenceFeature feature = reader.nextFeature();
+    cout << "Found feature " << feature.getId() << " of type " << feature.getType() << ", starting at " << feature.getStart() << " and ending at " << feature.getEnd() << endl;
+  }
+  return 0;
+  } catch (exception& ex) {
+    cerr << ex.what() << endl;
+    return 1;
+  }
+}

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



More information about the debian-med-commit mailing list