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

snp_ldpred2_auto return all NA #533

Open
SalemWerdyani opened this issue Jan 9, 2025 · 4 comments
Open

snp_ldpred2_auto return all NA #533

SalemWerdyani opened this issue Jan 9, 2025 · 4 comments

Comments

@SalemWerdyani
Copy link

SalemWerdyani commented Jan 9, 2025

Hello Florian, Happy new year.

I am using your LDpred2 tool to predict the PRS in my dataset, I performed the genotype QC, and sumStat filtering following to your recommendations, I matched pre-computed (map_hm3_plus.rds) LD with the sumStat, and calculated the LD matrix. Then I estimated the SNP-heritability from LD score regression as follow:

(ldsc <- with(df_beta, snp_ldsc(ld, ld_size = nrow(map_ldref), chi2 = (beta / beta_se)^2, sample_size = n_eff, ncores = NCORES)))

   int     int_se         h2      h2_se 

1.02813473 0.01029674 0.53933807 0.16249398

h2_est <- ldsc[["h2"]]
h2_est
[1] 0.5393381

Subsequently, I used the LDpred2 auto as below:
set.seed(1)
multi_auto <- snp_ldpred2_auto(corr, df_beta, h2_init = ldsc_h2_est,

  • vec_p_init = seq_log(1e-4, 0.2, length.out = 30), ncores = NCORES,
  • allow_jump_sign = FALSE, shrink_corr = 0.95). # I used different shrink_corr (0.4-0.95)

str(multi_auto, max.level = 1)
List of 30
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12
$ :List of 12

str(multi_auto[[1]], max.level = 1)
List of 12
$ beta_est : num [1:652630] NA NA NA NA NA NA NA NA NA NA ...
$ postp_est : num [1:652630] NA NA NA NA NA NA NA NA NA NA ...
$ corr_est : num [1:652630] NA NA NA NA NA NA NA NA NA NA ...
$ sample_beta :Formal class 'dgCMatrix' [package "Matrix"] with 6 slots
$ path_p_est : num [1:700] 0.0459 NA NA NA NA ...
$ path_h2_est : num [1:700] 0.198 NA NA NA NA ...
$ path_alpha_est: num [1:700] -1.28 NA NA NA NA ...
$ h2_est : num NA
$ p_est : num NA
$ alpha_est : num NA
$ h2_init : num 0.539
$ p_init : num 1e-04

auto <- multi_auto[[1]]
plot_grid(qplot(y = auto$path_p_est) + theme_bigstatsr() + geom_hline(yintercept = auto$p_est, col = "blue") + scale_y_log10() + labs(y = "p"),

  • qplot(y = auto$path_h2_est) + theme_bigstatsr() + geom_hline(yintercept = auto$h2_est, col = "blue") + labs(y = "h2"),
  • ncol = 1, align = "hv")

Warning messages:
1: Removed 699 rows containing missing values or values outside the scale range (geom_point()).
2: Removed 1 row containing missing values or values outside the scale range (geom_hline()).
3: Removed 699 rows containing missing values or values outside the scale range (geom_point()).
4: Removed 1 row containing missing values or values outside the scale range (geom_hline()).

I would appreciate your input and advise,

Thanks

@privefl
Copy link
Owner

privefl commented Jan 10, 2025

Hello, and happy new year to you too.

Did you look at similar issues here?

@SalemWerdyani
Copy link
Author

Yes I looked at similar issues and followed your advises to perform the genotyping QC and imputation of missing genotype using snp_fastImputeSimple , but still LDpred2 auto resulted NAs. is there any additional steps that can be done or other parameters can be modified to improve these results.

Also, could you please provide explanation about the results of LDpred2 grid and LDpred2 auto you provided in your tutorial, what are these numbers and how are they interpreted?

  1. LDprerd2 grid:
    [pcor](pred, y[ind.test], NULL)
    [1] 0.5109565 0.3833604 0.6194140

  2. LDpred2 auto:
    pcor(pred_auto, y[ind.test], NULL)
    [1] 0.4979167 0.3683406 0.6085168

Thanks for your time and support and have a wonderful day.

@privefl
Copy link
Owner

privefl commented Jan 14, 2025

Sorry for the late reply, I’m on vacation this week.

Have a look at a similar recent issue, and please provide the plot and the answers to the questions I had there.

@privefl
Copy link
Owner

privefl commented Jan 14, 2025

For the numbers, these are partial correlations, but only correlations here because no covariates are used (NULL).
The last two numbers are the 95% confidence interval.
Did you look at the documentation of pcor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants