Skip to content

Commit

Permalink
Merge branch 'multivariate_polynomial'
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentnoe committed May 28, 2020
2 parents 654cf20 + 4e74e53 commit 6970578
Show file tree
Hide file tree
Showing 29 changed files with 1,271 additions and 518 deletions.
2 changes: 2 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Makefile.am
EXTRA_DIST = README doxygenconfig
SUBDIRS = src tests

test: check
2 changes: 2 additions & 0 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,8 @@ uninstall-am:
.PRECIOUS: Makefile


test: check

# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
8 changes: 6 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ Version 1.06

Version 1.07
============

- A Full Templating of the automaton class has been applied to the program
(it can handle <double>,<cost<int>>, <polynomial<long int>>,...)
- Polynomial ongoing
- Multivariate polynomial are command-lined (output only, no seed selection)
- A automaton<void> templating has been enabled (no additional unused values
are stored on transitions)
- Adding the "-pF" polynomial computation : it will output polynomials according
to a probabilistic model in several variables.

33 changes: 30 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ Installation

(more at <http://bioinfo.cristal.univ-lille.fr/yass/iedera.php#downloadiedera>)

You need a C++ compiler and the autotools. On Linux, you can install
Binaries for Windows (x64) and OS X (x64) are available at <https://github.com/laurentnoe/iedera/releases>.

Otherwise, you need a C++ compiler and the autotools. On Linux, you can install
``g++``, ``autoconf``, ``automake``. On Mac, you can install
``xcode``, or the command line developer tools (or you can use
``macports`` to install ``g++-mp-5`` for example).
Expand Down Expand Up @@ -61,6 +63,7 @@ or copy the binary directly to your homedir::
cp src/iedera ~/.


Command-line
------------

Expand Down Expand Up @@ -184,14 +187,38 @@ will also probably improve the sensitivity result.
Polynomial form
---------------

When the probability *p* to generate a *match* is not fixed (for example *p=0.7* was set in all the previous examples), Mak & Benson have proposed to use a polynomial form and select what they called **dominant seeds**. We have noticed that this dominance applies as well for any other i.i.d criteria as the *Hit Integration* (Chung & Park), for *Lossless seeds*, and several discrete models ... (see <http://doi.org/10.1186/s13015-017-0092-1>) so the flag :
Bernoulli model
~~~~~~~~~~~~~~~

When the probability *p* to generate a *match* is not fixed (for example *p=0.7* was set in all the previous examples), Mak & Benson have proposed to use a polynomial form and select what they called **dominant seeds**. We have noticed that this dominance applies as well for any other i.i.d criteria as the *Hit Integration* (Chung & Park), for *Lossless seeds*, and several discrete models ... (see <http://doi.org/10.1186/s13015-017-0092-1>) so the flag:

-p
to activate dominant selection and output polynomial coefficients


is added in the current commited version of iedera (master branch).

Other multivariate models
~~~~~~~~~~~~~~~~~~~~~~~~~

When the probabilitic model is more complex compared to a simple Bernoulli model on a binary alphabet, it is possible to compute the probability as a multivariate polynomial form. For a given seed provided with the *-m* parameter, the output will contain this polynomial form set in square brackets. *Selection of the best seeds is left as an exercice for the reader.* The flag ``-pF <filename>`` activates the output of the multivariate polynomial on the given model. This flag is added on this local branch. The next example gives sensitivity of the seed 1101 on alignments of length 8 ::

iedera -spaced -pF model_bernoulli_simple_x_xp.txt -m "##-#" -l 8

on the bernoulli model provided by the file *model_bernoulli_simple_x_xp.txt* ::

2
0 1
0 1
0 x
1 1
0 xp
1 0
0 1
1 x
1 1
1 xp


References
----------
Expand Down
28 changes: 14 additions & 14 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -3883,8 +3883,8 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for type traits <tr1/type_traits> or <type_trait>, for std or std:tr1, and if compiler option -std=c++0x is needed" >&5
$as_echo_n "checking for type traits <tr1/type_traits> or <type_trait>, for std or std:tr1, and if compiler option -std=c++0x is needed... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for type traits <tr1/type_traits> or <type_trait>, for std or std:tr1, and if compiler option -std=c++11 is needed" >&5
$as_echo_n "checking for type traits <tr1/type_traits> or <type_trait>, for std or std:tr1, and if compiler option -std=c++11 is needed... " >&6; }
acx_type_traits=no
# (1) =========================== no compiler option ===========================
Expand All @@ -3897,7 +3897,7 @@ $as_echo_n "checking for type traits <tr1/type_traits> or <type_trait>, for std
int
main ()
{
typedef std::is_arithmetic<double> isArithmeticT;
typedef std::is_void<double> isVoidT;
;
return 0;
Expand Down Expand Up @@ -3927,7 +3927,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
int
main ()
{
typedef std::tr1::is_arithmetic<double> isArithmeticT;
typedef std::tr1::is_void<double> isVoidT;
;
return 0;
Expand Down Expand Up @@ -3957,7 +3957,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
int
main ()
{
typedef std::is_arithmetic<double> isArithmeticT;
typedef std::is_void<double> isVoidT;
;
return 0;
Expand Down Expand Up @@ -3987,7 +3987,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
int
main ()
{
typedef std::tr1::is_arithmetic<double> isArithmeticT;
typedef std::tr1::is_void<double> isVoidT;
;
return 0;
Expand All @@ -4013,15 +4013,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test "$acx_type_traits" = no; then
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=c++0x"
CXXFLAGS="$CXXFLAGS -std=c++11"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <type_traits>
int
main ()
{
typedef std::is_arithmetic<double> isArithmeticT;
typedef std::is_void<double> isVoidT;
;
return 0;
Expand Down Expand Up @@ -4050,15 +4050,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test "$acx_type_traits" = no; then
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=c++0x"
CXXFLAGS="$CXXFLAGS -std=c++11"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <type_traits>
int
main ()
{
typedef std::tr1::is_arithmetic<double> isArithmeticT;
typedef std::tr1::is_void<double> isVoidT;
;
return 0;
Expand Down Expand Up @@ -4087,15 +4087,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test "$acx_type_traits" = no; then
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=c++0x"
CXXFLAGS="$CXXFLAGS -std=c++11"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <tr1/type_traits>
int
main ()
{
typedef std::is_arithmetic<double> isArithmeticT;
typedef std::is_void<double> isVoidT;
;
return 0;
Expand Down Expand Up @@ -4124,15 +4124,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test "$acx_type_traits" = no; then
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=c++0x"
CXXFLAGS="$CXXFLAGS -std=c++11"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <tr1/type_traits>
int
main ()
{
typedef std::tr1::is_arithmetic<double> isArithmeticT;
typedef std::tr1::is_void<double> isVoidT;
;
return 0;
Expand Down
31 changes: 15 additions & 16 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

# Check for type traits in <type_traits> and std namespace

AC_DEFUN([ACX_CHECK_TYPE_TRAITS_CXX0X], [
AC_DEFUN([ACX_CHECK_TYPE_TRAITS_CXX11], [
AC_LANG_PUSH([C++])
AC_MSG_CHECKING([for type traits <tr1/type_traits> or <type_trait>, for std or std:tr1, and if compiler option -std=c++0x is needed])
AC_MSG_CHECKING([for type traits <tr1/type_traits> or <type_trait>, for std or std:tr1, and if compiler option -std=c++11 is needed])
acx_type_traits=no
# (1) =========================== no compiler option ===========================
Expand All @@ -14,7 +13,7 @@ AC_DEFUN([ACX_CHECK_TYPE_TRAITS_CXX0X], [
[
AC_LANG_PROGRAM(
[[#include <type_traits>]],
[[typedef std::is_arithmetic<double> isArithmeticT;]]
[[typedef std::is_void<double> isVoidT;]]
)
],
[
Expand All @@ -30,7 +29,7 @@ AC_DEFUN([ACX_CHECK_TYPE_TRAITS_CXX0X], [
[
AC_LANG_PROGRAM(
[[#include <type_traits>]],
[[typedef std::tr1::is_arithmetic<double> isArithmeticT;]]
[[typedef std::tr1::is_void<double> isVoidT;]]
)
],
[
Expand All @@ -46,7 +45,7 @@ AC_DEFUN([ACX_CHECK_TYPE_TRAITS_CXX0X], [
[
AC_LANG_PROGRAM(
[[#include <tr1/type_traits>]],
[[typedef std::is_arithmetic<double> isArithmeticT;]]
[[typedef std::is_void<double> isVoidT;]]
)
],
[
Expand All @@ -62,7 +61,7 @@ AC_DEFUN([ACX_CHECK_TYPE_TRAITS_CXX0X], [
[
AC_LANG_PROGRAM(
[[#include <tr1/type_traits>]],
[[typedef std::tr1::is_arithmetic<double> isArithmeticT;]]
[[typedef std::tr1::is_void<double> isVoidT;]]
)
],
[
Expand All @@ -77,12 +76,12 @@ AC_DEFUN([ACX_CHECK_TYPE_TRAITS_CXX0X], [
if test "$acx_type_traits" = no; then
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=c++0x"
CXXFLAGS="$CXXFLAGS -std=c++11"
AC_COMPILE_IFELSE(
[
AC_LANG_PROGRAM(
[[#include <type_traits>]],
[[typedef std::is_arithmetic<double> isArithmeticT;]]
[[typedef std::is_void<double> isVoidT;]]
)
],
[
Expand All @@ -100,12 +99,12 @@ AC_DEFUN([ACX_CHECK_TYPE_TRAITS_CXX0X], [
if test "$acx_type_traits" = no; then
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=c++0x"
CXXFLAGS="$CXXFLAGS -std=c++11"
AC_COMPILE_IFELSE(
[
AC_LANG_PROGRAM(
[[#include <type_traits>]],
[[typedef std::tr1::is_arithmetic<double> isArithmeticT;]]
[[typedef std::tr1::is_void<double> isVoidT;]]
)
],
[
Expand All @@ -123,12 +122,12 @@ AC_DEFUN([ACX_CHECK_TYPE_TRAITS_CXX0X], [
if test "$acx_type_traits" = no; then
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=c++0x"
CXXFLAGS="$CXXFLAGS -std=c++11"
AC_COMPILE_IFELSE(
[
AC_LANG_PROGRAM(
[[#include <tr1/type_traits>]],
[[typedef std::is_arithmetic<double> isArithmeticT;]]
[[typedef std::is_void<double> isVoidT;]]
)
],
[
Expand All @@ -146,12 +145,12 @@ AC_DEFUN([ACX_CHECK_TYPE_TRAITS_CXX0X], [
if test "$acx_type_traits" = no; then
ac_save_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -std=c++0x"
CXXFLAGS="$CXXFLAGS -std=c++11"
AC_COMPILE_IFELSE(
[
AC_LANG_PROGRAM(
[[#include <tr1/type_traits>]],
[[typedef std::tr1::is_arithmetic<double> isArithmeticT;]]
[[typedef std::tr1::is_void<double> isVoidT;]]
)
],
[
Expand Down Expand Up @@ -193,7 +192,7 @@ CXXFLAGS=""
AC_PROG_CXX
AC_CHECK_HEADERS([stdlib.h string.h sys/time.h unistd.h])
AC_CHECK_FUNCS([gettimeofday sqrt strdup strtol])
ACX_CHECK_TYPE_TRAITS_CXX0X
ACX_CHECK_TYPE_TRAITS_CXX11
LIBS="$LIBS -lm"
AC_SUBST(CXXFLAGS)
AC_SUBST(LIBS)
Expand Down
Loading

0 comments on commit 6970578

Please sign in to comment.