weizhouUMICH / SAIGE

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

Step 1 variance ratio = 1 #310

Closed ConnieXuhm closed 2 years ago

ConnieXuhm commented 3 years ago

Hi @weizhouUMICH , I have completed the imputation step for my data and try to use SAIGE for association analysis. When I conducted step 1, I met a problem that the variance ratio is 1. Following is my log file. I have tried to adjust the parameter by : 1) exclude all the covariant. 2) IsCovariateTransform=FALSE However, the ratio still at 1. Please help me, I cannot go further without fixing the problem. Thanks a lot!

fitNULLGLMM(plinkFile = "0205_SAIGE1_chr1", phenoFile = "SAIGE_PHENO.txt", phenoCol ="PHENO",traitType = "binary", covarColList=c("SEX","AGE","MISSING","PCA1","PCA2","PCA3","PCA4","PCA5"), sampleIDColinphenoFile ="IID",IsOverwriteVarianceRatioFile = TRUE,minMAFforGRM = 0.01, sexCol = "SEX", FemaleCode = 2, FemaleOnly = FALSE, MaleCode = 1,MaleOnly = FALSE, outputPrefix="0205_STEP1")
Markers in the Plink file with MAF >=  0.01  will be used to construct GRM
The variance ratio file  0205_STEP1.varianceRatio.txt  already exists. IsOverwriteVarianceRatioFile=TRUE so the file will be overwritten
2816  samples have genotypes
formula is  PHENO~SEX+AGE+MISSING+PCA1+PCA2+PCA3+PCA4+PCA5 
2814  samples have non-missing phenotypes
114  samples in geno file do not have phenotypes
2702  samples will be used for analysis
qr transformation has been performed on covariates
colnames(data.new) is  Y minus1 SEX AGE MISSING PCA1 PCA2 PCA3 PCA4 PCA5 
out.transform$Param.transform$qrr:  9 9 
PHENO  is a binary trait
glm:

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

Coefficients:
   minus1        SEX        AGE    MISSING       PCA1       PCA2       PCA3  
 3.322469   0.528005  -0.267559  -0.991011  -0.041096   0.016676   0.047519  
     PCA4       PCA5  
 0.033057   0.007545  

Degrees of Freedom: 2702 Total (i.e. Null);  2693 Residual
Null Deviance:      3746 
Residual Deviance: 933.2    AIC: 951.2
Start fitting the NULL GLMM
      user     system    elapsed 
  2734.159     97.295 323358.923 
[1] "Start reading genotype plink file here"
nbyte: 704
nbyte: 676
reserve: 459326688

M: 677473, N: 2816
size of genoVecofPointers: 1
setgeno mark1
setgeno mark2
1243962 markers with MAF >= 0.01 are used for GRM.
setgeno mark5
setgeno mark6
time: 26091.7
[1] "Genotype reading is done"
inital tau is  1 0.1 
iGet_Coef:  1 
iter from getPCG1ofSigmaAndVector 3
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 3
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
Tau:
[1] 1.0 0.1
Fixed-effect coefficients:
              [,1]
 [1,]  3.322141171
 [2,]  0.527579069
 [3,] -0.266782165
 [4,] -0.987898052
 [5,] -0.041588977
 [6,]  0.016701547
 [7,]  0.047216959
 [8,]  0.033331331
 [9,]  0.007433421
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
Variance component estimates:
[1] 1.00000000 0.09999383

Iteration  1 1 0.09999383 :
tau0_v1:  1 0.09999383 
iGet_Coef:  1 
iter from getPCG1ofSigmaAndVector 3
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 3
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
Tau:
[1] 1.00000000 0.09999383
Fixed-effect coefficients:
              [,1]
 [1,]  3.322140932
 [2,]  0.527579069
 [3,] -0.266782194
 [4,] -0.987898529
 [5,] -0.041588981
 [6,]  0.016701560
 [7,]  0.047217008
 [8,]  0.033331316
 [9,]  0.007433357
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
iter from getPCG1ofSigmaAndVector 2
[1] 0.0000000 0.8333248
tau:  1 0 
tau0:  1 0.09999383 

Final  1 0 :
iGet_Coef:  1 
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
Tau:
[1] 1 0
Fixed-effect coefficients:
              [,1]
 [1,]  3.322175503
 [2,]  0.528079331
 [3,] -0.267604172
 [4,] -0.991223872
 [5,] -0.041093543
 [6,]  0.016676297
 [7,]  0.047512434
 [8,]  0.033052865
 [9,]  0.007524821
      user     system    elapsed 
  5319.410    172.333 323443.428 
t_end - t_begin, fitting the NULL model took
    user   system  elapsed 
2585.251   75.038   84.505 
Start estimating variance ratios

Family: binomial 
Link function: logit 

iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
Only one variance ratio will be estimated using randomly selected markers with MAC >= 20
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
iter from getPCG1ofSigmaAndVector 1
211739 th marker
G0 1 0 1 0 1 1 2 1 1 0 
iter from getPCG1ofSigmaAndVector 1
664610 th marker
G0 2 1 1 0 1 1 1 0 0 1 
iter from getPCG1ofSigmaAndVector 1
479668 th marker
G0 0 0 0 0 0 0 1 0 0 0 
iter from getPCG1ofSigmaAndVector 1
216733 th marker
G0 0 0 0 0 0 0 0 0 0 0 
iter from getPCG1ofSigmaAndVector 1
413855 th marker
G0 0 0 0 0 0 0 0 0 1 0 
iter from getPCG1ofSigmaAndVector 1
535638 th marker
G0 0 1 0 0 1 0 0 0 0 1 
iter from getPCG1ofSigmaAndVector 1
562151 th marker
G0 0 0 0 0 0 0 0 1 0 0 
iter from getPCG1ofSigmaAndVector 1
269727 th marker
G0 0 0 0 0 0 1 0 0 0 0 
iter from getPCG1ofSigmaAndVector 1
47606 th marker
G0 0 0 0 0 0 0 0 0 0 0 
iter from getPCG1ofSigmaAndVector 1
486077 th marker
G0 0 1 0 1 1 1 1 1 0 0 
iter from getPCG1ofSigmaAndVector 1
[1] "OK"
[1] "OK1"
525684 th marker
G0 2 1 1 1 1 0 1 0 0 1 
iter from getPCG1ofSigmaAndVector 1
405220 th marker
G0 1 0 0 1 0 2 0 1 1 1 
iter from getPCG1ofSigmaAndVector 1
557582 th marker
G0 0 0 1 0 0 1 1 0 1 0 
iter from getPCG1ofSigmaAndVector 1
650757 th marker
G0 0 0 1 0 1 0 0 0 0 0 
iter from getPCG1ofSigmaAndVector 1
144338 th marker
G0 0 0 0 0 0 1 1 0 0 0 
iter from getPCG1ofSigmaAndVector 1
15904 th marker
G0 1 1 0 0 0 0 0 0 0 0 
iter from getPCG1ofSigmaAndVector 1
408855 th marker
G0 2 2 0 0 0 1 0 1 1 1 
iter from getPCG1ofSigmaAndVector 1
254661 th marker
G0 1 0 2 1 1 1 0 1 2 0 
iter from getPCG1ofSigmaAndVector 1
483131 th marker
G0 1 0 0 2 1 0 0 1 1 1 
iter from getPCG1ofSigmaAndVector 1
587415 th marker
G0 1 0 1 1 1 1 1 0 0 1 
iter from getPCG1ofSigmaAndVector 1
[1] "OK"
[1] "OK1"
350802 th marker
G0 1 0 1 0 0 0 0 0 1 2 
iter from getPCG1ofSigmaAndVector 1
139577 th marker
G0 0 1 1 0 1 1 1 0 2 1 
iter from getPCG1ofSigmaAndVector 1
222295 th marker
G0 0 0 0 0 0 0 0 0 0 0 
iter from getPCG1ofSigmaAndVector 1
461835 th marker
G0 1 2 1 1 2 1 1 1 1 1 
iter from getPCG1ofSigmaAndVector 1
36392 th marker
G0 0 1 0 0 0 0 0 0 0 1 
iter from getPCG1ofSigmaAndVector 1
275986 th marker
G0 2 0 1 1 1 2 0 0 0 0 
iter from getPCG1ofSigmaAndVector 1
541693 th marker
G0 0 0 0 0 1 0 1 0 1 1 
iter from getPCG1ofSigmaAndVector 1
225743 th marker
G0 1 0 0 0 1 0 0 1 0 0 
iter from getPCG1ofSigmaAndVector 1
431494 th marker
G0 0 1 0 0 0 0 0 0 0 1 
iter from getPCG1ofSigmaAndVector 1
49663 th marker
G0 1 1 0 0 0 0 2 0 1 0 
iter from getPCG1ofSigmaAndVector 1
[1] "OK"
[1] "OK1"
[1] "OK2"
CV for variance ratio estimate using  30  markers is  0  <  0.001 
varRatio 1 
[1] 1
     [,1]
[1,]    1
     [,1]
[1,]    1
[1] "0205_STEP1.varianceRatio.txt"
  V1
1  1
closed the plinkFile!
weizhouUMICH commented 3 years ago

Hi @ConnieXuhm,

Have you tried the Step 2? It is normal to see the variance ratio = 1 because the point estimate of tau is 0.

Thanks, Wei

weizhouUMICH commented 2 years ago

Sorry fo the late reply! 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