privefl / bigsnpr

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

Where to get SNP IDs corresponding to LDpred2 effect sizes? #438

Closed isobel16 closed 10 months ago

isobel16 commented 10 months ago

Hi Florian,

I am hoping to validate the PRS I have built using LDpred2 in an external population. I can't quite work out how the beta_grid is matched to the SNPs to do this. I essentially need a data frame of the SNP ID and the adjusted betas from LDpred2. Do you have suggestions on the best way to do this? Thanks.

privefl commented 10 months ago

Don't you have a SNP ID in either one of the data frames you pass to snp_match()? Without some code, it would be hard to help you more with this.

PS: the correct name of the method is LDpred2, not LDPred2

privefl commented 10 months ago

Any update on this?

isobel16 commented 10 months ago

Hi Florian,

Apologies for the late response I was distracted by another analysis. I am going to give this another go over the weekend. So the SNP IDs and the updated betas are in separate data frames and just require a merge to be matched and implemented to calculate PRS for an external population?

privefl commented 10 months ago

They should be in the same order, so just something like cbind() should work.

privefl commented 10 months ago

Any update on this?

isobel16 commented 10 months ago

I have figured out that binding df_beta to beta_grid gives the updated effect sizes, thank you!