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

[BUG]Prompting for non-conformable arguments when using MRAPSS::est_paras #4

Open
WangYe661 opened this issue Apr 15, 2024 · 1 comment

Comments

@WangYe661
Copy link

WangYe661 commented Apr 15, 2024

Prompting for non-conformable arguments when using MRAPSS::est_paras.

Are the matrices multiplied in the correct dimension and order?

here is the code and output to repeat the problem.

library(MRAPSS)
library(TwoSampleMR)
IV=extract_instruments(c("ieu-a-27"),p1=5e-5)%>%
  MRAPSS::format_data(snp_col = "SNP",b_col = "beta.exposure",se_col = "se.exposure",
                      A1_col = "effect_allele.exposure",A2_col = "other_allele.exposure",
                      p_col = "pval.exposure",n=26836)
out=extract_outcome_data(IV$SNP,outcomes ="ebi-a-GCST90018808")%>%
  MRAPSS::format_data(snp_col = "SNP",b_col = "beta.outcome",se_col = "se.outcome",
                      A1_col = "effect_allele.outcome",A2_col = "other_allele.outcome",
                      p_col = "pval.outcome",n=470002)
MRAPSS::est_paras(IV,out,ldscore.dir = "data/eur_w_ld_chr")
Merge dat1 and dat2 by SNP ...
Harmonize the direction of SNP effects of exposure and outcome
Read in LD scores ... 
Add LD scores to the harmonized data set...                                                                                                         
The Harmonized data set will also be used for MR analysis 

Begin estimation of C and Omega using LDSC ...
Estimate heritability for trait 1 ...
Error in t(weighted.LD[from[i]:to[i], ]) %*% weighted.chi[from[i]:to[i],  : 
  non-conformable arguments
@WangYe661 WangYe661 changed the title Prompting for non-conformable arguments when using MRAPSS::est_paras [BUG]Prompting for non-conformable arguments when using MRAPSS::est_paras Apr 15, 2024
@hxh0928
Copy link
Collaborator

hxh0928 commented Aug 15, 2024

MRAPSS uses genome-wide summary statistics as input to estimate the background parameters using LDSC. The use of only summary statistics of extracted IVs will lead to errors.

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