[med-svn] [bppsuite] 06/10: New upstream version 2.3.1

Andreas Tille tille at debian.org
Wed Jun 14 12:46:40 UTC 2017


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

tille pushed a commit to branch master
in repository bppsuite.

commit 616ba6cdb417124b6dde80a19daaf0632e9a3aad
Author: Andreas Tille <tille at debian.org>
Date:   Wed Jun 14 14:32:26 2017 +0200

    New upstream version 2.3.1
---
 AUTHORS.txt                                        |   2 +
 CMakeLists.txt                                     | 302 +++------------
 ChangeLog                                          |  31 ++
 Examples/MaximumLikelihood/Codons/M1/ML.bpp        |   4 +-
 Examples/MaximumLikelihood/Codons/M2/ML.bpp        |   4 +-
 Examples/PhylogeneticSampling/PhySamp.bpp          |  54 ---
 Examples/PopStats/PopStats.bpp                     |  11 +
 Examples/PopStats/PopStatsCodonSites.bpp           |  19 +
 Examples/README                                    |   1 -
 INSTALL.txt                                        |  13 +-
 bppSuite/CMakeLists.txt                            |  86 ++--
 bppSuite/bppAlnScore.cpp                           |  44 ++-
 bppSuite/bppAncestor.cpp                           |  43 +-
 bppSuite/bppConsense.cpp                           |   8 +-
 bppSuite/bppDist.cpp                               |  24 +-
 bppSuite/bppML.cpp                                 |  61 +--
 bppSuite/bppMixedLikelihoods.cpp                   |  75 ++--
 bppSuite/bppPars.cpp                               |  11 +-
 bppSuite/bppPhyloSampler.cpp                       | 282 --------------
 bppSuite/bppPopStats.cpp                           | 421 ++++++++++++++++++++
 bppSuite/bppReRoot.cpp                             |  10 +-
 bppSuite/bppSeqGen.cpp                             | 208 +++++++---
 bppSuite/bppSeqMan.cpp                             |  77 ++--
 bppSuite/bppTreeDraw.cpp                           |  20 +-
 bppsuite.spec                                      |  80 ++--
 buildBin.sh                                        |   5 +-
 debian/bppsuite.manpages                           |  11 -
 debian/changelog                                   |  73 ----
 debian/compat                                      |   1 -
 debian/control                                     |  27 --
 debian/copyright                                   |  62 ---
 debian/docs                                        |   0
 debian/rules                                       | 155 --------
 debian/source/format                               |   1 -
 doc/CMakeLists.txt                                 |  76 +++-
 doc/bppsuite.texi                                  | 431 ++++++++++++++++-----
 man/CMakeLists.txt                                 |  54 ++-
 man/{bppalnscore.1.txt => bppalnscore.1}           |   0
 man/{bppancestor.1.txt => bppancestor.1}           |   0
 man/{bppconsense.1.txt => bppconsense.1}           |   0
 man/{bppdist.1.txt => bppdist.1}                   |   0
 ...ixedlikelihoods.1.txt => bppmixedlikelihoods.1} |   0
 man/{bppml.1.txt => bppml.1}                       |   0
 man/{bpppars.1.txt => bpppars.1}                   |   0
 man/bppphysamp.1.txt                               |  37 --
 man/{bppreroot.1.txt => bpppopstats.1}             |  10 +-
 man/{bppreroot.1.txt => bppreroot.1}               |   0
 man/{bppseqgen.1.txt => bppseqgen.1}               |   0
 man/{bppseqman.1.txt => bppseqman.1}               |   0
 man/{bpptreedraw.1.txt => bpptreedraw.1}           |   0
 50 files changed, 1455 insertions(+), 1379 deletions(-)

diff --git a/AUTHORS.txt b/AUTHORS.txt
index cf13973..4452249 100644
--- a/AUTHORS.txt
+++ b/AUTHORS.txt
@@ -2,6 +2,7 @@ Julien Dutheil     <julien.dutheil at univ-montp2.fr>
 Céline Scornavacca <celine.scornavacca at lirmm.fr>
 Bastien Boussau    <boussau at biomserv.univ-lyon1.fr>
 Laurent Guéguen    <gueguen at biomserv.univ-lyon1.fr>
+François Gindraud  <francois.gindraud at gmail.com>
 
 Contributed code to Bio++ was enabled thanks to the following institutions and resources:
 
@@ -17,3 +18,4 @@ Contributed code to Bio++ was enabled thanks to the following institutions and r
 2009 - 2010 Berkeley University (Bastien Boussau)
 2010 -      Laboratoire BBE - UMR CNRS 5558 Université Lyon 1 (Bastien Boussau)   
 2008 -      Laboratoire BBE - UMR CNRS 5558 Université Lyon 1 (Laurent Guéguen)
+2017 - 2018 Projet GrASP - LabEX Ecofect - Université de Lyon (François Gindraud)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 91a5b51..011e25b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,28 +1,20 @@
 # CMake script for Bio++ Program Suite
-# Author: Julien Dutheil
+# Authors:
+#   Julien Dutheil
+#   Francois Gindraud (2017)
 # Created: 22/08/2009
 
-# Global parameters
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(bppsuite CXX)
+cmake_minimum_required (VERSION 2.8.11)
+project (bppsuite CXX)
+
+# Compile options
+SET (CMAKE_CXX_FLAGS "-std=c++11 -Wall -Weffc++ -Wshadow -Wconversion")
 
 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()
-
-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()
-
-IF(NO_VIRTUAL_COV)
-  MESSAGE("-- Covariant return with virtual inheritance disabled.")
-  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNO_VIRTUAL_COV=1")
-ENDIF()
+ENDIF(NOT CMAKE_BUILD_TYPE)
 
 IF(NOT NO_DEP_CHECK)
   SET(NO_DEP_CHECK FALSE CACHE BOOL
@@ -30,19 +22,6 @@ IF(NOT NO_DEP_CHECK)
       FORCE)
 ENDIF(NOT NO_DEP_CHECK)
 
-IF(NOT DOC_COMPRESS)
-  SET(DOC_COMPRESS gzip CACHE STRING
-      "Set program for compressing documentation."
-      FORCE)
-ENDIF(NOT DOC_COMPRESS)
-
-IF(NOT DOC_COMPRESS_EXT)
-  SET(DOC_COMPRESS_EXT gz CACHE STRING
-      "Set extension of compressed documentation."
-      FORCE)
-ENDIF(NOT DOC_COMPRESS_EXT)
-
-
 IF(NO_DEP_CHECK)
   MESSAGE("-- Dependencies checking disabled. Only distribution can be built.")
 ELSE(NO_DEP_CHECK)
@@ -59,212 +38,71 @@ IF(BUILD_STATIC)
   SET(CMAKE_CXX_FLAGS "-static -static-libgcc ${CMAKE_CXX_FLAGS}")
 ENDIF()
 
-#build info?
-IF(NOT DEFINED INFO)
-  SET(INFO UNIX)
-ENDIF(NOT DEFINED INFO)
-
-#build man pages?
-IF(NOT DEFINED MAN)
-  SET(MAN UNIX)
-ENDIF(NOT DEFINED MAN)
-
-#find executables for documentation
-IF(MAN)
-  FIND_PROGRAM(NROFF_EXE NAMES nroff)
-  IF(NROFF_EXE)
-    MESSAGE("-- Found nroff here: ${NROFF_EXE}")
-    MESSAGE("   Adding targets: man")
-
-    ADD_CUSTOM_TARGET(man
-      ALL
-      COMMAND cp bppml.1.txt bppml.1
-      COMMAND ${DOC_COMPRESS} -f bppml.1
-      COMMAND cp bppseqgen.1.txt bppseqgen.1
-      COMMAND ${DOC_COMPRESS} -f bppseqgen.1
-      COMMAND cp bppdist.1.txt bppdist.1
-      COMMAND ${DOC_COMPRESS} -f bppdist.1
-      COMMAND cp bpppars.1.txt bpppars.1
-      COMMAND ${DOC_COMPRESS} -f bpppars.1
-      COMMAND cp bppseqman.1.txt bppseqman.1
-      COMMAND ${DOC_COMPRESS} -f bppseqman.1
-      COMMAND cp bppconsense.1.txt bppconsense.1
-      COMMAND ${DOC_COMPRESS} -f bppconsense.1
-      COMMAND cp bppancestor.1.txt bppancestor.1
-      COMMAND ${DOC_COMPRESS} -f bppancestor.1
-      COMMAND cp bppreroot.1.txt bppreroot.1
-      COMMAND ${DOC_COMPRESS} -f bppreroot.1
-      COMMAND cp bppphysamp.1.txt bppphysamp.1
-      COMMAND ${DOC_COMPRESS} -f bppphysamp.1
-      COMMAND cp bpptreedraw.1.txt bpptreedraw.1
-      COMMAND ${DOC_COMPRESS} -f bpptreedraw.1
-      COMMAND cp bppalnscore.1.txt bppalnscore.1
-      COMMAND ${DOC_COMPRESS} -f bppalnscore.1
-      COMMAND cp bppmixedlikelihoods.1.txt bppmixedlikelihoods.1
-      COMMAND ${DOC_COMPRESS} -f bppmixedlikelihoods.1
-      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/man
-      )
-    SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "man/bppml.1.${DOC_COMPRESS_EXT};man/bppseqgen.1.${DOC_COMPRESS_EXT};man/bppdist.1.${DOC_COMPRESS_EXT};man/bpppars.1.${DOC_COMPRESS_EXT};man/bppseqman.1.${DOC_COMPRESS_EXT};man/bppconsense.1.${DOC_COMPRESS_EXT};man/bppancestor.1.${DOC_COMPRESS_EXT};man/bppreroot.1.${DOC_COMPRESS_EXT};man/bppphysamp.1.${DOC_COMPRESS_EXT};man/bpptreedraw.1.${DOC_COMPRESS_EXT};man/bppalnscore.1.${DOC_COMPRESS_EXT};man/bppmixedlikelihoods.1. [...]
-
-  ELSE()
-    MESSAGE(FATAL_ERROR "Program nroff required but not found.")
-  ENDIF()
-ENDIF(MAN)
-
-IF(INFO)
-  FIND_PROGRAM(MAKEINFO_EXE NAMES makeinfo)
-  IF(MAKEINFO_EXE)
-    MESSAGE("-- Found makeinfo here: ${MAKEINFO_EXE}")
-    MESSAGE("   Adding targets: info, html")
- 
-    SET(ADD_INFO_TO "ALL")
-    MESSAGE("   Adding target info to target all")
-    
-    ADD_CUSTOM_TARGET(info
-      ${ADD_INFO_TO}
-      COMMAND ${MAKEINFO_EXE} bppsuite.texi
-      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/doc
-      )
-
-    ADD_CUSTOM_TARGET(html
-      COMMAND ${MAKEINFO_EXE} --html --css-ref=http://www.w3.org/StyleSheets/Core/Steely bppsuite.texi
-      WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/doc
-      )
-  ELSE(MAKEINFO_EXE)
-    MESSAGE(FATAL_ERROR p"Program makeinfo required but not found.")
-  ENDIF(MAKEINFO_EXE)
-ENDIF(INFO)
-
-FIND_PROGRAM(PDFTEX_EXE NAMES pdftex)
-IF(PDFTEX_EXE)
-  MESSAGE("-- Found pdftex here: ${PDFTEX_EXE}")
-  MESSAGE("   Adding target: pdf")
-
-  ADD_CUSTOM_TARGET(pdf
-    COMMAND ${PDFTEX_EXE} bppsuite.texi
-    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/doc
-    )
-  SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "doc/bppsuite.pdf;doc/bppsuite.aux;doc/bppsuite.cp;doc/bppsuite.fn;doc/bppsuite.info;doc/bppsuite.ky;doc/bppsuite.log;doc/bppsuite.pg;doc/bppsuite.toc;doc/bppsuite.tp;doc/bppsuite.vr")
-ENDIF(PDFTEX_EXE)
-
-#here is a useful function:
-MACRO(IMPROVED_FIND_LIBRARY OUTPUT_LIBS lib_name include_to_find)
-  #start:
-  FIND_PATH(${lib_name}_INCLUDE_DIR ${include_to_find})
-  INCLUDE_DIRECTORIES(${${lib_name}_INCLUDE_DIR})
-
-  IF(BUILD_STATIC)
-    SET(${lib_name}_STATIC_NAMES lib${lib_name}.a)
-    FIND_LIBRARY(${lib_name}_STATIC_LIBRARY NAMES ${${lib_name}_STATIC_NAMES} PATH_SUFFIXES lib${LIB_SUFFIX})
-    IF(${lib_name}_STATIC_LIBRARY)
-      MESSAGE("-- Library ${lib_name} found here:")
-      MESSAGE("   includes: ${${lib_name}_INCLUDE_DIR}")
-      MESSAGE("   static libraries: ${${lib_name}_STATIC_LIBRARY}")
-    ELSE()
-      MESSAGE(FATAL_ERROR "${lib_name} required but not found.")
-    ENDIF()
-    #add the dependency:
-    SET(${OUTPUT_LIBS} ${${OUTPUT_LIBS}} ${${lib_name}_STATIC_LIBRARY})
-  ELSE()
-    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("   dynamic libraries: ${${lib_name}_LIBRARY}")
-    ELSE()
-      MESSAGE(FATAL_ERROR "${lib_name} required but not found.")
-    ENDIF()
-    #add the dependency:
-    SET(${OUTPUT_LIBS} ${${OUTPUT_LIBS}} ${${lib_name}_LIBRARY})
-  ENDIF()
-  
-ENDMACRO(IMPROVED_FIND_LIBRARY)
-
-# 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)
-
-#Find the libraries. The order is very important for static linkage, it won't
-#link if you change it!
-IMPROVED_FIND_LIBRARY(LIBS bpp-phyl Bpp/Phyl/Tree.h)
-IMPROVED_FIND_LIBRARY(LIBS bpp-seq Bpp/Seq/Alphabet/Alphabet.h)
-IMPROVED_FIND_LIBRARY(LIBS bpp-core Bpp/Clonable.h)
+# Check compression program
+# COMPRESS_PROGRAM controls the choice of program
+# COMPRESS_EXT can be used to override the file extension
+if (NOT COMPRESS_PROGRAM)
+  set (COMPRESS_PROGRAM gzip CACHE STRING "Set program for compressing documentation" FORCE)
+endif ()
+find_program (COMPRESS_BIN NAMES ${COMPRESS_PROGRAM} DOC "${COMPRESS_PROGRAM} compression program")
+if (NOT COMPRESS_BIN)
+  message (STATUS "${COMPRESS_PROGRAM} program not found, text doc will not be compressed")
+else ()
+  # Deduce COMPRESS_EXT for known compression programs if not set
+  if (NOT COMPRESS_EXT)
+    if (${COMPRESS_PROGRAM} STREQUAL "gzip")
+      set (COMPRESS_EXT "gz")
+    elseif (${COMPRESS_PROGRAM} STREQUAL "bzip2")
+      set (COMPRESS_EXT "bz2")
+    else ()
+      set (COMPRESS_EXT "${COMPRESS_PROGRAM}") # Default: program name (works for xz/lzma)
+    endif ()
+  endif ()
+  # Generate command line args (always add -c to output compressed file to stdout)
+  if (${COMPRESS_PROGRAM} STREQUAL "gzip")
+    # -n for no timestamp in files (reproducible builds)
+    set (COMPRESS_ARGS -c -n)
+  else ()
+    set (COMPRESS_ARGS -c)
+  endif ()
+  message (STATUS "Found ${COMPRESS_BIN} compression program, using file extension .${COMPRESS_EXT}")
+endif ()
+
+# Find dependencies (add install directory to search)
+if (CMAKE_INSTALL_PREFIX)
+  set (CMAKE_PREFIX_PATH "${CMAKE_INSTALL_PREFIX}" ${CMAKE_PREFIX_PATH})
+endif (CMAKE_INSTALL_PREFIX)
+
+include (GNUInstallDirs)
+find_package (bpp-phyl 11.0.0 REQUIRED)
+find_package (bpp-popgen 7.0.0 REQUIRED)
 
 # Subdirectories
-ADD_SUBDIRECTORY(bppSuite)
-ADD_SUBDIRECTORY(doc)
-ADD_SUBDIRECTORY(man)
+add_subdirectory (bppSuite)
+add_subdirectory (doc)
+add_subdirectory (man)
 
 ENDIF(NO_DEP_CHECK)
 
 # Packager
 SET(CPACK_PACKAGE_NAME "bppsuite")
 SET(CPACK_PACKAGE_VENDOR "Bio++ Development Team")
-SET(CPACK_PACKAGE_VERSION "2.2.0")
+SET(CPACK_PACKAGE_VERSION "2.3.1")
 SET(CPACK_PACKAGE_VERSION_MAJOR "2")
-SET(CPACK_PACKAGE_VERSION_MINOR "2")
-SET(CPACK_PACKAGE_VERSION_PATCH "0")
+SET(CPACK_PACKAGE_VERSION_MINOR "3")
+SET(CPACK_PACKAGE_VERSION_PATCH "1")
 SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Bio++ Program Suite")
 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"
- ".*\\\\.svn"
- ".*\\\\.gz"
- ".*\\\\.zip"
- ".*\\\\.deb"
- ".*\\\\.rpm"
- ".*\\\\.dmg"
- ".*\\\\.sh"
- ".*\\\\..*\\\\.swp"
- ".*stamp"
- "\\\\.sh"
- "bppSuite/\\\\..*"
- "bppSuite/bppancestor"
- "bppSuite/bppml"
- "bppSuite/bppphysamp"
- "bppSuite/bppseqman"
- "bppSuite/bppconsense"
- "bppSuite/bppreroot"
- "bppSuite/bpppars"
- "bppSuite/bpptreedraw"
- "bppSuite/bppdist"
- "bppSuite/bppseqgen"
- "bppSuite/bppalnscore"
- "doc/bppsuite/"
- "doc/bppsuite\\\\.info"
- "doc/bppsuite\\\\.toc"
- "doc/bppsuite\\\\.vr"
- "doc/bppsuite\\\\.tp"
- "doc/bppsuite\\\\.log"
- "doc/bppsuite\\\\.fn"
- "doc/bppsuite\\\\.ky"
- "doc/bppsuite\\\\.cp"
- "doc/bppsuite\\\\.pg"
- "doc/bppsuite\\\\.aux"
- "doc/bppsuite\\\\.pdf"
- "man/.*\\\\.1.${DOC_COMPRESS_EXT}"
- "debian/tmp"
- "debian/bppsuite/"
- "debian/bppsuite\\\\.substvars"
- "debian/bppsuite\\\\.debhelper"
- "debian/debhelper\\\\.log"
- "install_manifest.txt"
- "DartConfiguration.tcl"
- ${CPACK_SOURCE_IGNORE_FILES}
-)
-IF (MACOS)
-  SET(CPACK_GENERATOR "Bundle")
-ENDIF()
+# /!\ This assumes that an external build is used
+SET(CPACK_SOURCE_IGNORE_FILES 
+       "/build/" 
+       "/\\\\.git/" 
+       "/\\\\.gitignore" 
+       ${CPACK_SOURCE_IGNORE_FILES}
+       )
 
 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 "${CMAKE_PROJECT_NAME}_${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}.orig")
@@ -272,29 +110,9 @@ 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)
-
-  ADD_CUSTOM_TARGET(make_clean_man
-    COMMAND rm -f *.${DOC_COMPRESS_EXT}
-    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/man
-  )
-  ADD_DEPENDENCIES(dist make_clean_man)
-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)
-ADD_DEPENDENCIES(deb info man)
 
 #This creates rpm packages:
 ADD_CUSTOM_TARGET(rpm rpmbuild -ta ${CPACK_SOURCE_PACKAGE_FILE_NAME}.tar.gz)
diff --git a/ChangeLog b/ChangeLog
index c222707..69e7267 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,34 @@
+06/06/17 -*- Version 2.3.1 -*- 
+
+10/05/17 -*- Version 2.3.0 -*- 
+
+21/12/16 Julien Dutheil
+* BppPhySamp migrated to its own package.
+
+17/12/16 Julien Dutheil
+* Improved bppPopStats, outgroup analyses, MK table and output to file.
+
+06/10/16 Julien Dutheil
+* bppSeqGen now takes Hudson's MS ARG files as input.
+* new input.tree.scale option to adjust branch lengths.
+
+22/05/16 Julien Dutheil
+* bpppopstats now computes codon statistics per site (e.g. PiN, PiS)
+* Added example for bpppopstats.
+
+29/06/15 Julien Dutheil
+* New program bppPopStats
+
+28/01/15 Julien Dutheil
+* PhySamp now outputs the correct tree!
+
+25/11/14 Julien Dutheil
+* bppalnscore output contiguous segments in mase selection.
+* bppalnscore site selection works with codon alphabets.
+
+24/11/14 Julien Dutheil
+* bppSeqMan can now read alignments and perform site selection priori to any analysis.
+
 28/09/14 -*- Version 2.2.0 -*- 
 
 16/09/14 Julien Dutheil
diff --git a/Examples/MaximumLikelihood/Codons/M1/ML.bpp b/Examples/MaximumLikelihood/Codons/M1/ML.bpp
index 7fbe48b..a9f25ab 100644
--- a/Examples/MaximumLikelihood/Codons/M1/ML.bpp
+++ b/Examples/MaximumLikelihood/Codons/M1/ML.bpp
@@ -42,7 +42,7 @@ init.brlen.method = Input
 # ----------------------------------------------------------------------------------------
 # See the manual for a description of the syntax and available options.
 #
-model = YNGKP_M1(kappa=1, omega=0.5, frequencies=F1X4, p0=0.5, initFreqs=observed, observedPseudoCount=1)
+model = YNGP_M1(kappa=1, omega=0.5, frequencies=F1X4, p0=0.5, initFreqs=observed, observedPseudoCount=1)
 nonhomogeneous=no
 
 rate_distribution = Constant //Gamma(n=4, alpha=0.358)
@@ -85,7 +85,7 @@ optimization.final = none
 optimization.verbose = 3
 
 # Parameters to ignore (for instance equilibrium frequencies)
-optimization.ignore_parameter = YNGKP_M1.*Full*
+optimization.ignore_parameter = YNGP_M1.*Full*
 
 # Maximum number of likelihood evaluations:
 optimization.max_number_f_eval = 10000
diff --git a/Examples/MaximumLikelihood/Codons/M2/ML.bpp b/Examples/MaximumLikelihood/Codons/M2/ML.bpp
index fb0cf66..f3e13c9 100644
--- a/Examples/MaximumLikelihood/Codons/M2/ML.bpp
+++ b/Examples/MaximumLikelihood/Codons/M2/ML.bpp
@@ -42,7 +42,7 @@ init.brlen.method = Input
 # ----------------------------------------------------------------------------------------
 # See the manual for a description of the syntax and available options.
 #
-model = YNGKP_M2(kappa=1, omega0=0.5, omega2=2.0, frequencies=F3X4, theta1=0.33333, theta2=0.5, initFreqs=observed)
+model = YNGP_M2(kappa=1, omega0=0.5, omega2=2.0, frequencies=F3X4, theta1=0.33333, theta2=0.5, initFreqs=observed)
 nonhomogeneous=no
 
 rate_distribution = Constant() //Gamma(n=4, alpha=0.358)
@@ -85,7 +85,7 @@ optimization.final = none
 optimization.verbose = 3
 
 # Parameters to ignore (for instance equilibrium frequencies)
-optimization.ignore_parameter = YNGKP_M1.*Full*
+optimization.ignore_parameter = YNGP_M1.*Full*
 
 # Maximum number of likelihood evaluations:
 optimization.max_number_f_eval = 10000
diff --git a/Examples/PhylogeneticSampling/PhySamp.bpp b/Examples/PhylogeneticSampling/PhySamp.bpp
deleted file mode 100755
index 7bca1a8..0000000
--- a/Examples/PhylogeneticSampling/PhySamp.bpp
+++ /dev/null
@@ -1,54 +0,0 @@
-# Global variables:
-DATA = LSU
-
-# Sequences:
-
-# The alphabet to use:
-# DNA, RNA or Protein
-alphabet=DNA
-
-# The sequence file to use (sequences must be aligned!)
-input.sequence.file=../Data/$(DATA).phy
-
-# The alignment format:
-# Must be one of Mase, Fasta, Phylip, Clustal, DCSE or GenBank 
-input.sequence.format=Phylip(order=sequential, type=extended)
-
-# Input method: tree or matrix
-input.method=tree
-
-# Tree file if the tree method has been selected:
-input.tree.file=../Data/$(DATA).dnd
-input.tree.format=Newick
-
-# Matrix file if the matrix method has been selected:
-input.matrix=
-
-#threshold or sample
-deletion_method=sample
-# Threshold to use (same unit as distances on the tree/matrix)
-TYPE=05
-threshold=0.$(TYPE)
-# OR sample size:
-TYPE=20
-sample_size=$(TYPE)
-
-
-# Criterion to choose between sequences:
-# - length: keep the sequence with the highest number of positions
-# - length.complete: keep the sequence with the highest number of complete positions
-# - random: Keep a sequence randomly
-choice_criterion=length.complete
-
-# Output sequence file
-output.sequence.file=$(DATA).$(TYPE).fasta
-
-# Ouput format:
-output.sequence.format=Fasta()
-
-# Output tree file
-output.tree.file=$(DATA).$(TYPE).dnd
-
-# Ouput format:
-output.tree.format=Newick
-
diff --git a/Examples/PopStats/PopStats.bpp b/Examples/PopStats/PopStats.bpp
new file mode 100644
index 0000000..9a08535
--- /dev/null
+++ b/Examples/PopStats/PopStats.bpp
@@ -0,0 +1,11 @@
+input.sequence.file.ingroup = alignment.phy
+input.sequence.format.ingroup = Phylip(order=interleaved, type=classic)
+pop.stats= \
+    SiteFrequencies,\
+    Watterson75,\
+    Tajima83,\
+    TajimaD,\
+    FuAndLiDStar(tot_mut=no),\
+    FuAndLiFStar(tot_mut=no),\
+    FuAndLiDStar(tot_mut=yes),\
+    FuAndLiFStar(tot_mut=yes),\
diff --git a/Examples/PopStats/PopStatsCodonSites.bpp b/Examples/PopStats/PopStatsCodonSites.bpp
new file mode 100644
index 0000000..71422b2
--- /dev/null
+++ b/Examples/PopStats/PopStatsCodonSites.bpp
@@ -0,0 +1,19 @@
+# ---------------
+# Input sequences
+# ---------------
+
+# The alphabet to use:
+alphabet=Codon(letter=DNA)
+genetic_code=Standard
+
+# The sequence file to use (sequences must be aligned!)
+input.sequence.file.ingroup=alignment.phy
+
+# The file format:
+input.sequence.format.ingroup=Phylip(order=interleaved, type=classic)
+
+# ----------------
+# Analysis
+# ----------------
+
+pop.stats=CodonSiteStatistics(output.file=alignment.codons.csv),PiN_PiS
diff --git a/Examples/README b/Examples/README
index b6765a4..cef8251 100644
--- a/Examples/README
+++ b/Examples/README
@@ -27,7 +27,6 @@ These option files are split in their respective program directory:
   SeqGenNonHomogeneousModel.bpp  File included by SeqGen.bpp. Not to be used directly.
   Consense.bpp                   BppConsense option file.
   SeqMan.bpp                     BppSeqMan option file.
-  PhySamp.bpp                    BppPhyloSampler option file.
   ReRoot.bpp                     BppReRoot option file.
   AlnScores.bpp                  BppAlnscore option file.
 
diff --git a/INSTALL.txt b/INSTALL.txt
index c8859da..4f9751d 100644
--- a/INSTALL.txt
+++ b/INSTALL.txt
@@ -1,12 +1,17 @@
-This software needs cmake >= 2.6 to build.
+This software needs cmake >= 2.8.11 and a C++11 capable compiler 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] .
+$ 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
+Then compile and install the software with:
+$ make install
 
 You may also consider installing and using the software checkinstall for easier system administration.
 
+If you install Bio++ in a non standard path (not /usr/), and compile bppsuite with shared libraries,
+you must also tell programs where to find them at startup:
+-> either by adding the path to LD_LIBRARY_PATH environment variable.
+-> or by using RPATHs to hard code the path in the executable (generates NON PORTABLE executables !)
+  -> install Bio++ with the "-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE" option
diff --git a/bppSuite/CMakeLists.txt b/bppSuite/CMakeLists.txt
index af337cc..ca6cb7d 100644
--- a/bppSuite/CMakeLists.txt
+++ b/bppSuite/CMakeLists.txt
@@ -1,57 +1,25 @@
 # CMake script for Bio++ Program Suite
-# Author: Julien Dutheil
+# Authors:
+#   Julien Dutheil
+#   Francois Gindraud (2017)
 # Created: 22/08/2009
 
-ADD_EXECUTABLE(bppml bppML.cpp)
-TARGET_LINK_LIBRARIES(bppml ${LIBS})
-SET_TARGET_PROPERTIES(bppml PROPERTIES LINK_SEARCH_END_STATIC ${BUILD_STATIC})
-
-ADD_EXECUTABLE(bppseqgen bppSeqGen.cpp)
-TARGET_LINK_LIBRARIES(bppseqgen ${LIBS})
-SET_TARGET_PROPERTIES(bppseqgen PROPERTIES LINK_SEARCH_END_STATIC ${BUILD_STATIC})
-
-ADD_EXECUTABLE(bppdist bppDist.cpp)
-TARGET_LINK_LIBRARIES(bppdist ${LIBS})
-SET_TARGET_PROPERTIES(bppdist PROPERTIES LINK_SEARCH_END_STATIC ${BUILD_STATIC})
-
-ADD_EXECUTABLE(bpppars bppPars.cpp)
-TARGET_LINK_LIBRARIES(bpppars ${LIBS})
-SET_TARGET_PROPERTIES(bpppars PROPERTIES LINK_SEARCH_END_STATIC ${BUILD_STATIC})
-
-ADD_EXECUTABLE(bppseqman bppSeqMan.cpp)
-TARGET_LINK_LIBRARIES(bppseqman ${LIBS})
-SET_TARGET_PROPERTIES(bppseqman PROPERTIES LINK_SEARCH_END_STATIC ${BUILD_STATIC})
-
-ADD_EXECUTABLE(bppconsense bppConsense.cpp)
-TARGET_LINK_LIBRARIES(bppconsense ${LIBS})
-SET_TARGET_PROPERTIES(bppconsense PROPERTIES LINK_SEARCH_END_STATIC ${BUILD_STATIC})
-
-ADD_EXECUTABLE(bppancestor bppAncestor.cpp)
-TARGET_LINK_LIBRARIES(bppancestor ${LIBS})
-SET_TARGET_PROPERTIES(bppancestor PROPERTIES LINK_SEARCH_END_STATIC ${BUILD_STATIC})
-
-ADD_EXECUTABLE(bppmixedlikelihoods bppMixedLikelihoods.cpp)
-TARGET_LINK_LIBRARIES(bppmixedlikelihoods ${LIBS})
-SET_TARGET_PROPERTIES(bppmixedlikelihoods PROPERTIES LINK_SEARCH_END_STATIC ${BUILD_STATIC})
-
-ADD_EXECUTABLE(bppreroot bppReRoot.cpp)
-TARGET_LINK_LIBRARIES(bppreroot ${LIBS})
-SET_TARGET_PROPERTIES(bppreroot PROPERTIES LINK_SEARCH_END_STATIC ${BUILD_STATIC})
-
-ADD_EXECUTABLE(bppphysamp bppPhyloSampler.cpp)
-TARGET_LINK_LIBRARIES(bppphysamp ${LIBS})
-SET_TARGET_PROPERTIES(bppphysamp PROPERTIES LINK_SEARCH_END_STATIC ${BUILD_STATIC})
-
-ADD_EXECUTABLE(bpptreedraw bppTreeDraw.cpp)
-TARGET_LINK_LIBRARIES(bpptreedraw ${LIBS})
-SET_TARGET_PROPERTIES(bpptreedraw PROPERTIES LINK_SEARCH_END_STATIC ${BUILD_STATIC})
-
-ADD_EXECUTABLE(bppalnscore bppAlnScore.cpp)
-TARGET_LINK_LIBRARIES(bppalnscore ${LIBS})
-SET_TARGET_PROPERTIES(bppalnscore PROPERTIES LINK_SEARCH_END_STATIC ${BUILD_STATIC})
-
-# Install progs
-INSTALL(TARGETS
+# Executables of bppsuite.
+# Generation of targets from file name is not automated in case of executables not following the pattern.
+add_executable (bppml bppML.cpp)
+add_executable (bppseqgen bppSeqGen.cpp)
+add_executable (bppdist bppDist.cpp)
+add_executable (bpppars bppPars.cpp)
+add_executable (bppseqman bppSeqMan.cpp)
+add_executable (bppconsense bppConsense.cpp)
+add_executable (bppancestor bppAncestor.cpp)
+add_executable (bppmixedlikelihoods bppMixedLikelihoods.cpp)
+add_executable (bppreroot bppReRoot.cpp)
+add_executable (bpptreedraw bppTreeDraw.cpp)
+add_executable (bppalnscore bppAlnScore.cpp)
+add_executable (bpppopstats bppPopStats.cpp)
+
+set (bppsuite-targets
   bppml
   bppseqgen
   bppdist
@@ -61,7 +29,19 @@ INSTALL(TARGETS
   bppancestor
   bppmixedlikelihoods
   bppreroot
-  bppphysamp
   bpptreedraw
   bppalnscore
-  DESTINATION bin)
+  bpppopstats
+  )
+
+foreach (target ${bppsuite-targets})
+  # Link (static or shared)
+  if (BUILD_STATIC)
+    target_link_libraries (${target} ${BPP_LIBS_STATIC})
+    set_target_properties (${target} LINK_SEARCH_END_STATIC TRUE)
+  else (BUILD_STATIC)
+    target_link_libraries (${target} ${BPP_LIBS_SHARED})
+  endif (BUILD_STATIC)
+endforeach (target)
+
+install (TARGETS ${bppsuite-targets} DESTINATION ${CMAKE_INSTALL_BINDIR})
diff --git a/bppSuite/bppAlnScore.cpp b/bppSuite/bppAlnScore.cpp
index 956fcab..f340fb0 100644
--- a/bppSuite/bppAlnScore.cpp
+++ b/bppSuite/bppAlnScore.cpp
@@ -44,16 +44,18 @@
 
 using namespace std;
 
+#include <Bpp/Version.h>
 #include <Bpp/App/BppApplication.h>
 #include <Bpp/App/ApplicationTools.h>
 #include <Bpp/Text/TextTools.h>
+#include <Bpp/Numeric/Range.h>
 
-// From SeqLib:
+// From bpp-seq:
 #include <Bpp/Seq/SiteTools.h>
 #include <Bpp/Seq/Alphabet/Alphabet.h>
 #include <Bpp/Seq/App/SequenceApplicationTools.h>
-#include <Bpp/Seq/Io.all>
-#include <Bpp/Seq/Container.all>
+#include <Bpp/Seq/Io/Mase.h>
+#include <Bpp/Seq/Container/SiteContainerTools.h>
 #include <Bpp/Seq/SequenceTools.h>
 
 using namespace bpp;
@@ -71,8 +73,8 @@ void help()
 int main(int args, char** argv)
 {
   cout << "******************************************************************" << endl;
-  cout << "*              Bio++ Alignment Score, version 2.2.0              *" << endl;
-  cout << "* Author: J. Dutheil                        Last Modif. 25/09/14 *" << endl;
+  cout << "*              Bio++ Alignment Score, version " << BPP_VERSION << "              *" << endl;
+  cout << "* Author: J. Dutheil                        Last Modif. " << BPP_REL_DATE << " *" << endl;
   cout << "******************************************************************" << endl;
   cout << endl;
 
@@ -91,10 +93,10 @@ int main(int args, char** argv)
     Alphabet* alphabet = SequenceApplicationTools::getAlphabet(bppalnscore.getParams(), "", false, true, true);
 
     // Get the test alignment:
-    auto_ptr<SiteContainer> sitesTest(SequenceApplicationTools::getSiteContainer(alphabet, bppalnscore.getParams(), ".test", false, true));
+    unique_ptr<SiteContainer> sitesTest(SequenceApplicationTools::getSiteContainer(alphabet, bppalnscore.getParams(), ".test", false, true));
 
     // Get the reference alignment:
-    auto_ptr<SiteContainer> sitesRef(SequenceApplicationTools::getSiteContainer(alphabet, bppalnscore.getParams(), ".ref", false, true));
+    unique_ptr<SiteContainer> sitesRef(SequenceApplicationTools::getSiteContainer(alphabet, bppalnscore.getParams(), ".ref", false, true));
 
     // We check if the two alignments are compatible:
     vector<string> namesTest = sitesTest->getSequencesNames();
@@ -102,7 +104,7 @@ int main(int args, char** argv)
     if (namesTest != namesRef)
     {
       ApplicationTools::displayTask("Reorder sequences in ref. alignment", true);
-      auto_ptr<AlignedSequenceContainer> tmp(new AlignedSequenceContainer(sitesRef->getAlphabet()));
+      unique_ptr<AlignedSequenceContainer> tmp(new AlignedSequenceContainer(sitesRef->getAlphabet()));
       for (size_t i = 0; i < namesTest.size(); ++i)
       {
         ApplicationTools::displayGauge(i, namesTest.size() - 1);
@@ -116,7 +118,7 @@ int main(int args, char** argv)
         }
       }
       ApplicationTools::displayTaskDone();
-      sitesRef = tmp;
+      sitesRef = move(tmp);
     }
 
     // Build alignment indexes:
@@ -224,13 +226,29 @@ int main(int args, char** argv)
 
       MultiRange<size_t> csRanges;
       MultiRange<size_t> spsRanges;
+      size_t csBeg = 0, spsBeg = 0, csEnd = 0, spsEnd = 0;
+      size_t s = alphabet->getStateCodingSize();
       for (size_t i = 0; i < cs.size(); ++i)
       {
-        if (cs[i] == 1)
-          csRanges.addRange(Range<size_t>(i, i + 1));
-        if (sps[i] >= spsThreshold)
-          spsRanges.addRange(Range<size_t>(i, i + 1));
+        if (cs[i] == 1 && i > 0 && cs[i-1] != 1)
+          csBeg = i;
+        if (cs[i] != 1 && i > 0 && cs[i-1] == 1) {
+          csEnd = i;
+          csRanges.addRange(Range<size_t>(csBeg * s, csEnd * s));
+        }
+
+        if (sps[i] >= spsThreshold && i > 0 && sps[i-1] < spsThreshold)
+          spsBeg = i;
+        if (sps[i] < spsThreshold && i > 0 && sps[i-1] >= spsThreshold) {
+          spsEnd = i;
+          spsRanges.addRange(Range<size_t>(spsBeg * s, spsEnd * s));
+        }
       }
+      //Add the last range if any:
+      if (cs.back() == 1)
+        csRanges.addRange(Range<size_t>(csBeg * s, cs.size() * s));
+      if (sps.back() >= spsThreshold)
+        spsRanges.addRange(Range<size_t>(spsBeg * s, sps.size() * s));
 
       MaseHeader header;
       header.setSiteSelection("CS", csRanges);
diff --git a/bppSuite/bppAncestor.cpp b/bppSuite/bppAncestor.cpp
index 2c8019c..94f1e8f 100644
--- a/bppSuite/bppAncestor.cpp
+++ b/bppSuite/bppAncestor.cpp
@@ -44,6 +44,8 @@ knowledge of the CeCILL license and that you accept its terms.
 
 using namespace std;
 
+// From bpp-core:
+#include <Bpp/Version.h>
 #include <Bpp/App/BppApplication.h>
 #include <Bpp/App/ApplicationTools.h>
 #include <Bpp/Io/FileTools.h>
@@ -55,7 +57,7 @@ using namespace std;
 #include <Bpp/Numeric/VectorTools.h>
 #include <Bpp/Numeric/AutoParameter.h>
 
-// From SeqLib:
+// From bpp-seq:
 #include <Bpp/Seq/SiteTools.h>
 #include <Bpp/Seq/Alphabet/Alphabet.h>
 #include <Bpp/Seq/Container/VectorSiteContainer.h>
@@ -63,13 +65,19 @@ using namespace std;
 #include <Bpp/Seq/Container/SiteContainerTools.h>
 #include <Bpp/Seq/App/SequenceApplicationTools.h>
 
-// From PhylLib:
+// From bpp-phyl:
 #include <Bpp/Phyl/Tree.h>
-#include <Bpp/Phyl/Likelihood.all>
+#include <Bpp/Phyl/Likelihood/DRNonHomogeneousTreeLikelihood.h>
+#include <Bpp/Phyl/Likelihood/DRHomogeneousMixedTreeLikelihood.h>
+#include <Bpp/Phyl/Likelihood/RASTools.h>
+#include <Bpp/Phyl/Likelihood/MarginalAncestralStateReconstruction.h>
+#include <Bpp/Phyl/Likelihood/TreeLikelihoodTools.h>
+#include <Bpp/Phyl/Likelihood/DRTreeLikelihoodTools.h>
 #include <Bpp/Phyl/PatternTools.h>
 #include <Bpp/Phyl/App/PhylogeneticsApplicationTools.h>
 #include <Bpp/Phyl/OptimizationTools.h>
 #include <Bpp/Phyl/Model/MarkovModulatedSubstitutionModel.h>
+#include <Bpp/Phyl/Model/MixedSubstitutionModel.h>
 #include <Bpp/Phyl/Model/SubstitutionModelSet.h>
 #include <Bpp/Phyl/Model/SubstitutionModelSetTools.h>
 #include <Bpp/Phyl/Model/RateDistribution/ConstantRateDistribution.h>
@@ -92,9 +100,9 @@ void help()
 int main(int args, char ** argv)
 {
   cout << "******************************************************************" << endl;
-  cout << "*     Bio++ Ancestral Sequence Reconstruction, version 2.2.0     *" << endl;
+  cout << "*     Bio++ Ancestral Sequence Reconstruction, version " << BPP_VERSION << "     *" << endl;
   cout << "* Authors: J. Dutheil                       Created on: 10/09/08 *" << endl;
-  cout << "*          B. Boussau                       Last Modif: 25/09/14 *" << endl;
+  cout << "*          B. Boussau                       Last Modif: " << BPP_REL_DATE << " *" << endl;
   cout << "******************************************************************" << endl;
   cout << endl;
 
@@ -110,7 +118,7 @@ int main(int args, char ** argv)
   bppancestor.startTimer();
 
   Alphabet* alphabet = SequenceApplicationTools::getAlphabet(bppancestor.getParams(), "", false);
-  auto_ptr<GeneticCode> gCode;
+  unique_ptr<GeneticCode> gCode;
   CodonAlphabet* codonAlphabet = dynamic_cast<CodonAlphabet*>(alphabet);
   if (codonAlphabet) {
     string codeDesc = ApplicationTools::getStringParameter("genetic_code", bppancestor.getParams(), "Standard", "", true, true);
@@ -158,14 +166,14 @@ int main(int args, char ** argv)
   string nhOpt = ApplicationTools::getStringParameter("nonhomogeneous", bppancestor.getParams(), "no", "", true, false);
   ApplicationTools::displayResult("Heterogeneous model", nhOpt);
 
-  SubstitutionModel    *model    = 0;
+  TransitionModel    *model    = 0;
   SubstitutionModelSet *modelSet = 0;
   DiscreteDistribution *rDist    = 0;
   size_t nbStates;
 
   if (nhOpt == "no")
   {  
-    model = PhylogeneticsApplicationTools::getSubstitutionModel(alphabet, gCode.get(), sites, bppancestor.getParams());
+    model = PhylogeneticsApplicationTools::getTransitionModel(alphabet, gCode.get(), sites, bppancestor.getParams());
     if (model->getName() != "RE08") SiteContainerTools::changeGapsToUnknownCharacters(*sites);
     if (model->getNumberOfStates() > model->getAlphabet()->getSize())
     {
@@ -185,7 +193,7 @@ int main(int args, char ** argv)
   }
   else if (nhOpt == "one_per_branch")
   {
-    model = PhylogeneticsApplicationTools::getSubstitutionModel(alphabet, gCode.get(), sites, bppancestor.getParams());
+    model = PhylogeneticsApplicationTools::getTransitionModel(alphabet, gCode.get(), sites, bppancestor.getParams());
     if (model->getName() != "RE08") SiteContainerTools::changeGapsToUnknownCharacters(*sites);
     if (model->getNumberOfStates() > model->getAlphabet()->getSize())
     {
@@ -204,9 +212,12 @@ int main(int args, char ** argv)
       rateFreqs = vector<double>(n, 1./(double)n); // Equal rates assumed for now, may be changed later (actually, in the most general case,
                                                    // we should assume a rate distribution for the root also!!!  
     }
-    FrequenciesSet * rootFreqs = PhylogeneticsApplicationTools::getRootFrequenciesSet(alphabet, gCode.get(), sites, bppancestor.getParams(), rateFreqs);
+    
+    std::map<std::string, std::string> aliasFreqNames;
+    FrequenciesSet * rootFreqs = PhylogeneticsApplicationTools::getRootFrequenciesSet(alphabet, gCode.get(), sites, bppancestor.getParams(), aliasFreqNames, rateFreqs);
+    
     vector<string> globalParameters = ApplicationTools::getVectorParameter<string>("nonhomogeneous_one_per_branch.shared_parameters", bppancestor.getParams(), ',', "");
-    modelSet = SubstitutionModelSetTools::createNonHomogeneousModelSet(model, rootFreqs, tree, globalParameters); 
+    modelSet = SubstitutionModelSetTools::createNonHomogeneousModelSet(model, rootFreqs, tree, aliasFreqNames, globalParameters); 
     model = 0;
     if (dynamic_cast<MixedSubstitutionModelSet*>(modelSet))
       throw Exception("Non-homogeneous mixed substitution ancestor reconstruction not implemented, sorry!");
@@ -237,7 +248,7 @@ int main(int args, char ** argv)
   delete tree;
     
   double logL = tl->getValue();
-  if (isinf(logL))
+  if (std::isinf(logL))
   {
     // This may be due to null branch lengths, leading to null likelihood!
     ApplicationTools::displayWarning("!!! Warning!!! Likelihood is zero.");
@@ -251,7 +262,7 @@ int main(int args, char ** argv)
     tl->matchParametersValues(pl);
     logL = tl->getValue();
   }
-  if (isinf(logL))
+  if (std::isinf(logL))
   {
     ApplicationTools::displayError("!!! Unexpected likelihood == 0.");
     ApplicationTools::displayError("!!! Looking at each site:");
@@ -377,12 +388,12 @@ int main(int args, char ** argv)
         row[4] = TextTools::toString(classes[i]);
         row[5] = TextTools::toString(rates[i]);
 
-        unsigned int k = 6;
-        for (unsigned int j = 0; j < nbNodes; j++) {
+        size_t k = 6;
+        for (size_t j = 0; j < nbNodes; j++) {
           row[k] = sequences[j]->getChar(i);
           k++;
           if (probs) {
-            for (unsigned int l = 0; l < nbStates; l++) {
+            for (size_t l = 0; l < nbStates; l++) {
               row[k] = TextTools::toString((*probabilities[j])[i][l]);
               k++;
             }
diff --git a/bppSuite/bppConsense.cpp b/bppSuite/bppConsense.cpp
index 7a1c3c4..823a731 100644
--- a/bppSuite/bppConsense.cpp
+++ b/bppSuite/bppConsense.cpp
@@ -44,13 +44,15 @@ knowledge of the CeCILL license and that you accept its terms.
 
 using namespace std;
 
+// From bpp-core:
+#include <Bpp/Version.h>
 #include <Bpp/App/BppApplication.h>
 #include <Bpp/App/ApplicationTools.h>
 #include <Bpp/Io/FileTools.h>
 #include <Bpp/Text/TextTools.h>
 #include <Bpp/Text/KeyvalTools.h>
 
-// From PhylLib:
+// From bpp-phyl:
 #include <Bpp/Phyl/Tree.h>
 #include <Bpp/Phyl/Io/Newick.h>
 #include <Bpp/Phyl/App/PhylogeneticsApplicationTools.h>
@@ -70,9 +72,9 @@ void help()
 int main(int args, char ** argv)
 {
   cout << "******************************************************************" << endl;
-  cout << "*       Bio++ Consensus and Bootstrap Methods, version 2.2.0     *" << endl;
+  cout << "*       Bio++ Consensus and Bootstrap Methods, version " << BPP_VERSION << "     *" << endl;
   cout << "* Authors: J. Dutheil                       Created     06/06/07 *" << endl;
-  cout << "*          N. Galtier                       Last Modif. 25/09/14 *" << endl;
+  cout << "*          N. Galtier                       Last Modif. " << BPP_REL_DATE << " *" << endl;
   cout << "******************************************************************" << endl;
   cout << endl;
 
diff --git a/bppSuite/bppDist.cpp b/bppSuite/bppDist.cpp
index 626833f..079dd49 100644
--- a/bppSuite/bppDist.cpp
+++ b/bppSuite/bppDist.cpp
@@ -45,6 +45,8 @@ knowledge of the CeCILL license and that you accept its terms.
 
 using namespace std;
 
+// From bpp-core:
+#include <Bpp/Version.h>
 #include <Bpp/Numeric/Prob/DiscreteDistribution.h>
 #include <Bpp/Numeric/Prob/ConstantDistribution.h>
 #include <Bpp/App/BppApplication.h>
@@ -52,7 +54,7 @@ using namespace std;
 #include <Bpp/Io/FileTools.h>
 #include <Bpp/Text/TextTools.h>
 
-// From SeqLib:
+// From bpp-seq:
 #include <Bpp/Seq/Alphabet/Alphabet.h>
 #include <Bpp/Seq/Container/VectorSiteContainer.h>
 #include <Bpp/Seq/Container/SiteContainerTools.h>
@@ -61,12 +63,16 @@ using namespace std;
 #include <Bpp/Text/KeyvalTools.h>
 
 
-// From PhylLib:
+// From bpp-phyl:
 #include <Bpp/Phyl/Tree.h>
 #include <Bpp/Phyl/PatternTools.h>
 #include <Bpp/Phyl/App/PhylogeneticsApplicationTools.h>
-#include <Bpp/Phyl/Io.all>
-#include <Bpp/Phyl/Distance.all>
+#include <Bpp/Phyl/Io/Newick.h>
+#include <Bpp/Phyl/Io/IoDistanceMatrixFactory.h>
+#include <Bpp/Phyl/Distance/DistanceEstimation.h>
+#include <Bpp/Phyl/Distance/PGMA.h>
+#include <Bpp/Phyl/Distance/NeighborJoining.h>
+#include <Bpp/Phyl/Distance/BioNJ.h>
 #include <Bpp/Phyl/OptimizationTools.h>
 #include <Bpp/Phyl/Model/MarkovModulatedSubstitutionModel.h>
 #include <Bpp/Phyl/Model/RateDistribution/ConstantRateDistribution.h>
@@ -86,9 +92,9 @@ void help()
 int main(int args, char ** argv)
 {
   cout << "******************************************************************" << endl;
-  cout << "*              Bio++ Distance Methods, version 2.2.0             *" << endl;
+  cout << "*              Bio++ Distance Methods, version " << BPP_VERSION << "             *" << endl;
   cout << "* Author: J. Dutheil                        Created     05/05/07 *" << endl;
-  cout << "*                                           Last Modif. 25/09/14 *" << endl;
+  cout << "*                                           Last Modif. " << BPP_REL_DATE << " *" << endl;
   cout << "******************************************************************" << endl;
   cout << endl;
 
@@ -104,7 +110,7 @@ int main(int args, char ** argv)
   bppdist.startTimer();
 
   Alphabet* alphabet = SequenceApplicationTools::getAlphabet(bppdist.getParams(), "", false);
-  auto_ptr<GeneticCode> gCode;
+  unique_ptr<GeneticCode> gCode;
   CodonAlphabet* codonAlphabet = dynamic_cast<CodonAlphabet*>(alphabet);
   if (codonAlphabet) {
     string codeDesc = ApplicationTools::getStringParameter("genetic_code", bppdist.getParams(), "Standard", "", true, true);
@@ -121,7 +127,7 @@ int main(int args, char ** argv)
   ApplicationTools::displayResult("Number of sequences", TextTools::toString(sites->getNumberOfSequences()));
   ApplicationTools::displayResult("Number of sites", TextTools::toString(sites->getNumberOfSites()));
   
-  SubstitutionModel* model = PhylogeneticsApplicationTools::getSubstitutionModel(alphabet, gCode.get(), sites, bppdist.getParams());
+  TransitionModel* model = PhylogeneticsApplicationTools::getTransitionModel(alphabet, gCode.get(), sites, bppdist.getParams());
   
 	DiscreteDistribution* rDist = 0;
   if (model->getNumberOfStates() > model->getAlphabet()->getSize())
@@ -261,7 +267,7 @@ int main(int args, char ** argv)
     ODistanceMatrix* odm = IODistanceMatrixFactory().createWriter(IODistanceMatrixFactory::PHYLIP_FORMAT, extended);
     odm->write(*distEstimation.getMatrix(), matrixPath, true);
     delete odm;
-   }
+  }
   PhylogeneticsApplicationTools::writeTree(*tree, bppdist.getParams());
   
   //Output some parameters:
diff --git a/bppSuite/bppML.cpp b/bppSuite/bppML.cpp
index 8c6413d..7d4a1fd 100644
--- a/bppSuite/bppML.cpp
+++ b/bppSuite/bppML.cpp
@@ -45,6 +45,8 @@
 
 using namespace std;
 
+// From bpp-core:
+#include <Bpp/Version.h>
 #include <Bpp/Numeric/Prob/DiscreteDistribution.h>
 #include <Bpp/Numeric/Prob/ConstantDistribution.h>
 #include <Bpp/Numeric/DataTable.h>
@@ -66,11 +68,16 @@ using namespace std;
 
 // From bpp-phyl:
 #include <Bpp/Phyl/Tree.h>
-#include <Bpp/Phyl/Likelihood.all>
+#include <Bpp/Phyl/Likelihood/RHomogeneousMixedTreeLikelihood.h>
+#include <Bpp/Phyl/Likelihood/DRHomogeneousMixedTreeLikelihood.h>
+#include <Bpp/Phyl/Likelihood/RNonHomogeneousMixedTreeLikelihood.h>
+#include <Bpp/Phyl/Likelihood/DRNonHomogeneousTreeLikelihood.h>
+#include <Bpp/Phyl/Likelihood/RASTools.h>
 #include <Bpp/Phyl/PatternTools.h>
 #include <Bpp/Phyl/App/PhylogeneticsApplicationTools.h>
 #include <Bpp/Phyl/OptimizationTools.h>
-#include <Bpp/Phyl/Model.all>
+#include <Bpp/Phyl/Model/SubstitutionModelSetTools.h>
+#include <Bpp/Phyl/Model/MixedSubstitutionModel.h>
 #include <Bpp/Phyl/Model/Protein/CoalaCore.h>
 #include <Bpp/Phyl/Model/RateDistribution/ConstantRateDistribution.h>
 #include <Bpp/Phyl/Model/FrequenciesSet/MvaFrequenciesSet.h>
@@ -93,9 +100,9 @@ void help()
 int main(int args, char** argv)
 {
   cout << "******************************************************************" << endl;
-  cout << "*       Bio++ Maximum Likelihood Computation, version 1.6.0      *" << endl;
+  cout << "*       Bio++ Maximum Likelihood Computation, version " << BPP_VERSION << "      *" << endl;
   cout << "*                                                                *" << endl;
-  cout << "* Authors: J. Dutheil                       Last Modif. 29/01/13 *" << endl;
+  cout << "* Authors: J. Dutheil                       Last Modif. " << BPP_REL_DATE << " *" << endl;
   cout << "*          B. Boussau                                            *" << endl;
   cout << "*          L. Guéguen                                            *" << endl;
   cout << "*          M. Groussin                                           *" << endl;
@@ -114,7 +121,7 @@ int main(int args, char** argv)
     bppml.startTimer();
 
     Alphabet* alphabet = SequenceApplicationTools::getAlphabet(bppml.getParams(), "", false);
-    auto_ptr<GeneticCode> gCode;
+    unique_ptr<GeneticCode> gCode;
     CodonAlphabet* codonAlphabet = dynamic_cast<CodonAlphabet*>(alphabet);
     if (codonAlphabet) {
       string codeDesc = ApplicationTools::getStringParameter("genetic_code", bppml.getParams(), "Standard", "", true, true);
@@ -239,7 +246,7 @@ int main(int args, char** argv)
     bool optimizeTopo = ApplicationTools::getBooleanParameter("optimization.topology", bppml.getParams(), false, "", true, 1);
     unsigned int nbBS = ApplicationTools::getParameter<unsigned int>("bootstrap.number", bppml.getParams(), 0, "", true, 1);
 
-    SubstitutionModel*    model    = 0;
+    TransitionModel*    model    = 0;
     SubstitutionModelSet* modelSet = 0;
     DiscreteDistribution* rDist    = 0;
 
@@ -247,7 +254,7 @@ int main(int args, char** argv)
     {
       if (nhOpt != "no")
         throw Exception("Topology estimation with NH model not supported yet, sorry :(");
-      model = PhylogeneticsApplicationTools::getSubstitutionModel(alphabet, gCode.get(), sites, bppml.getParams());
+      model = PhylogeneticsApplicationTools::getTransitionModel(alphabet, gCode.get(), sites, bppml.getParams());
       if (model->getName() != "RE08") SiteContainerTools::changeGapsToUnknownCharacters(*sites);
       if (model->getNumberOfStates() >= 2 * model->getAlphabet()->getSize())
       {
@@ -265,7 +272,7 @@ int main(int args, char** argv)
     }
     else if (nhOpt == "no")
     {
-      model = PhylogeneticsApplicationTools::getSubstitutionModel(alphabet, gCode.get(), sites, bppml.getParams());
+      model = PhylogeneticsApplicationTools::getTransitionModel(alphabet, gCode.get(), sites, bppml.getParams());
       if (model->getName() != "RE08") SiteContainerTools::changeGapsToUnknownCharacters(*sites);
       if (model->getNumberOfStates() >= 2 * model->getAlphabet()->getSize())
       {
@@ -307,7 +314,7 @@ int main(int args, char** argv)
     }
     else if (nhOpt == "one_per_branch")
     {
-      model = PhylogeneticsApplicationTools::getSubstitutionModel(alphabet, gCode.get(), sites, bppml.getParams());
+      model = PhylogeneticsApplicationTools::getTransitionModel(alphabet, gCode.get(), sites, bppml.getParams());
       if (model->getName() != "RE08") SiteContainerTools::changeGapsToUnknownCharacters(*sites);
       if (model->getNumberOfStates() >= 2 * model->getAlphabet()->getSize())
       {
@@ -322,16 +329,18 @@ int main(int args, char** argv)
       if (model->getNumberOfStates() != alphabet->getSize())
       {
         // Markov-Modulated Markov Model...
-        unsigned int n = (unsigned int)(model->getNumberOfStates() / alphabet->getSize());
+        unsigned int n = static_cast<unsigned int>(model->getNumberOfStates() / alphabet->getSize());
         rateFreqs = vector<double>(n, 1. / static_cast<double>(n)); // Equal rates assumed for now, may be changed later (actually, in the most general case,
                                                        // we should assume a rate distribution for the root also!!!
       }
 
       bool stationarity = ApplicationTools::getBooleanParameter("nonhomogeneous.stationarity", bppml.getParams(), false, "", false, 1);
       FrequenciesSet* rootFreqs = 0;
+      std::map<std::string, std::string> aliasFreqNames;
       if (!stationarity)
       {
-        rootFreqs = PhylogeneticsApplicationTools::getRootFrequenciesSet(alphabet, gCode.get(), sites, bppml.getParams(), rateFreqs);
+        
+        rootFreqs = PhylogeneticsApplicationTools::getRootFrequenciesSet(alphabet, gCode.get(), sites, bppml.getParams(), aliasFreqNames, rateFreqs);
         stationarity = !rootFreqs;
         string freqDescription = ApplicationTools::getStringParameter("nonhomogeneous.root_freq", bppml.getParams(), "", "", true, 1);
         if (freqDescription == "MVAprotein")
@@ -348,9 +357,9 @@ int main(int args, char** argv)
       ApplicationTools::displayBooleanResult("Stationarity assumed", stationarity);
    
       vector<string> globalParameters = ApplicationTools::getVectorParameter<string>("nonhomogeneous_one_per_branch.shared_parameters", bppml.getParams(), ',', "");
-      for (unsigned int i = 0; i < globalParameters.size(); i++)
+      for (size_t i = 0; i < globalParameters.size(); i++)
         ApplicationTools::displayResult("Global parameter", globalParameters[i]);
-      modelSet = SubstitutionModelSetTools::createNonHomogeneousModelSet(model, rootFreqs, tree, globalParameters);
+      modelSet = SubstitutionModelSetTools::createNonHomogeneousModelSet(model, rootFreqs, tree, aliasFreqNames, globalParameters);
       model = 0;
 
       string recursion = ApplicationTools::getStringParameter("likelihood.recursion", bppml.getParams(), "simple", "", true, 1);
@@ -375,7 +384,9 @@ int main(int args, char** argv)
     else if (nhOpt == "general")
     {
       modelSet = PhylogeneticsApplicationTools::getSubstitutionModelSet(alphabet, gCode.get(), sites, bppml.getParams());
+
       if (modelSet->getModel(0)->getName() != "RE08") SiteContainerTools::changeGapsToUnknownCharacters(*sites);
+      
       if (modelSet->getNumberOfStates() >= 2 * modelSet->getAlphabet()->getSize())
       {
         // Markov-modulated Markov model!
@@ -415,7 +426,7 @@ int main(int args, char** argv)
       ApplicationTools::displayResult("List parameters to", paramNameFile);
       ofstream pnfile(paramNameFile.c_str(), ios::out);
       ParameterList pl = tl->getParameters();
-      for (unsigned int i = 0; i < pl.size(); ++i) {
+      for (size_t i = 0; i < pl.size(); ++i) {
         pnfile << pl[i].getName() << endl;
       }
       pnfile.close();
@@ -425,7 +436,7 @@ int main(int args, char** argv)
 
     //Check initial likelihood:
     double logL = tl->getValue();
-    if (isinf(logL))
+    if (std::isinf(logL))
     {
       // This may be due to null branch lengths, leading to null likelihood!
       ApplicationTools::displayWarning("!!! Warning!!! Initial likelihood is zero.");
@@ -440,7 +451,7 @@ int main(int args, char** argv)
       logL = tl->getValue();
     }
     ApplicationTools::displayResult("Initial log likelihood", TextTools::toString(-logL, 15));
-    if (isinf(logL))
+    if (std::isinf(logL))
     {
       ApplicationTools::displayError("!!! Unexpected initial likelihood == 0.");
       if (codonAlphabet)
@@ -448,7 +459,7 @@ int main(int args, char** argv)
         bool f = false;
         size_t s;
         for (size_t i = 0; i < sites->getNumberOfSites(); i++) {
-          if (isinf(tl->getLogLikelihoodForASite(i))) {
+          if (std::isinf(tl->getLogLikelihoodForASite(i))) {
             const Site& site = sites->getSite(i);
             s = site.size();
             for (size_t j = 0; j < s; j++) {
@@ -477,7 +488,7 @@ int main(int args, char** argv)
       } else {
         ApplicationTools::displayBooleanResult("Saturated site removal enabled", true);
         for (size_t i = sites->getNumberOfSites(); i > 0; --i) {
-          if (isinf(tl->getLogLikelihoodForASite(i - 1))) {
+          if (std::isinf(tl->getLogLikelihoodForASite(i - 1))) {
             ApplicationTools::displayResult("Ignore saturated site", sites->getSite(i - 1).getPosition());
             sites->deleteSite(i - 1);
           }
@@ -486,7 +497,7 @@ int main(int args, char** argv)
         tl->setData(*sites);
         tl->initialize();
         logL = tl->getValue();
-        if (isinf(logL)) {
+        if (std::isinf(logL)) {
           throw Exception("Likelihood is still 0 after saturated sites are removed! Looks like a bug...");
          }
         ApplicationTools::displayResult("Initial log likelihood", TextTools::toString(-logL, 15));
@@ -502,12 +513,12 @@ int main(int args, char** argv)
     // Write parameters to screen:
     ApplicationTools::displayResult("Log likelihood", TextTools::toString(-tl->getValue(), 15));
     ParameterList parameters = tl->getSubstitutionModelParameters();
-    for (unsigned int i = 0; i < parameters.size(); i++)
+    for (size_t i = 0; i < parameters.size(); i++)
     {
       ApplicationTools::displayResult(parameters[i].getName(), TextTools::toString(parameters[i].getValue()));
     }
     parameters = tl->getRateDistributionParameters();
-    for (unsigned int i = 0; i < parameters.size(); i++)
+    for (size_t i = 0; i < parameters.size(); i++)
     {
       ApplicationTools::displayResult(parameters[i].getName(), TextTools::toString(parameters[i].getValue()));
     }
@@ -517,6 +528,8 @@ int main(int args, char** argv)
 
     // Write parameters to file:
     string parametersFile = ApplicationTools::getAFilePath("output.estimates", bppml.getParams(), false, false, "none", 1);
+    bool withAlias = ApplicationTools::getBooleanParameter("output.estimates.alias", bppml.getParams(), true, "", true, 0);
+
     ApplicationTools::displayResult("Output estimates to file", parametersFile);
     if (parametersFile != "none")
     {
@@ -533,17 +546,17 @@ int main(int args, char** argv)
       if (modelSet)
       {
         modelSet->matchParametersValues(tl->getParameters());
-        PhylogeneticsApplicationTools::printParameters(modelSet, out);
+        PhylogeneticsApplicationTools::printParameters(modelSet, out, 1, withAlias);
       }
       else
       {
         model->matchParametersValues(tl->getParameters());
-        PhylogeneticsApplicationTools::printParameters(model, out);
+        PhylogeneticsApplicationTools::printParameters(model, out, 1, withAlias);
       }
       out.endLine();
       (out << "# Rate distribution parameters:").endLine();
       rDist->matchParametersValues(tl->getParameters());
-      PhylogeneticsApplicationTools::printParameters(rDist, out);
+      PhylogeneticsApplicationTools::printParameters(rDist, out, withAlias);
     }
 
     // Getting posterior rate class distribution:
diff --git a/bppSuite/bppMixedLikelihoods.cpp b/bppSuite/bppMixedLikelihoods.cpp
index 572d249..d08015a 100644
--- a/bppSuite/bppMixedLikelihoods.cpp
+++ b/bppSuite/bppMixedLikelihoods.cpp
@@ -44,6 +44,8 @@
 
 using namespace std;
 
+// From bpp-core:
+#include <Bpp/Version.h>
 #include <Bpp/App/BppApplication.h>
 #include <Bpp/App/ApplicationTools.h>
 #include <Bpp/Io/FileTools.h>
@@ -55,7 +57,7 @@ using namespace std;
 #include <Bpp/Numeric/VectorTools.h>
 #include <Bpp/Numeric/AutoParameter.h>
 
-// From SeqLib:
+// From bpp-seq:
 #include <Bpp/Seq/SiteTools.h>
 #include <Bpp/Seq/Alphabet/Alphabet.h>
 #include <Bpp/Seq/Container/VectorSiteContainer.h>
@@ -63,14 +65,19 @@ using namespace std;
 #include <Bpp/Seq/Container/SiteContainerTools.h>
 #include <Bpp/Seq/App/SequenceApplicationTools.h>
 
-// From PhylLib:
+// From bpp-phyl:
 #include <Bpp/Phyl/Tree.h>
-#include <Bpp/Phyl/Likelihood.all>
 #include <Bpp/Phyl/PatternTools.h>
 #include <Bpp/Phyl/App/PhylogeneticsApplicationTools.h>
 #include <Bpp/Phyl/OptimizationTools.h>
-#include <Bpp/Phyl/Model.all>
+#include <Bpp/Phyl/Model/SubstitutionModelSetTools.h>
+#include <Bpp/Phyl/Model/AbstractBiblioMixedSubstitutionModel.h>
+#include <Bpp/Phyl/Model/MixedSubstitutionModel.h>
+#include <Bpp/Phyl/Model/MixtureOfASubstitutionModel.h>
+#include <Bpp/Phyl/Model/MixtureOfSubstitutionModels.h>
 #include <Bpp/Phyl/Model/RateDistribution/ConstantRateDistribution.h>
+#include <Bpp/Phyl/Likelihood/RHomogeneousMixedTreeLikelihood.h>
+#include <Bpp/Phyl/Likelihood/RNonHomogeneousMixedTreeLikelihood.h>
 #include <Bpp/Phyl/Io/Newick.h>
 
 using namespace bpp;
@@ -91,8 +98,8 @@ int main(int args, char** argv)
 {
   cout << "******************************************************************" << endl;
   cout << "*     Bio++ Computation of site likelihoods inside mixed models  *" << endl;
-  cout << "*                        Version 2.2.0.                          *" << endl;
-  cout << "* Author: L. Guéguen                       Last Modif.: 25/09/14 *" << endl;
+  cout << "*                        Version " << BPP_VERSION << ".                          *" << endl;
+  cout << "* Author: L. Guéguen                       Last Modif.: " << BPP_REL_DATE << " *" << endl;
   cout << "******************************************************************" << endl;
   cout << endl;
 
@@ -108,7 +115,7 @@ int main(int args, char** argv)
     bppmixedlikelihoods.startTimer();
 
     Alphabet* alphabet = SequenceApplicationTools::getAlphabet(bppmixedlikelihoods.getParams(), "", false);
-    auto_ptr<GeneticCode> gCode;
+    unique_ptr<GeneticCode> gCode;
     CodonAlphabet* codonAlphabet = dynamic_cast<CodonAlphabet*>(alphabet);
     if (codonAlphabet) {
       string codeDesc = ApplicationTools::getStringParameter("genetic_code", bppmixedlikelihoods.getParams(), "Standard", "", true, true);
@@ -188,9 +195,12 @@ int main(int args, char** argv)
         rateFreqs = vector<double>(n, 1. / (double)n); // Equal rates assumed for now, may be changed later (actually, in the most general case,
         // we should assume a rate distribution for the root also!!!
       }
-      FrequenciesSet* rootFreqs = PhylogeneticsApplicationTools::getRootFrequenciesSet(alphabet, gCode.get(), sites, bppmixedlikelihoods.getParams(), rateFreqs);
+      
+      std::map<std::string, std::string> aliasFreqNames;
+
+      FrequenciesSet* rootFreqs = PhylogeneticsApplicationTools::getRootFrequenciesSet(alphabet, gCode.get(), sites, bppmixedlikelihoods.getParams(), aliasFreqNames, rateFreqs);
       vector<string> globalParameters = ApplicationTools::getVectorParameter<string>("nonhomogeneous_one_per_branch.shared_parameters", bppmixedlikelihoods.getParams(), ',', "");
-      modelSet = dynamic_cast<MixedSubstitutionModelSet*>(SubstitutionModelSetTools::createNonHomogeneousModelSet(model, rootFreqs, tree, globalParameters));
+      modelSet = dynamic_cast<MixedSubstitutionModelSet*>(SubstitutionModelSetTools::createNonHomogeneousModelSet(model, rootFreqs, tree, aliasFreqNames, globalParameters));
       model = 0;
       tl = new RNonHomogeneousMixedTreeLikelihood(*tree, *sites, modelSet, rDist, true);
     }
@@ -217,10 +227,11 @@ int main(int args, char** argv)
     }
     else
       throw Exception("Unknown option for nonhomogeneous: " + nhOpt);
+
     tl->initialize();
 
     double logL = tl->getValue();
-    if (isinf(logL))
+    if (std::isinf(logL))
     {
       // This may be due to null branch lengths, leading to null likelihood!
       ApplicationTools::displayWarning("!!! Warning!!! Likelihood is zero.");
@@ -235,7 +246,7 @@ int main(int args, char** argv)
       tl->matchParametersValues(pl);
       logL = tl->getValue();
     }
-    if (isinf(logL))
+    if (std::isinf(logL))
     {
       ApplicationTools::displayError("!!! Unexpected likelihood == 0.");
       ApplicationTools::displayError("!!! Looking at each site:");
@@ -290,24 +301,23 @@ int main(int args, char** argv)
       exit(-1);
     }
 
-    bool fromBiblio=false;
-    
     const AbstractBiblioMixedSubstitutionModel* ptmp = dynamic_cast<const AbstractBiblioMixedSubstitutionModel*>(p0);
     if (ptmp) {
       p0 = ptmp->getMixedModel().clone();
+
       if (nhOpt == "no")
         model = p0;
       else {
         modelSet->replaceModel(nummodel-1, p0);
         modelSet->isFullySetUpFor(*tree);
       }
-      fromBiblio=true;
     }
-
+    
     //////////////////////////////////////////////////
     // Case of a MixtureOfSubstitutionModels
 
     MixtureOfSubstitutionModels* pMSM = dynamic_cast<MixtureOfSubstitutionModels*>(p0);
+
     if (pMSM)
     {
       vector<string> colNames;
@@ -373,18 +383,25 @@ int main(int args, char** argv)
       if (pMSM2 != NULL)
       {
         size_t nummod = pMSM2->getNumberOfModels();
-        if (fromBiblio && (parname == ""))
+        if (parname == "")
         {
           ParameterList pl=pMSM2->getParameters();
 
           for (size_t i2 = 0; i2 < pl.size(); i2++)
           {
             string pl2n = pl[i2].getName();
-            string par2 = pl2n.substr(0,pl2n.find("_")) + "_1";
-            Vint vnmod = pMSM2->getSubmodelNumbers(par2);
-            if (vnmod.size() == 1) {
-              parname=pl2n.substr(0,pl2n.find("_"));
-              break;
+
+            if (dynamic_cast<const ConstantDistribution*>(pMSM2->getDistribution(pl2n))==NULL)
+            {
+              parname=pl2n;
+
+              while (parname.size()>0 && pMSM2->getDistribution(parname)==NULL)
+                parname=pl2n.substr(0,pl2n.rfind("_"));
+
+              if (parname.size()>0){
+                ApplicationTools::displayResult("likelihoods.parameter_name", parname);
+                break;
+              }
             }
           }
         }
@@ -408,7 +425,9 @@ int main(int args, char** argv)
         }
 
         size_t nbcl = vvnmod.size();
-
+        if (nbcl==0)
+          throw Exception("Parameter " + parname + " is not mixed.");
+        
         Vdouble vprob = pMSM2->getProbabilities();
 
         vector<vector<double> > vvprob;
@@ -430,14 +449,14 @@ int main(int args, char** argv)
         colNames.push_back("Sites");
 
         Vdouble dval;
-        for (unsigned int i = 0; i < nbcl; i++)
+        for (size_t i = 0; i < nbcl; i++)
         {
           SubstitutionModel* pSM = pMSM2->getNModel(static_cast<size_t>(vvnmod[i][0]));
           double valPar = pSM->getParameterValue(pSM->getParameterNameWithoutNamespace(parname));
           dval.push_back(valPar);
           colNames.push_back("Ll_" + parname + "=" + TextTools::toString(valPar));
         }
-        for (unsigned int i = 0; i < nbcl; i++)
+        for (size_t i = 0; i < nbcl; i++)
           colNames.push_back("Pr_" + parname + "=" + TextTools::toString(dval[i]));
 
         colNames.push_back("mean");
@@ -445,7 +464,7 @@ int main(int args, char** argv)
         DataTable* rates = new DataTable(nSites, colNames.size());
         rates->setColumnNames(colNames);
 
-        for (unsigned int i = 0; i < nSites; i++)
+        for (size_t i = 0; i < nSites; i++)
         {
           const Site* currentSite = &sites->getSite(i);
           int currentSitePosition = currentSite->getPosition();
@@ -491,14 +510,14 @@ int main(int args, char** argv)
           ApplicationTools::displayResult("Probability", TextTools::toString(vsprob[i], 15));
         }
 
-        for (unsigned int j = 0; j < nSites; j++)
+        for (size_t j = 0; j < nSites; j++)
         {
           Vdouble vd;
-          for (unsigned int i = 0; i < nbcl; i++)
+          for (size_t i = 0; i < nbcl; i++)
             vd.push_back(std::log(vsprob[i])+vvd[i][j]);
           
           VectorTools::logNorm(vd);
-          for (unsigned int i = 0; i < nbcl; i++)
+          for (size_t i = 0; i < nbcl; i++)
             (*rates)(j,nbcl + i + 1) = TextTools::toString(std::exp(vd[i]));
           (*rates)(j, 2 * nbcl + 1) = TextTools::toString(VectorTools::sumExp(vd, dval));
         }
diff --git a/bppSuite/bppPars.cpp b/bppSuite/bppPars.cpp
index 29621f0..7e26a9f 100644
--- a/bppSuite/bppPars.cpp
+++ b/bppSuite/bppPars.cpp
@@ -45,23 +45,24 @@ knowledge of the CeCILL license and that you accept its terms.
 
 using namespace std;
 
+// From bpp-core:
+#include <Bpp/Version.h>
 #include <Bpp/App/BppApplication.h>
 #include <Bpp/App/ApplicationTools.h>
 #include <Bpp/Io/FileTools.h>
 #include <Bpp/Text/TextTools.h>
 
-// From SeqLib:
+// From bpp-seq:
 #include <Bpp/Seq/Alphabet/Alphabet.h>
 #include <Bpp/Seq/Container/VectorSiteContainer.h>
 #include <Bpp/Seq/Container/SiteContainerTools.h>
 #include <Bpp/Seq/SiteTools.h>
 #include <Bpp/Seq/App/SequenceApplicationTools.h>
 
-// From PhylLib:
+// From bpp-phyl:
 #include <Bpp/Phyl/Tree.h>
 #include <Bpp/Phyl/PatternTools.h>
 #include <Bpp/Phyl/App/PhylogeneticsApplicationTools.h>
-#include <Bpp/Phyl/Parsimony.all>
 #include <Bpp/Phyl/OptimizationTools.h>
 #include <Bpp/Phyl/Io/Newick.h>
 
@@ -80,9 +81,9 @@ void help()
 int main(int args, char ** argv)
 {
   cout << "******************************************************************" << endl;
-  cout << "*             Bio++ Parsimony Methods, version 2.2.0             *" << endl;
+  cout << "*             Bio++ Parsimony Methods, version " << BPP_VERSION << "             *" << endl;
   cout << "* Author: J. Dutheil                        Created     05/05/07 *" << endl;
-  cout << "*                                           Last Modif. 25/09/14 *" << endl;
+  cout << "*                                           Last Modif. " << BPP_REL_DATE << " *" << endl;
   cout << "******************************************************************" << endl;
   cout << endl;
 
diff --git a/bppSuite/bppPhyloSampler.cpp b/bppSuite/bppPhyloSampler.cpp
deleted file mode 100755
index d31085d..0000000
--- a/bppSuite/bppPhyloSampler.cpp
+++ /dev/null
@@ -1,282 +0,0 @@
-//
-// File: PhyloSample.cpp
-// Created by: Julien Dutheil
-// Created on: Sunday, December 2nd 2007 16:48
-//
-
-/*
-Copyright or © or Copr. Bio++ Development Team
-
-This software is a computer program whose purpose is to estimate
-phylogenies and evolutionary parameters from a dataset according to
-the maximum likelihood principle.
-
-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.
-*/
-
-// From the STL:
-#include <iostream>
-#include <iomanip>
-
-using namespace std;
-
-#include <Bpp/App/BppApplication.h>
-#include <Bpp/App/ApplicationTools.h>
-#include <Bpp/Io/FileTools.h>
-#include <Bpp/Text/TextTools.h>
-#include <Bpp/Numeric/DataTable.h>
-#include <Bpp/Numeric/Random/RandomTools.h>
-
-// From bpp-seq:
-#include <Bpp/Seq/Alphabet.all>
-#include <Bpp/Seq/Container.all>
-#include <Bpp/Seq/Io.all>
-#include <Bpp/Seq/SiteTools.h>
-#include <Bpp/Seq/SequenceTools.h>
-#include <Bpp/Seq/App/SequenceApplicationTools.h>
-
-// From bpp-phyl:
-#include <Bpp/Phyl/Tree.h>
-#include <Bpp/Phyl/App/PhylogeneticsApplicationTools.h>
-#include <Bpp/Phyl/Io/PhylipDistanceMatrixFormat.h>
-
-using namespace bpp;
-
-void help()
-{
-  (*ApplicationTools::message << "__________________________________________________________________________").endLine();
-  (*ApplicationTools::message << "bppphysamp parameter1_name=parameter1_value").endLine();
-  (*ApplicationTools::message << "      parameter2_name=parameter2_value ... param=option_file").endLine();
-  (*ApplicationTools::message).endLine();
-  (*ApplicationTools::message << "  Refer to the Bio++ Program Suite Manual for a list of available options.").endLine();
-  (*ApplicationTools::message << "__________________________________________________________________________").endLine();
-}
-
-class Index {
-  public:
-    double distance;
-    unsigned int i1, i2;
-
-  public:
-    Index(double dist, unsigned int i, unsigned int j) : distance(dist), i1(i), i2(j) {}
-
-  public:
-    bool operator==(const Index& index) const { return distance == index.distance; }
-    bool operator<(const Index& index) const { return distance < index.distance; }
-};
-
-class Test {
-  private:
-    unsigned int pos_;
-
-  public:
-    Test(unsigned int pos) : pos_(pos) {}
-    
-  public:
-    bool operator()(const Index& index) { return index.i1 == pos_ || index.i2 == pos_; }
-};
-
-int main(int args, char ** argv)
-{
-  cout << "******************************************************************" << endl;
-  cout << "*           Bio++ Phylogenetic Sampler, version 2.2.0.           *" << endl;
-  cout << "* Author: J. Dutheil                        Last Modif. 25/09/14 *" << endl;
-  cout << "******************************************************************" << endl;
-  cout << endl;
-  
-  if(args == 1)
-  {
-    help();
-    return 0;
-  }
-  
-  try {
-
-  BppApplication bppphysamp(args, argv, "BppPhySamp");
-  bppphysamp.startTimer();
-
-  //Get sequences:
-  Alphabet* alphabet      = SequenceApplicationTools::getAlphabet(bppphysamp.getParams());
-  SequenceContainer* seqs = SequenceApplicationTools::getSequenceContainer(alphabet, bppphysamp.getParams());
-
-  string inputMethod = ApplicationTools::getStringParameter("input.method", bppphysamp.getParams(), "tree");
-  ApplicationTools::displayResult("Input method", inputMethod);
-
-  auto_ptr< DistanceMatrix > dist;
-  auto_ptr< TreeTemplate<Node> > tree;
-  if(inputMethod == "tree")
-  {
-    tree.reset(dynamic_cast<TreeTemplate<Node> *>(PhylogeneticsApplicationTools::getTree(bppphysamp.getParams())));
-    dist.reset(TreeTemplateTools::getDistanceMatrix(*tree));
-  }
-  else if(inputMethod == "matrix")
-  {
-    string distPath = ApplicationTools::getAFilePath("input.matrix", bppphysamp.getParams(), true, true);
-    PhylipDistanceMatrixFormat matIO;
-    dist.reset(matIO.read(distPath));
-  }
-  else throw Exception("Unknown input method: " + inputMethod);
-
-  string deleteMeth = ApplicationTools::getStringParameter("deletion_method", bppphysamp.getParams(), "threshold");
-  ApplicationTools::displayResult("Deletion method", deleteMeth);
-
-  string critMeth = ApplicationTools::getStringParameter("choice_criterion", bppphysamp.getParams(), "length");
-  ApplicationTools::displayResult("Sequence choice criterion", critMeth);
-
-  //Compute lengths:
-  vector<string> seqNames;
-  vector<size_t> seqLen(dist->size());
-  string name;
-  for(size_t i = 0; i < dist->size(); i++)
-  {
-    name = dist->getName(i);
-    if (critMeth == "length.complete")
-      seqLen[i] = SequenceTools::getNumberOfCompleteSites(seqs->getSequence(name));
-    else
-      seqLen[i] = SequenceTools::getNumberOfSites(seqs->getSequence(name));
-    seqNames.push_back(name);
-  }
-
-  //Sort matrix entries:
-  vector<Index> distances;
-  for (unsigned int i = 0; i < dist->size()-1; i++)
-    for (unsigned int j = i+1; j < dist->size(); j++)
-      distances.push_back(Index((*dist)(i, j), i , j));
-  sort(distances.begin(), distances.end());
-
-  if (deleteMeth == "random")
-  {
-    unsigned int sampleSize = ApplicationTools::getParameter<unsigned int>("sample_size", bppphysamp.getParams(), 10);
-    ApplicationTools::displayResult("Sample size", sampleSize);
-    vector<string> sample(sampleSize);
-    RandomTools::getSample(seqNames, sample, false);
-    seqNames = sample;
-    
-    double mini = -log(0.);
-    for (unsigned int i =  0; i < seqNames.size() - 1; ++i)
-      for (unsigned int j = i + 1; j < seqNames.size(); ++j)
-      {
-        double d = (*dist)(seqNames[i], seqNames[j]);
-        if (d < mini) mini = d;
-      }
-    ApplicationTools::displayResult("Minimal distance in final data set:", mini);
-  }
-  else if (deleteMeth == "threshold")
-  {
-    double threshold = ApplicationTools::getDoubleParameter("threshold", bppphysamp.getParams(), 0.01);
-    ApplicationTools::displayResult("Distance threshold", threshold);
-
-    unsigned int rm = 0;
-    while (distances[0].distance <= threshold)
-    {
-      //We need to chose between the two sequences:
-      if (critMeth == "length" || critMeth == "length.complete")
-      {
-        if (seqLen[distances[0].i1] > seqLen[distances[0].i2]) rm = distances[0].i2;
-        else rm = distances[0].i1;
-      }
-      else if (critMeth == "random")
-      {
-        if (RandomTools::flipCoin()) rm = distances[0].i2;
-        else rm = distances[0].i1;
-      }
-      else throw Exception("Unknown criterion: " + critMeth);
-
-      //Remove sequence in list:
-      size_t pos = VectorTools::which(seqNames, dist->getName(rm));
-      ApplicationTools::displayResult("Remove sequence", seqNames[pos]);
-      seqNames.erase(seqNames.begin() + static_cast<ptrdiff_t>(pos)); 
-        
-      //Ignore all distances from this sequence:
-      remove_if(distances.begin(), distances.end(), Test(rm));
-      if (distances.size() == 0)
-        throw Exception("Error, all sequences have been removed with this criterion!");
-    }
-    ApplicationTools::displayResult("Number of sequences kept:", seqNames.size());
-  }
-  else if (deleteMeth == "sample")
-  {
-    unsigned int sampleSize = ApplicationTools::getParameter<unsigned int>("sample_size", bppphysamp.getParams(), 10);
-    ApplicationTools::displayResult("Sample size", sampleSize);
-    
-    unsigned int rm = 0;
-    while (seqNames.size() > sampleSize)
-    {
-      //We need to chose between the two sequences:
-      if (critMeth == "length" || critMeth == "length.complete")
-      {
-        if (seqLen[distances[0].i1] > seqLen[distances[0].i2]) rm = distances[0].i2;
-        else rm = distances[0].i1;
-      }
-      else if (critMeth == "random")
-      {
-        if (RandomTools::flipCoin()) rm = distances[0].i2;
-        else rm = distances[0].i1;
-      }
-      else throw Exception("Unknown criterion: " + critMeth);
-
-      //Remove sequence in list:
-      size_t pos = VectorTools::which(seqNames, dist->getName(rm));
-      ApplicationTools::displayResult("Remove sequence", seqNames[pos]);
-      seqNames.erase(seqNames.begin() + static_cast<ptrdiff_t>(pos)); 
-        
-      //Ignore all distances from this sequence:
-      remove_if(distances.begin(), distances.end(), Test(rm));
-    }
-    ApplicationTools::displayResult("Minimal distance in final data set:", distances[0].distance);
-  }
-  else throw Exception("Unknown deletion method: " + deleteMeth + ".");
-
-  //Write sequences to file:
-  AlignedSequenceContainer asc(alphabet);
-  for (size_t i = 0; i < seqNames.size(); i++)
-    asc.addSequence(seqs->getSequence(seqNames[i]));
-   
-  SequenceApplicationTools::writeAlignmentFile(asc, bppphysamp.getParams());
-
-  //Write tree file:
-  if (ApplicationTools::getStringParameter("output.tree.file", bppphysamp.getParams(), "None") != "None") {
-    for (size_t i = 0; i < seqNames.size(); ++i) {
-      TreeTemplateTools::dropLeaf(*tree, seqNames[i]);
-    }
-    PhylogeneticsApplicationTools::writeTree(*tree, bppphysamp.getParams(), "output.", "", true, true, false);
-  }
-
-  bppphysamp.done();
-  }
-  catch (exception& e)
-  {
-    cout << endl;
-    cout << "_____________________________________________________" << endl;
-    cout << "ERROR!!!" << endl;
-    cout << e.what() << endl;
-    return 1;
-  }
-
-  return 0;
-}
-
diff --git a/bppSuite/bppPopStats.cpp b/bppSuite/bppPopStats.cpp
new file mode 100644
index 0000000..b0e2589
--- /dev/null
+++ b/bppSuite/bppPopStats.cpp
@@ -0,0 +1,421 @@
+//
+// File: bppPopStats.cpp
+// Created by: Julien Dutheil
+// Created on: Jun Wed 24 12:04 2015
+//
+
+/*
+   Copyright or � or Copr. Bio++ Development Team
+
+   This software is a computer program whose purpose is to simulate sequence
+   data according to a phylogenetic tree and an evolutionary model.
+
+   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.
+ */
+
+// From the STL:
+#include <iostream>
+#include <fstream>
+#include <iomanip>
+#include <memory>
+
+using namespace std;
+
+// From bpp-core:
+#include <Bpp/Version.h>
+#include <Bpp/App/BppApplication.h>
+#include <Bpp/App/ApplicationTools.h>
+#include <Bpp/Text/TextTools.h>
+#include <Bpp/Text/KeyvalTools.h>
+
+// From bpp-seq:
+#include <Bpp/Seq/SiteTools.h>
+#include <Bpp/Seq/CodonSiteTools.h>
+#include <Bpp/Seq/Alphabet/Alphabet.h>
+#include <Bpp/Seq/App/SequenceApplicationTools.h>
+
+// From bpp-popgen
+#include <Bpp/PopGen/PolymorphismSequenceContainer.h>
+#include <Bpp/PopGen/PolymorphismSequenceContainerTools.h>
+#include <Bpp/PopGen/SequenceStatistics.h>
+
+using namespace bpp;
+
+void help()
+{
+  (*ApplicationTools::message << "__________________________________________________________________________").endLine();
+  (*ApplicationTools::message << "bpppopstats parameter1_name=parameter1_value").endLine();
+  (*ApplicationTools::message << "      parameter2_name=parameter2_value ... param=option_file").endLine();
+  (*ApplicationTools::message).endLine();
+  (*ApplicationTools::message << "  Refer to the Bio++ Program Suite Manual for a list of available options.").endLine();
+  (*ApplicationTools::message << "__________________________________________________________________________").endLine();
+}
+
+int main(int args, char** argv)
+{
+  cout << "******************************************************************" << endl;
+  cout << "*              Bio++ Population Statistics, version " << BPP_VERSION << "        *" << endl;
+  cout << "* Author: J. Dutheil                        Last Modif. " << BPP_REL_DATE << " *" << endl;
+  cout << "******************************************************************" << endl;
+  cout << endl;
+
+  if (args == 1)
+  {
+    help();
+    return 0;
+  }
+
+  BppApplication bpppopstats(args, argv, "BppPopStats");
+  bpppopstats.startTimer();
+
+  string logFile = ApplicationTools::getAFilePath("logfile", bpppopstats.getParams(), false, false);
+  unique_ptr<ofstream> cLog;
+  if (logFile != "none")
+    cLog.reset(new ofstream(logFile.c_str(), ios::out));
+
+  //This counts instances of each tool, in case one is used several times, for instance with different options:
+  map<string, unsigned int> toolCounter;
+
+  try
+  {
+    // Get alphabet
+    Alphabet* alphabet = SequenceApplicationTools::getAlphabet(bpppopstats.getParams(), "", false, true, true);
+
+    // Get the genetic code, if codon alphabet
+    unique_ptr<GeneticCode> gCode;
+    CodonAlphabet* codonAlphabet = dynamic_cast<CodonAlphabet*>(alphabet);
+    if (codonAlphabet) {
+      string codeDesc = ApplicationTools::getStringParameter("genetic_code", bpppopstats.getParams(), "Standard", "", true, true);
+      ApplicationTools::displayResult("Genetic Code", codeDesc);
+      gCode.reset(SequenceApplicationTools::getGeneticCode(codonAlphabet->getNucleicAlphabet(), codeDesc));
+    }
+
+    unique_ptr<PolymorphismSequenceContainer> psc;
+    if (ApplicationTools::parameterExists("input.sequence.file.ingroup", bpppopstats.getParams())) {
+      // Get the ingroup alignment:
+      unique_ptr<SiteContainer> sitesIn(SequenceApplicationTools::getSiteContainer(alphabet, bpppopstats.getParams(), ".ingroup", false, true));
+      psc.reset(new PolymorphismSequenceContainer(*sitesIn));
+      if (ApplicationTools::parameterExists("input.sequence.file.outgroup", bpppopstats.getParams())) {
+        // Get the outgroup alignment:
+        unique_ptr<SiteContainer> sitesOut(SequenceApplicationTools::getSiteContainer(alphabet, bpppopstats.getParams(), ".outgroup", false, true));
+        SequenceContainerTools::append(*psc, *sitesOut);
+        for (size_t i = sitesIn->getNumberOfSequences(); i < psc->getNumberOfSequences(); ++i) {
+          psc->setAsOutgroupMember(i);
+        }
+      }
+    } else {
+      //Everything in one file
+      unique_ptr<SiteContainer> sites(SequenceApplicationTools::getSiteContainer(alphabet, bpppopstats.getParams(), "", false, true));
+      psc.reset(new PolymorphismSequenceContainer(*sites));
+      if (ApplicationTools::parameterExists("input.sequence.outgroup.index", bpppopstats.getParams())) {
+        vector<size_t> outgroups = ApplicationTools::getVectorParameter<size_t>("input.sequence.outgroup.index", bpppopstats.getParams(), ',', "");
+        for (auto g : outgroups) {
+          psc->setAsOutgroupMember(g-1);
+        }
+      }
+      if (ApplicationTools::parameterExists("input.sequence.outgroup.name", bpppopstats.getParams())) {
+        vector<string> outgroups = ApplicationTools::getVectorParameter<string>("input.sequence.outgroup.name", bpppopstats.getParams(), ',', "");
+        for (auto g : outgroups) {
+          psc->setAsOutgroupMember(g);
+        }
+      }
+    }
+
+    // Take care of stop codons:
+    string stopCodonOpt = ApplicationTools::getStringParameter("input.sequence.stop_codons_policy", bpppopstats.getParams(), "Keep", "", true, true);
+    ApplicationTools::displayResult("Stop codons policy", stopCodonOpt);
+
+    if (stopCodonOpt == "Keep") {
+      //do nothing
+    } else if (stopCodonOpt == "RemoveIfLast") {
+      if (CodonSiteTools::hasStop(psc->getSite(psc->getNumberOfSites() - 1), *gCode)) {
+        psc->deleteSite(psc->getNumberOfSites() - 1);
+        ApplicationTools::displayMessage("Info: last site contained a stop codon and was discarded.");
+        if (logFile != "none")
+          *cLog << "# Info: last site contained a stop codon and was discarded." << endl;
+      }
+    } else if (stopCodonOpt == "RemoveAll") {
+      size_t l1 = psc->getNumberOfSites();
+      SiteContainerTools::removeStopCodonSites(*psc, *gCode);
+      size_t l2 = psc->getNumberOfSites();
+      if (l2 != l1) {
+        ApplicationTools::displayMessage("Info: discarded " + TextTools::toString(l1 - l2) + " sites with stop codons.");
+        if (logFile != "none")
+          *cLog << "# Info: discarded " << (l1 - l2) << " sites with stop codons." << endl;
+      }
+    } else {
+      throw Exception("Unrecognized option for input.sequence.stop_codons_policy: " + stopCodonOpt);
+    }
+
+    shared_ptr<PolymorphismSequenceContainer> pscIn;
+    shared_ptr<PolymorphismSequenceContainer> pscOut;
+
+    if (psc->hasOutgroup()) {
+      pscIn.reset(PolymorphismSequenceContainerTools::extractIngroup(*psc));
+      pscOut.reset(PolymorphismSequenceContainerTools::extractOutgroup(*psc));
+    } else {
+      pscIn = std::move(psc);
+    }
+    ApplicationTools::displayResult("Number of sequences in ingroup", pscIn->getNumberOfSequences());
+    ApplicationTools::displayResult("Number of sequences in outgroup", pscOut.get() ? pscOut->getNumberOfSequences() : 0);
+    
+    // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+    
+    // Compute statistics
+    vector<string> actions = ApplicationTools::getVectorParameter<string>("pop.stats", bpppopstats.getParams(), ',', "", "", false, 1);
+
+    for (size_t a = 0; a < actions.size(); a++)
+    {
+      string cmdName;
+      map<string, string> cmdArgs;
+      KeyvalTools::parseProcedure(actions[a], cmdName, cmdArgs);
+      toolCounter[cmdName]++;
+
+      // +-------------------+
+      // | Frequencies       |
+      // +-------------------+
+      if (cmdName == "SiteFrequencies")
+      {
+        unsigned int s = SequenceStatistics::numberOfPolymorphicSites(*pscIn);
+        ApplicationTools::displayResult("Number of segregating sites:", s);
+        unsigned int nsg = SequenceStatistics::numberOfSingletons(*pscIn);
+        ApplicationTools::displayResult("Number of singletons:", nsg);
+        //Print to logfile:
+        if (logFile != "none") {
+          *cLog << "# Site frequencies" << endl;
+          *cLog << "NbSegSites" << (toolCounter[cmdName] > 1 ? TextTools::toString(toolCounter[cmdName]) : "") << " = " << s << endl;
+          *cLog << "NbSingl" << (toolCounter[cmdName] > 1 ? TextTools::toString(toolCounter[cmdName]) : "") << " = " << nsg << endl;
+        }
+      }
+
+      // +-------------------+
+      // | Watterson's theta |
+      // +-------------------+
+      else if (cmdName == "Watterson75")
+      {
+        double thetaW75 = SequenceStatistics::watterson75(*pscIn, true, true, true);
+        ApplicationTools::displayResult("Watterson's (1975) theta:", thetaW75);
+        //Print to logfile:
+        if (logFile != "none") {
+          *cLog << "# Watterson's (1975) theta" << endl;
+          *cLog << "thetaW75" << (toolCounter[cmdName] > 1 ? TextTools::toString(toolCounter[cmdName]) : "") << " = " << thetaW75 << endl;
+        }
+      }
+
+      // +-------------+
+      // | Tajima's pi |
+      // +-------------+
+      else if (cmdName == "Tajima83")
+      {
+        double piT83 = SequenceStatistics::tajima83(*pscIn, true, true, true);
+        ApplicationTools::displayResult("Tajima's (1983) pi:", piT83);
+        //Print to logfile:
+        if (logFile != "none") {
+          *cLog << "# Tajima's (1983) pi" << endl;
+          *cLog << "piT83" << (toolCounter[cmdName] > 1 ? TextTools::toString(toolCounter[cmdName]) : "") << " = " << piT83 << endl;
+        }
+      }
+
+      // +------------+
+      // | Tajima's D |
+      // +------------+
+      else if (cmdName == "TajimaD")
+      {
+        string positions = ApplicationTools::getStringParameter("positions", cmdArgs, "all", "", false, 1);
+        shared_ptr<PolymorphismSequenceContainer> pscTmp;
+        if ((positions == "synonymous" || positions == "non-synonymous") && !codonAlphabet)
+          throw Exception("Error: synonymous and non-synonymous positions can only be defined with a codon alphabet.");
+        if (positions == "synonymous") {
+          pscTmp.reset(PolymorphismSequenceContainerTools::getSynonymousSites(*pscIn, *gCode));
+        } else if (positions == "non-synonymous") {
+          pscTmp.reset(PolymorphismSequenceContainerTools::getNonSynonymousSites(*pscIn, *gCode));
+        } else if (positions == "all") {
+          pscTmp = pscIn;
+        } else throw Exception("Unrecognized option for argument 'positions': " + positions);
+
+        if (SequenceStatistics::numberOfPolymorphicSites(*pscTmp) > 0) {
+          double tajimaD = SequenceStatistics::tajimaDss(*pscTmp, true, true);
+          ApplicationTools::displayResult("Tajima's (1989) D:", tajimaD);
+          //Print to logfile:
+          if (logFile != "none") {
+            *cLog << "# Tajima's (1989) D (" << positions << " sites)" << endl;
+            *cLog << "tajD" << (toolCounter[cmdName] > 1 ? TextTools::toString(toolCounter[cmdName]) : "") << " = " << tajimaD << endl;
+          }
+        } else {
+          ApplicationTools::displayResult<string>("Tajima's (1989) D:", "NA (0 polymorphic sites)");
+          if (logFile != "none") {
+            *cLog << "# Tajima's (1989) D (" << positions << " sites)" << endl;
+            *cLog << "tajD" << (toolCounter[cmdName] > 1 ? TextTools::toString(toolCounter[cmdName]) : "") << " = NA" << endl;
+          }
+          
+        }
+      }
+
+      // +-----------+
+      // | FuAndLiD* |
+      // +-----------+
+      else if (cmdName == "FuAndLiDStar")
+      {
+        bool useTotMut = ApplicationTools::getBooleanParameter("tot_mut", cmdArgs, true, "", false, 1);
+        double flDstar = SequenceStatistics::fuLiDStar(*pscIn, !useTotMut);
+        ApplicationTools::displayResult("Fu and Li's (1993) D*:", flDstar);
+        ApplicationTools::displayResult("  computed using", (useTotMut ? "total number of mutations" : "number of segregating sites"));
+        //Print to logfile:
+        if (logFile != "none") {
+          *cLog << "# Fu and Li's (1993) D*" << endl;
+          if (useTotMut)
+            *cLog << "fuLiDstarTotMut" << (toolCounter[cmdName] > 1 ? TextTools::toString(toolCounter[cmdName]) : "") << " = " << flDstar << endl;
+          else
+            *cLog << "fuLiDstarSegSit" << (toolCounter[cmdName] > 1 ? TextTools::toString(toolCounter[cmdName]) : "") << " = " << flDstar << endl;
+        }
+      }
+
+      // +-----------+
+      // | FuAndLiF* |
+      // +-----------+
+      else if (cmdName == "FuAndLiFStar")
+      {
+        bool useTotMut = ApplicationTools::getBooleanParameter("tot_mut", cmdArgs, true, "", false, 1);
+        double flFstar = SequenceStatistics::fuLiFStar(*pscIn, !useTotMut);
+        ApplicationTools::displayResult("Fu and Li (1993)'s F*:", flFstar);
+        ApplicationTools::displayResult("  computed using", (useTotMut ? "total number of mutations" : "number of segregating sites"));
+        //Print to logfile:
+        if (logFile != "none") {
+          *cLog << "# Fu and Li's (1993) F*" << endl;
+          if (useTotMut)
+            *cLog << "fuLiFstarTotMut" << (toolCounter[cmdName] > 1 ? TextTools::toString(toolCounter[cmdName]) : "") << " = " << flFstar << endl;
+          else
+            *cLog << "fuLiFstarSegSit" << (toolCounter[cmdName] > 1 ? TextTools::toString(toolCounter[cmdName]) : "") << " = " << flFstar << endl;
+        }
+      }
+
+      // +-----------+
+      // | PiN / PiS |
+      // +-----------+
+      else if (cmdName == "PiN_PiS")
+      {
+        if (!codonAlphabet) {
+          throw Exception("PiN_PiS can only be used with a codon alignment. Check the input alphabet!");
+        }
+        double piS = SequenceStatistics::piSynonymous(*pscIn, *gCode);
+        double piN = SequenceStatistics::piNonSynonymous(*pscIn, *gCode);
+        double nbS = SequenceStatistics::meanNumberOfSynonymousSites(*pscIn, *gCode);
+        double nbN = SequenceStatistics::meanNumberOfNonSynonymousSites(*pscIn, *gCode);
+        double r = (piN / nbN) / (piS / nbS);
+        ApplicationTools::displayResult("PiN:", piN);
+        ApplicationTools::displayResult("PiS:", piS);
+        ApplicationTools::displayResult("#N:", nbN);
+        ApplicationTools::displayResult("#S:", nbS);
+        ApplicationTools::displayResult("PiN / PiS (corrected for #N and #S):", r);
+        if (logFile != "none") {
+          *cLog << "# PiN and PiS" << endl;
+          *cLog << "PiN" << (toolCounter[cmdName] > 1 ? TextTools::toString(toolCounter[cmdName]) : "") << " = " << piN << endl;
+          *cLog << "PiS" << (toolCounter[cmdName] > 1 ? TextTools::toString(toolCounter[cmdName]) : "") << " = " << piS << endl;
+          *cLog << "NbN" << (toolCounter[cmdName] > 1 ? TextTools::toString(toolCounter[cmdName]) : "") << " = " << nbN << endl;
+          *cLog << "NbS" << (toolCounter[cmdName] > 1 ? TextTools::toString(toolCounter[cmdName]) : "") << " = " << nbS << endl;
+        }
+      }
+
+      // +---------+
+      // | MK test |
+      // +---------+
+      else if (cmdName == "MKT")
+      {
+        if (!codonAlphabet) {
+          throw Exception("MacDonald-Kreitman test can only be performed on a codon alignment. Check the input alphabet!");
+        }
+        if (!pscOut.get()) {
+          throw Exception("MacDonald-Kreitman test requires at least one outgroup sequence.");
+        }
+        vector<unsigned int> mktable = SequenceStatistics::mkTable(*pscIn, *pscOut, *gCode);
+        ApplicationTools::displayResult("MK table, Pa:", mktable[0]);
+        ApplicationTools::displayResult("MK table, Ps:", mktable[1]);
+        ApplicationTools::displayResult("MK table, Da:", mktable[2]);
+        ApplicationTools::displayResult("MK table, Ds:", mktable[3]);
+        if (logFile != "none") {
+          *cLog << "# MK table" << endl;
+          *cLog << "# Pa Ps Da Ds" << endl;
+          *cLog << "MKtable" << (toolCounter[cmdName] > 1 ? TextTools::toString(toolCounter[cmdName]) : "") << " = " << mktable[0] << " " << mktable[1] << " " << mktable[2] << " " << mktable[3] << endl;
+        }
+      }
+
+      // +-----------------------+
+      // | Codon site statistics |
+      // +-----------------------+
+      else if (cmdName == "CodonSiteStatistics")
+      {
+        if (!codonAlphabet) {
+          throw Exception("CodonSiteStatstics can only be used with a codon alignment. Check the input alphabet!");
+        }
+        string path = ApplicationTools::getAFilePath("output.file", cmdArgs, true, false);
+        if (path == "none") throw Exception("You must specify an ouptut file for CodonSiteStatistics"); 
+        ApplicationTools::displayResult("Site statistics output to:", path);
+        ofstream out(path.c_str(), ios::out);
+        out << "Site\tIsComplete\tNbAlleles\tMinorAlleleFrequency\tMajorAlleleFrequency\tMinorAllele\tMajorAllele";
+        bool outgroup = (psc->hasOutgroup() && pscOut->getNumberOfSequences() == 1);
+        if (outgroup) {
+          out << "\tOutgroupAllele";
+        }
+        out << "\tMeanNumberSynPos\tIsSynPoly\tIs4Degenerated\tPiN\tPiS" << endl;
+        unique_ptr<SiteContainer> sites(pscIn->toSiteContainer());
+        for (size_t i = 0; i < sites->getNumberOfSites(); ++i) {
+          const Site& site = sites->getSite(i);
+          out << site.getPosition() << "\t";
+          out << SiteTools::isComplete(site) << "\t";
+          out << SiteTools::getNumberOfDistinctCharacters(site) << "\t";
+          out << SiteTools::getMinorAlleleFrequency(site) << "\t";
+          out << SiteTools::getMajorAlleleFrequency(site) << "\t";
+          out << alphabet->intToChar(SiteTools::getMinorAllele(site)) << "\t";
+          out << alphabet->intToChar(SiteTools::getMajorAllele(site)) << "\t";
+          if (outgroup) {
+           out << pscOut->getSequence(0).getChar(i) << "\t"; 
+          }
+          out << CodonSiteTools::meanNumberOfSynonymousPositions(site, *gCode) << "\t";
+          out << CodonSiteTools::isSynonymousPolymorphic(site, *gCode) << "\t";
+          out << CodonSiteTools::isFourFoldDegenerated(site, *gCode) << "\t";
+          out << CodonSiteTools::piNonSynonymous(site, *gCode) << "\t";
+          out << CodonSiteTools::piSynonymous(site, *gCode) << endl;
+        }
+      }
+      
+      else throw Exception("Unknown operation " + cmdName + ".");
+    }
+ 
+    // We're done!
+    bpppopstats.done();
+  }
+  catch (exception& e)
+  {
+    if (logFile != "none")
+      *cLog << "# Error: " << e.what() << endl;
+    cout << e.what() << endl;
+    return 1;
+  }
+
+  return 0;
+}
+
diff --git a/bppSuite/bppReRoot.cpp b/bppSuite/bppReRoot.cpp
index 5d1cdb3..58f20b4 100644
--- a/bppSuite/bppReRoot.cpp
+++ b/bppSuite/bppReRoot.cpp
@@ -43,6 +43,8 @@ knowledge of the CeCILL license and that you accept its terms.
 
 using namespace std;
 
+// From bpp-core:
+#include <Bpp/Version.h>
 #include <Bpp/Numeric/VectorTools.h>
 #include <Bpp/Io/FileTools.h>
 #include <Bpp/Text/TextTools.h>
@@ -50,8 +52,8 @@ using namespace std;
 #include <Bpp/App/BppApplication.h>
 #include <Bpp/App/ApplicationTools.h>
 
-// From PhylLib:
-#include <Bpp/Phyl/Io.all>
+// From bpp-phyl:
+#include <Bpp/Phyl/Io/Newick.h>
 #include <Bpp/Phyl/Tree.h>
 #include <Bpp/Phyl/Node.h>
 #include <Bpp/Phyl/TreeExceptions.h>
@@ -78,9 +80,9 @@ int main(int args, char ** argv)
 {
   
   cout << "******************************************************************" << endl;
-  cout << "*                  Bio++ ReRoot, version 2.2.0                   *" << endl;
+  cout << "*                  Bio++ ReRoot, version " << BPP_VERSION << "                   *" << endl;
   cout << "* Author: C. Scornavacca                    Created     15/01/08 *" << endl;
-  cout << "*                                           Last Modif. 25/09/14 *" << endl;
+  cout << "*                                           Last Modif. " << BPP_REL_DATE << " *" << endl;
   cout << "******************************************************************" << endl;
   cout << endl;
 
diff --git a/bppSuite/bppSeqGen.cpp b/bppSuite/bppSeqGen.cpp
index 8a888d8..cbf8dd4 100644
--- a/bppSuite/bppSeqGen.cpp
+++ b/bppSuite/bppSeqGen.cpp
@@ -5,22 +5,22 @@
 //
 
 /*
-Copyright or � or Copr. Bio++ Development Team
+Copyright or � or Copr. Bio++ Development Team
 
 This software is a computer program whose purpose is to simulate sequence
 data according to a phylogenetic tree and an evolutionary model.
 
 This software is governed by the CeCILL  license under French law and
-abiding by the rules of distribution of free software.  You can  use, 
+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". 
+"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. 
+liability.
 
 In this respect, the user's attention is drawn to the risks associated
 with loading,  using,  modifying and/or developing or reproducing the
@@ -29,9 +29,9 @@ 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. 
+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.
@@ -45,6 +45,7 @@ knowledge of the CeCILL license and that you accept its terms.
 using namespace std;
 
 // From bpp-core:
+#include <Bpp/Version.h>
 #include <Bpp/App/BppApplication.h>
 #include <Bpp/App/ApplicationTools.h>
 #include <Bpp/Io/FileTools.h>
@@ -66,7 +67,8 @@ using namespace std;
 // From bpp-phyl:
 #include <Bpp/Phyl/TreeTemplate.h>
 #include <Bpp/Phyl/App/PhylogeneticsApplicationTools.h>
-#include <Bpp/Phyl/Simulation.all>
+#include <Bpp/Phyl/Simulation/NonHomogeneousSequenceSimulator.h>
+#include <Bpp/Phyl/Simulation/SequenceSimulationTools.h>
 #include <Bpp/Phyl/Model/SubstitutionModelSetTools.h>
 #include <Bpp/Phyl/Model/RateDistribution/ConstantRateDistribution.h>
 #include <Bpp/Phyl/Model/FrequenciesSet/MvaFrequenciesSet.h>
@@ -75,9 +77,61 @@ using namespace std;
 using namespace bpp;
 
 /**
- * @brief Read trees from an input file, with segment annotations.
+ * @brief Read trees from an input file, with segment annotations. Hudson's MS format.
  */
-void readTrees(ifstream& file, vector<Tree*>& trees, vector<double>& pos) throw (Exception)
+void readTreesMs(ifstream& file, vector<Tree*>& trees, vector<double>& pos, unsigned int totPos) throw (Exception)
+{
+  string line = "";
+  unsigned int segsize;
+  unsigned int previous = 0;
+  string::size_type index;
+  pos.push_back(0);
+  string newickStr;
+  bool start = false;
+  while (!file.eof() && !start)
+  {
+    line = TextTools::removeSurroundingWhiteSpaces(FileTools::getNextLine(file));
+    start = (line == "//");
+  }
+  
+  ApplicationTools::displayTask("Reading tress for each partition");
+  while (!file.eof())
+  {
+    line = TextTools::removeSurroundingWhiteSpaces(FileTools::getNextLine(file));
+    ApplicationTools::displayGauge(previous, totPos, '=');
+    if (line.size() == 0 || (line.substr(0, 1) != "[" && line.substr(0, 1) != "(" )) continue;
+
+    if (line.substr(0, 1) == "(") {
+      //This is a single tree, no recombination event
+      TreeTemplate<Node>* t = TreeTemplateTools::parenthesisToTree(line, true, TreeTools::BOOTSTRAP, false, false);
+      trees.push_back(t);
+      pos.push_back(1);
+      return;
+    }
+
+    index = line.find("]");
+    if (index == string::npos) throw Exception("Error when parsing tree file: no valid position.");
+    segsize = TextTools::to<unsigned int>(line.substr(1, index - 1));
+    newickStr = line.substr(index + 1);
+    TreeTemplate<Node>* t = TreeTemplateTools::parenthesisToTree(newickStr, true, TreeTools::BOOTSTRAP, false, false);
+    if (trees.size() > 0)
+    {
+      //Check leave names:
+      if (!VectorTools::haveSameElements(t->getLeavesNames(), trees[trees.size()-1]->getLeavesNames()))
+        throw Exception("Error: all trees must have the same leaf names.");
+    }
+    trees.push_back(t);
+    previous += segsize;
+    pos.push_back(static_cast<double>(previous) / static_cast<double>(totPos)); //Convert to relative positions
+  }
+  ApplicationTools::displayGauge(totPos, totPos, '=');
+  ApplicationTools::displayTaskDone();
+}
+
+/**
+ * @brief Read trees from an input file, with segment annotations. Mailund's CoaSim format.
+ */
+void readTreesCoaSim(ifstream& file, vector<Tree*>& trees, vector<double>& pos) throw (Exception)
 {
   string line = "";
   double begin, end;
@@ -90,11 +144,11 @@ void readTrees(ifstream& file, vector<Tree*>& trees, vector<double>& pos) throw
     string tmp = TextTools::removeSurroundingWhiteSpaces(FileTools::getNextLine(file));
     if (tmp.size() == 0 || tmp.substr(0, 1) == "#") continue;
     line += tmp;
-        
+
     index1 = line.find_first_of(" \t");
-    if (index1 == string::npos) throw Exception("Error when parsing tree file: now begining position.");
+    if (index1 == string::npos) throw Exception("Error when parsing tree file: no begining position.");
     index2 = line.find_first_of(" \t", index1 + 1);
-    if (index2 == string::npos) throw Exception("Error when parsing tree file: now ending position.");
+    if (index2 == string::npos) throw Exception("Error when parsing tree file: no ending position.");
     begin  = TextTools::toDouble(line.substr(0, index1));
     end    = TextTools::toDouble(line.substr(index1 + 1, index2 - index1 - 1));
     index3 = line.find_first_of(";", index2 + 1);
@@ -105,7 +159,7 @@ void readTrees(ifstream& file, vector<Tree*>& trees, vector<double>& pos) throw
       index3 = line.find_first_of(";", index3);
     }
     newickStr = line.substr(index2 + 1, index3 - index2);
-    TreeTemplate<Node>* t = TreeTemplateTools::parenthesisToTree(newickStr);
+    TreeTemplate<Node>* t = TreeTemplateTools::parenthesisToTree(newickStr, true, TreeTools::BOOTSTRAP, false, false);
     if (trees.size() > 0)
     {
       //Check leave names:
@@ -134,33 +188,33 @@ void help()
 int main(int args, char ** argv)
 {
   cout << "******************************************************************" << endl;
-  cout << "*            Bio++ Sequence Generator, version 2.2.0             *" << endl;
+  cout << "*            Bio++ Sequence Generator, version " << BPP_VERSION << "             *" << endl;
   cout << "*                                                                *" << endl;
   cout << "* Authors: J. Dutheil                                            *" << endl;
-  cout << "*          B. Boussau                       Last Modif. 25/09/14 *" << endl;
+  cout << "*          B. Boussau                       Last Modif. " << BPP_REL_DATE << " *" << endl;
   cout << "*          L. Gueguen                                            *" << endl;
   cout << "*          M. Groussin                                           *" << endl;
   cout << "******************************************************************" << endl;
   cout << endl;
-  
+
   if(args == 1)
   {
     help();
     return 0;
   }
-  
+
   try {
 
   BppApplication bppseqgen(args, argv, "BppSeqGen");
   bppseqgen.startTimer();
 
   Alphabet* alphabet = SequenceApplicationTools::getAlphabet(bppseqgen.getParams(), "", false);
-  auto_ptr<GeneticCode> gCode;
+  unique_ptr<GeneticCode> gCode;
   CodonAlphabet* codonAlphabet = dynamic_cast<CodonAlphabet*>(alphabet);
   if (codonAlphabet) {
     string codeDesc = ApplicationTools::getStringParameter("genetic_code", bppseqgen.getParams(), "Standard", "", true, true);
     ApplicationTools::displayResult("Genetic Code", codeDesc);
-      
+
     gCode.reset(SequenceApplicationTools::getGeneticCode(codonAlphabet->getNucleicAlphabet(), codeDesc));
   }
 
@@ -169,11 +223,14 @@ int main(int args, char ** argv)
   /* Trees                  */
   /**************************/
 
-  
+
   vector<Tree*> trees;
   vector<double> positions;
   string inputTrees = ApplicationTools::getStringParameter("input.tree.method", bppseqgen.getParams(), "single", "", true, false);
-  if (inputTrees == "single")
+  string itName;
+  map<string, string> itArgs;
+  KeyvalTools::parseProcedure(inputTrees, itName, itArgs);
+  if (itName == "single")
   {
     trees.push_back(PhylogeneticsApplicationTools::getTree(bppseqgen.getParams()));
     positions.push_back(0);
@@ -200,21 +257,43 @@ int main(int args, char ** argv)
       exit(0);
     }
   }
-  else if (inputTrees == "multiple")
+  else if (itName == "multiple")
+  {
+    throw Exception("'multiple' option deprecated, use 'coasim' instead.");
+  }
+  else if (itName == "CoaSim")
+  {
+    string treesPath = ApplicationTools::getAFilePath("input.tree.file", bppseqgen.getParams(), false, true);
+    ApplicationTools::displayResult("Trees file", treesPath);
+    ifstream treesFile(treesPath.c_str(), ios::in);
+    readTreesCoaSim(treesFile, trees, positions);
+  }
+  else if (itName == "MS")
   {
     string treesPath = ApplicationTools::getAFilePath("input.tree.file", bppseqgen.getParams(), false, true);
+    unsigned int totPos = ApplicationTools::getParameter<unsigned int>("number_of_sites", itArgs, 100);
+    ApplicationTools::displayResult("Total # sites in ARG", totPos); 
     ApplicationTools::displayResult("Trees file", treesPath);
     ifstream treesFile(treesPath.c_str(), ios::in);
-    readTrees(treesFile, trees, positions);
+    readTreesMs(treesFile, trees, positions, totPos);
   }
   else throw Exception("Unknown input.tree.method option: " + inputTrees);
 
+  // Scaling of trees:
+  double scale = ApplicationTools::getDoubleParameter("input.tree.scale", bppseqgen.getParams(), 1, "", false, false);
+
+  if (scale != 1) {
+    ApplicationTools::displayResult("Trees are scaled by", scale);
+    for (Tree* tree : trees) {
+      tree -> scaleTree(scale);
+    }
+  }
 
   /**********************************/
   /*  Models                        */
   /**********************************/
 
-  
+
   string nhOpt = ApplicationTools::getStringParameter("nonhomogeneous", bppseqgen.getParams(), "no", "", true, false);
   ApplicationTools::displayResult("Heterogeneous model", nhOpt);
 
@@ -223,25 +302,25 @@ int main(int args, char ** argv)
   //Homogeneous case:
   if (nhOpt == "no")
   {
-    SubstitutionModel* model = PhylogeneticsApplicationTools::getSubstitutionModel(alphabet, gCode.get(), 0, bppseqgen.getParams());
+    TransitionModel* model = PhylogeneticsApplicationTools::getTransitionModel(alphabet, gCode.get(), 0, bppseqgen.getParams());
     FrequenciesSet* fSet = new FixedFrequenciesSet(model->getStateMap().clone(), model->getFrequencies());
     modelSet = SubstitutionModelSetTools::createHomogeneousModelSet(model, fSet, trees[0]);
   }
   //Galtier-Gouy case:
   else if (nhOpt == "one_per_branch")
   {
-    if(inputTrees == "multiple")
+    if(itName == "MS" || itName == "CoaSim")
       throw Exception("Multiple input trees cannot be used with non-homogeneous simulations.");
-    SubstitutionModel* model = 0;
+    TransitionModel* model = 0;
     string modelName = ApplicationTools::getStringParameter("model", bppseqgen.getParams(), "");
     if (!TextTools::hasSubstring(modelName,"COaLA"))
-      model = PhylogeneticsApplicationTools::getSubstitutionModel(alphabet, gCode.get(), 0, bppseqgen.getParams());
+      model = PhylogeneticsApplicationTools::getTransitionModel(alphabet, gCode.get(), 0, bppseqgen.getParams());
     else
     {
       //COaLA model
       VectorSiteContainer* allSitesAln = 0;
       allSitesAln = SequenceApplicationTools::getSiteContainer(alphabet, bppseqgen.getParams());
-      model = PhylogeneticsApplicationTools::getSubstitutionModel(alphabet, gCode.get(), allSitesAln, bppseqgen.getParams());
+      model = PhylogeneticsApplicationTools::getTransitionModel(alphabet, gCode.get(), allSitesAln, bppseqgen.getParams());
     }
 
     vector<string> globalParameters = ApplicationTools::getVectorParameter<string>("nonhomogeneous_one_per_branch.shared_parameters", bppseqgen.getParams(), ',', "");
@@ -251,21 +330,22 @@ int main(int args, char ** argv)
       //Markov-Modulated Markov Model...
       unsigned int n = static_cast<unsigned int>(model->getNumberOfStates() / alphabet->getSize());
       rateFreqs = vector<double>(n, 1./static_cast<double>(n)); // Equal rates assumed for now, may be changed later (actually, in the most general case,
-                                                   // we should assume a rate distribution for the root also!!!  
+                                                   // we should assume a rate distribution for the root also!!!
     }
-    FrequenciesSet* rootFreqs = PhylogeneticsApplicationTools::getRootFrequenciesSet(alphabet, gCode.get(), 0, bppseqgen.getParams(), rateFreqs);
+    std::map<std::string, std::string> aliasFreqNames;
+    FrequenciesSet* rootFreqs = PhylogeneticsApplicationTools::getRootFrequenciesSet(alphabet, gCode.get(), 0, bppseqgen.getParams(), aliasFreqNames, rateFreqs);
     string freqDescription = ApplicationTools::getStringParameter("nonhomogeneous.root_freq", bppseqgen.getParams(), "Full(init=observed)");
     if (freqDescription.substr(0,10) == "MVAprotein")
     {
-      dynamic_cast<MvaFrequenciesSet*>(rootFreqs)->setModelName("MVAprotein");   
-      dynamic_cast<MvaFrequenciesSet*>(rootFreqs)->initSet(dynamic_cast<CoalaCore*>(model));      
+      dynamic_cast<MvaFrequenciesSet*>(rootFreqs)->setModelName("MVAprotein");
+      dynamic_cast<MvaFrequenciesSet*>(rootFreqs)->initSet(dynamic_cast<CoalaCore*>(model));
     }
-    modelSet = SubstitutionModelSetTools::createNonHomogeneousModelSet(model, rootFreqs, trees[0], globalParameters); 
+    modelSet = SubstitutionModelSetTools::createNonHomogeneousModelSet(model, rootFreqs, trees[0], aliasFreqNames, globalParameters);
   }
   //General case:
   else if (nhOpt == "general")
   {
-    if (inputTrees == "multiple")
+    if (itName == "MS" || itName == "CoaSim")
       throw Exception("Multiple input trees cannot be used with non-homogeneous simulations.");
     string modelName = ApplicationTools::getStringParameter("model1",bppseqgen.getParams(),"");
     if (!TextTools::hasSubstring(modelName,"COaLA"))
@@ -276,7 +356,7 @@ int main(int args, char ** argv)
       VectorSiteContainer* allSitesAln = 0;
       allSitesAln = SequenceApplicationTools::getSiteContainer(alphabet, bppseqgen.getParams());
       modelSet = PhylogeneticsApplicationTools::getSubstitutionModelSet(alphabet, gCode.get(), allSitesAln, bppseqgen.getParams());
-    } 
+    }
   }
   else throw Exception("Unknown non-homogeneous option: " + nhOpt);
 
@@ -292,13 +372,16 @@ int main(int args, char ** argv)
   SiteContainer* sites = 0;
   size_t nbSites = 0;
 
+  bool outputInternalSequences = ApplicationTools::getBooleanParameter("output.internal.sequences", bppseqgen.getParams(), false, "", true, 1);
+
+
   string infosFile = ApplicationTools::getAFilePath("input.infos", bppseqgen.getParams(), false, true);
 
   bool withStates = false;
   bool withRates = false;
   vector<size_t> states;
   vector<double> rates;
-  
+
   if (infosFile != "none")
   {
     ApplicationTools::displayResult("Site information", infosFile);
@@ -310,7 +393,7 @@ int main(int args, char ** argv)
     string stateCol = ApplicationTools::getStringParameter("input.infos.states", bppseqgen.getParams(), "none", "", true, true);
     withRates = rateCol != "none";
     withStates = stateCol != "none";
-  
+
     if (withRates)
     {
       rDist = new ConstantRateDistribution();
@@ -363,11 +446,11 @@ int main(int args, char ** argv)
             vector<size_t> vPos;
             for (size_t p = 0; p < nbSites; ++p)
               vPos.push_back(p);
-          
+
             RandomTools::getSample(vPos, vSite, replace);
           }
         }
-        
+
         nbSites = vSite.size();
 
         vector<size_t> newStates(nbSites);
@@ -389,27 +472,27 @@ int main(int args, char ** argv)
     try {
       VectorSiteContainer* allSeq = 0;
       allSeq = SequenceApplicationTools::getSiteContainer(alphabet, bppseqgen.getParams());
-      
+
       if (allSeq->getNumberOfSequences() > 0)
-      {  
+      {
         Sequence* pseq = SequenceTools::getSequenceWithCompleteSites(allSeq->getSequence(0));
-        
+
         nbSites = pseq->size();
         states.resize(nbSites);
         withStates = true;
-        
+
 	for (size_t i = 0; i < nbSites; ++i) {
           states[i] = RandomTools::pickOne(modelSet->getModelStates((*pseq)[i]));
         }
         ApplicationTools::displayResult("Number of sites", TextTools::toString(nbSites));
-        
+
         delete pseq;
       }
     }
     catch (Exception& e)
     {
     }
-      
+
   }
 
   if (rDist == 0)
@@ -428,7 +511,7 @@ int main(int args, char ** argv)
 
   if (nbSites == 0)
     nbSites = ApplicationTools::getParameter<size_t>("number_of_sites", bppseqgen.getParams(), 100);
-  
+
   /*******************/
   /* Simulations     */
   /*******************/
@@ -438,6 +521,7 @@ int main(int args, char ** argv)
     if (trees.size() == 1)
     {
       seqsim = new NonHomogeneousSequenceSimulator(modelSet, rDist, trees[0]);
+      seqsim->outputInternalSequences(outputInternalSequences);
       ApplicationTools::displayTask("Perform simulations");
       if (withRates)
         if (withStates)
@@ -447,17 +531,18 @@ int main(int args, char ** argv)
       else
         if (withStates){
           sites = SequenceSimulationTools::simulateSites(*seqsim, states);
-        }      
+        }
         else
           throw Exception("Error! Info file should contain either site specific rates of ancestral states or both.");
-      
-      delete seqsim;    
+
+      delete seqsim;
     }
     else
     {
       ApplicationTools::displayTask("Perform simulations", true);
       ApplicationTools::displayGauge(0, trees.size() - 1, '=');
       seqsim = new NonHomogeneousSequenceSimulator(modelSet, rDist, trees[0]);
+      seqsim->outputInternalSequences(outputInternalSequences);
       ptrdiff_t previousPos = 0;
       ptrdiff_t currentPos = static_cast<ptrdiff_t>(round(positions[1]*static_cast<double>(nbSites)));
       vector<double> tmpRates;
@@ -479,11 +564,12 @@ int main(int args, char ** argv)
           throw Exception("Error! Info file should contain either site specific rates of ancestral states or both.");
       previousPos = currentPos;
       delete seqsim;
-      
+
       for(size_t i = 1; i < trees.size(); i++)
       {
         ApplicationTools::displayGauge(i, trees.size() - 1, '=');
         seqsim = new NonHomogeneousSequenceSimulator(modelSet, rDist, trees[i]);
+        seqsim->outputInternalSequences(outputInternalSequences);
         currentPos = static_cast<ptrdiff_t>(round(positions[i+1]) * static_cast<double>(nbSites));
         if (withRates)
           tmpRates = vector<double>(rates.begin() + previousPos + 1, rates.begin() + currentPos);
@@ -493,7 +579,7 @@ int main(int args, char ** argv)
         if (withRates)
           if (withStates)
             tmpCont2 = SequenceSimulationTools::simulateSites(*seqsim, tmpRates, tmpStates);
-          else     
+          else
             tmpCont2 = SequenceSimulationTools::simulateSites(*seqsim, tmpRates);
         else
           if (withStates)
@@ -524,10 +610,11 @@ int main(int args, char ** argv)
     {
       rDist = PhylogeneticsApplicationTools::getRateDistribution(bppseqgen.getParams());
     }
-    
+
     if (trees.size() == 1)
     {
       seqsim = new NonHomogeneousSequenceSimulator(modelSet, rDist, trees[0]);
+      seqsim->outputInternalSequences(outputInternalSequences);
       ApplicationTools::displayResult("Number of sites", TextTools::toString(nbSites));
       ApplicationTools::displayTask("Perform simulations");
       sites = seqsim->simulate(nbSites);
@@ -538,16 +625,18 @@ int main(int args, char ** argv)
       ApplicationTools::displayTask("Perform simulations", true);
       ApplicationTools::displayGauge(0, trees.size() - 1, '=');
       seqsim = new NonHomogeneousSequenceSimulator(modelSet, rDist, trees[0]);
+      seqsim->outputInternalSequences(outputInternalSequences);
       size_t previousPos = 0;
       size_t currentPos = static_cast<unsigned int>(round(positions[1] * static_cast<double>(nbSites)));
       SequenceContainer* tmpCont1 = seqsim->simulate(currentPos - previousPos);
       previousPos = currentPos;
       delete seqsim;
- 
+
       for (size_t i = 1; i < trees.size(); i++)
       {
         ApplicationTools::displayGauge(i, trees.size() - 1, '=');
         seqsim = new NonHomogeneousSequenceSimulator(modelSet, rDist, trees[i]);
+        seqsim->outputInternalSequences(outputInternalSequences);
         currentPos = static_cast<unsigned int>(round(positions[i+1] * static_cast<double>(nbSites)));
         SequenceContainer* tmpCont2 = seqsim->simulate(currentPos - previousPos);
         previousPos = currentPos;
@@ -563,18 +652,18 @@ int main(int args, char ** argv)
       delete tmpCont1;
     }
   }
-  
+
   // Write to file:
   SequenceApplicationTools::writeAlignmentFile(*sites, bppseqgen.getParams());
-  
+
   delete alphabet;
   for (size_t i = 0; i < trees.size(); i++)
     delete trees[i];
   delete rDist;
 
   bppseqgen.done();
-  
-}
+
+  }
   catch (exception& e)
   {
     cout << e.what() << endl;
@@ -583,4 +672,3 @@ int main(int args, char ** argv)
 
   return 0;
 }
-
diff --git a/bppSuite/bppSeqMan.cpp b/bppSuite/bppSeqMan.cpp
index 7cc52e1..a62e581 100644
--- a/bppSuite/bppSeqMan.cpp
+++ b/bppSuite/bppSeqMan.cpp
@@ -44,6 +44,8 @@ knowledge of the CeCILL license and that you accept its terms.
 
 using namespace std;
 
+// From bpp-core:
+#include <Bpp/Version.h>
 #include <Bpp/App/BppApplication.h>
 #include <Bpp/App/ApplicationTools.h>
 #include <Bpp/Io/FileTools.h>
@@ -55,11 +57,10 @@ using namespace std;
 #include <Bpp/Seq/Alphabet/Alphabet.h>
 #include <Bpp/Seq/Alphabet/AlphabetTools.h>
 #include <Bpp/Seq/Container/VectorSiteContainer.h>
+#include <Bpp/Seq/Container/SiteContainerTools.h>
+#include <Bpp/Seq/Container/SequenceContainerTools.h>
 #include <Bpp/Seq/App/SequenceApplicationTools.h>
-#include <Bpp/Seq/Io.all>
-#include <Bpp/Seq/Container.all>
 #include <Bpp/Seq/SequenceTools.h>
-#include <Bpp/Seq/GeneticCode.all>
 
 //From bpp-phyl:
 #include <Bpp/Phyl/Tree.h>
@@ -80,8 +81,8 @@ void help()
 int main(int args, char** argv)
 {
   cout << "******************************************************************" << endl;
-  cout << "*           Bio++ Sequence Manipulator, version 2.2.0.           *" << endl;
-  cout << "* Author: J. Dutheil                        Last Modif. 25/09/14 *" << endl;
+  cout << "*           Bio++ Sequence Manipulator, version " << BPP_VERSION << ".           *" << endl;
+  cout << "* Author: J. Dutheil                        Last Modif. " << BPP_REL_DATE << " *" << endl;
   cout << "******************************************************************" << endl;
   cout << endl;
   
@@ -98,22 +99,31 @@ int main(int args, char** argv)
   
   // Get alphabet
   Alphabet* alphabet = SequenceApplicationTools::getAlphabet(bppseqman.getParams(), "", false, true, true);
-  auto_ptr<GeneticCode> gCode;
+  unique_ptr<GeneticCode> gCode;
   CodonAlphabet* codonAlphabet = dynamic_cast<CodonAlphabet*>(alphabet);
 
   // Get sequences:
-  SequenceContainer* tmp = SequenceApplicationTools::getSequenceContainer(alphabet, bppseqman.getParams(), "", true, true);
-  OrderedSequenceContainer* sequences = new VectorSequenceContainer(*tmp);
-  delete tmp;
+  bool aligned = ApplicationTools::getBooleanParameter("input.alignment", bppseqman.getParams(), false, "", true, 1);
+  OrderedSequenceContainer* sequences = 0;
+
+  if (aligned) {
+    VectorSiteContainer* allSites = SequenceApplicationTools::getSiteContainer(alphabet, bppseqman.getParams());
+    sequences = SequenceApplicationTools::getSitesToAnalyse(*allSites, bppseqman.getParams(), "", true, false);
+    delete allSites;
+  } else {
+    SequenceContainer* tmp = SequenceApplicationTools::getSequenceContainer(alphabet, bppseqman.getParams(), "", true, true);
+    sequences = new VectorSequenceContainer(*tmp);
+    delete tmp;
+  }
+
   ApplicationTools::displayResult("Number of sequences", sequences->getNumberOfSequences());
   
   // Perform manipulations
   
   vector<string> actions = ApplicationTools::getVectorParameter<string>("sequence.manip", bppseqman.getParams(), ',', "", "", false, 1);
   
-  bool aligned = false;
 
-  for (unsigned int a = 0; a < actions.size(); a++)
+  for (size_t a = 0; a < actions.size(); a++)
   {
     string cmdName;
     map<string, string> cmdArgs;
@@ -128,7 +138,7 @@ int main(int args, char** argv)
       OrderedSequenceContainer* sc = 0;
       if (aligned) sc = new VectorSiteContainer(sequences->getAlphabet());
       else         sc = new VectorSequenceContainer(sequences->getAlphabet());
-      for (unsigned int i = 0; i < sequences->getNumberOfSequences(); i++)
+      for (size_t i = 0; i < sequences->getNumberOfSequences(); i++)
       {
         Sequence* seq = SequenceTools::getComplement(sequences->getSequence(i));
         sc->addSequence(*seq, false);
@@ -190,10 +200,13 @@ int main(int args, char** argv)
       OrderedSequenceContainer* sc = 0;
       if (aligned) sc = new VectorSiteContainer(alpha);
       else         sc = new VectorSequenceContainer(alpha);
-      for (unsigned int i = 0; i < sequences->getNumberOfSequences(); i++)
+      for (size_t i = 0; i < sequences->getNumberOfSequences(); i++)
       {
         const Sequence* old = &sequences->getSequence(i);
-        Sequence* seq = new BasicSequence(old->getName(), old->getContent(), old->getComments(), alpha);
+        vector<int> content(old->size());
+        for (size_t j = 0; j < old->size(); ++j)
+          content[j] = (*old)[j];
+        Sequence* seq = new BasicSequence(old->getName(), content, old->getComments(), alpha);
         sc->addSequence(*seq, false);
         delete seq;
       }
@@ -233,9 +246,9 @@ int main(int args, char** argv)
     else if (cmdName == "RemoveGaps")
     {
       VectorSequenceContainer* sc = new VectorSequenceContainer(sequences->getAlphabet());
-      for (unsigned int i = 0; i < sequences->getNumberOfSequences(); i++)
+      for (size_t i = 0; i < sequences->getNumberOfSequences(); i++)
       {
-        auto_ptr<Sequence> seq(sequences->getSequence(i).clone());
+        unique_ptr<Sequence> seq(sequences->getSequence(i).clone());
         SequenceTools::removeGaps(*seq);
         sc->addSequence(*seq);
       }
@@ -251,7 +264,7 @@ int main(int args, char** argv)
       OrderedSequenceContainer* sc = 0;
       if (aligned) sc = new VectorSiteContainer(sequences->getAlphabet());
       else         sc = new VectorSequenceContainer(sequences->getAlphabet());
-      for (unsigned int i = 0; i < sequences->getNumberOfSequences(); i++)
+      for (size_t i = 0; i < sequences->getNumberOfSequences(); i++)
       {
         Sequence* seq = new BasicSequence(sequences->getSequence(i));
         SymbolListTools::changeGapsToUnknownCharacters(*seq);
@@ -269,7 +282,7 @@ int main(int args, char** argv)
       OrderedSequenceContainer* sc = 0;
       if (aligned) sc = new VectorSiteContainer(sequences->getAlphabet());
       else         sc = new VectorSequenceContainer(sequences->getAlphabet());
-      for (unsigned int i = 0; i < sequences->getNumberOfSequences(); i++)
+      for (size_t i = 0; i < sequences->getNumberOfSequences(); i++)
       {
         Sequence* seq = new BasicSequence(sequences->getSequence(i));
         SymbolListTools::changeUnresolvedCharactersToGaps(*seq);
@@ -296,7 +309,7 @@ int main(int args, char** argv)
         VectorSequenceContainer* sc = new VectorSequenceContainer(sequences->getAlphabet());
         for (size_t i = 0; i < sequences->getNumberOfSequences(); ++i)
         {
-          auto_ptr<Sequence> seq(sequences->getSequence(i).clone());
+          unique_ptr<Sequence> seq(sequences->getSequence(i).clone());
           SequenceTools::removeStops(*seq, *gCode);
           sc->addSequence(*seq);
         }
@@ -306,7 +319,7 @@ int main(int args, char** argv)
         VectorSiteContainer* sc = new VectorSiteContainer(sequences->getAlphabet());
         for (size_t i = 0; i < sequences->getNumberOfSequences(); ++i)
         {
-          auto_ptr<Sequence> seq(sequences->getSequence(i).clone());
+          unique_ptr<Sequence> seq(sequences->getSequence(i).clone());
           SequenceTools::replaceStopsWithGaps(*seq, *gCode);
           sc->addSequence(*seq);
         }
@@ -318,12 +331,12 @@ int main(int args, char** argv)
     // +--------------+
     // | Remove stops |
     // +--------------+
-    else if (cmdName == "RemoveColumnsWithStop")
+    else if (cmdName == "RemoveColumnsWithStops")
     {
       SiteContainer* sites = dynamic_cast<SiteContainer*>(sequences);
       if (!sites)
       {
-        throw Exception("'RemoveColumnsWithStop' can only be used on alignment. You may consider using the 'CoerceToAlignment' command.");
+        throw Exception("'RemoveColumnsWithStops' can only be used on alignment. You may consider using the 'CoerceToAlignment' command.");
       }
       if (!gCode.get()) {
         string codeDesc = ApplicationTools::getStringParameter("genetic_code", bppseqman.getParams(), "Standard", "", true, 1);
@@ -440,7 +453,7 @@ int main(int args, char** argv)
       OrderedSequenceContainer* sc = 0;
       if (aligned) sc = new VectorSiteContainer(sequences->getAlphabet());
       else         sc = new VectorSequenceContainer(sequences->getAlphabet());
-      for (unsigned int i = 0; i < sequences->getNumberOfSequences(); i++)
+      for (size_t i = 0; i < sequences->getNumberOfSequences(); i++)
       {
         const Sequence* old = &sequences->getSequence(i);
         Sequence* seq = SequenceTools::getInvert(*old);
@@ -470,7 +483,7 @@ int main(int args, char** argv)
     // +-----------------+
     else if (cmdName == "FilterFromTree")
     {
-      auto_ptr<Tree> tree(PhylogeneticsApplicationTools::getTree(cmdArgs, ""));
+      unique_ptr<Tree> tree(PhylogeneticsApplicationTools::getTree(cmdArgs, ""));
       vector<string> names = tree->getLeavesNames();
       OrderedSequenceContainer* reorderedSequences = 0;
       if (aligned) {
@@ -484,6 +497,22 @@ int main(int args, char** argv)
       delete sequences;
       sequences = reorderedSequences;
     }
+    // +----------------------+
+    // | RemoveEmptySequences |
+    // +----------------------+
+    else if (cmdName == "RemoveEmptySequences")
+    {
+      OrderedSequenceContainer* sc = 0;
+      if (aligned) sc = new VectorSiteContainer(sequences->getAlphabet());
+      else         sc = new VectorSequenceContainer(sequences->getAlphabet());
+      for (size_t i = 0; i < sequences->getNumberOfSequences(); ++i)
+      {
+        if (SequenceTools::getNumberOfSites(sequences->getSequence(i))!=0)
+          sc->addSequence(sequences->getSequence(i), false);
+      }
+      delete sequences;
+      sequences = sc;
+    }
 
     else throw Exception("Unknown action: " + cmdName);
   }
diff --git a/bppSuite/bppTreeDraw.cpp b/bppSuite/bppTreeDraw.cpp
index 556f3a7..35156f9 100644
--- a/bppSuite/bppTreeDraw.cpp
+++ b/bppSuite/bppTreeDraw.cpp
@@ -42,19 +42,21 @@ knowledge of the CeCILL license and that you accept its terms.
 
 using namespace std;
 
-// From Utils:
+// From bpp-core:
+#include <Bpp/Version.h>
 #include <Bpp/App/BppApplication.h>
 #include <Bpp/App/ApplicationTools.h>
 #include <Bpp/Text/KeyvalTools.h>
-#include <Bpp/Graphics.all>
-#include <Bpp/Graphics/Svg.all>
-#include <Bpp/Graphics/Latex.all>
-#include <Bpp/Graphics/Fig.all>
+#include <Bpp/Graphics/Svg/SvgGraphicDevice.h>
+#include <Bpp/Graphics/Latex/PgfGraphicDevice.h>
+#include <Bpp/Graphics/Fig/XFigGraphicDevice.h>
 
-// From PhylLib:
+// From bpp-phyl:
 #include <Bpp/Phyl/Tree.h>
 #include <Bpp/Phyl/App/PhylogeneticsApplicationTools.h>
-#include <Bpp/Phyl/Graphics.all>
+#include <Bpp/Phyl/Graphics/PhylogramPlot.h>
+#include <Bpp/Phyl/Graphics/CladogramPlot.h>
+#include <Bpp/Phyl/Graphics/TreeDrawingDisplayControler.h>
 
 using namespace bpp;
 
@@ -73,9 +75,9 @@ void help()
 int main(int args, char ** argv)
 {
   cout << "******************************************************************" << endl;
-  cout << "*       Bio++ Tree Drawing program, version 2.2.0.               *" << endl;
+  cout << "*       Bio++ Tree Drawing program, version " << BPP_VERSION << ".               *" << endl;
   cout << "*                                                                *" << endl; 
-  cout << "* Authors: J. Dutheil                       Last Modif. 25/09/14 *" << endl;
+  cout << "* Authors: J. Dutheil                       Last Modif. " << BPP_REL_DATE << " *" << endl;
   cout << "******************************************************************" << endl;
   cout << endl;
 
diff --git a/bppsuite.spec b/bppsuite.spec
index d4255d9..a10b3d2 100644
--- a/bppsuite.spec
+++ b/bppsuite.spec
@@ -1,34 +1,36 @@
 %define _basename bppsuite
-%define _version 2.2.0
+%define _version 2.3.1
 %define _release 1
 %define _prefix /usr
 
-URL: http://home.gna.org/bppsuite/
+URL: https://github.com/BioPP
 
 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
+Source: %{_basename}-%{_version}.tar.gz
 Summary: The Bio++ Program Suite
 Group: Productivity/Scientific/Other
 
-Requires: libbpp-phyl9 = %{_version}
-Requires: libbpp-seq9 = %{_version}
-Requires: libbpp-core2 = %{_version}
+Requires: libbpp-phyl11 = %{_version}
+Requires: libbpp-seq11 = %{_version}
+Requires: libbpp-core3 = %{_version}
 
 BuildRoot: %{_builddir}/%{_basename}-root
-BuildRequires: cmake >= 2.6.0
-BuildRequires: gcc-c++ >= 4.0.0
+BuildRequires: cmake >= 2.8.11
+BuildRequires: gcc-c++ >= 4.7.0
 BuildRequires: groff
 BuildRequires: texinfo >= 4.0.0
-BuildRequires: libbpp-core2 = %{_version}
+BuildRequires: libbpp-core3 = %{_version}
 BuildRequires: libbpp-core-devel = %{_version}
-BuildRequires: libbpp-seq9 = %{_version}
+BuildRequires: libbpp-seq11 = %{_version}
 BuildRequires: libbpp-seq-devel = %{_version}
-BuildRequires: libbpp-phyl9 = %{_version}
+BuildRequires: libbpp-phyl11 = %{_version}
 BuildRequires: libbpp-phyl-devel = %{_version}
+BuildRequires: libbpp-popgen7 = %{_version}
+BuildRequires: libbpp-popgen-devel = %{_version}
 
 
 AutoReq: yes
@@ -36,14 +38,14 @@ AutoProv: yes
 %if 0%{?mdkversion}
 %if 0%{?mdkversion} >= 201100
 BuildRequires: xz
-%define zipext xz
+%define compress_program xz
 %else
 BuildRequires: lzma
-%define zipext lzma
+%define compress_program lzma
 %endif
 %else
 BuildRequires: gzip
-%define zipext gz
+%define compress_program gzip
 %endif
 
 %description
@@ -55,31 +57,20 @@ Bio++ program suite includes programs:
  - BppPars for parsimony analysis,
  - BppSeqMan for file conversion and sequence manipulation,
  - BppConsense for building consensus tree and computing bootstrap values,
- - BppPhySamp for phylogenetic sampling,
  - BppReRoot for tree rerooting.
  - BppTreeDraw for tree drawing.
  - BppAlnScore for comparing alignments and computing alignment scores.
+ - BppPopStats for population genetics.
  - BppMixedLikelioods for computing the site per site likelihoods of submodels from a mixture model.
  
 %prep
 %setup -q
 
 %build
-CFLAGS="-I%{_prefix}/include $RPM_OPT_FLAGS"
-CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=%{_prefix}"
-if [ %{_lib} == 'lib64' ] ; then
-  CMAKE_FLAGS="$CMAKE_FLAGS -DLIB_SUFFIX=64"
-fi
-if [ %{zipext} == 'lzma' ] ; then
-  CMAKE_FLAGS="$CMAKE_FLAGS -DDOC_COMPRESS=lzma -DDOC_COMPRESS_EXT=lzma"
-fi
-if [ %{zipext} == 'xz' ] ; then
-  CMAKE_FLAGS="$CMAKE_FLAGS -DDOC_COMPRESS=xz -DDOC_COMPRESS_EXT=xz"
-fi
-
+CFLAGS="$RPM_OPT_FLAGS"
+CMAKE_FLAGS="-DCMAKE_INSTALL_PREFIX=%{_prefix} -DCOMPRESS_PROGRAM=%{compress_program}"
 cmake $CMAKE_FLAGS .
 make
-make info
 
 %install
 make DESTDIR=$RPM_BUILD_ROOT install
@@ -94,33 +85,16 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(-,root,root)
 %doc AUTHORS.txt COPYING.txt INSTALL.txt ChangeLog
-%{_prefix}/bin/bppml
-%{_prefix}/bin/bppseqgen
-%{_prefix}/bin/bppancestor
-%{_prefix}/bin/bppdist
-%{_prefix}/bin/bpppars
-%{_prefix}/bin/bppseqman
-%{_prefix}/bin/bppconsense
-%{_prefix}/bin/bppphysamp
-%{_prefix}/bin/bppreroot
-%{_prefix}/bin/bpptreedraw
-%{_prefix}/bin/bppalnscore
-%{_prefix}/bin/bppmixedlikelihoods
-%{_prefix}/share/info/bppsuite.info.%{zipext}
-%{_prefix}/share/man/man1/bppml.1.%{zipext}
-%{_prefix}/share/man/man1/bppseqgen.1.%{zipext}
-%{_prefix}/share/man/man1/bppancestor.1.%{zipext}
-%{_prefix}/share/man/man1/bpppars.1.%{zipext}
-%{_prefix}/share/man/man1/bppdist.1.%{zipext}
-%{_prefix}/share/man/man1/bppconsense.1.%{zipext}
-%{_prefix}/share/man/man1/bppseqman.1.%{zipext}
-%{_prefix}/share/man/man1/bppreroot.1.%{zipext}
-%{_prefix}/share/man/man1/bppphysamp.1.%{zipext}
-%{_prefix}/share/man/man1/bpptreedraw.1.%{zipext}
-%{_prefix}/share/man/man1/bppalnscore.1.%{zipext}
-%{_prefix}/share/man/man1/bppmixedlikelihoods.1.%{zipext}
+%{_prefix}/bin/*
+%{_prefix}/share/info/*.info*
+%{_prefix}/share/man/man1/*.1*
 
 %changelog
+* Tue Jun 06 2017 Julien Dutheil <julien.dutheil at univ-montp2.fr> 2.3.1-1
+* Wed May 10 2017 Julien Dutheil <julien.dutheil at univ-montp2.fr> 2.3.0-1
+- New BppPopStats program
+- BppPhySamp is now distributed separately
+- Several bugs fixed and improvements
 * Mon Sep 28 2014 Julien Dutheil <julien.dutheil at univ-montp2.fr> 2.2.0-1
 - Compatibility update. Bio++ Program Suite version number is now indexed
   on Bio++'s version.
diff --git a/buildBin.sh b/buildBin.sh
index 5b71638..ad31af0 100755
--- a/buildBin.sh
+++ b/buildBin.sh
@@ -1,6 +1,6 @@
 #! /bin/sh
 arch=x86_64 #i686
-version=0.8.0-1
+version=1.3.0a-1
 
 strip bppSuite/bppdist
 strip bppSuite/bpppars
@@ -14,5 +14,6 @@ strip bppSuite/bppancestor
 strip bppSuite/bpptreedraw
 strip bppSuite/bppalnscore
 strip bppSuite/bppmixedlikelihoods
-tar cvzf bppsuite-${arch}-bin-static-${version}.tar.gz bppSuite/bppdist bppSuite/bpppars bppSuite/bppml bppSuite/bppseqgen bppSuite/bppconsense bppSuite/bppseqman bppSuite/bppphysamp bppSuite/bppreroot bppSuite/bppancestor bppSuite/bpptreedraw bppSuite/bppalnscore bppSuite/bppmixedlikelihoods
+strip bppSuite/bpppopstats
+tar cvzf bppsuite-${arch}-bin-static-${version}.tar.gz bppSuite/bppdist bppSuite/bpppars bppSuite/bppml bppSuite/bppseqgen bppSuite/bppconsense bppSuite/bppseqman bppSuite/bppphysamp bppSuite/bppreroot bppSuite/bppancestor bppSuite/bpptreedraw bppSuite/bppalnscore bppSuite/bppmixedlikelihoods bppSuite/bpppopstats
 
diff --git a/debian/bppsuite.manpages b/debian/bppsuite.manpages
deleted file mode 100644
index 58f176a..0000000
--- a/debian/bppsuite.manpages
+++ /dev/null
@@ -1,11 +0,0 @@
-man/bppml.1.gz
-man/bppseqgen.1.gz
-man/bppancestor.1.gz
-man/bppdist.1.gz
-man/bpppars.1.gz
-man/bppseqman.1.gz
-man/bppphysamp.1.gz
-man/bppreroot.1.gz
-man/bppconsense.1.gz
-man/bpptreedraw.1.gz
-man/bppmixedlikelihoods.1.gz
diff --git a/debian/changelog b/debian/changelog
deleted file mode 100644
index 9ac4650..0000000
--- a/debian/changelog
+++ /dev/null
@@ -1,73 +0,0 @@
-bppsuite (2.2.0-1) unstable; urgency=low
-
-  * Compatibility update. Bio++ Program Suite version number is now indexed
-    on Bio++'s version.
-  * Programs support the --seed argument for setting the random seed.
-  * bppSeqGen suport generic characters as input.
-  * bppPhySamp outputs sampled trees.
-
- -- Julien Dutheil <julien.dutheil at univ-montp2.fr>  Mon, 28 Sep 2014 14:00:00 +0100
-
-bppsuite (0.8.0-1) unstable; urgency=low
-
-  * New models for proteins (COaLA)
-  * New program bppMixedLikelihoods
-
- -- Julien Dutheil <julien.dutheil at univ-montp2.fr>  Fri, 08 Mar 2013 11:41:00 +0100
-
-bppsuite (0.7.0-1) unstable; urgency=low
-
-  * Several program improvements (more models, options, etc.)
-  * New program bpp Alignment scores.
-
- -- Julien Dutheil <julien.dutheil at univ-montp2.fr>  Wed, 15 Feb 2012 09:17:00 +0100
-
-bppsuite (0.6.2-1) unstable; urgency=low
-
-  * RFP: Bio++ -- The Bio++ bioinformatics libraries. (Closes: #616373).
-  * Packages are now non-native.
-
- -- Julien Dutheil <julien.dutheil at univ-montp2.fr>  Thu, 09 Jun 2011 11:00:00 +0100
-
-bppsuite (0.6.1) unstable; urgency=low
-
-  * Compatibility update with bpp-phyl 2.0.1.
-
- -- Julien Dutheil <julien.dutheil at univ-montp2.fr>  Mon, 28 Feb 2011 09:00:00 +0100
-
-bppsuite (0.6.0) unstable; urgency=low
-
-  * Compatibility update with Bio++ 2.0.0.
-  * New mixed substitution models.
-  * More sequence manipulation tools.
-  * Several bug fixed and syntax improvements.
-
- -- Julien Dutheil <julien.dutheil at univ-montp2.fr>  Mon, 07 Feb 2011 09:00:00 +0100
-
-bppsuite (0.5.0) unstable; urgency=low
-
-  * New substitution models.
-  * New tree drawing program.
-  * Compatibility update with Bio++ 1.9.0.
-
- -- Julien Dutheil <julien.dutheil at univ-montp2.fr>  Thu, 25 Mar 2010 21:17:37 +0100
-
-bppsuite (0.4.0) unstable; urgency=low
-
-  * Major syntax update, using keyvals.
-  * Compatibility update with Bio++ 1.8.0.
-
- -- Julien Dutheil <jdutheil at birc.au.dk>  Wed, 10 Jun 2009 11:28:58 +0100
-
-bppsuite (0.3.1) unstable; urgency=low
-
-  * Several bug fixed.
-
- -- Julien Dutheil <jdutheil at birc.au.dk>  Thu, 11 Dec 2008 12:21:37 +0100
-
-bppsuite (0.3.0) unstable; urgency=low
-
-  * Initial release
-
- -- Julien Dutheil <jdutheil at birc.au.dk>  Fri, 25 Sep 2008 14:28:21 +0200
-
diff --git a/debian/compat b/debian/compat
deleted file mode 100644
index 7ed6ff8..0000000
--- a/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-5
diff --git a/debian/control b/debian/control
deleted file mode 100644
index 52236d8..0000000
--- a/debian/control
+++ /dev/null
@@ -1,27 +0,0 @@
-Source: bppsuite
-Section: science
-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), dpkg (>= 1.15.4) | install-info, texinfo,
-  libbpp-phyl-dev (>= 2.2.0)
-Standards-Version: 3.9.4
-
-Package: bppsuite
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, libbpp-phyl9 (>= 2.2.0)
-Description: Bio++ program suite
- Includes programs:
-  - BppML for maximum likelihood analysis,
-  - BppSeqGen for sequences simulation,
-  - BppAncestor for ancestral states reconstruction,
-  - BppDist for distance methods,
-  - BppPars for parsimony analysis,
-  - BppSeqMan for file conversion and sequence manipulation,
-  - BppConsense for building consensus tree and computing bootstrap values,
-  - BppPhySamp for phylogenetic sampling,
-  - BppReRoot for tree rerooting.
-  - BppTreeDraw for tree drawing.
-  - BppAlnScore for comparing alignments and computing alignment scores.
-  - BppMixedLikelihoods for computing site per site likelihoods of components of mixture models.
-
diff --git a/debian/copyright b/debian/copyright
deleted file mode 100644
index 1428d5b..0000000
--- a/debian/copyright
+++ /dev/null
@@ -1,62 +0,0 @@
-This package was debianized by Julien Dutheil <julien.dutheil at univ-montp2.fr> on
-Mon, 28 Sep 2014 14:00:00 +0100
-
-It was downloaded from <http://biopp.univ-montp2.fr/repos/sources/bppsuite>
-
-Upstream Author: 
-
-    Julien Dutheil <julien.dutheil at univ-montp2.fr>
-
-Copyright: 
-
-    Copyright (C) 2014 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
-
-The Debian packaging is (C) 2014, Julien Dutheil <julien.dutheil at univ-montp2.fr> and
-is licensed under the GPL, see `/usr/share/common-licenses/GPL'.
-
-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/docs b/debian/docs
deleted file mode 100644
index e69de29..0000000
diff --git a/debian/rules b/debian/rules
deleted file mode 100755
index 14221ee..0000000
--- a/debian/rules
+++ /dev/null
@@ -1,155 +0,0 @@
-#!/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.
-#
-# Modified to make a template file for a multi-binary package with separated
-# build-arch and build-indep targets  by Bill Allombert 2001
-
-# 25/03/10 Modification for use with CMake by Julien Dutheil.
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-# This has to be exported to make some magic below work.
-export DH_OPTIONS
-
-# 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
-
-configure:
-	cmake -DCMAKE_INSTALL_PREFIX=/usr .
-
-config.status: configure
-	dh_testdir
-
-#Architecture 
-build: build-arch build-indep
-
-build-arch: build-arch-stamp
-build-arch-stamp:  config.status
-
-	# Add here commands to compile the arch part of the package.
-	#$(MAKE) 
-	touch $@
-
-build-indep: build-indep-stamp
-build-indep-stamp:  config.status
-
-	# Add here commands to compile the indep part of the package.
-	#$(MAKE) doc
-	touch $@
-
-clean:
-	dh_testdir
-	dh_testroot
-	rm -f build-arch-stamp build-indep-stamp #CONFIGURE-STAMP#
-	rm -f CMakeCache.txt
-
-	# Add here commands to clean up after the build process.
-	[ ! -f Makefile ] || $(MAKE) clean;
-	[ ! -f Makefile ] || rm Makefile;
-	[ ! -f bppSuite/Makefile ] || rm bppSuite/Makefile;
-	[ ! -f doc/Makefile ] || rm doc/Makefile;
-	[ ! -f man/Makefile ] || rm man/Makefile;
-	rm -f man/*.gz;
-	rm -f config.sub config.guess
-	rm -f build-stamp
-	rm -f CMakeCache.txt
-	rm -f *.cmake
-	rm -f bppSuite/*.cmake
-	#rm -f test/*.cmake
-	rm -f man/*.cmake
-	rm -f doc/*.cmake
-	rm -rf CMakeFiles
-	rm -rf bppSuite/CMakeFiles
-	#rm -rf test/CMakeFiles
-	rm -rf man/CMakeFiles
-	rm -rf doc/CMakeFiles
-	rm -rf doc/bppsuite.info
-	rm -rf _CPack_Packages
-	#rm -rf Testing
-	#rm -f DartConfiguration.tcl
-
-	dh_clean 
-
-install: install-indep install-arch
-install-indep:
-	dh_testdir
-	dh_testroot
-	dh_prep -i 
-	dh_installdirs -i
-
-	# Add here commands to install the indep part of the package into
-	# debian/<package>-doc.
-	#INSTALLDOC#
-
-	dh_install -i
-
-install-arch:
-	dh_testdir
-	dh_testroot
-	dh_prep -s 
-	dh_installdirs -s
-
-	# Add here commands to install the arch part of the package into 
-	# debian/tmp.
-	$(MAKE) DESTDIR=$(CURDIR)/debian/bppsuite man doc install
-
-	dh_install -s
-# Must not depend on anything. This is to be called by
-# binary-arch/binary-indep
-# in another 'make' thread.
-binary-common:
-	dh_testdir
-	dh_testroot
-	dh_installchangelogs ChangeLog
-	dh_installdocs
-	dh_installexamples
-#	dh_installmenu
-#	dh_installdebconf	
-#	dh_installlogrotate	
-#	dh_installemacsen
-#	dh_installpam
-#	dh_installmime
-#	dh_python
-#	dh_installinit
-#	dh_installcron
-	dh_installinfo
-	dh_installman
-	dh_link
-	dh_strip
-	dh_compress 
-	dh_fixperms
-#	dh_perl
-#	dh_makeshlibs
-	dh_installdeb
-	dh_shlibdeps
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
-# Build architecture independant packages using the common target.
-binary-indep: build-indep install-indep
-	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
-
-# Build architecture dependant packages using the common target.
-binary-arch: build-arch install-arch
-	$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
-
-binary: binary-arch binary-indep
-.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch 
diff --git a/debian/source/format b/debian/source/format
deleted file mode 100644
index 163aaf8..0000000
--- a/debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (quilt)
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 42678ec..36a25d2 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -1,7 +1,75 @@
 # CMake script for Bio++ Program Suite
-# Author: Julien Dutheil
+# Authors:
+#   Julien Dutheil
+#   Francois Gindraud (2017)
 # Created: 22/08/2009
 
-IF(INFO)
-  INSTALL(FILES bppsuite.info DESTINATION share/info)
-ENDIF(INFO)
+# Builds info, html, pdf doc.
+# Info doc is built and install as part of "all" if makeinfo is found.
+# Html doc is proposed as a "html" optional target if makeinfo is found.
+# Pdf doc is proposed as a "pdf" optional target if makeinfo AND texi2dvi are found.
+
+find_program (MAKEINFO NAMES makeinfo texi2any DOC "makeinfo doc generator program")
+if (NOT MAKEINFO)
+  message (STATUS "makeinfo program not found: 'info' and 'html' target disabled (builds info/html doc)")
+else ()
+  message (STATUS "Found ${MAKEINFO}: 'info' and 'html' target enabled (builds info/html doc)")
+
+  set (input ${CMAKE_CURRENT_SOURCE_DIR}/bppsuite.texi)
+
+  # Build info page
+  set (output ${CMAKE_CURRENT_BINARY_DIR}/bppsuite.info)
+  add_custom_command (
+    OUTPUT ${output}
+    COMMAND ${MAKEINFO} --no-split -o ${output} ${input}
+    DEPENDS ${input}
+    COMMENT "Generating info page"
+    VERBATIM
+    )
+
+  # Install, and have "info" built with "all" (install needs the file to be built)
+  if (NOT COMPRESS_BIN)
+    # Install uncompressed info page
+    install (FILES ${output} DESTINATION ${CMAKE_INSTALL_INFODIR})
+    add_custom_target (info ALL DEPENDS ${output})
+  else ()
+    # Compress and install compressed file
+    set (compressed_ouput ${output}.${COMPRESS_EXT})
+    add_custom_command (
+      OUTPUT ${compressed_ouput}
+      COMMAND ${COMPRESS_BIN} ${COMPRESS_ARGS} ${output} > ${compressed_ouput}
+      DEPENDS ${output}
+      COMMENT "Compressing info page"
+      VERBATIM
+      )
+    install (FILES ${compressed_ouput} DESTINATION ${CMAKE_INSTALL_INFODIR})
+    add_custom_target (info ALL DEPENDS ${compressed_ouput})
+  endif ()
+
+  # Also provide a "html" target that builds html doc (not installed, and not part of "all").
+  set (output ${CMAKE_CURRENT_BINARY_DIR}/bppsuite.html)
+  set (makeinfo-css "http://www.w3.org/StyleSheets/Core/Steely")
+  add_custom_command (
+    OUTPUT ${output}
+    COMMAND ${MAKEINFO} --html --css-ref=${makeinfo-css} --no-split -o ${output} ${input}
+    DEPENDS ${input}
+    COMMENT "Generating html doc"
+    VERBATIM
+    )
+  add_custom_target (html DEPENDS ${output})
+
+  # Provide a "pdf" target that builds pdf doc (not installed, not part of "all").
+  find_program (TEXIDVI NAMES texi2dvi)
+  if (TEXIDVI)
+    message (STATUS "Found texi2dvi: 'pdf' target enabled (builds pdf doc)")
+    set (output ${CMAKE_CURRENT_BINARY_DIR}/bppsuite.pdf)
+    add_custom_command (
+      OUTPUT ${output}
+      COMMAND ${MAKEINFO} --pdf --Xopt=--clean -o ${output} ${input}
+      DEPENDS ${input}
+      COMMENT "Generating pdf doc"
+      VERBATIM
+      )
+    add_custom_target (pdf DEPENDS ${output})
+  endif ()
+endif ()
diff --git a/doc/bppsuite.texi b/doc/bppsuite.texi
index 012f62f..313132f 100644
--- a/doc/bppsuite.texi
+++ b/doc/bppsuite.texi
@@ -1,7 +1,7 @@
 \input texinfo   @c -*-texinfo-*-
 @c %**start of header
 @setfilename bppsuite.info
- at settitle BppSuite Manual 2.2.0
+ at settitle BppSuite Manual 2.3.1
 @documentencoding UTF-8
 @afourpaper
 @dircategory Science Biology Genetics
@@ -12,18 +12,18 @@
 * bppdist: (bppdist)            Bio++ Distance Methods.
 * bpppars: (bpppars)            Bio++ Maximum Parsimony.
 * bppconsense: (bppconsense)    Bio++ Consensus Trees.
-* bppphysamp: (bppphysamp)      Bio++ Phylogenetic Sampler.
 * bppreroot: (bppreroot)        Bio++ Serial Tree Re-rooting.
 * bppseqman: (bppseqman)        Bio++ Sequences Manipulation.
-* bppalnscore: (bppalnscore)    Bio++ Alignment Scoring
+* bppalnscore: (bppalnscore)    Bio++ Alignment Scoring.
+* bpppopstats: (bpppopstats)    Bio++ Population Genetics.
 * bpptreedraw: (bpptreedraw)    Bio++ Tree Drawing.
 @end direntry
 @c %**end of header
 
 @copying
-This is the manual of the Bio++ Program Suite, version 2.2.0.
+This is the manual of the Bio++ Program Suite, version 2.3.1.
 
-Copyright @copyright{} 2007-2014 Bio++ development team
+Copyright @copyright{} 2007-2017 Bio++ development team
 @end copying
 
 @titlepage
@@ -45,7 +45,6 @@ Copyright @copyright{} 2007-2014 Bio++ development team
 @top The Bio++ Program Suite Manual
 
 @insertcopying
- at end ifnottex
 
 @menu
 * Introduction::                Introducing the Bio++ Program Suite and this manual.                
@@ -58,23 +57,23 @@ Copyright @copyright{} 2007-2014 Bio++ development team
 
 Common options encountered in several programs.
 
-* Alphabet::                    Alphabets and genetic codes.
-* Sequences::                   Loading sequences/alignments.
-* Tree::                        Loading trees.
-* AlphabetIndex::               Setting biochemical properties and distances. 
-* Process::                     
-* Distribution::                Setting of the discrete distributions.
-* Estimation::                  Estimating parameters by maximizing a likelihood function.
-* WritingSequences::            Writing sequences/alignments to files. 
-* WritingTrees::                Writing trees to files. 
+* Alphabet::                    Alphabets and genetic codes
+* Sequences::                   Loading sequences/alignments
+* Tree::                        Loading trees
+* AlphabetIndex::               Setting biochemical properties and distances 
+* Process::                     Specifying the substitution process
+* Distribution::                Setting of the discrete distributions
+* Estimation::                  Estimating parameters by maximizing a likelihood function
+* WritingSequences::            Writing sequences/alignments to files
+* WritingTrees::                Writing trees to files
 
 Process specification
 
-* Model::                       
-* Non-homogeneity::             Specific declaration of non-homogeneous modelling.
+* Model::                       Substitution process
+* Non-homogeneity::             Specific declaration of non-homogeneous modelling
 * FrequenciesSet::              Frequencies 
 * Rates::                       Rates across sites
-* Linking::                     
+* Linking::                     Aliasing parameters
 
 Setting up the substitution model
 
@@ -88,22 +87,23 @@ Setting up the substitution model
 
 Bio++ Program Suite Reference
 
-* bppml::                       Bio++ Maximum Likelihood.
-* bppseqgen::                   Bio++ Sequence Generator.
-* bppancestor::                 Bio++ Ancestral Sequences and Rates reconstruction.
-* bppmixedlikelihoods::         Bio++ Site-Likelihoods Inside Mixed Models.
-* bppdist::                     Bio++ Distance Methods.
-* bpppars::                     Bio++ Maximum Parsimony.
-* bppconsense::                 Bio++ Consensus Trees.
-* bppphysamp::                  Bio++ Phylogenetic Sampler.
-* bppreroot::                   Bio++ Serial Tree Re-rooting.
-* bppseqman::                   Bio++ Sequences Manipulation.
+* bppml::                       Bio++ Maximum Likelihood
+* bppseqgen::                   Bio++ Sequence Generator
+* bppancestor::                 Bio++ Ancestral Sequences and Rates reconstruction
+* bppmixedlikelihoods::         Bio++ Site-Likelihoods Inside Mixed Models
+* bppdist::                     Bio++ Distance Methods
+* bpppars::                     Bio++ Maximum Parsimony
+* bppconsense::                 Bio++ Consensus Trees
+* bppreroot::                   Bio++ Serial Tree Re-rooting
+* bppseqman::                   Bio++ Sequences Manipulation
 * bppalnscore::                 Bio++ Alignment Scoring
-* bpptreedraw::                 Bio++ Tree Drawing.
+* bpppopstats::                 Bio++ Population Genetics
+* bpptreedraw::                 Bio++ Tree Drawing
 
 @end detailmenu
 @end menu
 
+ at end ifnottex
 @c ------------------------------------------------------------------------------------------------------------------
 
 @node Introduction, Syntax, Top, Top
@@ -315,7 +315,7 @@ data=LSU
 * Sequences::                   Loading sequences/alignments.
 * Tree::                        Loading trees.
 * AlphabetIndex::               Setting biochemical properties and distances. 
-* Process::                     
+* Process::
 * Distribution::                Setting of the discrete distributions.
 * Estimation::                  Estimating parameters by maximizing a likelihood function.
 * WritingSequences::            Writing sequences/alignments to files. 
@@ -352,6 +352,10 @@ The following table give the currently implemented codes with their correspondin
 @end multitable
 @end table
 
+The states of the alphabets are in alphabetical order. For the proteic
+alphabet, the amino-acid are in the order of their 3-letters code
+(ALA, ARG, ASN, ...).
+
 @c ------------------------------------------------------------------------------------------------------------------
 
 @node Sequences, Tree, Alphabet, Common
@@ -572,11 +576,11 @@ whether distances should be signed or not.
 @section Process specification
 
 @menu
-* Model::                       
+* Model::
 * Non-homogeneity::             Specific declaration of non-homogeneous modelling.
 * FrequenciesSet::              Frequencies 
 * Rates::                       Rates across sites
-* Linking::                     
+* Linking::
 @end menu
 
 The substitution model specification over the tree is set up in different parts.
@@ -701,6 +705,23 @@ exchangeability matrix. See the
 The strand-symmetric model of Lobry 1995, for nucleotides. See the
 @uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1L95.html#_details, Bio++ description}.
 
+ at item SSR([beta=@{real>0@}, gamma=@{real>0@}, delta=@{real>0@}, theta=@{real]0,1[@}])
+The strand-symmetric reversible model, for nucleotides. See the
+ at uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1SSR.html#_details, Bio++ description}.
+
+ at item RN95([thetaR=@{real]0,1[@}, thetaC=@{real]0,1[@}, thetaG=@{real]0,1[@}, kappaP=@{real[0,1[@}, gammaP=@{real[0,1[@}, sigmaP=@{real>1@}, alphaP=@{real>1@}])
+The model described by Rhetsky and Nei, where the only hypothesis is
+that the transversion rates are only dependent of the target
+nucleotide. This model is not reversible. See the
+ at uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1RN95.html#_details,Bio++
+description}.
+
+ at item RN95s([thetaA=@{real]0,0.5[@}, gamma=@{real]0,0.5[@}, alphaP=@{real>1@}]) 
+The instersection of models RN95 and L95. The two hypotheses are that
+the transversion rates are only dependent of the target nucleotide,
+and strand symmetry. See the
+ at uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1RN95s.html#_details,Bio++
+description}.
 
 @end table
 
@@ -737,34 +758,43 @@ Protein substitution model, from Le & Gascuel 2008. See the
 
 
 @item LLG08_EX2([relrate1=@{real]0,1[@}, relproba1=@{real]0,1[@}])
-Protein substitution model, from Le, Lartillot & Gascuel 2008. See
-the meaning of the variables in the Mixture model below. See the
- at uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1LLG08__EX2.html#_details, Bio++ description}.
+Protein substitution model, from Le, Lartillot & Gascuel 2008.
+ at xref{Mixture}, for the meaning of the variables. See the
+ at uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1LLG08__EX2.html#_details,
+Bio++ description}.
 
 
 @item LLG08_EX3([relrate1=@{real]0,1[@}, relrate2=@{real]0,1[@}, relproba1=@{real]0,1[@}, relproba2=@{real]0,1[@}])
-Protein substitution model, from Le, Lartillot & Gascuel 2008.  See
-the meaning of the variables in the Mixture model below. See the
+Protein substitution model, from Le, Lartillot & Gascuel 2008. @xref{Mixture}, for the meaning of the variables. See the
 @uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1LLG08__EX3.html#_details, Bio++ description}.
 
 
 @item LLG08_EHO([relrate1=@{real]0,1[@}, relrate2=@{real]0,1[@}, relproba1=@{real]0,1[@}, relproba2=@{real]0,1[@}])
-Protein substitution model, from Le, Lartillot & Gascuel 2008. See
-the meaning of the variables in the Mixture model below. See the
+Protein substitution model, from Le, Lartillot & Gascuel 2008. @xref{Mixture}, for the meaning of the variables. See the
 @uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1LLG08__EHO.html#_details, Bio++ description}.
 
 
 @item LLG08_UL2([relrate1=@{real]0,1[@}, relproba1=@{real]0,1[@}])
-Protein substitution model, from Le, Lartillot & Gascuel 2008. See
-the meaning of the variables in the Mixture model below. See the
+Protein substitution model, from Le, Lartillot & Gascuel 2008. @xref{Mixture}, for the meaning of the variables. See the
 @uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1LLG08__UL2.html#_details, Bio++ description}.
 
 
 @item LLG08_UL3([relrate1=@{real]0,1[@}, relrate2=@{real]0,1[@}, relproba1=@{real]0,1[@}, relproba2=@{real]0,1[@}])
-Protein substitution model, from Le, Lartillot & Gascuel 2008. See
-the meaning of the variables in the Mixture model below. See the
+Protein substitution model, from Le, Lartillot & Gascuel 2008. @xref{Mixture}, for the meaning of the variables. See the
 @uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1LLG08__UL3.html#_details, Bio++ description}.
 
+ at item LGL08_CAT(nbCat=@{[10,20,30,40,50,60]@}, [relrate1=@{real]0,1[@}, relrate2=@{real]0,1[@}, ..., relproba1=@{real]0,1[@}, relproba2=@{real]0,1[@}, ...] ))
+CAT protein substitution model, from Le, Gascuel & Lartillot 2008, with a
+given number (@var{nbCat}) of profiles. @xref{Mixture}, for the meaning
+of the variables. See the
+ at uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1LGL08__CAT.html#_details,
+Bio++ description}.
+
+ at item LGL08_CAT_C@{[1,...,nbCat]@}(nbCat=@{[10,20,30,40,50,60]@})
+Submodel of a given CAT Protein substitution model, from Le, Gascuel &
+Lartillot 2008, with a given number (@var{nbCat}) of profiles. See the
+ at uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1LGL08__CAT.html#_details,
+Bio++ description}.
 
 @item DSO78+F([theta=@{real]0,1[@}, theta1=@{real]0,1[@}, theta2=@{real]0,1[@}, ... ,"equilibrium frequencies"])
 Protein substitution model, using the dcmutt implementation of Kosiol
@@ -872,28 +902,28 @@ Yang and Nielsen (1998) substitution model for codons (default values:
 @uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1YN98.html#_details, Bio++ description}.
 
 
- at item YNGKP_M0([genetic_code=@{genetic code description@}, kappa=@{real>0@}, omega=@{real>0@}, "equilibrium frequencies"])
+ at item YNGP_M0([genetic_code=@{genetic code description@}, kappa=@{real>0@}, omega=@{real>0@}, "equilibrium frequencies"])
 The M0 model of PAML, ie the same as YN98. See the
 @uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1YN98.html#_details, Bio++ description}.
 
 
- at item YNGKP_M1([genetic_code=@{genetic code description@},kappa=@{real>0@}, omega=@{real>0@}, p0=@{real>0 and <1 @}, "equilibrium frequencies"])
+ at item YNGP_M1([genetic_code=@{genetic code description@},kappa=@{real>0@}, omega=@{real>0@}, p0=@{real>0 and <1 @}, "equilibrium frequencies"])
 The M1a model of PAML, see Yang, Z., R. Nielsen, N. Goldman, and A.-M.
 K. Pedersen (2000) (default values: @var{kappa}=1, @var{p0}=0.5,
 @var{omega}=0.5). See the
- at uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1YNGKP__M1.html#_details, Bio++ description}.
+ at uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1YNGP__M1.html#_details, Bio++ description}.
 
 
- at item YNGKP_M2([genetic_code=@{genetic code description@},kappa=@{real>0@}, omega0=@{real>0 and <1@}, theta1=@{real>0 and <1 @}],  omega1=@{real>1@},  theta2=@{real>0 and <1 @}, "equilibrium frequencies"])
+ at item YNGP_M2([genetic_code=@{genetic code description@},kappa=@{real>0@}, omega0=@{real>0 and <1@}, theta1=@{real>0 and <1 @}],  omega1=@{real>1@},  theta2=@{real>0 and <1 @}, "equilibrium frequencies"])
 
 The M2a model of PAML, see Yang, Z., R. Nielsen, N. Goldman, and A.-M.
 K. Pedersen (2000), with  p0=theta1  and
 p1=(1-theta1)*theta2 (default values: @var{kappa}=1, @var{theta1}=0.33333,
 @var{theta2}=0.5, @var{omega0}=0.5, @var{omega2}=0.5). See the
- at uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1YNGKP__M2.html#_details, Bio++ description}.
+ at uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1YNGP__M2.html#_details, Bio++ description}.
   
 
- at item YNGKP_M3([genetic_code=@{genetic code description@}, n=@{integer>0@}, kappa=@{real>0@}, omega0=@{real>0 and <1@}, delta1=@{real>0@}, ..., delta at var{n-1}=@{real>0@}, theta1=@{real>0 and <1 @}, ..., theta at var{n-1}1=@{real>0 and <1 @}, "equilibrium frequencies"])
+ at item YNGP_M3([genetic_code=@{genetic code description@}, n=@{integer>0@}, kappa=@{real>0@}, omega0=@{real>0 and <1@}, delta1=@{real>0@}, ..., delta at var{n-1}=@{real>0@}, theta1=@{real>0 and <1 @}, ..., theta at var{n-1}1=@{real>0 and <1 @}, "equilibrium frequencies"])
 
 The M3 model of PAML, see Yang, Z., R. Nielsen, N. Goldman, and A.-M.
 K. Pedersen (2000), with @var{n} discrete values, with p0=theta1
@@ -901,24 +931,24 @@ and pk=(1-theta1)*...*(1-thetak)*theta(k+1), and
 omegak=omega0+delta1+....+deltak (default values: @var{n}=3,
 @var{kappa}=1, @var{thetak}=1/(n-k+1), @var{omega0}=0.5,
 @var{deltak}=0.5). See the
- at uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1YNGKP__M3.html#_details, Bio++ description}.
+ at uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1YNGP__M3.html#_details, Bio++ description}.
 
 
- at item YNGKP_M7(n=@{integer>0@}, genetic_code=@{genetic code description@},kappa=@{real>0@}, p=@{real>1@}, q=@{real>1 @}, "equilibrium frequencies"])
+ at item YNGP_M7(n=@{integer>0@}, genetic_code=@{genetic code description@},kappa=@{real>0@}, p=@{real>1@}, q=@{real>1 @}, "equilibrium frequencies"])
 
 The M7 model of PAML, see Yang, Z., R. Nielsen, N. Goldman, and A.-M.
 K. Pedersen (2000), with the Beta distribution discretized in @var{n}
 classes (default values: @var{kappa}=1, @var{p}=2, @var{q}=2). See the
- at uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1YNGKP__M7.html#_details, Bio++ description}.
+ at uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1YNGP__M7.html#_details, Bio++ description}.
 
 
- at item YNGKP_M8(n=@{integer>0@}, [genetic_code=@{genetic code description@},kappa=@{real>0@}, omegas=@{real>1@}, p0=@{real>0@},p=@{real>1@}, q=@{real>1 @}, "equilibrium frequencies"])
+ at item YNGP_M8(n=@{integer>0@}, [genetic_code=@{genetic code description@},kappa=@{real>0@}, omegas=@{real>1@}, p0=@{real>0@},p=@{real>1@}, q=@{real>1 @}, "equilibrium frequencies"])
 
 The M8 model of PAML, see Yang, Z., R. Nielsen, N. Goldman, and A.-M.
 K. Pedersen (2000), with the Beta distribution discretized in @var{n}
 classes (default values: @var{kappa}=1, @var{p}=2, @var{q}=2,
 @var{p0}=0.5, @var{omegas}=2). See the
- at uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1YNGKP__M8.html#_details, Bio++ description}.
+ at uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1YNGP__M8.html#_details, Bio++ description}.
 
 
 @end table
@@ -1091,6 +1121,35 @@ has parameters @var{CodonDistFreq.012_T92.kappa},
 See the
 @uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1CodonDistanceFrequenciesSubstitutionModel.html#_details, Bio++ description}.
 
+ at item KronDistFreq(model=@{model name@} [,positions=pos1*pos2*...*posn + posx*...*posm + ...)])
+
+ at item KronDistFreq(model1=@{model name@}, model1=@{model name@}, ..., modeln=@{model name@}[,positions=pos1*pos2*...*posn + posx*...*posm + ...])
+
+substitution model on codons as @var{CodonDistFreq} above,
+allowing simultaneous substitutions.
+
+Optional argument @var{positions} can be used to describe which
+substitutions are allowed. See model @xref{Kron}.
+
+ at item KronDist(model=@{model name@} [,positions=pos1*pos2*...*posn + posx*...*posm + ...)])
+
+ at item KronDist(model1=@{model name@}, model1=@{model name@}, ..., modeln=@{model name@}[,positions=pos1*pos2*...*posn + posx*...*posm + ...])
+
+substitution model on codons as @var{CodonDist} above, allowing
+simultaneous substitutions.
+
+Optional argument @var{positions} can be used to describe which
+substitutions are allowed. See model @xref{Kron}.
+
+ at item KCM7() and  KCM19() 
+
+Kronecker Codon Model based on a unique (KCM7) or one per position
+(KCM19) GTR model. From Zaheri \& al, MBE, 2014.
+
+See the
+ at uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1KCM.html#_details, Bio++ description}.
+
+
 @item CodonDistPhasFreq(model=@{model name@}, frequencies=@{frequencies set description@} [, geneticcode=@{genetic code description@}, beta=@{real>0@}])
 
 or
@@ -1153,9 +1212,9 @@ See the
 
 @table @command
 
- at item Word(model=@{model name@} [,relrate1=@{1>real>0@}, ..., relrate@{n-1@}=@{1>real>0@}, "equilibrium frequencies"]) 
+ at item Word(model=@{model name@} [,relrate1=@{1>real>0@}, ..., relrate@{n-1@}=@{1>real>0@}]) 
 or 
- at item Word(model1=@{model name@}, model1=@{model name@}, ..., modeln=@{model name@}[, relrate1=@{1> real>0@}, ..., relrate@{n-1@}=@{1> real>0@}, "equilibrium frequencies"])
+ at item Word(model1=@{model name@}, model1=@{model name@}, ..., modeln=@{model name@}[, relrate1=@{1> real>0@}, ..., relrate@{n-1@}=@{1> real>0@}])
 
 substitution model on words. The arguments @var{model} and
 @var{model@{i@}} are for descriptions of models on single sites such
@@ -1202,6 +1261,67 @@ site follows a HKY85 model. Then the parameters names are
 See the
 @uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1WordSubstitutionModel.html#_details, Bio++ description}.
 
+ at item Kron(model=@{model name@} [,positions=pos1*pos2*...*posn + posx*...*posm + ...)])
+ at anchor{Kron}
+
+ at item Kron(model1=@{model name@}, model1=@{model name@}, ..., modeln=@{model name@}[,positions=pos1*pos2*...*posn + posx*...*posm + ...])
+
+substitution model on words, allowing simultaneous substitutions. The
+arguments @var{model} and @var{model@{i@}} are for descriptions of
+models on single sites such as nucleotides or proteins. The alphabet
+must be a Word alphabet.
+
+If the argument is @var{model}, the length of the words in the
+substitution model is determined by the length of the words in the
+alphabet, and the @emph{same} single site model is used (ie the
+parameters are shared between all positions).
+
+If the arguments are @var{model1}, ..., @var{model@{n@}}, the length
+of the words in the alphabet must be @var{n}, and each single site
+model stands for a single-site substitution model. In that case, all
+single site models parameters are position dependent.
+
+The rate of a multiple substitution is the product of the rates of the
+single substitutions it is made of.
+
+Without optional argument @var{positions}, all single and multiple
+substitutions are allowed.
+
+Optional argument @var{positions} describes the allowed substitutions.
+It is written as a formula with positions between 1 and the length of
+the word, and symbols '*' (to link positions that must change
+together) and '+' (to link sets of multiple susbtitutions that are
+allowed).
+
+As examples, on a DNA word with 3 positions:
+
+ at example
+model=Kron(model=K80(), positions=1*2*3)
+ at end example
+allows only substitutions that change the 3 positions.
+
+ at example
+model=Kron(model=K80(), positions=1*2+3)
+ at end example
+allows only substitutions that change the positions 1 and 2, and the
+ones that change position 3 alone.
+
+ at example
+model=Kron(model=K80(), positions=1*2+2*3)
+ at end example
+allows only substitutions that change two neighbor positions.
+
+ at example
+model=Kron(model=K80(), positions=1+2+3)
+ at end example
+allows only substitutions that change one position, i.e. @var{Word}
+model.
+
+
+See the
+ at uref{http://biopp.univ-montp2.fr/Documents/ClassDocumentation/bpp-phyl/html/classbpp_1_1KronSubstitutionModel.html#_details, Bio++ description}.
+
+
 @item Triplet(model=@{model description@} [, relrate1=@{real>0@}, relrate2=@{real>0@}]) 
 or 
 @item Triplet(model1=@{model description@}, model2=@{model description@}, model3=@{model description@}[, relrate1=@{real>0@}, relrate2=@{real>0@}]) 
@@ -1344,7 +1464,9 @@ different mixtures (see below).
 Mixture model from a given @var{model} in which some parameters follow
 a probabilistic distribution. Any discrete distribution available can
 be used @xref{Discrete distributions}. The description of the
-parameters distributions is described below.
+parameters distributions is described below. In case the range of a
+parameter is limited, the domain of the corresponding distribution is
+truncated accordingly.
 
 @example
 model=MixedModel(model=TN93(kappa1=Gamma(n=4,alpha=3,beta=1),\
@@ -2022,10 +2144,10 @@ This section now details the specific options for each program in the Bio++ Prog
 * bppdist::                     Bio++ Distance Methods.
 * bpppars::                     Bio++ Maximum Parsimony.
 * bppconsense::                 Bio++ Consensus Trees.
-* bppphysamp::                  Bio++ Phylogenetic Sampler.
 * bppreroot::                   Bio++ Serial Tree Re-rooting.
 * bppseqman::                   Bio++ Sequences Manipulation.
 * bppalnscore::                 Bio++ Alignment Scoring
+* bpppopstats::
 * bpptreedraw::                 Bio++ Tree Drawing.
 @end menu
 
@@ -2140,7 +2262,11 @@ Topology estimation is not possible with a clock constraint.
 Alignment information log file (site specific rates, etc):
 
 @item output.estimates = @{@{path@}|none@}
-Write numerical parameter estimated values.
+Write parameter estimated values.
+
+ at item output.estimates.alias = @{boolean@}
+Write the alias names of the aliased parameters instead of their
+values (default: true).
 
 @end table
 
@@ -2192,7 +2318,6 @@ This is usually the best option, particularly for nucleotide data sets.
 
 The BppSeqGen program uses the common syntax introduced in the previous section for setting the alphabet, loading the sequences (@pxref{Sequences}) and tree (@pxref{Tree}), specifying the model (@pxref{Model}) and writing sequence data (@pxref{WritingSequences}).
 
-
 The root sequence can be sampled from the model specification, with
 additional argument:
 
@@ -2232,6 +2357,23 @@ used to sample from the given sequence (@pxref{Sequences}).
 
 @end table
 
+Addition optional arguments include:
+
+ at table @command
+
+ at item input.tree.scale = @{float@}
+An optional scaling factor for the branch length (default to 1.0)
+
+ at item input.tree.method = @{single|MS|CoaSim@}
+Format of input tree(s). By default, a single tree is expected ('single'). Ancestral recombination graphs (ARGs), in the form of multiple trees, can also be provided in the MS or CoaSim format.
+Note that in the case of MS, ARG are given for a certain number of sites, wich should be provided as additional argument (e.g. @command{MS(number_of_sites=100)}).
+The ARG will be unscaled according to the given size, and rescaled according to the given number of sites to simulate. ARG in CoaSim format are already in relative scale.
+
+ at end table
+
+In addition, command line argument @option{--seed=@{int>0@}} can be
+used to set the seed of the random generator.
+
 @end table
 
  
@@ -2371,7 +2513,7 @@ Where to write bootstrap trees.
 
 @c ------------------------------------------------------------------------------------------------------------------
 
- at node bppconsense, bppphysamp, bpppars, Reference
+ at node bppconsense, bppreroot, bpppars, Reference
 @section BppConsense: Bio++ Consensus Trees
 
 Probably one of the simplest program to use in the suite, just takes a list of trees (for instance produced by BppML, BppDist or BppPars with the bootstrap option enabled) and compute bootstrap values for a reference tree, provided as input, or constructed using a consensus method.
@@ -2399,40 +2541,7 @@ Build a consensus tree according to a given threshold.
 
 @c ------------------------------------------------------------------------------------------------------------------
 
- at node bppphysamp, bppreroot, bppconsense, Reference
- at section BppPhySamp: Bio++ Phylogenetic Sampler
- 
-The Bio++ Phylogenetic Sampler samples sequences from a file according to phylogenetic information.
-The goal is to clean a big data set by removing redundant sequences, bringing only few additional information for evolutionary analyses.
-
-The BppPhySamp programs uses the common options for setting the alphabet, loading the sequences (@pxref{Sequences}) and (@pxref{Tree}) and writing the resulting data set (@pxref{WritingSequences}, @pxref{WritingTrees}).
-
- at table @command
-
- at item input.method = @{tree|matrix@}
-The method to provide phylogenetic information, either by a tree or a matrix.
-If the @option{tree} option is used, then the options for reading trees are used (@pxref{Tree}).
-
- at item input.matrix = @{path@} [[input.method = matrix]]
-The input matrix file.
-
- at item deletion_method = @{random|threshold|sample@}
-Method to use to remove sequence. 
-
- at item threshold = @{float>0@} [[deletion_method = threshold ]]
-The minimum distance separating two sequences in the sampled data set.
-Any sequences closer than this threshold in the original data set will be confronted so that only one is kept.
-
- at item sample_size = @{int>0@} [[deletion_method = sample|random ]]
-The number of sequences to keep in the final data set.
-
- at item choice_criterion = @{length|length.complete|random@}
-How to chose between closely related sequences? @option{length} takes the longest (maximum number of non-gap positions), @option{length.complete} takes the sequence with the maximum number of fully resolved positions and @option{random} picks one sequence at random.
- at end table 
-
- at c ------------------------------------------------------------------------------------------------------------------
-
- at node bppreroot, bppseqman, bppphysamp, Reference
+ at node bppreroot, bppseqman, bppconsense, Reference
 @section BppReroot: Bio++ Serial Tree Re-rooting
  
 @table @command
@@ -2470,6 +2579,9 @@ BppSeqMan can perform any number of elementary operation, in any order, providin
 Specific options:
 @table @command
 
+ at item input.alignment = @{boolean@}
+Are the input sequence aligned? If so site selection and filtering is enabled and can be used to preprocess the input data.
+
 @item sequence.manip = @{list<string>@}
 The list, in appropriate order, of elementary operations to perform.
 See below for a list of these operations.
@@ -2507,7 +2619,10 @@ Remove all stop codons in sequences. If sequences are aligned, stop codons will
 The genetic code used for translation is set via the genetic_code option.
 Genetic code is set once for all sequences.
 
- at item RemoveColumnsWithStops
+ at item RemoveEmptySequences
+Remove all empty sequences (ie sequences with only gaps).
+
+ at item RemoveColumnsWithStop
 Remove all sites with at least one stop codon.
 The genetic code used for translation is set via the genetic_code option.
 Genetic code is set once for all sequences.
@@ -2571,7 +2686,7 @@ sequence.manip=KeepComplete(maxGapAllowed=30%),GapToUnknown
 
 @c ------------------------------------------------------------------------------------------------------------------
 
- at node bppalnscore, bpptreedraw, bppseqman, Reference
+ at node bppalnscore, bpppopstats, bppseqman, Reference
 @section BppAlnScore: Bio++ Alignment Scoring
 
 This program compares two alignments and computes column scores.
@@ -2625,7 +2740,127 @@ word in all sequences will be used to determine the phase.
 
 @c ------------------------------------------------------------------------------------------------------------------
 
- at node bpptreedraw,  , bppalnscore, Reference
+ at node bpppopstats, bpptreedraw, bppalnscore, Reference
+ at section BppPopStats: Bio++ Population Genetics Statistics
+
+The @command{BppPopStats} program computes population genetics statistics from a sequence input alignement.
+It can compute glabal alignment statistics, as well as site-specific statistics. In the first case, results
+are output on screen or in a log file. In the second case, results are written in a table file, with one site per line.
+Statistics available also depend on the type on input data (coding or non-coding).
+
+ at command{BppPopStats} recognizes the standard options for alphabet and genetic code, in case a codon alphabet was specified.
+Sequences will be considered as coding if encoded with a codon alphabet, and non-coding otherwise.
+
+ at subsection Specific options
+
+ at table @command
+
+ at item input.sequence.file.ingroup = @{path@}
+Path toward the file containing the ingroup sequences.
+
+ at item input.sequence.format.ingroup = @{string@}
+Alignment input format, following standard options.
+
+ at item input.sequence.file.outgroup = @{path@}
+Path toward the file containing the outgroup sequences.
+
+ at item input.sequence.format.outgroup = @{string@}
+Alignment input format, following standard options.
+
+ at item input.sequence.file = @{path@}
+Path toward the file containing all sequences.
+This option is only recognized if @command{input.sequence.file.ingroup} was not specified.
+
+ at item input.sequence.format = @{string@}
+Alignment input format, following standard options.
+
+ at item input.sequence.outgroup.index = @{[int>0]@}
+Vector of positions indicating the positions of the outgroup sequences in the alignment.
+This option is only recognized if @command{input.sequence.file.ingroup} was not specified.
+
+ at item input.sequence.outgroup.name = @{[string]@}
+Vector of sequence names indicating the positions of the outgroup sequences in the alignment.
+This option is only recognized if @command{input.sequence.file.ingroup} was not specified.
+
+ at item input.sequence.stop_codons_policy = Keep|RemoveIfLast|RemoveAll
+Tells what to do with positions containing at least one stop codon: keep them, remove them only if they are at the end of the alignment, or remove them all.
+
+ at item pop.stats = @{[string]@}
+The list of statistics to compute. The next section describes all available statistics.
+
+ at item logfile = @{path@}
+Optional file where to output results.
+
+ at end table
+
+ at subsection Available statistics
+
+ at table @command
+
+ at item SiteFrequencies
+Output the number of segregating sites as well as the number of singletons.
+ 
+ at item Watterson75
+Compute Watterson's nucleotide diversity estimator (theta, averaged per site).
+
+ at item Tajima83
+Compute Tajima's nucleotide diversity estimator (pi, averaged per site).
+
+ at item TajimaD
+Compute Tajima's D. If a codon alignment is specified (and alphabet is set to codon type),
+the @command{positions} argument further allow to compute Tajima's D on synonymous sites only
+(@command{positions=synonymous}), non-synonymous sites (@command{positions=non-synonymous}).
+Default is to use all sites (@command{positions=all}).
+
+ at item FuAndLiDStar | FuAndLiFStar
+Compute Fu and Li's (1993) D and F statistics. If argument @command{tot_mut} is set to yes,
+then the total number of mutations is used in the calculation, instead of the number of segregating sites (default).
+
+ at item PiN_PiS
+For codon sequences only, obviously. Compute nucleotide diversity at synonymous and non-synonymous site,
+the number of synonymous and non-synonymous sites, as well as the weighted ratio (PiN / NbN) / (PiS / NbS). 
+
+ at item MKT
+Compute the MacDonald-Kreitman table, for codon sequences with outgroup.
+
+ at item CodonSitesStatistics
+Generate a table with codon-site specifics statistics, including:
+
+ at itemize @bullet
+
+ at item Whether the site is complete or not
+
+ at item Number of distinct states
+
+ at item Minor allele frequency
+
+ at item Major allele frequency
+
+ at item Minor allele
+
+ at item Major allele
+
+ at item State in the first outgroup sequence, if any
+
+ at item Mean number of synonymous positions
+
+ at item Whether the site is synonymous polymorphic
+
+ at item Whether the site is four-fold degenerated
+
+ at item Non-synonymous diversity (piN)
+
+ at item Synonymous diversity (piS)
+
+ at end itemize
+
+The @command{output.file} argument allows to specify the output file (mandatory).
+
+ at end table
+
+ at c ------------------------------------------------------------------------------------------------------------------
+
+ at node bpptreedraw,  , bpppopstats, Reference
 @section BppTreeDraw: Bio++ Tree Drawing
 
 This is a simple program that outputs a tree in various vector formats.
diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt
index 9c009cb..469cdb3 100644
--- a/man/CMakeLists.txt
+++ b/man/CMakeLists.txt
@@ -1,18 +1,42 @@
 # CMake script for Bio++ Program Suite
-# Author: Julien Dutheil
+# Authors:
+#   Julien Dutheil
+#   Francois gindraud (2017)
 # Created: 22/08/2009
 
-IF(MAN)
-  INSTALL(FILES bppml.1.${DOC_COMPRESS_EXT} DESTINATION share/man/man1)
-  INSTALL(FILES bppseqgen.1.${DOC_COMPRESS_EXT} DESTINATION share/man/man1)
-  INSTALL(FILES bppancestor.1.${DOC_COMPRESS_EXT} DESTINATION share/man/man1)
-  INSTALL(FILES bpppars.1.${DOC_COMPRESS_EXT} DESTINATION share/man/man1)
-  INSTALL(FILES bppdist.1.${DOC_COMPRESS_EXT} DESTINATION share/man/man1)
-  INSTALL(FILES bppconsense.1.${DOC_COMPRESS_EXT} DESTINATION share/man/man1)
-  INSTALL(FILES bppseqman.1.${DOC_COMPRESS_EXT} DESTINATION share/man/man1)
-  INSTALL(FILES bppreroot.1.${DOC_COMPRESS_EXT} DESTINATION share/man/man1)
-  INSTALL(FILES bppphysamp.1.${DOC_COMPRESS_EXT} DESTINATION share/man/man1)
-  INSTALL(FILES bpptreedraw.1.${DOC_COMPRESS_EXT} DESTINATION share/man/man1)
-  INSTALL(FILES bppalnscore.1.${DOC_COMPRESS_EXT} DESTINATION share/man/man1)
-  INSTALL(FILES bppmixedlikelihoods.1.${DOC_COMPRESS_EXT} DESTINATION share/man/man1)
-ENDIF(MAN)
+# Build manpages.
+# In practice, they are just compressed from the text files using COMPRESS_PROGRAM
+# Manpages are built and installed as part of "all" if a COMPRESS_PROGRAM is found.
+
+# Take all manpages files in the directory
+file (GLOB manpage_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.1)
+
+if (NOT COMPRESS_BIN)
+  # Just install manpages from source
+  foreach (manpage_file ${manpage_files})
+    install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${manpage_file} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
+  endforeach (manpage_file)
+else ()
+  # Create a list of manpage targets
+  set (manpage-targets)
+
+  foreach (manpage_file ${manpage_files})
+    # Compress manpage, install, add to manpage target list
+    set (input ${CMAKE_CURRENT_SOURCE_DIR}/${manpage_file})
+    set (output ${CMAKE_CURRENT_BINARY_DIR}/${manpage_file}.${COMPRESS_EXT})
+    add_custom_command (
+      OUTPUT ${output}
+      COMMAND ${COMPRESS_BIN} ${COMPRESS_ARGS} ${input} > ${output}
+      DEPENDS ${input}
+      COMMENT "Compressing manpage ${manpage_file}"
+      VERBATIM
+      )
+    install (FILES ${output} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
+    list (APPEND manpage-targets ${output})
+    unset (input)
+    unset (output)
+  endforeach (manpage_file)
+
+  # Add target "man", built with "all" (needed because install will fail if not built).
+  add_custom_target (man ALL DEPENDS ${manpage-targets})
+endif ()
diff --git a/man/bppalnscore.1.txt b/man/bppalnscore.1
similarity index 100%
rename from man/bppalnscore.1.txt
rename to man/bppalnscore.1
diff --git a/man/bppancestor.1.txt b/man/bppancestor.1
similarity index 100%
rename from man/bppancestor.1.txt
rename to man/bppancestor.1
diff --git a/man/bppconsense.1.txt b/man/bppconsense.1
similarity index 100%
rename from man/bppconsense.1.txt
rename to man/bppconsense.1
diff --git a/man/bppdist.1.txt b/man/bppdist.1
similarity index 100%
rename from man/bppdist.1.txt
rename to man/bppdist.1
diff --git a/man/bppmixedlikelihoods.1.txt b/man/bppmixedlikelihoods.1
similarity index 100%
rename from man/bppmixedlikelihoods.1.txt
rename to man/bppmixedlikelihoods.1
diff --git a/man/bppml.1.txt b/man/bppml.1
similarity index 100%
rename from man/bppml.1.txt
rename to man/bppml.1
diff --git a/man/bpppars.1.txt b/man/bpppars.1
similarity index 100%
rename from man/bpppars.1.txt
rename to man/bpppars.1
diff --git a/man/bppphysamp.1.txt b/man/bppphysamp.1.txt
deleted file mode 100644
index 09e85d7..0000000
--- a/man/bppphysamp.1.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-.TH BPPPHYSAMP 1 LOCAL
-
-.SH NAME
-
-bppphysamp - Phylogenetic sampling with Bio++
-
-.SH SYNOPSIS
-
-.B bppphysamp [options]
-
-.SH AVAILABILITY
-
-All UNIX flavors
-
-.SH DESCRIPTION
-
-bppphysamp samples a sequence alignment according to a given phylogenetic tree, in order to control the set of redundancy in the data.
-
-.SH OPTIONS
-
-You should refer to 'info bppsuite' or to the online manual of bppsuite for a complete list of available options.
-
-.TP 5
-
---noninteractive
-
-generates output for redirection in a file.
-
-.TP
-
-param=file
-
-reads a file for loading options
-
-.SH AUTHOR
-
-The Bio++ Development Team.
diff --git a/man/bppreroot.1.txt b/man/bpppopstats.1
similarity index 59%
copy from man/bppreroot.1.txt
copy to man/bpppopstats.1
index 8067265..2495237 100644
--- a/man/bppreroot.1.txt
+++ b/man/bpppopstats.1
@@ -1,12 +1,12 @@
-.TH BPPREROOT 1 LOCAL
+.TH BPPSEQMAN 1 LOCAL
 
 .SH NAME
 
-bppreroot - Sequential rerooting of trees with Bio++
+bpppopstats - Population genetics with Bio++
 
 .SH SYNOPSIS
 
-.B bppreroot [options]
+.B bpppopstats [options]
 
 .SH AVAILABILITY
 
@@ -14,7 +14,7 @@ All UNIX flavors
 
 .SH DESCRIPTION
 
-bppreroot reroots a set of trees according to a list of outgroup species.
+bpppopstats computes several population genetics statistics such as nucleotide diversity, tests for selection etc.
 
 .SH OPTIONS
 
@@ -34,4 +34,4 @@ reads a file for loading options
 
 .SH AUTHOR
 
-The Bio++ Development Team.
+Bio++ Development Team.
diff --git a/man/bppreroot.1.txt b/man/bppreroot.1
similarity index 100%
rename from man/bppreroot.1.txt
rename to man/bppreroot.1
diff --git a/man/bppseqgen.1.txt b/man/bppseqgen.1
similarity index 100%
rename from man/bppseqgen.1.txt
rename to man/bppseqgen.1
diff --git a/man/bppseqman.1.txt b/man/bppseqman.1
similarity index 100%
rename from man/bppseqman.1.txt
rename to man/bppseqman.1
diff --git a/man/bpptreedraw.1.txt b/man/bpptreedraw.1
similarity index 100%
rename from man/bpptreedraw.1.txt
rename to man/bpptreedraw.1

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



More information about the debian-med-commit mailing list