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.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/param.cpp b/src/param.cpp
index 74b2f9b..516dfd8 100644
--- a/src/param.cpp
+++ b/src/param.cpp
@@ -149,10 +149,6 @@ void PARAM::ReadFiles(void) {
     }
   }
 
-  if (file_geno.find(".mdb") != string::npos) {
-    is_mdb = true;
-  }
-
   if (!is_mdb) {
     // Read SNP set into setSnps (without filtering)
     if (!file_snps.empty()) {
@@ -943,13 +939,18 @@ void PARAM::CheckParam(void) {
   enforce_fexists(file_gwasnps, "open file");
   enforce_fexists(file_anno, "open file");
 
+  if (file_geno.find(".mdb") != string::npos) {
+    is_mdb = true;
+  }
+
   if (!loco.empty()) {
     enforce_msg((a_mode >= 1 && a_mode <= 4) || a_mode == 9 || a_mode == 21 || a_mode == 22,
                 "LOCO only works with LMM and K");
     // enforce_msg(file_bfile.empty(), "LOCO does not work with PLink (yet)");
     enforce_msg(file_gxe.empty(), "LOCO does not support GXE (yet)");
-    enforce_msg(!file_anno.empty(),
-                "LOCO requires annotation file (-a switch)");
+    if (!is_mdb)
+      enforce_msg(!file_anno.empty(), "Without mdb LOCO requires annotation file (-a switch)");
+
     enforce_msg(file_ksnps.empty(), "LOCO does not allow -ksnps switch");
     enforce_msg(file_gwasnps.empty(), "LOCO does not allow -gwasnps switch");
   }