0

I'm using LDpred2 incorporated in bigsnpr to calculate polygenic scores with my own set of genetic Data. I am following the steps found in the online tutorial of LDpred2 on Github (https://privefl.github.io/bigsnpr/articles/LDpred2.html) to use the automatic model snp_ldpred2_auto. I cannot execute the line:

pred_auto <- big_prodMat(G, beta_auto, ind.row = ind.test, ind.col = df_beta[["_NUM_ID_"]])

I suspect this happens because the matrices are not fit for multiplication with each other since the number of columns in G (the FBM matrix) is not identical as the number of rows in beta_auto (a common matrix). I intend to filter out variants (SNPs) from G such that the number of variants in G equals the number of variants in beta_auto . I have never worked before with matrices of class FBM.code256 and do not know how to achieve this subsetting. Guidance is much appreciated.

  • `ind.col` refers to the column indices of `G` that corresponds to the rows of `beta_auto`. Also, if you have questions about {bigsnpr} (which is a rather specific package), prefer opening an issue on the GitHub repo. – F. Privé Dec 06 '21 at 16:19
  • "I cannot execute the line" -> please provide the error message, or explain what went wront. – F. Privé Dec 06 '21 at 16:19
  • I get the following message: "Error: You can't have missing values in 'X'." – Javier Schneider Dec 06 '21 at 16:33
  • in my case length(ind.col) = 423242; dim(beta_auto) = 423242x30; and dim(G) = 528x492469 – Javier Schneider Dec 06 '21 at 16:55
  • Yes, so the error has nothing to do with dimensions. The problem is that you have missing values in `G`. You can look at https://github.com/privefl/bigsnpr/issues/49. – F. Privé Dec 07 '21 at 07:21

0 Answers0