|
Post by pvdmost on Oct 3, 2017 10:37:03 GMT
pvdmost It seems something wrong with the phenotype or GRM. The program can't even compute the prior values. The GRM was created by GCTA. The phenotypes are formatted as described on the GCTA homepage (and in any event, GCTA correctly identifies the number of samples, so it's imported correctly). That said, I did run into another strange problem when trying to add a qualitative covariate (gender): GCTA insisted it had "only one class". That's definitely incorrect: there are both 0 and 1 values in there; and it's not the case that one gender is removed entirely. Also, the number of samples was again correctly identified, so the file is imported in full. So I am wondering if there is some problem while reading in the data. If not, I am at a loss at what causes this problem.
|
|
xue
New Member
Posts: 3
|
Post by xue on Oct 3, 2017 16:02:49 GMT
If you set gender as qualitative covariate, you should use --qcovar flag instead of --covar flag. I think there is something wrong in your covariate file.
|
|
|
Post by pvdmost on Oct 6, 2017 13:21:26 GMT
If you set gender as qualitative covariate, you should use --qcovar flag instead of --covar flag. I think there is something wrong in your covariate file. According to the GCTA help page, --covar (and not --qcovar) should be used for discrete covariants. There may be something wrong with my covariate files though, but I get the "matrix not invertable" message even when running the analysis without any covariates. My phenotype file looks as follows (no header, space delimited): 1 KS1-1336-1 NA 2 KS1-1571-0 NA 3 KS1-1602-0 NA 4 KS1-1672-0 NA 5 KS1-1670-0 NA 6 KS1-1623-0 NA 7 KS1-1265-1 0 8 KS1-1619-0 1 9 KS1-2378-0 1 10 KS1-2390-0 NA My covar file looks like this (same format as phenotype file): 1 KS1-1336-1 0 2 KS1-1571-0 1 3 KS1-1602-0 1 4 KS1-1672-0 1 5 KS1-1670-0 1 6 KS1-1623-0 1 7 KS1-1265-1 1 8 KS1-1619-0 0 9 KS1-2378-0 1 10 KS1-2390-0 0 And my qcovar file (same format again): 1 KS1-1336-1 52 NA NA NA NA NA 2 KS1-1571-0 50.3353867214237 NA NA NA NA NA 3 KS1-1602-0 31.0444900752909 NA NA NA NA NA 4 KS1-1672-0 28.3613963039014 NA NA NA NA NA 5 KS1-1670-0 54.9377138945927 NA NA NA NA NA 6 KS1-1623-0 31.6194387405886 NA NA NA NA NA 7 KS1-1265-1 62 -0.0170325995005562 0.387951761414274 -1.42294537946666 1.35059300328805 -3.28452476624655 8 KS1-1619-0 56.5941136208077 0.524859137364817 -0.514953406224902 0.413367066125791 3.8614083321193 -1.01249696269569 9 KS1-2378-0 42.0013689253936 -0.303002282772656 -0.486459070566716 -0.919987733445255 7.53314476436061 -5.7062195349548 10 KS1-2390-0 NA NA NA NA NA NA The large number of samples with missing data is due to exclusions of ethnic outliers and the like. There are still 1580 samples that do have sufficient data present.
|
|
|
Post by charles on Oct 10, 2017 8:53:22 GMT
Dear all, I have the same problem and I cant figure out why. "Error: the X^t * V^-1 * X matrix is not invertible. Please check the covariate(s) and/or the environmental factor(s)." I have this error only when using --reml-bivar 1 2 and --covar Everything is fine when I use the --reml and --covar Everything is fine when I use the --reml-bivar 1 2 without --covar
Here is the result from GCTA: MacBook-Pro-de-Charles:4 charly$ ./gcta_mac --reml-bivar 1 2 --grm grm5ld --pheno corsica.phen --grm-adj 0 --out bivar --covar corsicaSEX.covar ******************************************************************* * Genome-wide Complex Trait Analysis (GCTA) * version 1.02 * (C) 2010 Jian Yang, Hong Lee, Michael Goddard and Peter Visscher * GNU General Public License, v2 * Queensland Institute of Medical Research ******************************************************************* Analysis started: Tue Oct 10 10:44:04 2017 Options: --reml-bivar 1 2 --grm grm5ld --pheno corsica.phen --grm-adj 0 --out bivar --covar corsicaSEX.covar Reading IDs of the genetic relationship matrix (GRM) from [grm5ld.grm.id]. 494 IDs read from [grm5ld.grm.id]. Reading the GRM from [grm5ld.grm.gz]. Pairwise genetic relationships between 494 individuals are included from [grm5ld.grm.gz]. Reading phenotypes from [corsica.phen]. There are 2 traits specified in the file [corsica.phen]. Traits 1 and 2 are included in the bivariate analysis. Nonmissing phenotypes of 494 individuals are included from [corsica.phen]. Reading discrete covariates from [corsicaSEX.covar]. 1 discrete covarites of 495 individuals are included from [corsicaSEX.covar]. Adjusting the GRM for sampling errors ... 494 individuals are in common in these files. 494 non-missing phenotypes for trait 1 and 494 for trait 2 1 discrete variable(s) included as covariate(s). Performing bivariate REML analysis ... (NOTE: may take hours depending on sample size). 988 observations, 6 fixed effect(s), and 6 variance component(s)(including residual variance). Calculating prior values of variance components by EM-REML ... Error: the X^t * V^-1 * X matrix is not invertible. Please check the covariate(s) and/or the environmental factor(s).
|
|
|
Post by pvdmost on Oct 10, 2017 13:37:11 GMT
pvdmost It seems something wrong with the phenotype or GRM. The program can't even compute the prior values. The GRM was created by GCTA. The phenotypes are formatted as described on the GCTA homepage (and in any event, GCTA correctly identifies the number of samples, so it's imported correctly). That said, I did run into another strange problem when trying to add a qualitative covariate (gender): GCTA insisted it had "only one class". That's definitely incorrect: there are both 0 and 1 values in there; and it's not the case that one gender is removed entirely. Also, the number of samples was again correctly identified, so the file is imported in full. So I am wondering if there is some problem while reading in the data. If not, I am at a loss at what causes this problem. I just found the cause of the error. You were right: there was a problem with the phenotype files. I had recoded the family IDs (but not individual IDs) for a previous analysis. Restoring the old family IDs solved the problem. Since the mach/dosage files do not contain family IDs, I am guessing it occurred while trying to match the GRM (which did use the old IDs) to the phenotype file.
|
|
dhui
New Member
Posts: 4
|
Post by dhui on Sept 20, 2023 3:26:09 GMT
Sorry to post here 6 years later but I'm getting this error now, and this seems to be the only thread where people have reported this issue. It seems to only happen when I use the option " --mlma-no-preadj-covar", which we would like to use. I can run it without covariates and with covariates without using the "--mlma-no-preadj-covar" option. I checked the IDs and that doesn't seem to be a problem, neither does collinearity in the covariates, as it gives the error when I only have one binary covariate (sex). It gives the error once it starts running the association test, with the last few lines before error being: Log-likelihood ratio converged. Calculating allele frequencies ... Running association tests for 456328 SNPs ... Error: Xt_Vi_X is not invertible. An error occurs, please check the options or data This is using gcta-1.94.1. Here's a full example command that gives error: ~/gcta-1.94.1 --mlma --mlma-no-preadj-covar --bfile ../merged_WGS_imputed_array/merged_SILVER_gte18_arrays_DR2gt.80_chr22_mac20 --grm allChr_merged_SILVER_gte18_arrays_DR2gt.80_typedOnly_geno.01_maf.01_pruned --mlma-subtract-grm allChr_merged_SILVER_gte18_arrays_DR2gt.80_typedOnly_geno.01_maf.01_pruned_chr22 --pheno height_gte18_onlyIncluded.txt --covar covar_gte18_onlyIncluded.txt --qcovar qcovar_gte18.txt --thread-num 10 --out test I also attached an example log from a run that gives error. Any help is appreciated, thanks.
|
|