[Genabel-commits] r1720 - in branches/ProbABEL-pvals/ProbABEL: . src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Apr 30 16:50:58 CEST 2014


Author: lckarssen
Date: 2014-04-30 16:50:58 +0200 (Wed, 30 Apr 2014)
New Revision: 1720

Modified:
   branches/ProbABEL-pvals/ProbABEL/configure.ac
   branches/ProbABEL-pvals/ProbABEL/src/main.cpp
   branches/ProbABEL-pvals/ProbABEL/src/main_functions_dump.cpp
Log:
ProbABEL p-vals branch:
- Changed WITH_BOOST preprocessor variable name to WITH_BOOST_MATH so we can later also separately check for other parts of the Boost library if necessary.
- Minor updates to the Doxygen documentation.


Modified: branches/ProbABEL-pvals/ProbABEL/configure.ac
===================================================================
--- branches/ProbABEL-pvals/ProbABEL/configure.ac	2014-04-30 14:03:05 UTC (rev 1719)
+++ branches/ProbABEL-pvals/ProbABEL/configure.ac	2014-04-30 14:50:58 UTC (rev 1720)
@@ -39,7 +39,7 @@
       # User did not set CPPFLAGS, so we can put in our own defaults
       CPPFLAGS="-Wall"
    fi
-   CXXFLAGS+=" -g -Wextra"
+   CXXFLAGS+=" -g"
 fi
 
 if test "x$devoptions" = "xno"; then
@@ -91,9 +91,9 @@
 fi
 
 
-# See if we can use the Boost libraries for calculating p-values
-AC_ARG_WITH([boost],
- AS_HELP_STRING([--with-boost], [Use the Boost Math library for
+# See if we can use the Boost math libraries for calculating p-values
+AC_ARG_WITH([boost-math],
+ AS_HELP_STRING([--with-boost-math], [Use the Boost Math library for
  calculating p-values. This is enabled by default]
                )
 )
@@ -103,7 +103,7 @@
 
     AC_ARG_WITH([boost-include-path],
         [AS_HELP_STRING([--with-boost-include-path],
-          [location of the Boost Math headers, defaults to /usr/include/boost])],
+          [location of the Boost headers, defaults to /usr/include/boost])],
         [CXXFLAGS+=" -I${withval}"
         CPPFLAGS+=" -I${withval}"],
         [CXXFLAGS+=' -I/usr/include/boost'
@@ -118,10 +118,10 @@
 to disable the calculation of p-values.])
     fi
 else
-   AC_MSG_NOTICE([not using the Boost libraries, so no p-values in the \
+   AC_MSG_NOTICE([not using the Boost Math libraries, so no p-values in the \
 output])
 fi
-AM_CONDITIONAL([WITH_BOOST], test "x$with_boost" != "xno")
+AM_CONDITIONAL([WITH_BOOST_MATH], test "x$with_boost" != "xno")
 
 
 # Checks for typedefs, structures, and compiler characteristics.

Modified: branches/ProbABEL-pvals/ProbABEL/src/main.cpp
===================================================================
--- branches/ProbABEL-pvals/ProbABEL/src/main.cpp	2014-04-30 14:03:05 UTC (rev 1719)
+++ branches/ProbABEL-pvals/ProbABEL/src/main.cpp	2014-04-30 14:50:58 UTC (rev 1720)
@@ -242,7 +242,7 @@
     std::vector<std::ostringstream *> covvalue;
     std::vector<double*> chi2val; // vector that contains the chi2 values
     std::vector<std::ostringstream *> chi2;
-#if WITH_BOOST
+#if WITH_BOOST_MATH
     std::vector<std::ostringstream *> pval;
 #endif
 
@@ -263,7 +263,7 @@
         chi2[i]->precision(6);
         // *chi2[i] << scientific;
         chi2val.push_back(new double);
-#if WITH_BOOST
+#if WITH_BOOST_MATH
         pval.push_back(new std::ostringstream());
         pval[i]->precision(6);
 #endif
@@ -559,7 +559,7 @@
                 }  // END ngpreds == 1 (and SNP is rare)
             }  // END else: SNP is rare
 
-#if WITH_BOOST
+#if WITH_BOOST_MATH
             // Calulate p-values based on the chi^2 values
             int chi2df = 1;
             *pval[model] << pchisq(*chi2val[model], chi2df);
@@ -583,7 +583,7 @@
 #endif
                 *outfile[model] << chi2[model]->str();
 
-#if WITH_BOOST
+#if WITH_BOOST_MATH
                 *outfile[model] << input_var.getSep() << pval[model]->str();
 #endif
 
@@ -601,7 +601,7 @@
 #endif
             *outfile[0] << chi2[0]->str();
 
-#if WITH_BOOST
+#if WITH_BOOST_MATH
             *outfile[0] << input_var.getSep() << pval[0]->str();
 #endif
 
@@ -616,7 +616,7 @@
             covvalue[model]->str("");
             // Oct 26, 2009
             chi2[model]->str("");
-#if WITH_BOOST
+#if WITH_BOOST_MATH
             pval[model]->str("");
 #endif
         }
@@ -663,7 +663,7 @@
         ++it;
     }
 
-#if WITH_BOOST
+#if WITH_BOOST_MATH
     it = pval.begin();
     while (it != pval.end())
     {

Modified: branches/ProbABEL-pvals/ProbABEL/src/main_functions_dump.cpp
===================================================================
--- branches/ProbABEL-pvals/ProbABEL/src/main_functions_dump.cpp	2014-04-30 14:03:05 UTC (rev 1719)
+++ branches/ProbABEL-pvals/ProbABEL/src/main_functions_dump.cpp	2014-04-30 14:50:58 UTC (rev 1720)
@@ -1,3 +1,12 @@
+/**
+ * \file   main_functions_dump.cpp
+ * \author Yurii S. Aulchenko
+ * \author M. Kooyman
+ * \author L.C. Karssen
+ * \author Maksim V. Struchalin
+ *
+ * \brief File containing a bunch of functions used in main().
+ */
 /*
  * main_functions_dump.cpp
  *
@@ -35,7 +44,7 @@
 #include <iomanip>
 #include <vector>
 
-#if WITH_BOOST
+#if WITH_BOOST_MATH
 #include <boost/math/distributions.hpp>
 #endif
 
@@ -263,7 +272,7 @@
 #endif
         }
         *outfile[0] << input_var.getSep() << "chi2_SNP_add";
-#if WITH_BOOST
+#if WITH_BOOST_MATH
         *outfile[0] << input_var.getSep() << "pval_SNP_add";
 #endif
         *outfile[0] << "\n";
@@ -350,7 +359,7 @@
         *outfile[3] << input_var.getSep() << "chi2_SNP_rec";
         *outfile[4] << input_var.getSep() << "chi2_SNP_odom";
 
-#ifdef WITH_BOOST
+#ifdef WITH_BOOST_MATH
         *outfile[0] << input_var.getSep() << "pval_SNP_2df";
         *outfile[1] << input_var.getSep() << "pval_SNP_add";
         *outfile[2] << input_var.getSep() << "pval_SNP_dom";
@@ -372,7 +381,8 @@
 
 
 /**
- * Write the information from the mlinfo file to the output file(s).
+ * \brief Write the information from the mlinfo file to the output
+ * file(s).
  *
  * \param outfile Vector of output file(s)
  * \param file index number identifying the file in the vector of files
@@ -468,13 +478,16 @@
 }
 
 
-#ifdef WITH_BOOST
+#if WITH_BOOST_MATH
 /**
- * Calculate the p-value based on the chi^2 distribution.
+ * \brief Calculate the p-value based on the chi^2 distribution.
  *
- * \param chi2 chi^2 value for which the p-value should be
+ * This function is only available if ./configure has detected the
+ * Boost Math libraries.
+ *
+ * \param chi2 \f$\chi^2\f$ value for which the \f$p\f$-value should be
  * calculated.
- * \param df degrees of freedom of the chi^2 distribution
+ * \param df degrees of freedom of the \f$\chi^2\f$ distribution
  */
 double pchisq(const double chi2, const int df)
 {



More information about the Genabel-commits mailing list