[Genabel-commits] r658 - in pkg/VariABEL: R src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Feb 18 15:37:40 CET 2011


Author: maksim
Date: 2011-02-18 15:37:40 +0100 (Fri, 18 Feb 2011)
New Revision: 658

Modified:
   pkg/VariABEL/R/var.test.gwaa.R
   pkg/VariABEL/src/var_homogeneity_test_C.cpp
Log:
The order of adjustment on covariates is changed. Now the adjustment is performed during zerrizing of genotypic mean.

Modified: pkg/VariABEL/R/var.test.gwaa.R
===================================================================
--- pkg/VariABEL/R/var.test.gwaa.R	2011-02-18 13:14:35 UTC (rev 657)
+++ pkg/VariABEL/R/var.test.gwaa.R	2011-02-18 14:37:40 UTC (rev 658)
@@ -212,12 +212,12 @@
 
 for(i in 2:p)
 	{
-	output_column_names <- c(output_column_names, paste(cov_names[i], "_effect", sep=""))
+	output_column_names <- c(output_column_names, paste(cov_names[i], "_eff", sep=""))
 	output_column_names <- c(output_column_names, paste(cov_names[i], "_se", sep=""))
 	}
 
-output_column_names <- c(output_column_names, "main_snp_effect")
-output_column_names <- c(output_column_names, "main_snp_effect_se")
+output_column_names <- c(output_column_names, "snp_eff_dispertion")
+output_column_names <- c(output_column_names, "snp_se_dispertion")
 
 colnames(results_df) <- output_column_names
 

Modified: pkg/VariABEL/src/var_homogeneity_test_C.cpp
===================================================================
--- pkg/VariABEL/src/var_homogeneity_test_C.cpp	2011-02-18 13:14:35 UTC (rev 657)
+++ pkg/VariABEL/src/var_homogeneity_test_C.cpp	2011-02-18 14:37:40 UTC (rev 658)
@@ -165,7 +165,7 @@
 	//Get rid of major SNP effect
 	//___________________________________________
 	
-	int p_geno_mean = 2;
+	int p_disp = 2;
 	for(int i=0; i<nids_nona ; i++) design_matrix_copy[i] = design_matrix[i];
 	for(int i=0; i<nids_nona ; i++) design_matrix_copy[i+nids_nona] = design_matrix[i +(p-1)*nids_nona];
 
@@ -182,14 +182,14 @@
 
  
  linear_regression(
-				        /*input variables:*/     trait, design_matrix_copy, &p_geno_mean, &nids_nona,
+				        /*input variables:*/     trait, design_matrix, p_, &nids_nona,
 								/*return variables:*/    betas, se, residuals,
 								/*auxiliary variables:*/ qty, jpvt, qraux, work, v, x_for_ch2inv);
 
 	//___________________________________________
 
-  double beta_snp   = betas[1];
-	double sebeta_snp = se[1];
+//  double beta_snp   = betas[1];
+//	double sebeta_snp = se[1];
 	
 		
 
@@ -200,10 +200,13 @@
 
 	//___________________________________________
 
+ 	double betas_disp[2], se_disp[2];
+
+	std::cout<<"1\n";
 	for(int i=0; i<nids ; i++) {residuals[i] = residuals[i]*residuals[i];}
 	linear_regression(
-				        /*input variables:*/     residuals, design_matrix, p_, &nids_nona,
-								/*return variables:*/    betas, se, residuals,
+				        /*input variables:*/     residuals, design_matrix_copy, &p_disp, &nids_nona,
+								/*return variables:*/    betas_disp, se_disp, residuals,
 								/*auxiliary variables:*/ qty, jpvt, qraux, work, v, x_for_ch2inv);
 
 	//___________________________________________
@@ -213,10 +216,15 @@
 //	for(int i=0 ; i<p ; i++) {std::cout<<"betas["<<i<<"]="<<betas[i]<<", se["<<i<<"]="<<se[i]<<"\n";}
 
 
-	*chi2 = (betas[p-1]/se[p-1])*(betas[p-1]/se[p-1]);
+	std::cout<<"2\n";
+	*chi2 = (betas_disp[1]/se_disp[1])*(betas_disp[1]/se_disp[1]);
+	std::cout<<"3\n";
 	*df = 1;
-	betas[p] = beta_snp;
-  se[p]	   = sebeta_snp;
+	std::cout<<"4\n";
+	betas[p] = betas_disp[1];
+	std::cout<<"5\n";
+  se[p]	   = se_disp[1];
+	std::cout<<"6\n";
 	
 	}
 



More information about the Genabel-commits mailing list