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

Error: Incompatibility between dimensions #15

Closed
XcodeBio opened this issue Nov 9, 2020 · 11 comments
Closed

Error: Incompatibility between dimensions #15

XcodeBio opened this issue Nov 9, 2020 · 11 comments

Comments

@XcodeBio
Copy link

XcodeBio commented Nov 9, 2020

Hi Sam,

Thank you very much for the tutorial on running PRS on Chromosome separated bed files. I separated the EUR.QC files into individual chromosomes (for example Eur_chr{1..22}) and tried running PRS on these files. I get an error on running the step

4. Perform LD score regression.

The code below throws an error as "### Error: Incompatibility between dimensions." It works well for Genome Wide bed file but not for Chromosome separated bed files.
ldsc <- snp_ldsc( ld,
length(ld),
chi2 = (df_beta$beta / df_beta$beta_se)^2,
sample_size = df_beta$n_eff,
blocks = NULL)

Thanks for your help.

@choishingwan
Copy link
Owner

choishingwan commented Nov 9, 2020 via email

@XcodeBio
Copy link
Author

XcodeBio commented Nov 9, 2020

Thank you very much, Sam.

@XcodeBio
Copy link
Author

XcodeBio commented Nov 9, 2020

Hi Sam,
I just tried it on Chromosome separated bed files and I think there are a couple of typos.

Calculate the LD matrix
Error 1. tmp_snp <- snp_match(sumstats[sumstats$chr==chr,], map) # because of / the code throws an errr: Error: unexpected input in:" # perform SNP matching tmp_snp <- snp_match(sumstats[sumstats"

Obtain model PRS (Using chromosome separated bed files)
Error 2. obj.bigSNP <- snp_attach(paste0("EUR_chr",chr,".rds")) # unexpected _ in _.rds.

Apart from these the code works fine.

Thank you very much again for the wonderful tutorial.

@choishingwan
Copy link
Owner

choishingwan commented Nov 9, 2020 via email

@XcodeBio
Copy link
Author

Hi Sam,

I have one question regarding your tutorial. Let me know if you want me to open a separate issue for this.

In Figure 1 of your paper entitled "a guide to performing polygenic risk score analyses" you talk about "Test (Generate PRS and perform association testing)" and "Validate(Out-of-sample PRS testing)" but you do not mention it in the LDpred-2 tutorial. Is there a particular reason for that? Does the LDpred-2 tutorial only covers the "Test (Generate PRS and perform association testing)" part?

I have seen in other PRS tutorials (for example LDpred2) that the author divides example dataset into "validation ( to tune hyper-parameters )" and "testing(to evaluate the final models)".

Thank you.

@choishingwan
Copy link
Owner

choishingwan commented Nov 11, 2020 via email

@XcodeBio
Copy link
Author

Okay, no problems. I hope you don't mind me asking some questions regarding PRS validation (Out-of-sample PRS testing). Again, please let me know if you want me to open a separate issue for this. Apologies, if the questions are very basic.

I understand that "Testing" includes

  1. Generation of PRS
  2. Examination of the association between PRS and a trait. for example once a PRS of height is constructed (as you show in your LDpred2 tutorial) its association can be tested using PRS~height+covariates.

So my question is regarding PRS validation (Out-of-sample PRS testing).

  1. What are the steps involved in Out-of-sample PRS validation?
  2. What information are you using from the "testing" phase for Out-of-sample PRS validation? PRS, beta, SE??
  3. I am assuming you have to construct a PRS in Out-of-sample set too and then examine any association between the PRS and trait. Is this right?

Thank you again for your help.

@choishingwan
Copy link
Owner

choishingwan commented Nov 16, 2020 via email

@XcodeBio
Copy link
Author

Hi,

Thank you! Sorry I should have been specific that I am trying to understand your LDpred-2 tutorial which covers the 'testing' approach (https://choishingwan.github.io/PRS-Tutorial/ldpred/) .

I learnt that you have used three LDpred-2 models namely Infinitesimal , Grid and Auto to obtain model PRS (section 7), and then you get get the final performance of the LDpred models in section 8.

  1. Infinitesimal = 0.0100
  2. Grid Model = 0.00180
  3. Auto Model = 0.171

Because Auto model explains the highest phenotypic variance here, based on this would you say that Auto model is the best for prediction? If so, how would you use data from Auto Model to perform validation?

Thank you!

@choishingwan
Copy link
Owner

choishingwan commented Nov 17, 2020 via email

@XcodeBio
Copy link
Author

Thank you Sam! Appreciate your time!

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