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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Apr 28 16:14:25 CEST 2014


Author: lckarssen
Date: 2014-04-28 16:14:25 +0200 (Mon, 28 Apr 2014)
New Revision: 1708

Modified:
   pkg/ProbABEL/src/coxph_data.cpp
   pkg/ProbABEL/src/coxph_data.h
Log:
Added consts to the coxph_data class of ProbABEL.

This change also involves some code layout changes in the .h file and a small fix in the Doxygen documentation of coxph_data::update_snp.


Modified: pkg/ProbABEL/src/coxph_data.cpp
===================================================================
--- pkg/ProbABEL/src/coxph_data.cpp	2014-04-28 09:57:18 UTC (rev 1707)
+++ pkg/ProbABEL/src/coxph_data.cpp	2014-04-28 14:14:25 UTC (rev 1708)
@@ -215,20 +215,21 @@
     delete[] passed_sorted;
 }
 
-void coxph_data::update_snp(gendata *gend, const int snpnum) {
-    /**
+void coxph_data::update_snp(const gendata *gend, const int snpnum) {
+    /*
      * This is the main part of the fix of bug #1846
      * (C) of the fix:
      *   UMC St Radboud Nijmegen,
      *   Dept of Epidemiology & Biostatistics,
      *   led by Prof. B. Kiemeney
-     *
+     */
+    /**
      * Note this sorts by "order"!!!
      * Here we deal with transposed X, hence last two arguments are swapped
-     * compared to the other 'update_snp'
+     * compared to regdata::update_snp().
      * Also, the starting column-1 is not necessary for cox X therefore
      * 'ncov-j' changes to 'ncov-j-1'
-     **/
+     */
 
     // reset counter for frequency since it is a new snp
     gcount = 0;
@@ -236,7 +237,7 @@
 
     for (int j = 0; j < ngpreds; j++) {
         double *snpdata = new double[nids];
-       std::fill (masked_data, masked_data + nids, 0);
+        std::fill (masked_data, masked_data + nids, 0);
 
         gend->get_var(snpnum * ngpreds + j, snpdata);
 

Modified: pkg/ProbABEL/src/coxph_data.h
===================================================================
--- pkg/ProbABEL/src/coxph_data.h	2014-04-28 09:57:18 UTC (rev 1707)
+++ pkg/ProbABEL/src/coxph_data.h	2014-04-28 14:14:25 UTC (rev 1708)
@@ -39,8 +39,21 @@
 
 class coxph_data {
  public:
-    coxph_data get_unmasked_data();
+    int nids;
+    int ncov;
+    int ngpreds;
+    unsigned int gcount;
+    double freq;
+    mematrix<double> weights;
+    mematrix<double> stime;
+    mematrix<int>    sstat;
+    mematrix<double> offset;
+    mematrix<int>    strata;
+    mematrix<double> X;
+    mematrix<int>    order;
+    unsigned short int * masked_data;
 
+
     coxph_data()
     {
         nids        = 0;
@@ -53,23 +66,12 @@
 
     coxph_data(const coxph_data &obj);
     coxph_data(phedata &phed, gendata &gend, const int snpnum);
-    void update_snp(gendata *gend, const int snpnum);
-    void remove_snp_from_X();
     ~coxph_data();
 
-    int nids;
-    int ncov;
-    int ngpreds;
-    unsigned int gcount;
-    double freq;
-    mematrix<double> weights;
-    mematrix<double> stime;
-    mematrix<int>    sstat;
-    mematrix<double> offset;
-    mematrix<int>    strata;
-    mematrix<double> X;
-    mematrix<int>    order;
-    unsigned short int * masked_data;
+
+    coxph_data get_unmasked_data();
+    void update_snp(const gendata *gend, const int snpnum);
+    void remove_snp_from_X();
 };
 
 
@@ -83,7 +85,10 @@
     double chi2_score;
     int niter;
 
+
     coxph_reg(coxph_data &cdatain);
+
+
     void estimate(coxph_data &cdatain, int maxiter,
                   double eps, double tol_chol, const int model,
                   const int interaction, const int ngpreds, const bool iscox,



More information about the Genabel-commits mailing list