From fa6555d53fab6388473922c271d52fb97991f4d7 Mon Sep 17 00:00:00 2001
From: weizhouUMICH <zhowei@umich.edu>
Date: Sat, 21 Sep 2019 01:47:14 -0400
Subject: [PATCH] add minCovariateCount in step 1

---
 extdata/step1_fitNULLGLMM.R | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/extdata/step1_fitNULLGLMM.R b/extdata/step1_fitNULLGLMM.R
index f91f2e4a0..23decbec1 100644
--- a/extdata/step1_fitNULLGLMM.R
+++ b/extdata/step1_fitNULLGLMM.R
@@ -79,7 +79,9 @@ option_list <- list(
   make_option("--useSparseSigmaforInitTau", type="logical", default=FALSE,
     help="Whether to use sparse Sigma to estiamte initial tau [default='FALSE']."),
   make_option("--minMAFforGRM", type="numeric", default=0.01,
-    help="minimum MAF of markers used for GRM")	
+    help="minimum MAF of markers used for GRM"),
+  make_option("--minCovariateCount", type="numeric", default=-1,
+    help="If binary covariates have a count less than this, they will be excluded from the model to avoid convergence issues. By default, -1 (no covariates will be excluded)")
 )
 
 
@@ -134,4 +136,5 @@ fitNULLGLMM(plinkFile=opt$plinkFile,
             isDiagofKinSetAsOne = opt$isDiagofKinSetAsOne,
 	    useSparseSigmaConditionerforPCG = opt$useSparseSigmaConditionerforPCG,
 	    useSparseSigmaforInitTau = opt$useSparseSigmaforInitTau,
-	     minMAFforGRM = opt$minMAFforGRM)	
+	     minMAFforGRM = opt$minMAFforGRM,
+	minCovariateCount=opt$minCovariateCount)	
-- 
2.23.0

