weizhouUMICH / SAIGE

GNU Lesser General Public License v3.0
188 stars 73 forks source link

SAIGE is killed after a few iterations for binary association analysis #323

Closed buutrg closed 2 years ago

buutrg commented 3 years ago

Dear Authors, I am using SAIGE for binary trait association analysis but it is said that the program is killed after a few iterations? May I ask how to solve this problem? Your help is really appreciated!

`Rscript /scratch/eu82/bt0689/data/hsc-admmt/Tools/SAIGE/extdata/step1_fitNULLGLMM.R --plinkFile=plink_all_nsamp100000_nsnp50000.${partid} --phenoFile=${covarfile}${partid}.txt_save --phenoCol=Pheno --sampleIDColinphenoFile=IID --traitType=binary --outputPrefix=test --nThreads=20 --LOCO=FALSE --IsOverwriteVarianceRatioFile=TRUE Loading required package: optparse R version 3.6.1 (2019-07-05) Platform: x86_64-conda_cos6-linux-gnu (64-bit) Running under: CentOS Linux 8

Matrix products: default BLAS/LAPACK: /home/567/bt0689/anaconda3/envs/RSAIGE/lib/R/lib/libRblas.so

locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] optparse_1.6.6 SAIGE_0.44.2

loaded via a namespace (and not attached): [1] compiler_3.6.1 Matrix_1.2-17 Rcpp_1.0.6 getopt_1.20.3
[5] grid_3.6.1 RcppParallel_5.0.3 lattice_0.20-41
$plinkFile [1] "plink_all_nsamp100000_nsnp50000.part1"

$phenoFile [1] "cov_part1.txt_save"

$phenoCol [1] "Pheno"

$traitType [1] "binary"

$invNormalize [1] FALSE

$covarColList [1] ""

$sampleIDColinphenoFile [1] "IID"

$tol [1] 0.02

$maxiter [1] 20

$tolPCG [1] 1e-05

$maxiterPCG [1] 500

$nThreads [1] 20

$SPAcutoff [1] 2

$numRandomMarkerforVarianceRatio [1] 30

$skipModelFitting [1] FALSE

$memoryChunk [1] 2

$tauInit [1] "0,0"

$LOCO [1] FALSE

$traceCVcutoff [1] 0.0025

$ratioCVcutoff [1] 0.001

$outputPrefix [1] "test"

$IsOverwriteVarianceRatioFile [1] TRUE

$IsSparseKin [1] FALSE

$numRandomMarkerforSparseKin [1] 2000

$isCateVarianceRatio [1] FALSE

$relatednessCutoff [1] 0.125

$cateVarRatioMinMACVecExclude [1] "0.5,1.5,2.5,3.5,4.5,5.5,10.5,20.5"

$cateVarRatioMaxMACVecInclude [1] "1.5,2.5,3.5,4.5,5.5,10.5,20.5"

$isCovariateTransform [1] TRUE

$isDiagofKinSetAsOne [1] FALSE

$useSparseSigmaConditionerforPCG [1] FALSE

$useSparseSigmaforInitTau [1] FALSE

$useSparseGRMtoFitNULL [1] FALSE

$minMAFforGRM [1] 0.01

$minCovariateCount [1] -1

$includeNonautoMarkersforVarRatio [1] FALSE

$FemaleOnly [1] FALSE

$MaleOnly [1] FALSE

$sexCol [1] ""

$FemaleCode [1] "1"

$MaleCode [1] "0"

$noEstFixedEff [1] FALSE

$help [1] FALSE

tauInit is 0 0 cateVarRatioMinMACVecExclude is 0.5 1.5 2.5 3.5 4.5 5.5 10.5 20.5 cateVarRatioMaxMACVecInclude is 1.5 2.5 3.5 4.5 5.5 10.5 20.5 Markers in the Plink file with MAF >= 0.01 will be used to construct GRM 20 threads are set to be used
The variance ratio file test.varianceRatio.txt already exists. IsOverwriteVarianceRatioFile=TRUE so the file will be overwritten 33332 samples have genotypes formula is Pheno~ 1 33332 samples have non-missing phenotypes 33332 samples will be used for analysis Pheno is a binary trait glm:

Call: glm(formula = formula.new, family = binomial, data = data.new)

Coefficients: (Intercept)
-2.202

Degrees of Freedom: 33331 Total (i.e. Null); 33331 Residual Null Deviance: 21600 Residual Deviance: 21600 AIC: 21610 Start fitting the NULL GLMM user system elapsed 1.052 0.222 1.427 [1] "Start reading genotype plink file here" nbyte: 8333 nbyte: 8333 reserve: 416749984

M: 50000, N: 33332 size of genoVecofPointers: 1 setgeno mark1 setgeno mark2 49981 markers with MAF >= 0.01 are used for GRM. setgeno mark5 setgeno mark6 time: 22167.7 [1] "Genotype reading is done" inital tau is 1 0.1 iGet_Coef: 1 iter from getPCG1ofSigmaAndVector 4 iter from getPCG1ofSigmaAndVector 2 Tau: [1] 1.0 0.1 Fixed-effect coefficients: [,1] [1,] -2.202304 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 Variance component estimates: [1] 1.0000000 0.1001629

Iteration 1 1 0.1001629 : tau0_v1: 1 0.1001629 iGet_Coef: 1 iter from getPCG1ofSigmaAndVector 4 iter from getPCG1ofSigmaAndVector 2 Tau: [1] 1.0000000 0.1001629 Fixed-effect coefficients: [,1] [1,] -2.202304 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 iter from getPCG1ofSigmaAndVector 3 [1] 0.0000000 0.7560271 tau: 1 0.7829117 tau0: 1 0.1001629

Iteration 2 1 0.7829117 : tau0_v1: 1 0.7829117 iGet_Coef: 1 iter from getPCG1ofSigmaAndVector 7 iter from getPCG1ofSigmaAndVector 5 Tau: [1] 1.0000000 0.7829117 Fixed-effect coefficients: [,1] [1,] -2.215194 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 iter from getPCG1ofSigmaAndVector 6 Killed`

humanpaingeneticslab commented 3 years ago

Hi thanhbuu04, the SAIGE getting killed - this may be due to the fact that SAIGE's memory requirement exceeds the machine's capacity. To test this hypothesis, you'll have to start SAIGE while monitoring SAIGE's resources using "top" on a UNIX computer, or the "system monitor" on a Windows station. If SAIGE uses more than 80-90% of the computer's memory then it might be killed by the operating system. Please let us know!

weizhouUMICH commented 3 years ago

Hi @thanhbuu04, the memory usage can be estimated as #markers * #samples/4 bytes, so you job should only need < 1 Gb . As @unepanthere suggested, can you try use "top" to monitor?

Thanks, Wei

weizhouUMICH commented 2 years ago

We have just released a new version 1.0.0. It has substantial computational efficiency improvements for both Step 1 and Step 2 for single-variant and set-based tests and clearer log output. We have created a new program github page https://github.com/saigegit/SAIGE with the documentation provided https://saigegit.github.io/SAIGE-doc/ The program will be maintained by multiple SAIGE developers there. The docker image has been updated. Please feel free to try the version 1.0.0 and report issues if any.

Thanks! Wei