about summary refs log tree commit diff
path: root/src/param.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/param.cpp')
-rw-r--r--src/param.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/param.cpp b/src/param.cpp
index f799ef7..955da8e 100644
--- a/src/param.cpp
+++ b/src/param.cpp
@@ -149,26 +149,28 @@ void PARAM::ReadFiles(void) {
     }
   }
 
-  // Read SNP set.
-  if (!file_snps.empty()) {
-    if (ReadFile_snps(file_snps, setSnps) == false) {
-      error = true;
-    }
-  } else {
-    setSnps.clear();
+  if (file_geno.find(".mdb") != string::npos) {
+    is_mdb = true;
   }
 
-  // Read KSNP set.
-  if (!file_ksnps.empty()) {
-    if (ReadFile_snps(file_ksnps, setKSnps) == false) {
-      error = true;
+  if (!is_mdb) {
+    // Read SNP set into setSnps (without filtering)
+    if (!file_snps.empty()) {
+      if (ReadFile_snps(file_snps, setSnps) == false) {
+        error = true;
+      }
+    } else {
+      setSnps.clear();
     }
-  } else {
-    setKSnps.clear();
-  }
 
-  if (file_geno.find(".mdb") != string::npos) {
-    is_mdb = true;
+    // Also read KSNP set. Snps used by GRM.
+    if (!file_ksnps.empty()) {
+      if (ReadFile_snps(file_ksnps, setKSnps) == false) {
+        error = true;
+      }
+    } else {
+      setKSnps.clear();
+    }
   }
 
   // For prediction.