about summary refs log tree commit diff
path: root/src/param.cpp
diff options
context:
space:
mode:
authorPjotr Prins2025-11-27 10:20:49 +0100
committerPjotr Prins2025-11-27 10:23:18 +0100
commit6bd0ea3e2a245c3f86f66505eec118296ae04d30 (patch)
tree04ef903832c459490f508af2dc5ed474c4f7f22a /src/param.cpp
parent333bfc9adfff0fcd444a815cfcca27708442fe80 (diff)
downloadpangemma-6bd0ea3e2a245c3f86f66505eec118296ae04d30.tar.gz
No one uses these uchar versions
Diffstat (limited to 'src/param.cpp')
-rw-r--r--src/param.cpp32
1 files changed, 8 insertions, 24 deletions
diff --git a/src/param.cpp b/src/param.cpp
index f96e9c3..9755579 100644
--- a/src/param.cpp
+++ b/src/param.cpp
@@ -104,7 +104,9 @@ PARAM::PARAM(void)
       randseed(-1), window_cm(0), window_bp(0), window_ns(0), n_block(200),
       error(false), ni_subsample(0), n_cvt(1), n_cat(0), n_vc(1),
       time_total(0.0), time_G(0.0), time_eigen(0.0), time_UtX(0.0),
-      time_UtZ(0.0), time_opt(0.0), time_Omega(0.0) {}
+      time_UtZ(0.0), time_opt(0.0), time_Omega(0.0) {
+    is_mdb = false;
+  }
 
 PARAM::~PARAM() {
   if (gsl_r)
@@ -181,12 +183,14 @@ void PARAM::ReadFiles(void) {
     }
 
     if (!file_geno.empty()) {
-      if (ReadFile_pheno(file_pheno, indicator_pheno, pheno, p_column) ==
-          false) {
+      std::string extension = ".mdb";
+      if (file_geno.size() >= extension.size() && file_geno.compare(file_geno.size() - extension.size(), extension.size(), extension) == 0)
+        is_mdb = true;
+      if (ReadFile_pheno(file_pheno, indicator_pheno, pheno, p_column) == false) {
         error = true;
       }
 
-      if (CountFileLines(file_geno, ns_total) == false) {
+      if (!is_mdb && is_check_mode() && CountFileLines(file_geno, ns_total) == false) {
         error = true;
       }
     }
@@ -1277,26 +1281,6 @@ void PARAM::ReadGenotypes(gsl_matrix *UtX, gsl_matrix *K, const bool calc_K) {
   return;
 }
 
-void PARAM::ReadGenotypes(vector<vector<unsigned char>> &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;
-    }
-  } else {
-    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;