privefl / bigsnpr

R package for the analysis of massive SNP arrays.
https://privefl.github.io/bigsnpr/
196 stars 44 forks source link

'chi2' and 'ld_score' should have the same length #512

Closed koujiaodahan closed 3 months ago

koujiaodahan commented 4 months ago

Before running the program, I extracted the overlap sites among the genotype, gwas summary statistics and Map files. I checked all of the variants are the same. and the program is worked on the chr22. But when I run all the chromosome data, there is bug log:

"2,395,488 variants to be matched. 2,395,488 variants have been matched; 0 were flipped and 0 were reversed. Error: Incompatibility between dimensions. 'chi2' and 'ld_score' should have the same length. Execution halted"

privefl commented 4 months ago

I guess this is from snp_ldsc(). You need to provide these two vectors of the same length.

koujiaodahan commented 3 months ago

I guess this is from snp_ldsc(). You need to provide these two vectors of the same length.

Oh, I find the bug. Because the program didn't handle chrX, there are sites on chrX that I've included in my inputs. So do you suggest not inputting chrX when computing h2 and running LDpred2-auto?

privefl commented 3 months ago

I don't know whether it is valid to use chrX in LD Score regression or not. But in terms of code, if you input both corresponding chi2 and ld, that should give you some result, since the chromosome information is not used anywhere.