Closed lizlitkowski closed 3 years ago
You should not have to match after getting the results from LDpred2, you should always do it before, otherwise you could lose some predictive accuracy.
Do not use GFBM = as_FBM(G[,map_pgs2[["_NUM_ID_"]]])
, use instead the ind.col
parameter in big_prodMat()
.
I am not sure where the issue is but maybe it's because you're multiplying by map_pgs2$beta
first, and then only uniformly by (-1)
?
Anyway, I'm quite sure there is no issue with big_prodMat()
; it must be some mistake in your code.
Thanks for the quick reply. I didn't think there was an issue with big_prodMat(). I was trying to understand if it was just performing a simple calculation of the beta value*genotype for each SNP for each individual and then summing them up?
Yes, just a matrix product, equivalent to G %*% beta, and yes you need to sum these up if you do it per chromosome.
Great. Thank you!
Hi,
I was trying to check my matrix math and compare to the output of big_prodMat in the bigsnpr package (about 20 lines of code and output attached). I expected to be able to multiply the beta values by the genotypes, sum them up, and get the same answer as in the function. However, it is always a little off. I expected it to be exact. Could this be due to different levels of rounding?
Thanks. Liz