Closed lcpilling closed 11 months ago
Thanks so much, Luke, for your help to improve MRlap!
Zoltan
On Tue, 3 Oct 2023 at 15:09, Luke C. Pilling @.***> wrote:
Hi Ninon,
With these changes, the user can:
- use local installation of Plink for LD clumping with a custom reference panel (using MR_plink and MR_bfile options). This is useful to e.g., use a subset of UK Biobank EUR as reference panel
- turn off automatic pruning and instead provide own list of variants to use as Instrumental Variables (using do_pruning and user_SNPsToKeep options)
These three examples (#1 https://github.com/n-mounier/MRlap/pull/1 is the normal behaviour of v0.3.0 with remote clumping) to demonstrate the syntax/options.
determine IVs using TwoSampleMR::clump_data() with R^2=0.001 (remote clumping)test1 = MRlap::MRlap(exposure = gwas_exp, exposure_name = "exposure_gwas",
outcome = gwas_out, outcome_name = "outcome_gwas", ld = ld_dir, hm3 = hm3_file, MR_pruning_LD=0.001)
use ieugwasr::ld_clump() and local Plink installation with custom panel for clumping with R^2=0.001test2 = MRlap::MRlap(exposure = gwas_exp, exposure_name = "exposure_gwas",
outcome = gwas_out, outcome_name = "outcome_gwas", ld = ld_dir, hm3 = hm3_file, MR_pruning_LD=0.001, MR_plink = "plink", MR_bfile = "/path/to/ukbiobank/imputed_500k/5k_eur/ukb_imp_v3.5k_eur")
do not perform clumping. User-provided list of variant IDs instead test3 = MRlap::MRlap(exposure = gwas_exp, exposure_name = "exposure_gwas",
outcome = gwas_out, outcome_name = "outcome_gwas", ld = ld_dir, hm3 = hm3_file, do_pruning = FALSE, user_SNPsToKeep = c("rs11121214", "rs3917932", "rs776431379", "rs6686289", ...))
I have put a few minor checks of the input but I guess ideally there would be "better" checking (e.g., that provided IDs are in the data - I just assume the user has checked this, or that the Plink binary actually exists).
Feel free to make changes, of course, and no problem if you don't want to implement. I had made these changes for a project so thought I'd put them back on GitHub in case useful to others.
Luke
You can view, comment on, or merge this pull request online at:
https://github.com/n-mounier/MRlap/pull/10 Commit Summary
- a31169a https://github.com/n-mounier/MRlap/pull/10/commits/a31169aaa66228be6e83726c35bf22ccc1398cdc Add user options for providing own lead SNPs
- 2536153 https://github.com/n-mounier/MRlap/pull/10/commits/2536153c0db20c5b9cf556bf9b059dda27e16bbe Add options and checks for user-provided SNP list
- d89efb9 https://github.com/n-mounier/MRlap/pull/10/commits/d89efb958645ab4b5b70b9d625223a0515d30648 Add option for local plink LD clumping
- f68c569 https://github.com/n-mounier/MRlap/pull/10/commits/f68c56922ccf1e5ce2881e47f75f6af7f0ee11bf Fix
do_pruning
checking- e0b8749 https://github.com/n-mounier/MRlap/pull/10/commits/e0b8749392096baf52ede9ff180dc26cf0e19801 Provide checks for MR_bfile existance
- 926fac0 https://github.com/n-mounier/MRlap/pull/10/commits/926fac02725da0eaafcd68ba98940c4ecc7b4d5b Update NEWS.md
File Changes
(7 files https://github.com/n-mounier/MRlap/pull/10/files)
- M DESCRIPTION https://github.com/n-mounier/MRlap/pull/10/files#diff-9cc358405149db607ff830a16f0b4b21f7366e3c99ec00d52800acebe21b231c (7)
- M NEWS.md https://github.com/n-mounier/MRlap/pull/10/files#diff-51920e95310ebfbc1ae31709f3b95f89afffbf4f1a6e38e8b2b406e2fb6197ea (7)
- M R/MRlap.R https://github.com/n-mounier/MRlap/pull/10/files#diff-9062831956482f015c2596610c88b3ca8e3f6b2b2cec07e461c61276e4ee5f65 (29)
- M R/run_MR.R https://github.com/n-mounier/MRlap/pull/10/files#diff-86f0b8249973e5ba8d10698ba1cb81be962201818221598fde688b42aba655dd (97)
- M man/MRlap.Rd https://github.com/n-mounier/MRlap/pull/10/files#diff-5b2d7adbe5e8b6201910aeff16086fbbf6d87225970ad5b743ba4e8dd288f62f (35)
- M man/SmallExposure_Data.Rd https://github.com/n-mounier/MRlap/pull/10/files#diff-f5432354f7c506ebf033343c4bdc563f5ca78e3beb3375d5e53e1cbd8be32dab (6)
- M man/SmallOutcome_Data.Rd https://github.com/n-mounier/MRlap/pull/10/files#diff-b9bba3045623524695ccfdb975f707f12480416feb24341223945bf2a24714fc (6)
Patch Links:
— Reply to this email directly, view it on GitHub https://github.com/n-mounier/MRlap/pull/10, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADUPFNIXIPU24ZM5AA52AXTX5QE75AVCNFSM6AAAAAA5Q66N5SVHI2DSMVQWIX3LMV43ASLTON2WKOZRHEZDIMJSGAYDSOA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Hi Ninon,
With these changes, the user can:
MR_plink
andMR_bfile
options). This is useful to e.g., use a subset of UK Biobank EUR as reference paneldo_pruning
anduser_SNPsToKeep
options)These three examples show the changes in syntax/options (the first is the normal behaviour of v0.3.0 with remote clumping):
I have put a few minor checks of the input but I guess ideally there would be "better" checking (e.g., that provided IDs are in the data - I just assume the user has checked this, or that the Plink binary actually exists).
Feel free to make changes, of course, and no problem if you don't want to implement. I had made these changes for a project so thought I'd put them back on GitHub in case useful to others.
Luke