Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should error when using a correlation matrix with NA / NaNs values #498

Open
privefl opened this issue May 22, 2024 · 0 comments
Open

Should error when using a correlation matrix with NA / NaNs values #498

privefl opened this issue May 22, 2024 · 0 comments

Comments

@privefl
Copy link
Owner

privefl commented May 22, 2024

library(bigsnpr)
bigsnp <- snp_attachExtdata()
G <- bigsnp$genotypes
corr0 <- snp_cor(G)
corr <- as_SFBM(corr0)
gwas <- big_univLinReg(G, rnorm(nrow(G)))
df_beta <- dplyr::transmute(gwas, beta = estim, beta_se = std.err, 
                            n_eff = nrow(G))
snp_ldpred2_auto(corr, df_beta, 0.01)

G[, 1] <- 0
corr0.2 <- snp_cor(G)
corr.2 <- as_SFBM(corr0.2)

# Here should start to error, instead of returning some BS
snp_ldpred2_auto(corr.2, df_beta, 0.01)
snp_ldpred2_grid(corr.2, df_beta, data.frame(h2 = 0.01, p = 0.1, sparse = FALSE))
# snp_ldpred2_inf(corr.2, df_beta, h2 = 0.01)  # run indefinitely
snp_lassosum2(corr.2, df_beta, delta = 0.01)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant