From fc5c1760bf8c09e90b27a0fd709d9bda6ed30a76 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Mon, 28 Sep 2020 09:23:29 +0100 Subject: Add debug statements parsing genotype file --- src/gemma_io.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gemma_io.cpp b/src/gemma_io.cpp index 0eea17f..20f7ce3 100644 --- a/src/gemma_io.cpp +++ b/src/gemma_io.cpp @@ -1482,6 +1482,9 @@ bool BimbamKin(const string file_geno, const set ksnps, token_i++; } + if (ns_test<1) + write(geno,"geno raw"); + geno_mean /= (double)(ni_total - n_miss); geno_var += geno_mean * geno_mean * (double)n_miss; geno_var /= (double)ni_total; @@ -1494,14 +1497,19 @@ bool BimbamKin(const string file_geno, const set ksnps, } } - // subtract the mean + if (ns_test<1) write(geno,"geno imputed"); + + // subtract the mean (centering genotype values) gsl_vector_add_constant(geno, -1.0 * geno_mean); + if (ns_test<1) write(geno,"geno mean"); - // center the genotypes + // z-score the genotypes if (k_mode == 2 && geno_var != 0) { // centering gsl_vector_scale(geno, 1.0 / sqrt(geno_var)); } - write(geno,"geno"); + + if (ns_test<1) write(geno,"geno z-scored"); + // set the SNP column ns_test gsl_vector_view Xlarge_col = gsl_matrix_column(Xlarge, ns_test % msize); enforce_gsl(gsl_vector_memcpy(&Xlarge_col.vector, geno)); -- cgit v1.2.3