library(devtools)
library(knitr)
load_all()
## Loading TwoSampleMR
## Welcome to TwoSampleMR.
## [>] Check for updates: https://github.com/MRCIEU/TwoSampleMR
## [>] Full documentation: https://mrcieu.github.io/TwoSampleMR
lipids <- mv_extract_exposures(c(299,300,302), access_token=NULL)
## Loading required package: reshape2
## Warning: package 'reshape2' was built under R version 3.4.3
## Warning: This analysis is still experimental
## Testing the regression based multivariable MR
## Requesting default values. Extracting from pre-clumped data
## Loading required package: MRInstruments
## Warning in extract_instruments(id_exposure, r2 = clump_r2, kb = clump_kb, :
## From version 0.4.2 the exposure name format has changed.
## Clumping 1, 223 SNPs
## Removing the following SNPs due to LD with other SNPs:
## rs10761771
## rs12740374
## rs102275
## rs12801636
## rs492571
## rs12133576
## rs2075650
## rs2288912
## rs103294
## rs2278236
## rs6031587
## rs676210
## rs3822072
## rs6450176
## rs3861397
## rs9457931
## rs1980493
## rs4917014
## rs17145738
## rs10808546
## rs10087900
## rs1866956
## rs13702
## rs7112577
## rs964184
## rs2419604
## rs174583
## rs3184504
## rs1169288
## rs2587534
## rs247616
## rs2000999
## rs6504872
## rs1800961
## rs10195252
## rs72902576
## rs5763662
## rs6818397
## rs1408272
## rs10947332
## rs2737252
## rs2954029
## rs9987289
## rs964184
## rs10501321
## rs11057408
## rs1321257
## rs11613352
## rs17513135
## rs2043085
## rs588136
## rs4587594
## rs247616
## rs8077889
## rs10401969
## rs439401
## rs3760627
## rs7248104
## rs6029143
## rs4810479
## rs13389219
## rs676210
## rs2972146
## rs10440120
## rs645040
## rs719726
## rs2665357
## rs287621
## rs4719841
## rs6995541
## rs12676857
## rs4738684
## Extracting data for 143 SNP(s) from 3 GWAS(s)
## Warning in format_d(d): From version 0.4.2 the outcome format has
## changed. You can find the deprecated version of the output name in
## outcome.deprecated
## Harmonising HDL cholesterol || id:299 (299) and LDL cholesterol || id:300 (300)
## Harmonising HDL cholesterol || id:299 (299) and Triglycerides || id:302 (302)
chd <- extract_outcome_data(lipids$SNP, 7, access_token = NULL)
## Extracting data for 143 SNP(s) from 1 GWAS(s)
## Warning in format_d(d): From version 0.4.2 the outcome format has
## changed. You can find the deprecated version of the output name in
## outcome.deprecated
## Finding proxies for 1 SNPs in outcome 7
## Extracting data for 1 SNP(s) from 1 GWAS(s)
control <- mv_harmonise_data(lipids, chd)
## Harmonising HDL cholesterol || id:299 (299) and Coronary heart disease || id:7 (7)
kable(mv_residual(control, intercept=TRUE, instrument_specific=TRUE)$result)
HDL cholesterol || id:299 |
78 |
0.09060433 |
0.08374807 |
1.396557e-01 |
LDL cholesterol || id:300 |
68 |
0.37110414 |
0.05140104 |
2.603606e-13 |
Triglycerides || id:302 |
40 |
0.13712959 |
0.05218640 |
4.298360e-03 |
kable(mv_residual(control, intercept=FALSE, instrument_specific=TRUE)$result)
HDL cholesterol || id:299 |
78 |
-0.03380854 |
0.04665401 |
2.343287e-01 |
LDL cholesterol || id:300 |
68 |
0.33397087 |
0.05005202 |
1.257617e-11 |
Triglycerides || id:302 |
40 |
0.11408189 |
0.04571798 |
6.291829e-03 |
kable(mv_residual(control, intercept=TRUE, instrument_specific=FALSE)$result)
HDL cholesterol || id:299 |
78 |
0.04698281 |
0.10390043 |
3.255658e-01 |
LDL cholesterol || id:300 |
68 |
0.40073757 |
0.03576771 |
1.951013e-29 |
Triglycerides || id:302 |
40 |
0.16991171 |
0.07853643 |
1.525228e-02 |
kable(mv_residual(control, intercept=FALSE, instrument_specific=FALSE)$result)
HDL cholesterol || id:299 |
78 |
-0.001869845 |
0.07154955 |
4.895754e-01 |
LDL cholesterol || id:300 |
68 |
0.383081071 |
0.03542813 |
1.495192e-27 |
Triglycerides || id:302 |
40 |
0.154454528 |
0.07396662 |
1.839147e-02 |
kable(mv_multiple(control, intercept=TRUE, instrument_specific=TRUE)$result)
HDL cholesterol || id:299 |
78 |
0.1199871 |
0.08859308 |
8.781037e-02 |
LDL cholesterol || id:300 |
68 |
0.3991170 |
0.05648046 |
7.946702e-13 |
Triglycerides || id:302 |
40 |
0.1245082 |
0.06607167 |
2.975263e-02 |
kable(mv_multiple(control, intercept=FALSE, instrument_specific=TRUE)$result)
HDL cholesterol || id:299 |
78 |
-0.06314559 |
0.05783640 |
1.374612e-01 |
LDL cholesterol || id:300 |
68 |
0.40342520 |
0.05614386 |
3.346549e-13 |
Triglycerides || id:302 |
40 |
0.16127358 |
0.06361080 |
5.617272e-03 |
kable(mv_multiple(control, intercept=TRUE, instrument_specific=FALSE)$result)
HDL cholesterol || id:299 |
78 |
0.01413549 |
0.07797721 |
4.280750e-01 |
LDL cholesterol || id:300 |
68 |
0.38392926 |
0.04799501 |
6.253477e-16 |
Triglycerides || id:302 |
40 |
0.10560738 |
0.06902882 |
6.302040e-02 |
kable(mv_multiple(control, intercept=FALSE, instrument_specific=FALSE)$result)
HDL cholesterol || id:299 |
78 |
-0.08273782 |
0.05958443 |
8.248007e-02 |
LDL cholesterol || id:300 |
68 |
0.38902913 |
0.04836873 |
4.383662e-16 |
Triglycerides || id:302 |
40 |
0.12432296 |
0.06896322 |
3.571429e-02 |
a <- mv_extract_exposures(c("UKB-a:196", 1001), access_token=NULL)
## Warning: This analysis is still experimental
## Testing the regression based multivariable MR
## Requesting default values. Extracting from pre-clumped data
## Warning in extract_instruments(id_exposure, r2 = clump_r2, kb = clump_kb, :
## From version 0.4.2 the exposure name format has changed.
## Clumping 1, 118 SNPs
## Removing the following SNPs due to LD with other SNPs:
## rs6839705
## rs16845580
## rs8049439
## rs10483349
## rs13421974
## rs62100767
## rs766406
## rs1035578
## rs2402707
## rs7742854
## rs34506349
## rs3740422
## rs35644384
## rs1093725
## rs12128707
## rs1472661
## rs10259686
## rs11125721
## rs17043393
## rs2352974
## rs34522021
## rs1054442
## Extracting data for 96 SNP(s) from 2 GWAS(s)
## Warning in format_d(d): From version 0.4.2 the outcome format has
## changed. You can find the deprecated version of the output name in
## outcome.deprecated
## Finding proxies for 12 SNPs in outcome UKB-a:196
## Extracting data for 12 SNP(s) from 1 GWAS(s)
## Warning in format_d(d): From version 0.4.2 the outcome format has
## changed. You can find the deprecated version of the output name in
## outcome.deprecated
## Finding proxies for 2 SNPs in outcome 1001
## Extracting data for 2 SNP(s) from 1 GWAS(s)
## Warning in format_d(d): From version 0.4.2 the outcome format has
## changed. You can find the deprecated version of the output name in
## outcome.deprecated
## Harmonising Fluid intelligence score || id:UKB-a:196 (UKB-a:196) and Years of schooling || id:1001 (1001)
## Removing the following SNPs for incompatible alleles:
## rs36143444
## Removing the following SNPs for being palindromic with intermediate allele frequencies:
## rs10874938, rs11130222, rs12534506, rs4245255
b <- extract_outcome_data(a$SNP, 297, access_token = NULL)
## Extracting data for 94 SNP(s) from 1 GWAS(s)
## Warning in format_d(d): From version 0.4.2 the outcome format has
## changed. You can find the deprecated version of the output name in
## outcome.deprecated
## Finding proxies for 7 SNPs in outcome 297
## Extracting data for 7 SNP(s) from 1 GWAS(s)
## Warning in format_d(d): From version 0.4.2 the outcome format has
## changed. You can find the deprecated version of the output name in
## outcome.deprecated
dat <- mv_harmonise_data(a, b)
## Harmonising Fluid intelligence score || id:UKB-a:196 (UKB-a:196) and Alzheimer's disease || id:297 (297)
## Removing the following SNPs for incompatible alleles:
## rs36143444
## Removing the following SNPs for being palindromic with intermediate allele frequencies:
## rs10772644, rs10874938, rs11130222, rs11540358, rs12534506, rs152590, rs3744108, rs4240470, rs4245255, rs4493682, rs538628, rs58694847, rs7033137
kable(mv_residual(dat, intercept=TRUE, instrument_specific=TRUE)$result)
Fluid intelligence score || id:UKB-a:196 |
29 |
0.06272424 |
0.07036162 |
0.1863425 |
Years of schooling || id:1001 |
57 |
0.12066781 |
0.15923704 |
0.2242892 |
kable(mv_residual(dat, intercept=FALSE, instrument_specific=TRUE)$result)
Fluid intelligence score || id:UKB-a:196 |
29 |
0.06078521 |
0.07029384 |
0.1935934 |
Years of schooling || id:1001 |
57 |
0.08076213 |
0.15039814 |
0.2956376 |
kable(mv_residual(dat, intercept=TRUE, instrument_specific=FALSE)$result)
Fluid intelligence score || id:UKB-a:196 |
29 |
-0.006564608 |
0.05827831 |
0.4551570 |
Years of schooling || id:1001 |
57 |
-0.168830702 |
0.17236942 |
0.1636739 |
kable(mv_residual(dat, intercept=FALSE, instrument_specific=FALSE)$result)
Fluid intelligence score || id:UKB-a:196 |
29 |
-0.004250667 |
0.05734102 |
0.4704536 |
Years of schooling || id:1001 |
57 |
-0.198486919 |
0.16494382 |
0.1144184 |
kable(mv_multiple(dat, intercept=TRUE, instrument_specific=TRUE)$result)
Fluid intelligence score || id:UKB-a:196 |
29 |
0.1790975 |
0.1198547 |
0.06755004 |
Years of schooling || id:1001 |
57 |
0.1843595 |
0.3243529 |
0.28488450 |
kable(mv_multiple(dat, intercept=FALSE, instrument_specific=TRUE)$result)
Fluid intelligence score || id:UKB-a:196 |
29 |
0.18035725 |
0.1294978 |
0.08184861 |
Years of schooling || id:1001 |
57 |
-0.04084533 |
0.3115188 |
0.44784148 |
kable(mv_multiple(dat, intercept=TRUE, instrument_specific=FALSE)$result)
Fluid intelligence score || id:UKB-a:196 |
29 |
-0.006102403 |
0.08344648 |
0.47085152 |
Years of schooling || id:1001 |
57 |
-0.402331469 |
0.23609196 |
0.04417837 |
kable(mv_multiple(dat, intercept=FALSE, instrument_specific=FALSE)$result)
Fluid intelligence score || id:UKB-a:196 |
29 |
0.00549592 |
0.08536188 |
0.47433233 |
Years of schooling || id:1001 |
57 |
-0.54006263 |
0.23350407 |
0.01036512 |
kable(mv_ivw(dat)$result)
Fluid intelligence score || id:UKB-a:196 |
29 |
0.18035725 |
0.1294978 |
0.08184861 |
Years of schooling || id:1001 |
57 |
-0.04084533 |
0.3115188 |
0.44784148 |
kable(mv_basic(dat)$result)
Fluid intelligence score || id:UKB-a:196 |
29 |
0.06083229 |
0.07042451 |
0.19385045 |
Years of schooling || id:1001 |
57 |
-0.22289480 |
0.16584914 |
0.08948047 |
``` |
|
|
|
|