jianyangqt / gcta

GCTA software
GNU General Public License v3.0
73 stars 23 forks source link

Error: XtWX is not invertible. #71

Closed AmandaHWChong closed 5 months ago

AmandaHWChong commented 5 months ago

Hi,

I have been trying to run fastGWA-mlm-binary and have been getting the error ' XtWX is not invertible'. I have adjusted for age and sex prior to the GWAS analysis and have only include PCs. Could you please advise on how to troubleshoot this issue?

Thank you!

Output below:

Options:

--bfile chr1_22 --grm-sparse sp_grm --fastGWA-mlm-binary --joint-covar --pheno chd_adjusted.txt --qcovar pc.txt --thread-num 40 --out chd_assoc

The program will be running with up to 40 threads. Reading PLINK FAM file from [ch1_22.fam]... 140831 individuals to be included from FAM file. Reading phenotype data from [chd_adjusted.txt]... 140831 overlapping individuals with non-missing data to be included from the phenotype file. 140831 individuals to be included. 0 males, 0 females, 140831 unknown. Reading PLINK BIM file from [ch1_22.bim]... 7941687 SNPs to be included from BIM file(s). Reading quantitative covariates from [pc.txt]. 7 covariates of 140831 samples to be included. 140831 overlapping individuals with non-missing data to be included from the covariate file(s). Reading the sparse GRM file from [sp_grm]... After matching all the files, 140831 individuals to be included in the analysis. Fitting covariates jointly in the association analysis. Performing GLM to get the starting values of beta for the covariates... Error: XtWX is not invertible. An error occurs, please check the options or data

longmanz commented 5 months ago

Hi, Can you check if your cases are coded as "1" and controls are coded as "0"? This is different from the coding in Plink2.

AmandaHWChong commented 5 months ago

Hi,

Yes that's correct, the cases are coded as "1" and controls as "0".

longmanz commented 5 months ago

Hi, I just realize that you have adjusted for age and sex prior to running GWAS. Please do not do that. Instead, you should include them as covariates as well when running fastGWA-mlm-binary. fastGWA-mlm-binary only accepts "0" and "1" as phenotypes. Alternatively, if you want to keep using the adjusted phenotypes, you can use fastGWA-mlm (treating it as a quantitative traits) instead of fastGWA-mlm-binary.