saigegit / SAIGE

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

Error in chromosome X #32

Closed xingejun closed 1 year ago

xingejun commented 2 years ago

Hi, I am using SAIGE and SAIGE-GENE for analysis with 22 autosome chromosome and chromosome X .

At step1, autosome chromosome goes well but chromosome X goes with the error both in SAIGE and SAIGE-GENE:

Error in if (genoInd == 0) { : missing value where TRUE/FALSE needed Calls: fitNULLGLMM -> [extractVarianceRatio]

bed, bim, fam file was used in my analysis, I have checked the log ,it seems like there are NA in genoInd, but I don't know how it happens. I have post my step1 shell file and the log file.

Looking forward to your reply.

step1.txt step1.x.o284667.txt

saigegit commented 2 years ago

Hi @xingejun,

In Step 1, the genetic relationship matrix (GRM) is constructed only with autosomal markers.

Actually, in Step 1, the plink file should contain markers for constructing GRM (estimating sample relatedness coefficients) instead of all markers that you want to test the associations. Ideally, the number of markers is not smaller than the number of samples. For imputation data, in Step 1, we usually use the LD-pruned hard-called markers.

In Step 2, all input markers will be tested for associations. The number of markers is usually much larger than the number of markers used for GRM in Step 1.

Please see the examples here. https://saigegit.github.io//SAIGE-doc/docs/single_example.html#example-1

Thanks, Wei

xingejun commented 2 years ago

Thanks!

xingejun

xingejun commented 2 years ago

Hi Wei!

Given your suggestions, I am wondering if it is possible for me to randomly select some makers to construct the full genetic relationship matrix (GRM) as your example https://saigegit.github.io//SAIGE-doc/docs/single_step1.html But in the example, it seems like the selection only used when a sparse GRM is used to fit the null model.

Looking forward to your reply, again.

Thanks, xin

xingejun commented 2 years ago

Hi Wei.

I have met another issue.

At Step 2 for SAIGE-GENE, I am wondering if i can use the same one bfile with 22 chromosomes merged together, with --chrom used for special chromosome. And that is to say,I don't know if it can go well when the --plinkFile(22 chromosomes in it) did not match the --groupFile(only 1 chromosome information in it) with the option --chromosome used. And I haven't found similiar examples at examples.

Thanks again! xin

xingejun commented 2 years ago

Hi Wei,

I have tried use the same one bfile with 22 autosomal makers for step1 and step2, and it seems going well.

However, when I try to fit the null model for chromosome X using the sparse GRM constructed with the 22 autosomal markers, there is a error again:

missing value where TRUE/FALSE needed Calls: fitNULLGLMM -> [extractVarianceRatio] Calls: fitNULLGLMM -> extractVarianceRatio

So, I checked the --help for step1, and I added --includeNonautoMarkersforVarRatio=TRUE to my code. Now everything goes well, but I am not sure if it is right.

Thanks again, xin

saigegit commented 1 year ago

Hi Xin, --includeNonautoMarkersforVarRatio=TRUE is used to allow for using non-autosomal markers to be used for variance ratio estimation. You may check the QQ and Manhattan plots to see if it works.

Thanks, Wei