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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Dec 29 16:18:53 CET 2013


Author: lckarssen
Date: 2013-12-29 16:18:53 +0100 (Sun, 29 Dec 2013)
New Revision: 1513

Modified:
   pkg/ProbABEL/src/reg1.cpp
Log:
Minor code layout changes in ProbABEL's reg1.cpp. No functional changes.


Modified: pkg/ProbABEL/src/reg1.cpp
===================================================================
--- pkg/ProbABEL/src/reg1.cpp	2013-12-29 14:33:18 UTC (rev 1512)
+++ pkg/ProbABEL/src/reg1.cpp	2013-12-29 15:18:53 UTC (rev 1513)
@@ -39,7 +39,7 @@
                 {
                     if (iscox)
                     {
-                        //Maksim: interaction with SNP;;
+                        // Maksim: interaction with SNP;;
                         nX[i * nX.ncol + c1] = X[i * X.ncol + csnp_p1]
                                 * X[i * X.ncol + interaction - 1];
                         nX[i * nX.ncol + c2] = X[i * X.ncol + csnp_p2]
@@ -47,7 +47,7 @@
                     }
                     else
                     {
-                        //Maksim: interaction with SNP;;
+                        // Maksim: interaction with SNP;;
                         nX[i * nX.ncol + c1] = X[i * X.ncol + csnp_p1]
                                 * X[i * X.ncol + interaction];
                         nX[i * nX.ncol + c2] = X[i * X.ncol + csnp_p2]
@@ -62,7 +62,7 @@
 
                     for (int row = 0; row < nX.nrow; row++)
                     {
-                        //Han Chen
+                        // Han Chen
                         int col_new = -1;
                         for (int col = 0; col < nX.ncol; col++)
                         {
@@ -82,12 +82,12 @@
                                         + col_new] =
                                     nX[row * nX.ncol + col];
                             }
-                        } //interaction_only, model==0, ngpreds==2
-                          //Oct 26, 2009
+                        } // interaction_only, model==0, ngpreds==2
+                          // Oct 26, 2009
                     }
                     return nX_without_interact_phe;
-                } //end of is_interaction_excluded
-                  //________________________
+                }  // end of is_interaction_excluded
+                   //________________________
                 return (nX);
             }
             if (ngpreds == 1)
@@ -104,13 +104,13 @@
                 {
                     if (iscox)
                     {
-                        //Maksim: interaction with SNP;;
+                        // Maksim: interaction with SNP;;
                         nX[i * nX.ncol + c1] = X[i * X.ncol + csnp_p1]
                                 * X[i * X.ncol + interaction - 1];
                     }
                     else
                     {
-                         //Maksim: interaction with SNP;;
+                         // Maksim: interaction with SNP;;
                         nX[i * nX.ncol + c1] = X[i * X.ncol + csnp_p1]
                                 * X[i * X.ncol + interaction];
                     }
@@ -144,7 +144,7 @@
                         }
                     }
                     return nX_without_interact_phe;
-                } //end of is_interaction_excluded
+                }  // end of is_interaction_excluded
                   //________________________
                 return (nX);
             }
@@ -176,18 +176,18 @@
 
     for (int i = 0; i < nX.nrow; i++)
     {
-        if (model == 1) // additive
+        if (model == 1)  // additive
             nX[i * nX.ncol + c1] = X[i * X.ncol + c1] + 2. * X[i * X.ncol + c2];
-        else if (model == 2) //dominant
+        else if (model == 2)  //dominant
             nX[i * nX.ncol + c1] = X[i * X.ncol + c1] + X[i * X.ncol + c2];
-        else if (model == 3) // recessive
+        else if (model == 3)  // recessive
             nX[i * nX.ncol + c1] = X[i * X.ncol + c2];
-        else if (model == 4) // over-dominant
+        else if (model == 4)  // over-dominant
             nX[i * nX.ncol + c1] = X[i * X.ncol + c1];
 
         if (interaction != 0)
             nX[i * nX.ncol + c2] = X[i * nX.ncol + interaction]
-                    * nX[i * nX.ncol + c1]; //Maksim: interaction with SNP
+                    * nX[i * nX.ncol + c1];  // Maksim: interaction with SNP
     }
 
     //Han Chen
@@ -216,10 +216,11 @@
             }
         }
         return nX_without_interact_phe;
-    } //interaction_only, model!=0, ngpreds==2
+    }  // interaction_only, model!=0, ngpreds==2
     return nX;
 }
 
+
 mematrix<double> t_apply_model(mematrix<double>& X, int model, int interaction,
                                int ngpreds, bool iscox, int nullmodel)
 {
@@ -230,6 +231,7 @@
     return out;
 }
 
+
 linear_reg::linear_reg(regdata& rdatain)
 {
     regdata rdata = rdatain.get_unmasked_data();
@@ -250,6 +252,7 @@
     chi2_score = -1.;
 }
 
+
 void base_reg::base_score(mematrix<double>& resid, regdata& rdata, int verbose,
                           double tol_chol, int model, int interaction,
                           int ngpreds, const masked_matrix& invvarmatrix,
@@ -296,6 +299,7 @@
     chi2_score = chi2[0];
 }
 
+
 void linear_reg::estimate(regdata& rdatain, int verbose, double tol_chol,
                           int model, int interaction, int ngpreds,
                           masked_matrix& invvarmatrixin, int robust,
@@ -576,6 +580,7 @@
     }
 }
 
+
 void linear_reg::score(mematrix<double>& resid, regdata& rdatain, int verbose,
                        double tol_chol, int model, int interaction, int ngpreds,
                        const masked_matrix& invvarmatrix, int nullmodel)
@@ -585,6 +590,7 @@
                invvarmatrix, nullmodel = 0);
 }
 
+
 logistic_reg::logistic_reg(regdata& rdatain)
 {
     regdata rdata = rdatain.get_unmasked_data();
@@ -604,6 +610,7 @@
     chi2_score = -1.;
 }
 
+
 void logistic_reg::estimate(regdata& rdatain, int verbose, int maxiter,
                             double eps, double tol_chol, int model,
                             int interaction, int ngpreds,
@@ -835,6 +842,7 @@
     // exit(1);
 }
 
+
 void logistic_reg::score(mematrix<double>& resid, regdata& rdata, int verbose,
                          double tol_chol, int model, int interaction,
                          int ngpreds, masked_matrix& invvarmatrix,



More information about the Genabel-commits mailing list