about summary refs log tree commit diff
path: root/src/param.cpp
diff options
context:
space:
mode:
authorPjotr Prins2025-11-27 10:45:42 +0100
committerPjotr Prins2025-11-27 10:45:42 +0100
commit6abb0ce062f27e15a4168fca80939bc7600d781d (patch)
tree8361dd17aa97310907714440f3d2c6470dbdc876 /src/param.cpp
parent6bd0ea3e2a245c3f86f66505eec118296ae04d30 (diff)
downloadpangemma-6abb0ce062f27e15a4168fca80939bc7600d781d.tar.gz
Changing namings to bimbam to make clearer
Diffstat (limited to 'src/param.cpp')
-rw-r--r--src/param.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/param.cpp b/src/param.cpp
index 9755579..7e7ff6e 100644
--- a/src/param.cpp
+++ b/src/param.cpp
@@ -318,9 +318,10 @@ void PARAM::ReadFiles(void) {
 
     trim_individuals(indicator_idv, ni_max);
     trim_individuals(indicator_cvt, ni_max);
-    if (ReadFile_geno(file_geno, setSnps, W2, indicator_idv, indicator_snp,
-                      maf_level, miss_level, hwe_level, r2_level, mapRS2chr,
-                      mapRS2bp, mapRS2cM, snpInfo, ns_test) == false) {
+    // The following reads the geno file to get the SNPs
+    if (is_bimbam && ReadFile_bimbam_geno(file_geno, setSnps, W2, indicator_idv, indicator_snp,
+                                          maf_level, miss_level, hwe_level, r2_level, mapRS2chr,
+                                          mapRS2bp, mapRS2cM, snpInfo, ns_test) == false) {
       error = true;
       return;
     }
@@ -424,7 +425,7 @@ void PARAM::ReadFiles(void) {
     string file_name;
     size_t ns_test_tmp;
     while (!safeGetline(infile, file_name).eof()) {
-      if (ReadFile_geno(file_name, setSnps, W4, indicator_idv, indicator_snp,
+      if (ReadFile_bimbam_geno(file_name, setSnps, W4, indicator_idv, indicator_snp,
                         maf_level, miss_level, hwe_level, r2_level, mapRS2chr,
                         mapRS2bp, mapRS2cM, snpInfo, ns_test_tmp) == false) {
         error = true;
@@ -1262,7 +1263,7 @@ void PARAM::PrintSummary() {
   return;
 }
 
-void PARAM::ReadGenotypes(gsl_matrix *UtX, gsl_matrix *K, const bool calc_K) {
+void PARAM::ReadBIMBAMGenotypes(gsl_matrix *UtX, gsl_matrix *K, const bool calc_K) {
   string file_str;
 
   if (!file_bfile.empty()) {
@@ -1272,8 +1273,8 @@ void PARAM::ReadGenotypes(gsl_matrix *UtX, gsl_matrix *K, const bool calc_K) {
       error = true;
     }
   } else {
-    if (ReadFile_geno(file_geno, indicator_idv, indicator_snp, UtX, K,
-                      calc_K) == false) {
+      // Read BIMBAM. Not supposed to be mdb
+      if (is_mdb || ReadFile_geno(file_geno, indicator_idv, indicator_snp, UtX, K, calc_K) == false) {
       error = true;
     }
   }