saigegit / SAIGE

Development for SAIGE and SAIGE-GENE(+)
GNU General Public License v3.0
64 stars 27 forks source link

Step 1 with sparse GRM gets stuck on "use sparse kinship to fit the model" #141

Open alix-lacoste opened 3 months ago

alix-lacoste commented 3 months ago

I have successfully run Step 1 computing the GRM on the fly. However, when I try using a sparse GRM computed through SAIGE (Step 0), the code initially runs but then gets stuck on the line "use sparse kinship to fit the model".

Any tips would be much appreciated.

See experts from the log below:

sparse GRM will be used to fit the NULL model and nThreads is set to 1
Leave-one-chromosome-out is not applied
24810  samples have genotypes
sex are categorical covariates
formula is  y_binary~sex+age 
24810  samples have non-missing phenotypes
24810  samples are in the sparse GRM
24810  samples who have non-missing phenotypes are also in the sparse GRM
24810  samples will be used for analysis
[...]
qr transformation has been performed on covariates
colnames(data.new) is  y_binary minus1 sexMale sexUnknown age 
out.transform$Param.transform$qrr:  4 4 
[1] "isCovariateOffset=TRUE, so fixed effects coefficients won't be estimated."
extract sparse GRM
[1] 27851446
set elements in the sparse GRM <=  0  to zero 
[1] 27851446                                
24810  samples have been used to fit the glmm null model
Setting up sparse GRM using  step_0_relatednessCutoff_0.05_1000_randomMarkersUsed.sparseGRM.mtx  and  step_0_relatednessCutoff_0.05_1000_randomMarkersUsed.sparseGRM.mtx.sampleIDs.txt 
Dimension of the sparse GRM is  24810 24810 
2 locationMat.n_rows 
27851446 locationMat.n_cols 
27851446 valueVec.n_elem 
geno.g_minMACVarRatio 20
geno.g_maxMACVarRatio -1
Markers in the Plink file with MAF <  0.01  will be removed before constructing GRM
Markers in the Plink file with missing rate >  0.15  will be removed before constructing GRM
y_binary  is a binary trait
[1] "formula.new"
y_binary ~ 1
<environment: 0xa561be8>
[1] "head(data.new)"
  y_binary minus1    sexMale    sexUnknown        age   covoffset
1        0     -1 -1.0599135 -8.538737e-18  1.1771875  0.07386317
2        0     -1 -1.0599135 -1.665592e-16 -1.0781962 -0.38528577
3        0     -1 -1.0599135 -1.159836e-18 -1.1224195 -0.39428869
4        0     -1 -1.0599135 -2.417142e-18 -1.4319819 -0.45730913
5        0     -1  0.9434732 -1.200045e-02  0.3630953  0.22223307
6        0     -1  0.9434732 -1.200045e-02 -0.8309314 -0.02084578
glm:

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

Coefficients:
(Intercept)  
 -0.0005768  

Degrees of Freedom: 24809 Total (i.e. Null);  24809 Residual
Null Deviance:      33990 
Residual Deviance: 33990    AIC: 33990
Start fitting the NULL GLMM
   user  system elapsed 
 61.884  46.398  20.396 
   user  system elapsed 
 66.039  50.184  20.555 
[1] "Start reading genotype plink file here"
nbyte: 6203
nbyte: 6203
reserve: 6205000

M: 1000, N: 24810
setgeno mark1
setgeno mark2
42 markers with MAF >= 0.01 and missing rate <= 0.15
time: 264.405
[1] "Genotype reading is done"
inital tau is  1 0.1 
use sparse kinship to fit the model 
use sparse kinship to fit the model 
Tau:
[1] 1.0 0.1
Fixed-effect coefficients:
            [,1]
[1,] 0.007855873
use sparse kinship to fit the model 
use sparse kinship to fit the model 
use sparse kinship to fit the model