Investigating sexual behaviour in relation to number of live births
library(TwoSampleMR)
## TwoSampleMR version 0.5.6
## [>] New: Option to use non-European LD reference panels for clumping etc
## [>] Some studies temporarily quarantined to verify effect allele
## [>] See news(package='TwoSampleMR') and https://gwas.mrcieu.ac.uk for further details
d <- make_dat("ukb-b-12405", "ukb-b-1209")
## API: public: http://gwas-api.mrcieu.ac.uk/
## Extracting data for 35 SNP(s) from 1 GWAS(s)
## Harmonising Age at first live birth || id:ukb-b-12405 (ukb-b-12405) and Number of live births || id:ukb-b-1209 (ukb-b-1209)
d_mr<-mr(d)
## Analysing 'ukb-b-12405' on 'ukb-b-1209'
d_mr
## id.exposure id.outcome outcome
## 1 ukb-b-12405 ukb-b-1209 Number of live births || id:ukb-b-1209
## 2 ukb-b-12405 ukb-b-1209 Number of live births || id:ukb-b-1209
## 3 ukb-b-12405 ukb-b-1209 Number of live births || id:ukb-b-1209
## 4 ukb-b-12405 ukb-b-1209 Number of live births || id:ukb-b-1209
## 5 ukb-b-12405 ukb-b-1209 Number of live births || id:ukb-b-1209
## exposure method nsnp
## 1 Age at first live birth || id:ukb-b-12405 MR Egger 35
## 2 Age at first live birth || id:ukb-b-12405 Weighted median 35
## 3 Age at first live birth || id:ukb-b-12405 Inverse variance weighted 35
## 4 Age at first live birth || id:ukb-b-12405 Simple mode 35
## 5 Age at first live birth || id:ukb-b-12405 Weighted mode 35
## b se pval
## 1 -0.5060921 0.24046501 4.302098e-02
## 2 -0.3028982 0.04464528 1.164476e-11
## 3 -0.3433739 0.04132265 9.604048e-17
## 4 -0.2461135 0.09722791 1.615588e-02
## 5 -0.2422998 0.10570024 2.820053e-02
mr_scatter_plot(d_mr,d)
## $`ukb-b-12405.ukb-b-1209`
##
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
## id.exposure id.outcome
## 1 ukb-b-12405 ukb-b-1209
d <- make_dat("ukb-b-1209", "ukb-b-12405")
## Extracting data for 11 SNP(s) from 1 GWAS(s)
## Harmonising Number of live births || id:ukb-b-1209 (ukb-b-1209) and Age at first live birth || id:ukb-b-12405 (ukb-b-12405)
d_mr<-mr(d)
## Analysing 'ukb-b-1209' on 'ukb-b-12405'
d_mr
## id.exposure id.outcome outcome
## 1 ukb-b-1209 ukb-b-12405 Age at first live birth || id:ukb-b-12405
## 2 ukb-b-1209 ukb-b-12405 Age at first live birth || id:ukb-b-12405
## 3 ukb-b-1209 ukb-b-12405 Age at first live birth || id:ukb-b-12405
## 4 ukb-b-1209 ukb-b-12405 Age at first live birth || id:ukb-b-12405
## 5 ukb-b-1209 ukb-b-12405 Age at first live birth || id:ukb-b-12405
## exposure method nsnp
## 1 Number of live births || id:ukb-b-1209 MR Egger 11
## 2 Number of live births || id:ukb-b-1209 Weighted median 11
## 3 Number of live births || id:ukb-b-1209 Inverse variance weighted 11
## 4 Number of live births || id:ukb-b-1209 Simple mode 11
## 5 Number of live births || id:ukb-b-1209 Weighted mode 11
## b se pval
## 1 -0.04834468 1.31463005 0.9714676757
## 2 -0.40832712 0.09364731 0.0000129905
## 3 -0.51702378 0.15125124 0.0006301106
## 4 -0.42579904 0.15677822 0.0217113943
## 5 -0.37205500 0.15333171 0.0356647646
mr_scatter_plot(d_mr,d)
## $`ukb-b-1209.ukb-b-12405`
##
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
## id.exposure id.outcome
## 1 ukb-b-1209 ukb-b-12405
Age at first live birth has a large effect on the number of children. Interestingly high effect in the reverse (which doesn’t make sense temporally) so maybe some form of bias going on.
d <- make_dat("ukb-b-6591", "ukb-b-1209")
## Extracting data for 200 SNP(s) from 1 GWAS(s)
## Harmonising Age first had sexual intercourse || id:ukb-b-6591 (ukb-b-6591) and Number of live births || id:ukb-b-1209 (ukb-b-1209)
d_mr<-mr(d)
## Analysing 'ukb-b-6591' on 'ukb-b-1209'
d_mr
## id.exposure id.outcome outcome
## 1 ukb-b-6591 ukb-b-1209 Number of live births || id:ukb-b-1209
## 2 ukb-b-6591 ukb-b-1209 Number of live births || id:ukb-b-1209
## 3 ukb-b-6591 ukb-b-1209 Number of live births || id:ukb-b-1209
## 4 ukb-b-6591 ukb-b-1209 Number of live births || id:ukb-b-1209
## 5 ukb-b-6591 ukb-b-1209 Number of live births || id:ukb-b-1209
## exposure method
## 1 Age first had sexual intercourse || id:ukb-b-6591 MR Egger
## 2 Age first had sexual intercourse || id:ukb-b-6591 Weighted median
## 3 Age first had sexual intercourse || id:ukb-b-6591 Inverse variance weighted
## 4 Age first had sexual intercourse || id:ukb-b-6591 Simple mode
## 5 Age first had sexual intercourse || id:ukb-b-6591 Weighted mode
## nsnp b se pval
## 1 200 -0.4082106 0.10461461 1.306684e-04
## 2 200 -0.2419585 0.02650640 6.958074e-20
## 3 200 -0.2523349 0.02350201 6.841883e-27
## 4 200 -0.2573727 0.08357179 2.365174e-03
## 5 200 -0.2479373 0.07919046 2.005136e-03
mr_scatter_plot(d_mr,d)
## $`ukb-b-6591.ukb-b-1209`
##
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
## id.exposure id.outcome
## 1 ukb-b-6591 ukb-b-1209
d <- make_dat("ukb-b-1209", "ukb-b-6591")
## Extracting data for 11 SNP(s) from 1 GWAS(s)
## Harmonising Number of live births || id:ukb-b-1209 (ukb-b-1209) and Age first had sexual intercourse || id:ukb-b-6591 (ukb-b-6591)
d_mr<-mr(d)
## Analysing 'ukb-b-1209' on 'ukb-b-6591'
d_mr
## id.exposure id.outcome outcome
## 1 ukb-b-1209 ukb-b-6591 Age first had sexual intercourse || id:ukb-b-6591
## 2 ukb-b-1209 ukb-b-6591 Age first had sexual intercourse || id:ukb-b-6591
## 3 ukb-b-1209 ukb-b-6591 Age first had sexual intercourse || id:ukb-b-6591
## 4 ukb-b-1209 ukb-b-6591 Age first had sexual intercourse || id:ukb-b-6591
## 5 ukb-b-1209 ukb-b-6591 Age first had sexual intercourse || id:ukb-b-6591
## exposure method nsnp
## 1 Number of live births || id:ukb-b-1209 MR Egger 11
## 2 Number of live births || id:ukb-b-1209 Weighted median 11
## 3 Number of live births || id:ukb-b-1209 Inverse variance weighted 11
## 4 Number of live births || id:ukb-b-1209 Simple mode 11
## 5 Number of live births || id:ukb-b-1209 Weighted mode 11
## b se pval
## 1 0.92532096 1.20259114 0.461348229
## 2 -0.04262213 0.06303462 0.498932596
## 3 -0.45340862 0.14725483 0.002076446
## 4 -0.06099427 0.06750242 0.387463770
## 5 -0.02308541 0.04717412 0.635138753
mr_scatter_plot(d_mr,d)
## $`ukb-b-1209.ukb-b-6591`
##
## attr(,"split_type")
## [1] "data.frame"
## attr(,"split_labels")
## id.exposure id.outcome
## 1 ukb-b-1209 ukb-b-6591
Very highly related
Which is more important?
d <- mv_extract_exposures(c("ukb-b-12405", "ukb-b-6591"))
## Please look at vignettes for options on running this locally if you need to run many instances of this command.
## Clumping 1, 235 variants, using EUR population reference
## Removing 35 of 235 variants due to LD with other variants or absence from LD reference panel
## Extracting data for 200 SNP(s) from 2 GWAS(s)
## Harmonising Age at first live birth || id:ukb-b-12405 (ukb-b-12405) and Age first had sexual intercourse || id:ukb-b-6591 (ukb-b-6591)
## Removing the following SNPs for being palindromic with intermediate allele frequencies:
## rs10496949, rs10922907, rs1226414, rs12653396, rs1454687, rs1891588, rs3739121, rs6955073, rs9514600, rs976179
o <- extract_outcome_data(d$SNP, "ukb-b-1209")
## Extracting data for 200 SNP(s) from 1 GWAS(s)
d <- mv_harmonise_data(d, o)
## Harmonising Age at first live birth || id:ukb-b-12405 (ukb-b-12405) and Number of live births || id:ukb-b-1209 (ukb-b-1209)
## Removing the following SNPs for being palindromic with intermediate allele frequencies:
## rs10496949, rs10922907, rs1226414, rs12653396, rs1454687, rs1891588, rs3739121, rs6955073, rs9514600, rs976179
mv_multiple(d)
## $result
## id.exposure exposure id.outcome
## 1 ukb-b-12405 Age at first live birth || id:ukb-b-12405 ukb-b-1209
## 2 ukb-b-6591 Age first had sexual intercourse || id:ukb-b-6591 ukb-b-1209
## outcome nsnp b se
## 1 Number of live births || id:ukb-b-1209 14 -0.39253475 0.06196927
## 2 Number of live births || id:ukb-b-1209 183 0.01139307 0.04970093
## pval
## 1 2.383505e-10
## 2 8.186882e-01
Age at first live birth is more important.