From 12d2acb8f8ea39da448c94754a708c0dd4369c34 Mon Sep 17 00:00:00 2001 From: Peter Carbonetto Date: Thu, 4 May 2017 15:17:47 -0500 Subject: Fixed problems with duplicate symbols; now using static gsl libraries in Makefile.osx so that others don't have to download it using Homebrew. --- src/vc.cpp | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) (limited to 'src/vc.cpp') diff --git a/src/vc.cpp b/src/vc.cpp index c0aa40d..1e0c562 100644 --- a/src/vc.cpp +++ b/src/vc.cpp @@ -453,7 +453,7 @@ int LogRL_dev12 (const gsl_vector *log_sigma2, void *params, gsl_vector *dev1, g //read header to determine which column contains which item -bool ReadHeader (const string &line, HEADER &header) +bool ReadHeader_vc (const string &line, HEADER &header) { string rs_ptr[]={"rs","RS","snp","SNP","snps","SNPS","snpid","SNPID","rsid","RSID"}; set rs_set(rs_ptr, rs_ptr+10); @@ -586,7 +586,7 @@ void ReadFile_cor (const string &file_cor, const set &setSnps, vector &vec_rs, const v HEADER header; !safeGetline(infile, line).eof(); - ReadHeader (line, header); + ReadHeader_vc (line, header); while (!safeGetline(infile, line).eof()) { //do not read cor values this time; upto col_n-1 @@ -1059,25 +1059,6 @@ void ReadFile_cor (const string &file_cor, const vector &vec_rs, const v return; } - - - - -//copied from lmm.cpp; is used in the following function VCss -//map a number 1-(n_cvt+2) to an index between 0 and [(n_c+2)^2+(n_c+2)]/2-1 -size_t GetabIndex (const size_t a, const size_t b, const size_t n_cvt) { - if (a>n_cvt+2 || b>n_cvt+2 || a<=0 || b<=0) {cout<<"error in GetabIndex."<a) {l=a; h=b;} else {l=b; h=a;} - - size_t n=n_cvt+2; - index=(2*n-l+2)*(l-1)/2+h-l; - - return index; -} - - //use the new method to calculate variance components with summary statistics //first, use a function CalcS to compute S matrix (where the diagonal elements are part of V(q) ), and then use bootstrap to compute the variance for S, use a set of genotypes, phenotypes, and individual ids, and snp category label void CalcVCss(const gsl_matrix *Vq, const gsl_matrix *S_mat, const gsl_matrix *Svar_mat, const gsl_vector *q_vec, const gsl_vector *s_vec, const double df, vector &v_pve, vector &v_se_pve, double &pve_total, double &se_pve_total, vector &v_sigma2, vector &v_se_sigma2, vector &v_enrich, vector &v_se_enrich) { -- cgit v1.2.3