aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPjotr Prins2020-09-28 09:23:29 +0100
committerPjotr Prins2020-09-28 09:23:29 +0100
commitfc5c1760bf8c09e90b27a0fd709d9bda6ed30a76 (patch)
tree7230737a989a54c3c0bc2c20588c2ee4c5c3c782
parent6233a881ceaf701c8ae4b075e4a3ac0f90b6ca84 (diff)
downloadpangemma-fc5c1760bf8c09e90b27a0fd709d9bda6ed30a76.tar.gz
Add debug statements parsing genotype file
-rw-r--r--src/gemma_io.cpp14
1 files 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<string> 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<string> 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));