From 1f35ffa0806f5f0d70f31f3894cfd1ef816c2fdb Mon Sep 17 00:00:00 2001 From: xiangzhou Date: Sat, 20 Sep 2014 11:51:03 -0400 Subject: version 0.95alpha --- bslmm.cpp | 13 +++++++------ bslmm.h | 1 + gemma.cpp | 12 ++++++++++-- lm.cpp | 3 ++- lm.h | 1 + lmm.cpp | 5 +++-- lmm.h | 1 + main.cpp | 10 +++++----- mvlmm.cpp | 3 ++- mvlmm.h | 1 + param.cpp | 6 +++--- param.h | 1 + prdt.cpp | 5 +++-- prdt.h | 1 + vc.h | 2 ++ 15 files changed, 43 insertions(+), 22 deletions(-) diff --git a/bslmm.cpp b/bslmm.cpp index ff9618d..55a05ca 100644 --- a/bslmm.cpp +++ b/bslmm.cpp @@ -70,6 +70,7 @@ void BSLMM::CopyFromParam (PARAM &cPar) file_bfile=cPar.file_bfile; file_geno=cPar.file_geno; file_out=cPar.file_out; + path_out=cPar.path_out; l_min=cPar.h_min; l_max=cPar.h_max; @@ -134,7 +135,7 @@ void BSLMM::CopyToParam (PARAM &cPar) void BSLMM::WriteBV (const gsl_vector *bv) { string file_str; - file_str="./output/"+file_out; + file_str=path_out+"/"+file_out; file_str+=".bv.txt"; ofstream outfile (file_str.c_str(), ofstream::out); @@ -162,7 +163,7 @@ void BSLMM::WriteBV (const gsl_vector *bv) void BSLMM::WriteParam (vector > &beta_g, const gsl_vector *alpha, const size_t w) { string file_str; - file_str="./output/"+file_out; + file_str=path_out+"/"+file_out; file_str+=".param.txt"; ofstream outfile (file_str.c_str(), ofstream::out); @@ -198,7 +199,7 @@ void BSLMM::WriteParam (vector > &beta_g, const gsl_vector void BSLMM::WriteParam (const gsl_vector *alpha) { string file_str; - file_str="./output/"+file_out; + file_str=path_out+"/"+file_out; file_str+=".param.txt"; ofstream outfile (file_str.c_str(), ofstream::out); @@ -228,9 +229,9 @@ void BSLMM::WriteParam (const gsl_vector *alpha) void BSLMM::WriteResult (const int flag, const gsl_matrix *Result_hyp, const gsl_matrix *Result_gamma, const size_t w_col) { string file_gamma, file_hyp; - file_gamma="./output/"+file_out; + file_gamma=path_out+"/"+file_out; file_gamma+=".gamma.txt"; - file_hyp="./output/"+file_out; + file_hyp=path_out+"/"+file_out; file_hyp+=".hyp.txt"; ofstream outfile_gamma, outfile_hyp; @@ -1448,7 +1449,7 @@ void BSLMM::SetXgamma (const gsl_matrix *X, const gsl_matrix *X_old, const gsl_m //somehow the lapack_dgemm does not work here //#ifdef WITH_LAPACK //lapack_dgemm ((char *)"T", (char *)"N", 1.0, X_add, X_add, 0.0, XtX_aa); - //lapack_dgemm ((char *)"T", (char *)"N", 1.0, X_add, X_old, 0.0, XtX_ao); + //lapack_dgemm ((char *)"T", (char *)"N", 1.0, X_add, X_temp, 0.0, XtX_at); //#else gsl_blas_dgemm (CblasTrans, CblasNoTrans, 1.0, X_add, X_add, 0.0, XtX_aa); diff --git a/bslmm.h b/bslmm.h index f407794..8b5edc7 100644 --- a/bslmm.h +++ b/bslmm.h @@ -49,6 +49,7 @@ public: string file_bfile; string file_geno; string file_out; + string path_out; // LMM related parameters double l_min; diff --git a/gemma.cpp b/gemma.cpp index 093cd05..b8693a8 100644 --- a/gemma.cpp +++ b/gemma.cpp @@ -61,7 +61,7 @@ using namespace std; GEMMA::GEMMA(void): -version("0.95"), date("08/08/2014"), year("2011") +version("0.95alpha"), date("08/08/2014"), year("2011") {} void GEMMA::PrintHeader (void) @@ -238,6 +238,7 @@ void GEMMA::PrintHelp(size_t option) cout<<" 2: \"id id value\" format"< > indicator_pheno; vector indicator_cvt; diff --git a/vc.h b/vc.h index aed5247..f34d72e 100644 --- a/vc.h +++ b/vc.h @@ -57,6 +57,7 @@ class VC { public: // IO related parameters string file_out; + string path_out; vector v_sigma2; vector v_se_sigma2; @@ -72,6 +73,7 @@ public: // Main functions void CopyFromParam (PARAM &cPar); void CopyToParam (PARAM &cPar); + void CalcVChe (const gsl_matrix *K, const gsl_matrix *W, const gsl_vector *y); void CalcVCreml (const gsl_matrix *K, const gsl_matrix *W, const gsl_vector *y); }; -- cgit v1.2.3