[Genabel-commits] r1731 - pkg/ProbABEL/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon May 19 17:18:19 CEST 2014


Author: lckarssen
Date: 2014-05-19 17:18:19 +0200 (Mon, 19 May 2014)
New Revision: 1731

Modified:
   pkg/ProbABEL/src/gendata.cpp
   pkg/ProbABEL/src/main.cpp
   pkg/ProbABEL/src/mlinfo.cpp
   pkg/ProbABEL/src/reg1.h
Log:
Fixed a couple of Style guide violations in ProbABEL.
Things like lines > 80 characters, superfluous empty lines, etc. Only changes in code layout.


Modified: pkg/ProbABEL/src/gendata.cpp
===================================================================
--- pkg/ProbABEL/src/gendata.cpp	2014-05-19 14:46:52 UTC (rev 1730)
+++ pkg/ProbABEL/src/gendata.cpp	2014-05-19 15:18:19 UTC (rev 1731)
@@ -42,8 +42,9 @@
     int j = 0;
     // Check if not a null pointer
     if (!*all_numbers){
-        perror("Error while reading genetic data (expected pointer to char but found a null pointer)");
-                       exit(EXIT_FAILURE);
+        perror("Error while reading genetic data (expected pointer to char\
+ but found a null pointer)");
+        exit(EXIT_FAILURE);
     }
 
     while (j < amount_of_numbers)
@@ -61,7 +62,8 @@
         {
             result = std::numeric_limits<double>::quiet_NaN();
             // Skip other characters of NaN
-            while ((toupper(*all_numbers) == 'A') | (toupper(*all_numbers) == 'N'))
+            while ((toupper(*all_numbers) == 'A') |
+                   (toupper(*all_numbers) == 'N'))
             {
                 all_numbers++;
             }
@@ -216,7 +218,8 @@
         if (allmeasured[i] && idnames[j] != DAGobsname)
         {
             report_error(
-                "names do not match for observation at phenofile line (phe/geno) %i/+1 (%s/%s)\n",
+                "names do not match for observation at phenofile line\
+ (phe/geno) %i/+1 (%s/%s)\n",
                 i + 1, idnames[j].c_str(), DAGobsname.c_str());
         }
     }
@@ -311,7 +314,6 @@
     }
 
     infile.close();
-
 }
 
 // HERE NEED A NEW CONSTRUCTOR BASED ON DATABELBASECPP OBJECT

Modified: pkg/ProbABEL/src/main.cpp
===================================================================
--- pkg/ProbABEL/src/main.cpp	2014-05-19 14:46:52 UTC (rev 1730)
+++ pkg/ProbABEL/src/main.cpp	2014-05-19 15:18:19 UTC (rev 1731)
@@ -124,7 +124,6 @@
         // TODO(maartenk): remove timing code
         double millisec=((std::clock() - start) / (double)(CLOCKS_PER_SEC / 1000))/1000;
         cout << "done in "<< millisec<< " seconds.\n" << flush;
-
     }
     else
     {
@@ -134,7 +133,6 @@
                        input_var.getNgpreds(), phd.nids_all, phd.nids,
                        phd.allmeasured, phd.idnames);
         cout << "done.\n" << flush;
-
     }
 
 

Modified: pkg/ProbABEL/src/mlinfo.cpp
===================================================================
--- pkg/ProbABEL/src/mlinfo.cpp	2014-05-19 14:46:52 UTC (rev 1730)
+++ pkg/ProbABEL/src/mlinfo.cpp	2014-05-19 15:18:19 UTC (rev 1731)
@@ -54,14 +54,16 @@
         }
         nlin--; // Subtract one, the previous loop added 1 too much
     } else {
-        std::cerr << "mlinfo: cannot open info file " << filename << std::endl;
+        std::cerr << "mlinfo: cannot open info file "
+                  << filename << std::endl;
         exit(1);
     }
     infile.close();
 
     if (nlin % 7)
     {
-        std::cerr << "mlinfo: number of columns != 7 in " << filename << std::endl;
+        std::cerr << "mlinfo: number of columns != 7 in "
+                  << filename << std::endl;
         exit(1);
     }
     nsnps = static_cast<int>((nlin / 7) - 1);
@@ -78,7 +80,8 @@
     infile.open(filename);
     if (!infile)
     { // file couldn't be opened
-        std::cerr << "mlinfo: cannot open info file " << filename << std::endl;
+        std::cerr << "mlinfo: cannot open info file "
+                  << filename << std::endl;
         exit(1);
     }
     /* Read the header and discard it */
@@ -114,7 +117,8 @@
 
         if (!instr.is_open())
         {
-            std::cerr << "mlinfo: cannot open map file " << mapname << std::endl;
+            std::cerr << "mlinfo: cannot open map file "
+                      << mapname << std::endl;
             exit(1);
         }
 

Modified: pkg/ProbABEL/src/reg1.h
===================================================================
--- pkg/ProbABEL/src/reg1.h	2014-05-19 14:46:52 UTC (rev 1730)
+++ pkg/ProbABEL/src/reg1.h	2014-05-19 15:18:19 UTC (rev 1731)
@@ -138,6 +138,7 @@
                const int model, const int interaction,
                const int ngpreds, const masked_matrix& invvarmatrix,
                int nullmodel = 0);
+
  private:
     /**
      * \brief Constant that contains the maximum number of iterations



More information about the Genabel-commits mailing list