From f3df6447b345c6b4dee79d9996696978520344bb Mon Sep 17 00:00:00 2001 From: Peter Carbonetto Date: Mon, 19 Jun 2017 13:49:30 -0500 Subject: Removed FORCE_FLOAT from param.cpp. --- src/bslmm.cpp | 30 +- src/io.cpp | 26 +- src/param.cpp | 1124 ++++++++++++++++++++++++++++++++++----------------------- 3 files changed, 699 insertions(+), 481 deletions(-) diff --git a/src/bslmm.cpp b/src/bslmm.cpp index 92762e2..563b743 100644 --- a/src/bslmm.cpp +++ b/src/bslmm.cpp @@ -1730,10 +1730,14 @@ void BSLMM::MCMC (const gsl_matrix *X, const gsl_vector *y) { gsl_vector_view Xtznew_sub=gsl_vector_subvector(Xtz_new, 0, rank_new.size()); gsl_vector_view betanew_sub=gsl_vector_subvector(beta_new, 0, rank_new.size()); - gsl_matrix_memcpy(&Xold_sub.matrix, &Xnew_sub.matrix); - gsl_matrix_memcpy(&XtXold_sub.matrix, &XtXnew_sub.matrix); - gsl_vector_memcpy(&Xtzold_sub.vector, &Xtznew_sub.vector); - gsl_vector_memcpy(&betaold_sub.vector, &betanew_sub.vector); + gsl_matrix_memcpy(&Xold_sub.matrix, + &Xnew_sub.matrix); + gsl_matrix_memcpy(&XtXold_sub.matrix, + &XtXnew_sub.matrix); + gsl_vector_memcpy(&Xtzold_sub.vector, + &Xtznew_sub.vector); + gsl_vector_memcpy(&betaold_sub.vector, + &betanew_sub.vector); } } else { cHyp_new=cHyp_old; @@ -1777,12 +1781,18 @@ void BSLMM::MCMC (const gsl_matrix *X, const gsl_vector *y) { } } - gsl_matrix_set(Result_hyp,w_col,0,cHyp_old.h); - gsl_matrix_set(Result_hyp,w_col,1,cHyp_old.pve); - gsl_matrix_set(Result_hyp,w_col,2,cHyp_old.rho); - gsl_matrix_set(Result_hyp,w_col,3,cHyp_old.pge); - gsl_matrix_set(Result_hyp,w_col,4,cHyp_old.logp); - gsl_matrix_set(Result_hyp,w_col,5,cHyp_old.n_gamma); + gsl_matrix_set(Result_hyp,w_col,0, + cHyp_old.h); + gsl_matrix_set(Result_hyp,w_col,1, + cHyp_old.pve); + gsl_matrix_set(Result_hyp,w_col,2, + cHyp_old.rho); + gsl_matrix_set(Result_hyp,w_col,3, + cHyp_old.pge); + gsl_matrix_set(Result_hyp,w_col,4, + cHyp_old.logp); + gsl_matrix_set(Result_hyp,w_col,5, + cHyp_old.n_gamma); for (size_t i=0; i1) {cout<<"error! h values must be bewtween 0 and 1. current values = "<1) {cout<<"error! rho values must be between 0 and 1. current values = "<0) {cout<<"error! maximum logp value must be smaller than 0. current values = "<1) { + cout<<"error! h values must be bewtween 0 and 1. current "<< + "values = "<1) { + cout<<"error! rho values must be between 0 and 1. current "<< + "values = "<0) { + cout<<"error! maximum logp value must be smaller than 0. "<< + "current values = "<1.0) {cout<<"error! hscale value must be between 0 and 1. current value = "<1.0) {cout<<"error! rscale value must be between 0 and 1. current value = "<1.0) {cout<<"error! pscale value must be between 0 and 1. current value = "<1.0) { + cout<<"error! hscale value must be between 0 and 1. "<< + "current value = "<1.0) { + cout<<"error! rscale value must be between 0 and 1. "<< + "current value = "<1.0) { + cout<<"error! pscale value must be between 0 and 1. "<< + "current value = "<1 && a_mode!=1 && a_mode!=2 && a_mode!=3 && a_mode!=4 && a_mode!=43) { - cout<<"error! the current analysis mode "<1 && a_mode!=1 && a_mode!=2 && a_mode!=3 && a_mode!=4 && + a_mode!=43) { + cout<<"error! the current analysis mode "<1 && !file_gene.empty() ) { - cout<<"error! multiple phenotype analysis option not allowed with gene expression files. "<1) { - cout<<"error! pnr value must be between 0 and 1. current value = "<::size_type i=0; i<(indicator_idv).size(); ++i) { - indicator_idv[i]*=indicator_cvt[i]; - ni_test+=indicator_idv[i]; - } - } - - if ((indicator_read).size()!=0) { - ni_test=0; - for (vector::size_type i=0; i<(indicator_idv).size(); ++i) { - indicator_idv[i]*=indicator_read[i]; - ni_test+=indicator_idv[i]; - } - } - */ - if (ni_test==0 && file_cor.empty() && file_mstudy.empty() && file_study.empty() && file_beta.empty() && file_bf.empty() ) { + if (ni_test==0 && file_cor.empty() && file_mstudy.empty() && + file_study.empty() && file_beta.empty() && file_bf.empty() ) { error=true; cout<<"error! number of analyzed individuals equals 0. "<ns_test) {s_max=ns_test; cout<<"s_max is re-set to the number of analyzed SNPs."<ns_test) { + s_max=ns_test; + cout<<"s_max is re-set to the number of analyzed SNPs."<< + endl; + } + if (s_max > &Xt, gsl_matrix *K, const bool calc_K) { +void PARAM::ReadGenotypes (vector > &Xt, gsl_matrix *K, + const bool calc_K) { string file_str; if (!file_bfile.empty()) { file_str=file_bfile+".bed"; - if (ReadFile_bed (file_str, indicator_idv, indicator_snp, Xt, K, calc_K, ni_test, ns_test)==false) {error=true;} + if (ReadFile_bed (file_str, indicator_idv, indicator_snp, + Xt, K, calc_K, ni_test, ns_test)==false) { + error=true; + } } else { - if (ReadFile_geno (file_geno, indicator_idv, indicator_snp, Xt, K, calc_K, ni_test, ns_test)==false) {error=true;} + if (ReadFile_geno (file_geno, indicator_idv, indicator_snp, + Xt, K, calc_K, ni_test, ns_test)==false) { + error=true; + } } return; } - - - void PARAM::CalcKin (gsl_matrix *matrix_kin) { string file_str; @@ -1016,24 +1272,33 @@ void PARAM::CalcKin (gsl_matrix *matrix_kin) { if (!file_bfile.empty() ) { file_str=file_bfile+".bed"; - if (PlinkKin (file_str, indicator_snp, a_mode-20, d_pace, matrix_kin)==false) {error=true;} + if (PlinkKin (file_str, indicator_snp, a_mode-20, d_pace, + matrix_kin)==false) { + error=true; + } } else if (!file_oxford.empty() ) { file_str=file_oxford+".bgen"; - if (bgenKin (file_str, indicator_snp, a_mode-20, d_pace, matrix_kin)==false) {error=true;} + if (bgenKin (file_str, indicator_snp, a_mode-20, d_pace, + matrix_kin)==false) { + error=true; + } } else { file_str=file_geno; - if (BimbamKin (file_str, indicator_snp, a_mode-20, d_pace, matrix_kin)==false) {error=true;} + if (BimbamKin (file_str, indicator_snp, a_mode-20, d_pace, + matrix_kin)==false) { + error=true; + } } return; } - - -//from an existing n by nd A and K matrices, compute the d by d S matrix (which is not necessary symmetric) -void compAKtoS (const gsl_matrix *A, const gsl_matrix *K, const size_t n_cvt, gsl_matrix *S) { +// From an existing n by nd A and K matrices, compute the d by d S +// matrix (which is not necessary symmetric). +void compAKtoS (const gsl_matrix *A, const gsl_matrix *K, const size_t n_cvt, + gsl_matrix *S) { size_t n_vc=S->size1, ni_test=A->size1; double di, dj, tr_AK, sum_A, sum_K, s_A, s_K, sum_AK, tr_A, tr_K, d; @@ -1070,17 +1335,16 @@ void compAKtoS (const gsl_matrix *A, const gsl_matrix *K, const size_t n_cvt, gs } } - //eigenlib_invert(Si); - //cout<n_cvt+2 || b>n_cvt+2 || a<=0 || b<=0) {cout<<"error in GetabIndex."<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;} @@ -1091,8 +1355,10 @@ size_t GetabIndex (const size_t a, const size_t b, const size_t n_cvt) { return index; } -//from an existing n by nd (centered) G matrix, compute the d+1 by d*(d-1)/2*(d+1) Q matrix -//where inside i'th d+1 by d+1 matrix, each element is tr(KiKlKjKm)-r*tr(KmKiKl)-r*tr(KlKjKm)+r^2*tr(KlKm), where r=n/(n-1) +// From an existing n by nd (centered) G matrix, compute the d+1 by +// d*(d-1)/2*(d+1) Q matrix where inside i'th d+1 by d+1 matrix, each +// element is tr(KiKlKjKm)-r*tr(KmKiKl)-r*tr(KlKjKm)+r^2*tr(KlKm), +// where r=n/(n-1) void compKtoV (const gsl_matrix *G, gsl_matrix *V) { size_t n_vc=G->size2/G->size1, ni_test=G->size1; @@ -1103,27 +1369,24 @@ void compKtoV (const gsl_matrix *G, gsl_matrix *V) { double d, tr, r=(double)ni_test/(double)(ni_test-1); size_t t, t_il, t_jm, t_lm, t_im, t_jl, t_ij; - //compute KiKj for all pairs of i and j (not including the identity matrix) + // Compute KiKj for all pairs of i and j (not including the identity + // matrix). t=0; for (size_t i=0; isize1, ni_test=A->size1, n_cvt=W->size2; vector > > trAK, sumAK; @@ -1262,10 +1539,7 @@ void JackknifeAKtoS (const gsl_matrix *W, const gsl_matrix *A, const gsl_matrix vector vec_tmp; double di, dj, d, m, v; - //gsl_matrix *Stmp=gsl_matrix_alloc (n_vc, ni_test*n_vc); - //gsl_matrix *Stmp_sub=gsl_matrix_alloc (n_vc, n_vc); - - //initialize and set all elements to zero + // Initialize and set all elements to zero. for (size_t i=0; i &mapRS2wA, const map &mapRS2wK, const gsl_matrix *W, gsl_matrix *A, gsl_matrix *K, gsl_matrix *S, gsl_matrix *Svar, gsl_vector *ns) { +// Compute the d by d S matrix with its d by d variance matrix of +// Svar, and the d+1 by d(d+1) matrix of Q for V(q). +void PARAM::CalcS (const map &mapRS2wA, + const map &mapRS2wK, + const gsl_matrix *W, gsl_matrix *A, + gsl_matrix *K, gsl_matrix *S, + gsl_matrix *Svar, gsl_vector *ns) { string file_str; gsl_matrix_set_zero (S); gsl_matrix_set_zero (Svar); gsl_vector_set_zero (ns); - //compute the kinship matrix G for multiple categories; these matrices are not centered, for convienence of Jacknife sampling + // Compute the kinship matrix G for multiple categories; these + // matrices are not centered, for convienence of Jacknife sampling. if (!file_bfile.empty() ) { file_str=file_bfile+".bed"; if (mapRS2wA.size()==0) { - if (PlinkKin (file_str, d_pace, indicator_idv, indicator_snp, mapRS2wK, mapRS2cat, snpInfo, W, K, ns)==false) {error=true;} + if (PlinkKin (file_str, d_pace, indicator_idv, indicator_snp, mapRS2wK, + mapRS2cat, snpInfo, W, K, ns)==false) { + error=true; + } } else { - if (PlinkKin (file_str, d_pace, indicator_idv, indicator_snp, mapRS2wA, mapRS2cat, snpInfo, W, A, ns)==false) {error=true;} + if (PlinkKin (file_str, d_pace, indicator_idv, indicator_snp, mapRS2wA, + mapRS2cat, snpInfo, W, A, ns)==false) { + error=true; + } } } else if (!file_geno.empty()) { file_str=file_geno; if (mapRS2wA.size()==0) { - if (BimbamKin (file_str, d_pace, indicator_idv, indicator_snp, mapRS2wK, mapRS2cat, snpInfo, W, K, ns)==false) {error=true;} + if (BimbamKin (file_str, d_pace, indicator_idv, indicator_snp, + mapRS2wK, mapRS2cat, snpInfo, W, K, ns)==false) { + error=true; + } } else { - if (BimbamKin (file_str, d_pace, indicator_idv, indicator_snp, mapRS2wA, mapRS2cat, snpInfo, W, A, ns)==false) {error=true;} + if (BimbamKin (file_str, d_pace, indicator_idv, indicator_snp, + mapRS2wA, mapRS2cat, snpInfo, W, A, ns)==false) { + error=true; + } } } else if (!file_mbfile.empty() ){ if (mapRS2wA.size()==0) { - if (MFILEKin (1, file_mbfile, d_pace, indicator_idv, mindicator_snp, mapRS2wK, mapRS2cat, msnpInfo, W, K, ns)==false) {error=true;} + if (MFILEKin (1, file_mbfile, d_pace, indicator_idv, mindicator_snp, + mapRS2wK, mapRS2cat, msnpInfo, W, K, ns)==false) { + error=true; + } } else { - if (MFILEKin (1, file_mbfile, d_pace, indicator_idv, mindicator_snp, mapRS2wA, mapRS2cat, msnpInfo, W, A, ns)==false) {error=true;} + if (MFILEKin (1, file_mbfile, d_pace, indicator_idv, mindicator_snp, + mapRS2wA, mapRS2cat, msnpInfo, W, A, ns)==false) { + error=true; + } } } else if (!file_mgeno.empty()) { if (mapRS2wA.size()==0) { - if (MFILEKin (0, file_mgeno, d_pace, indicator_idv, mindicator_snp, mapRS2wK, mapRS2cat, msnpInfo, W, K, ns)==false) {error=true;} + if (MFILEKin (0, file_mgeno, d_pace, indicator_idv, mindicator_snp, + mapRS2wK, mapRS2cat, msnpInfo, W, K, ns)==false) { + error=true; + } } else { - if (MFILEKin (0, file_mgeno, d_pace, indicator_idv, mindicator_snp, mapRS2wA, mapRS2cat, msnpInfo, W, A, ns)==false) {error=true;} + if (MFILEKin (0, file_mgeno, d_pace, indicator_idv, mindicator_snp, + mapRS2wA, mapRS2cat, msnpInfo, W, A, ns)==false) { + error=true; + } } } @@ -1438,33 +1707,28 @@ void PARAM::CalcS (const map &mapRS2wA, const mapsize2, S); - //compute Svar and update S with Jacknife + // Compute Svar and update S with Jacknife. JackknifeAKtoS (W, A, K, S, Svar); - //based on G, compute a matrix Q that can be used to calculate the variance of q - //compKtoV (G, V); - return; } - - -void PARAM::WriteVector (const gsl_vector *q, const gsl_vector *s, const size_t n_total, const string suffix) -{ +void PARAM::WriteVector (const gsl_vector *q, const gsl_vector *s, + const size_t n_total, const string suffix) { string file_str; file_str=path_out+"/"+file_out; file_str+="."; @@ -1472,7 +1736,10 @@ void PARAM::WriteVector (const gsl_vector *q, const gsl_vector *s, const size_t file_str+=".txt"; ofstream outfile (file_str.c_str(), ofstream::out); - if (!outfile) {cout<<"error writing file: "< set_remove; - //check if any columns is an intercept + // Check if any columns is an intercept. for (size_t i=0; isize2; i++) { gsl_vector_view w_col=gsl_matrix_column (W, i); gsl_vector_minmax (&w_col.vector, &v_min, &v_max); if (v_min==v_max) {flag_ipt=1; set_remove.insert (i);} } - //add an intecept term if needed + // Add an intecept term if needed. if (n_cvt==set_remove.size()) { indicator_cvt.clear(); n_cvt=1; } else if (flag_ipt==0) { - cout<<"no intecept term is found in the cvt file. a column of 1s is added."<::size_type i=0; i::size_type i=0; i<(indicator_idv).size(); ++i) { + for (vector::size_type i=0; + i<(indicator_idv).size(); + ++i) { indicator_idv[i]*=indicator_cvt[i]; } } - //remove individuals with missing gxe variables + // Remove individuals with missing gxe variables. if ((indicator_gxe).size()!=0) { - for (vector::size_type i=0; i<(indicator_idv).size(); ++i) { + for (vector::size_type i=0; + i<(indicator_idv).size(); + ++i) { indicator_idv[i]*=indicator_gxe[i]; } } - //remove individuals with missing residual weights + // Remove individuals with missing residual weights. if ((indicator_weight).size()!=0) { - for (vector::size_type i=0; i<(indicator_idv).size(); ++i) { + for (vector::size_type i=0; + i<(indicator_idv).size(); + ++i) { indicator_idv[i]*=indicator_weight[i]; } } - //obtain ni_test + // Obtain ni_test. ni_test=0; for (vector::size_type i=0; i<(indicator_idv).size(); ++i) { if (indicator_idv[i]==0) {continue;} ni_test++; } - - - //if subsample number is set, perform a random sub-sampling to determine the subsampled ids + // If subsample number is set, perform a random sub-sampling + // to determine the subsampled ids. if (ni_subsample!=0) { if (ni_testtm_hour%24*3600+ptm->tm_min*60+ptm->tm_sec); + randseed = (unsigned) + (ptm->tm_hour%24*3600+ptm->tm_min*60+ptm->tm_sec); } gsl_r = gsl_rng_alloc(gslType); gsl_rng_set(gsl_r, randseed); - //from ni_test, sub-sample ni_subsample + // From ni_test, sub-sample ni_subsample. vector a, b; for (size_t i=0; i(&a[0]), ni_subsample, static_cast(&b[0]), ni_test, sizeof (size_t) ); + gsl_ran_choose (gsl_r, static_cast(&a[0]), ni_subsample, + static_cast(&b[0]),ni_test,sizeof (size_t)); - //re-set indicator_idv and ni_test + // Re-set indicator_idv and ni_test. int j=0; for (vector::size_type i=0; i<(indicator_idv).size(); ++i) { if (indicator_idv[i]==0) {continue;} @@ -1715,25 +1991,27 @@ void PARAM::ProcessCvtPhen () } } - //check ni_test + // Check ni_test. if (ni_test==0 && a_mode!=15) { error=true; cout<<"error! number of analyzed individuals equals 0. "< cvt_row; cvt_row.push_back(1); - for (vector::size_type i=0; i<(indicator_idv).size(); ++i) { + for (vector::size_type i=0; + i<(indicator_idv).size(); + ++i) { indicator_cvt.push_back(1); - cvt.push_back(cvt_row); } } @@ -1741,11 +2019,7 @@ void PARAM::ProcessCvtPhen () return; } - - - -void PARAM::CopyCvt (gsl_matrix *W) -{ +void PARAM::CopyCvt (gsl_matrix *W) { size_t ci_test=0; for (vector::size_type i=0; i flag_vec; - vector catc; - - for (size_t j=0; j::size_type i=0; i::size_type i=0; i::size_type i=0; i::size_type i=0; i::size_type i=0; i::size_type i=0; i &setSnps_beta, map &mapRS2wK) -{ +void PARAM::ObtainWeight (const set &setSnps_beta, + map &mapRS2wK) { mapRS2wK.clear(); vector wsum, wcount; @@ -1921,7 +2134,10 @@ void PARAM::ObtainWeight (const set &setSnps_beta, map & if (indicator_snp[i]==0) {continue;} rs=snpInfo[i].rs_number; - if ( (setSnps_beta.size()==0 || setSnps_beta.count(rs)!=0) && (mapRS2wsnp.size()==0 || mapRS2wsnp.count(rs)!=0) && (mapRS2wcat.size()==0 || mapRS2wcat.count(rs)!=0) && (mapRS2cat.size()==0 || mapRS2cat.count(rs)!=0) ) { + if ( (setSnps_beta.size()==0 || setSnps_beta.count(rs)!=0) && + (mapRS2wsnp.size()==0 || mapRS2wsnp.count(rs)!=0) && + (mapRS2wcat.size()==0 || mapRS2wcat.count(rs)!=0) && + (mapRS2cat.size()==0 || mapRS2cat.count(rs)!=0) ) { if (mapRS2wsnp.size()!=0) { mapRS2wK[rs]=mapRS2wsnp[rs]; if (mapRS2cat.size()==0) { @@ -1945,7 +2161,10 @@ void PARAM::ObtainWeight (const set &setSnps_beta, map & if (indicator_snp[i]==0) {continue;} rs=snpInfo[i].rs_number; - if ( (setSnps_beta.size()==0 || setSnps_beta.count(rs)!=0) && (mapRS2wsnp.size()==0 || mapRS2wsnp.count(rs)!=0) && (mapRS2wcat.size()==0 || mapRS2wcat.count(rs)!=0) && (mapRS2cat.size()==0 || mapRS2cat.count(rs)!=0) ) { + if ((setSnps_beta.size()==0 || setSnps_beta.count(rs)!=0) && + (mapRS2wsnp.size()==0 || mapRS2wsnp.count(rs)!=0) && + (mapRS2wcat.size()==0 || mapRS2wcat.count(rs)!=0) && + (mapRS2cat.size()==0 || mapRS2cat.count(rs)!=0) ) { if (mapRS2wsnp.size()!=0) { mapRS2wK[rs]=mapRS2wsnp[rs]; if (mapRS2cat.size()==0) { @@ -1967,7 +2186,9 @@ void PARAM::ObtainWeight (const set &setSnps_beta, map & wsum[i]/=wcount[i]; } - for (map::iterator it=mapRS2wK.begin(); it!=mapRS2wK.end(); ++it) { + for (map::iterator it=mapRS2wK.begin(); + it!=mapRS2wK.end(); + ++it) { if (mapRS2cat.size()==0) { it->second/=wsum[0]; } else { @@ -1978,10 +2199,12 @@ void PARAM::ObtainWeight (const set &setSnps_beta, map & return; } - -//pve_flag=0 then do not change pve; pve_flag==1, then change pve to 0 if pve < 0 and pve to 1 if pve > 1 -void PARAM::UpdateWeight (const size_t pve_flag, const map &mapRS2wK, const size_t ni_test, const gsl_vector *ns, map &mapRS2wA) -{ +// If pve_flag=0 then do not change pve; pve_flag==1, then change pve +// to 0 if pve < 0 and pve to 1 if pve > 1. +void PARAM::UpdateWeight (const size_t pve_flag, + const map &mapRS2wK, + const size_t ni_test, const gsl_vector *ns, + map &mapRS2wA) { double d; vector wsum, wcount; @@ -1990,7 +2213,9 @@ void PARAM::UpdateWeight (const size_t pve_flag, const map &mapR wcount.push_back(0.0); } - for (map::const_iterator it=mapRS2wK.begin(); it!=mapRS2wK.end(); ++it) { + for (map::const_iterator it=mapRS2wK.begin(); + it!=mapRS2wK.end(); + ++it) { d=1; for (size_t i=0; i=1 && pve_flag==1) { @@ -1998,7 +2223,8 @@ void PARAM::UpdateWeight (const size_t pve_flag, const map &mapR } else if (v_pve[i]<=0 && pve_flag==1) { d+=0; } else { - d+=(double)ni_test/gsl_vector_get(ns, i)*mapRS2wcat[it->first][i]*v_pve[i]; + d+=(double)ni_test/gsl_vector_get(ns, i)* + mapRS2wcat[it->first][i]*v_pve[i]; } } mapRS2wA[it->first]=1/(d*d); @@ -2016,7 +2242,9 @@ void PARAM::UpdateWeight (const size_t pve_flag, const map &mapR wsum[i]/=wcount[i]; } - for (map::iterator it=mapRS2wA.begin(); it!=mapRS2wA.end(); ++it) { + for (map::iterator it=mapRS2wA.begin(); + it!=mapRS2wA.end(); + ++it) { if (mapRS2cat.size()==0) { it->second/=wsum[0]; } else { @@ -2026,9 +2254,13 @@ void PARAM::UpdateWeight (const size_t pve_flag, const map &mapR return; } -// this function updates indicator_snp, and save z-scores and other values into vectors -void PARAM::UpdateSNPnZ (const map &mapRS2wA, const map &mapRS2A1, const map &mapRS2z, gsl_vector *w, gsl_vector *z, vector &vec_cat) -{ +// This function updates indicator_snp, and save z-scores and other +// values into vectors. +void PARAM::UpdateSNPnZ (const map &mapRS2wA, + const map &mapRS2A1, + const map &mapRS2z, + gsl_vector *w, gsl_vector *z, + vector &vec_cat) { gsl_vector_set_zero (w); gsl_vector_set_zero (z); vec_cat.clear(); @@ -2086,11 +2318,9 @@ void PARAM::UpdateSNPnZ (const map &mapRS2wA, const map &mapRS2wA) -{ +// This function updates indicator_snp, and save z-scores and other +// values into vectors. +void PARAM::UpdateSNP (const map &mapRS2wA) { string rs; if (msnpInfo.size()==0) { for (size_t i=0; i