n-mounier / MRlap

R package to perform two-sample Mendelian Randomisation (MR) analyses using (potentially) overlapping samples
GNU General Public License v2.0
47 stars 11 forks source link

Error when run the IVW-MR #19

Open dqq0404 opened 3 months ago

dqq0404 commented 3 months ago

Hi, When I ran the MRlap, it had a problem as followed : <<< Running IVW-MR >>>

Identifying IVs... 2,291 IVs with p < 5e-10 0 IVs excluded - more strongly associated with the outcome than with the exposure, p < 1e-03 Pruning : distance : 500 Kb - LD threshold : 0.05 Error in mtfrm.default(list(url = "https://api.opengwas.io/api/ld/clump", : cannot mtfrm In addition: There were 25 warnings (use warnings() to see them) What does this mean?

dqq0404 commented 2 months ago

There is another question : Error in tidy_inputGWAS(): ! Can't subset .data outside of a data mask context. Backtrace: ▆

  1. └─MRlap::MRlap(...)
  2. └─MRlap:::tidy_inputGWAS(outcome, need_chrpos, verbose)
  3. ├─dplyr::mutate(Z = log(.data$beta)/.data$se, beta = NULL, se = NULL)
  4. ├─
  5. └─rlang:::$.rlang_fake_data_pronoun(.data, "beta")
  6. └─rlang:::stop_fake_data_subset(call)
  7. └─rlang::abort(...)
dqq0404 commented 2 months ago

Hi,the above problems have been solved. But why are the number of SNPs obtained twice different? The first time is 2291 and the second time is 1582.

lcpilling commented 2 months ago

Glad you've resolved your first issue. Not sure on the 2nd. Could you paste the command you used, and the full output? (I might not know the answer but might be able to help)

dqq0404 commented 2 months ago

Hi, the command is : B = MRlap(exposure = a, exposure_name = ..., outcome = b, outcome_name = ..., ld = "D:/GWAS_Summary/MRlap/1000G/eur_w_ld_chr", hm3 = "D:/GWAS_Summary/MRlap/1000G/w_hm3.noMHC.snplist", MR_threshold = 5e-10, MR_pruning_LD = 0.05) the output is : <<< Performing cross-trait LDSC >>>

Munging exposure data... Munging outcome data... Running cross-trait LDSC... Please consider saving the log files and checking them to ensure that all columns were interpreted correctly and no warnings were issued for any of the summary statistics files Cleaning temporary files... <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> <<< Running IVW-MR >>>
Identifying IVs... 1,582 IVs with p < 5e-10 0 IVs excluded - more strongly associated with the outcome than with the exposure, p < 1e-03 Pruning : distance : 500 Kb - LD threshold : 0.05 41 IVs left after pruning Performing MR IVW-MR observed effect: 0.0107 ( 0.0328 ) <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> <<< Estimating corrected effect >>>
Estimating genetic architecture parameters... Estimating corrected effect... corrected effect: 0.0106 ( 0.0372 ) covariance between observed and corrected effect: 0.00122 9000 simulations were used to estimate the variance and the covariance. Testing difference between observed and corrected effect... Runtime of the analysis: 10 minute(s) and 36 second(s).
It seems no error. And the IVs output this time are the same as those output last time.

dqq0404 commented 2 months ago

Hi,sorry to bother you again. I used repeated samples of case-control. The corrected effect size of a significant MR result is larger than the uncorrected effect size. Is this rational?

lcpilling commented 2 months ago

Hi, the output looks OK to me?

dqq0404 commented 2 months ago

Yeah,maybe the first was wrong,and now it is ok.

---- Replied Message ---- | From | Luke C. @.> | | Date | 04/30/2024 15:59 | | To | n-mounier/MRlap @.> | | Cc | dqq0404 @.>, Author @.> | | Subject | Re: [n-mounier/MRlap] Error when run the IVW-MR (Issue #19) |

Hi, the output looks OK to me?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>