[Genabel-commits] r1396 - pkg/ProbABEL/src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Nov 19 00:29:26 CET 2013
Author: lckarssen
Date: 2013-11-19 00:29:25 +0100 (Tue, 19 Nov 2013)
New Revision: 1396
Modified:
pkg/ProbABEL/src/command_line_settings.h
pkg/ProbABEL/src/coxph_data.h
pkg/ProbABEL/src/data.h
pkg/ProbABEL/src/eigen_mematrix.h
pkg/ProbABEL/src/gendata.h
pkg/ProbABEL/src/maskedmatrix.h
pkg/ProbABEL/src/mematrix.h
pkg/ProbABEL/src/phedata.h
pkg/ProbABEL/src/reg1.cpp
pkg/ProbABEL/src/reg1.h
pkg/ProbABEL/src/regdata.h
Log:
Fixing some more cpplint errors in ProbABEL. This time only changes in code layout (adding a space in front of 'public' and 'private' and fixing long lines), not functional changes.
Modified: pkg/ProbABEL/src/command_line_settings.h
===================================================================
--- pkg/ProbABEL/src/command_line_settings.h 2013-11-18 23:17:22 UTC (rev 1395)
+++ pkg/ProbABEL/src/command_line_settings.h 2013-11-18 23:29:25 UTC (rev 1396)
@@ -13,7 +13,7 @@
class cmdvars
{
-private:
+ private:
char * program_name;
char *phefilename;
@@ -42,7 +42,7 @@
int skipd;
int allcov;
-public:
+ public:
cmdvars()
{
program_name = NULL;
Modified: pkg/ProbABEL/src/coxph_data.h
===================================================================
--- pkg/ProbABEL/src/coxph_data.h 2013-11-18 23:17:22 UTC (rev 1395)
+++ pkg/ProbABEL/src/coxph_data.h 2013-11-18 23:29:25 UTC (rev 1396)
@@ -22,7 +22,7 @@
#include "phedata.h"
class coxph_data {
-public:
+ public:
coxph_data get_unmasked_data();
coxph_data()
@@ -52,8 +52,9 @@
unsigned short int * masked_data;
};
+
class coxph_reg {
-public:
+ public:
mematrix<double> beta;
mematrix<double> sebeta;
mematrix<double> residuals;
Modified: pkg/ProbABEL/src/data.h
===================================================================
--- pkg/ProbABEL/src/data.h 2013-11-18 23:17:22 UTC (rev 1395)
+++ pkg/ProbABEL/src/data.h 2013-11-18 23:29:25 UTC (rev 1396)
@@ -20,7 +20,7 @@
*
*/
class mlinfo {
-public:
+ public:
int nsnps; /**< Number of SNPs */
std::string * name; /**< Array of SNP names */
std::string * A1; /**< Array with the first allele */
@@ -47,13 +47,13 @@
};
class InvSigma {
-private:
+ private:
static const unsigned MAXIMUM_PEOPLE_AMOUNT = 1000000;
unsigned int npeople; /* number of people */
std::string filename;
mematrix<double> matrix; /* file is stored here */
-public:
+ public:
InvSigma(const char * filename_, phedata * phe);
mematrix<double> & get_matrix();
~InvSigma();
Modified: pkg/ProbABEL/src/eigen_mematrix.h
===================================================================
--- pkg/ProbABEL/src/eigen_mematrix.h 2013-11-18 23:17:22 UTC (rev 1395)
+++ pkg/ProbABEL/src/eigen_mematrix.h 2013-11-18 23:29:25 UTC (rev 1396)
@@ -10,7 +10,7 @@
template<class DT> class mematrix {
-public:
+ public:
int nrow;
int ncol;
int nelements;
Modified: pkg/ProbABEL/src/gendata.h
===================================================================
--- pkg/ProbABEL/src/gendata.h 2013-11-18 23:17:22 UTC (rev 1395)
+++ pkg/ProbABEL/src/gendata.h 2013-11-18 23:29:25 UTC (rev 1396)
@@ -18,7 +18,7 @@
#endif
class gendata {
-public:
+ public:
unsigned int nsnps;
unsigned int nids;
unsigned int ngpreds;
@@ -39,7 +39,7 @@
// MAKE THAT PRIVATE, ACCESS THROUGH GET_SNP
// ANOTHER PRIVATE OBJECT IS A POINTER TO DATABELBASECPP
// UPDATE SNP, ALL REGRESSION METHODS: ACCOUNT FOR MISSING
-private:
+ private:
mematrix<double> G;
AbstractMatrix * DAG;
unsigned short int * DAGmask;
Modified: pkg/ProbABEL/src/maskedmatrix.h
===================================================================
--- pkg/ProbABEL/src/maskedmatrix.h 2013-11-18 23:17:22 UTC (rev 1395)
+++ pkg/ProbABEL/src/maskedmatrix.h 2013-11-18 23:29:25 UTC (rev 1396)
@@ -17,7 +17,7 @@
#endif
class masked_matrix {
-public:
+ public:
masked_matrix();
masked_matrix(mematrix<double> M);
void set_matrix(const mematrix<double> &M);
@@ -27,8 +27,8 @@
mematrix<double> matrix_original;
mematrix<double> *masked_data;
int length_of_mask;
-private:
- //char type;
+
+ private:
mematrix<double> matrix_masked_data;
unsigned short int *mask_of_old;
void mask_symmetric(int nmeasured);
Modified: pkg/ProbABEL/src/mematrix.h
===================================================================
--- pkg/ProbABEL/src/mematrix.h 2013-11-18 23:17:22 UTC (rev 1395)
+++ pkg/ProbABEL/src/mematrix.h 2013-11-18 23:29:25 UTC (rev 1396)
@@ -5,7 +5,7 @@
template<class DT> class mematrix
{
-public:
+ public:
int nrow;
int ncol;
int nelements;
Modified: pkg/ProbABEL/src/phedata.h
===================================================================
--- pkg/ProbABEL/src/phedata.h 2013-11-18 23:17:22 UTC (rev 1395)
+++ pkg/ProbABEL/src/phedata.h 2013-11-18 23:29:25 UTC (rev 1396)
@@ -17,7 +17,7 @@
#endif
class phedata {
-public:
+ public:
phedata()
{
is_interaction_excluded = 0;
Modified: pkg/ProbABEL/src/reg1.cpp
===================================================================
--- pkg/ProbABEL/src/reg1.cpp 2013-11-18 23:17:22 UTC (rev 1395)
+++ pkg/ProbABEL/src/reg1.cpp 2013-11-18 23:29:25 UTC (rev 1396)
@@ -70,15 +70,17 @@
{
col_new++;
nX_without_interact_phe[row
- * nX_without_interact_phe.ncol + col_new] =
- nX[row * nX.ncol + col];
+ * nX_without_interact_phe.ncol
+ + col_new] =
+ nX[row * nX.ncol + col];
}
if (col != interaction - 1 && iscox)
{
col_new++;
nX_without_interact_phe[row
- * nX_without_interact_phe.ncol + col_new] =
- nX[row * nX.ncol + col];
+ * nX_without_interact_phe.ncol
+ + col_new] =
+ nX[row * nX.ncol + col];
}
} //interaction_only, model==0, ngpreds==2
//Oct 26, 2009
@@ -97,17 +99,20 @@
for (int i = 0; i < X.nrow; i++)
for (int j = 0; j < (X.ncol); j++)
nX[i * nX.ncol + j] = X[i * X.ncol + j];
+
for (int i = 0; i < nX.nrow; i++)
{
if (iscox)
{
+ //Maksim: interaction with SNP;;
nX[i * nX.ncol + c1] = X[i * X.ncol + csnp_p1]
- * X[i * X.ncol + interaction - 1]; //Maksim: interaction with SNP;;
+ * X[i * X.ncol + interaction - 1];
}
else
{
+ //Maksim: interaction with SNP;;
nX[i * nX.ncol + c1] = X[i * X.ncol + csnp_p1]
- * X[i * X.ncol + interaction]; //Maksim: interaction with SNP;;
+ * X[i * X.ncol + interaction];
}
}
//________________________
@@ -161,8 +166,11 @@
nX.reinit(X.nrow, (X.ncol - 1));
}
- int c1 = X.ncol - 2; // column with Prob(A1A2)
- int c2 = X.ncol - 1; // column with Prob(A1A1). Note the order is swapped cf the file!
+ // column with Prob(A1A2)
+ int c1 = X.ncol - 2;
+ // column with Prob(A1A1). Note the order is swapped cf the file!
+ int c2 = X.ncol - 1;
+
for (int i = 0; i < X.nrow; i++)
for (int j = 0; j < (X.ncol - 2); j++)
nX[i * nX.ncol + j] = X[i * X.ncol + j];
@@ -374,7 +382,8 @@
printf("beta[0] = %e\n", betaeigen.data()[0]);
printf("----\n");
// (beta).print();
- double relative_error = (tXXeigen * betaeigen - tXYeigen).norm() / tXYeigen.norm(); // norm() is L2 norm
+ double relative_error = (tXXeigen * betaeigen - tXYeigen).norm() /
+ tXYeigen.norm(); // norm() is L2 norm
cout << "The relative error is:\n" << relative_error << endl;
}
Modified: pkg/ProbABEL/src/reg1.h
===================================================================
--- pkg/ProbABEL/src/reg1.h 2013-11-18 23:17:22 UTC (rev 1395)
+++ pkg/ProbABEL/src/reg1.h 2013-11-18 23:29:25 UTC (rev 1396)
@@ -38,7 +38,7 @@
int ngpreds, bool iscox, int nullmodel = 0);
class base_reg {
-public:
+ public:
mematrix<double> beta;
mematrix<double> sebeta;
//Han Chen
@@ -55,7 +55,7 @@
};
class linear_reg: public base_reg {
-public:
+ public:
linear_reg(regdata& rdatain);
~linear_reg()
{
@@ -75,7 +75,7 @@
};
class logistic_reg: public base_reg {
-public:
+ public:
int niter;
logistic_reg(regdata& rdatain);
Modified: pkg/ProbABEL/src/regdata.h
===================================================================
--- pkg/ProbABEL/src/regdata.h 2013-11-18 23:17:22 UTC (rev 1395)
+++ pkg/ProbABEL/src/regdata.h 2013-11-18 23:29:25 UTC (rev 1396)
@@ -19,7 +19,7 @@
#include "phedata.h"
class regdata {
-public:
+ public:
int nids;
int ncov;
int ngpreds;
@@ -38,7 +38,7 @@
regdata get_unmasked_data();
~regdata();
-private:
+ private:
};
#endif /* REGDATA_H_ */
More information about the Genabel-commits
mailing list