aboutsummaryrefslogtreecommitdiff
path: root/src/gemma_io.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gemma_io.cpp')
-rw-r--r--src/gemma_io.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gemma_io.cpp b/src/gemma_io.cpp
index 20f7ce3..9c10e62 100644
--- a/src/gemma_io.cpp
+++ b/src/gemma_io.cpp
@@ -1482,14 +1482,16 @@ 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;
geno_var -= geno_mean * geno_mean;
+ if (ns_test<1) {
+ write(geno,"geno raw");
+ write(geno_mean,"geno mean");
+ }
+
// impute missing values by plugging in the mean
for (size_t i = 0; i < ni_total; ++i) {
if (gsl_vector_get(geno_miss, i) == 0) {
@@ -1504,7 +1506,7 @@ bool BimbamKin(const string file_geno, const set<string> ksnps,
if (ns_test<1) write(geno,"geno mean");
// z-score the genotypes
- if (k_mode == 2 && geno_var != 0) { // centering
+ if (k_mode == 2 && geno_var != 0) { // some confusion here
gsl_vector_scale(geno, 1.0 / sqrt(geno_var));
}