diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..176a458 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/.gitignore b/.gitignore index 76f85cb..c6c031d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,5 @@ mrbase.oauth *.rdx *.rdb +*_cache/ +.DS_Store diff --git a/DESCRIPTION b/DESCRIPTION index cd28f8e..4ec3b79 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,21 +1,44 @@ Package: tryx Title: MR-TRYX (treasure your exceptions) -Version: 0.2.0 -Authors@R: c(person("Gibran", "Hemani", email = "g.hemani@bristol.ac.uk", role = c("aut", "cre")), person("Yoonsu", "Cho", email = "yoonsu.cho@bristol.ac.uk", role = c("aut"))) -Description: Heterogeneity in MR analyses can arise due to horizontal pleiotropy. This package uses MR-Base to identify possible traits that can explain the heterogeneity, with a view to identifying novel putative associations, and adjusting for their influences to reduce heterogeneity and improve power. -Depends: R (>= 3.6.0), - TwoSampleMR, - dplyr, - RadialMR, - magrittr, - tidyr, - ggplot2, - glmnet, - ggrepel +Version: 0.2.1 +Authors@R: c( + person("Gibran", "Hemani", , "g.hemani@bristol.ac.uk", role = c("aut", "cre")), + person("Yoonsu", "Cho", , "yoonsu.cho@bristol.ac.uk", role = "aut") + ) +Description: Heterogeneity in MR analyses can arise due to horizontal + pleiotropy. This package uses MR-Base to identify possible traits that + can explain the heterogeneity, with a view to identifying novel + putative associations, and adjusting for their influences to reduce + heterogeneity and improve power. +License: MIT + file LICENSE +URL: https://mrcieu.r-universe.dev/tryx, + https://explodecomputer.github.io/tryx/, + https://github.com/explodecomputer/tryx +BugReports: https://github.com/explodecomputer/tryx/issues +Depends: + R (>= 4.1.0) +Imports: + dplyr, + ggplot2, + ggrepel, + glmnet, + magrittr, + R6, + RadialMR, + tibble, + tidyr, + TwoSampleMR Suggests: igraph, + knitr, + rmarkdown, + simulateGP, testthat -License: MIT + file LICENSE +VignetteBuilder: + knitr +Remotes: + explodecomputer/simulateGP, + MRCIEU/TwoSampleMR, + WSpiller/RadialMR +Config/roxygen2/version: 8.1.0 Encoding: UTF-8 -LazyData: true -RoxygenNote: 7.0.2 diff --git a/NAMESPACE b/NAMESPACE index 0448e00..caf3f36 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -10,3 +10,63 @@ export(tryx.scan) export(tryx.sig) export(tryx.simulate) export(volcano_plot) +importFrom(R6,R6Class) +importFrom(TwoSampleMR, + available_outcomes, + extract_instruments, + extract_outcome_data, + harmonise_data, + mr, + mr_heterogeneity, + mr_method_list, + mv_extract_exposures, + mv_harmonise_data, + mv_multiple +) +importFrom(dplyr, + arrange, + bind_rows, + desc, + do, + filter, + group_by, + mutate, + n, + summarise +) +importFrom(ggplot2, + aes, + arrow, + element_blank, + element_text, + facet_grid, + geom_abline, + geom_errorbarh, + geom_point, + geom_segment, + geom_vline, + ggplot, + labs, + scale_colour_brewer, + theme, + theme_bw, + unit, + xlim, + ylim +) +importFrom(ggrepel,geom_label_repel) +importFrom(magrittr, + "%$%", + "%>%" +) +importFrom(stats, + as.formula, + coef, + coefficients, + lm, + p.adjust, + rnorm, + sd +) +importFrom(tibble,tibble) +importFrom(utils,combn) diff --git a/R/adjustment.r b/R/adjustment.r index 6a87484..be1044b 100644 --- a/R/adjustment.r +++ b/R/adjustment.r @@ -207,7 +207,7 @@ tryx.adjustment.mv <- function(tryxscan, lasso=TRUE, id_remove=NULL, proxies=FAL #' @param tryxscan Output from \code{tryx.scan} #' @param plot Whether to plot or not. Default is TRUE #' @param id_remove List of IDs to exclude from the adjustment analysis. It is possible that in the outlier search a candidate trait will come up which is essentially just a surrogate for the outcome trait (e.g. if you are analysing coronary heart disease as the outcome then a variable related to heart disease medication might come up as a candidate trait). Adjusting for a trait which is essentially the same as the outcome will erroneously nullify the result, so visually inspect the candidate trait list and remove those that are inappropriate. -#' @param duplicate_outliers_method Sometimes more than one trait will associate with a particular outlier. TRUE = only keep the trait that has the biggest influence on heterogeneity +#' @param filter_duplicate_outliers Sometimes more than one trait will associate with a particular outlier. TRUE = only keep the trait that has the biggest influence on heterogeneity #' #' @export #' @return List of @@ -246,11 +246,6 @@ tryx.analyse <- function(tryxscan, plot=TRUE, id_remove=NULL, filter_duplicate_o # analysis$detection <- detection # } - cpg <- require(ggrepel) - if(!cpg) - { - stop("Please install the ggrepel package\ninstall.packages('ggrepel')") - } dat <- subset(tryxscan$dat, mr_keep, select=c(SNP, beta.exposure, beta.outcome, se.exposure, se.outcome)) dat$ratio <- dat$beta.outcome / dat$beta.exposure @@ -310,7 +305,7 @@ tryx.analyse <- function(tryxscan, plot=TRUE, id_remove=NULL, filter_duplicate_o # Outliers removed (all) tt <- subset(dat, !SNP %in% tryxscan$outliers) mod <- try(summary(lm(ratiow ~ -1 + weights, data=tt))) - if(class(mod) != "try-error") + if(!inherits(mod, "try-error")) { estimates <- bind_rows(estimates, tibble( @@ -328,7 +323,7 @@ tryx.analyse <- function(tryxscan, plot=TRUE, id_remove=NULL, filter_duplicate_o # Outliers removed (candidates) tt <- subset(dat, !SNP %in% temp$SNP) mod <- try(summary(lm(ratiow ~ -1 + weights, data=tt))) - if(class(mod) != "try-error") + if(!inherits(mod, "try-error")) { estimates <- bind_rows(estimates, tibble( @@ -348,7 +343,7 @@ tryx.analyse <- function(tryxscan, plot=TRUE, id_remove=NULL, filter_duplicate_o tt$qi <- cochrans_q(tt$beta.outcome / tt$beta.exposure, tt$se.outcome / abs(tt$beta.exposure)) analysis$Q$adj_Q <- sum(tt$qi) mod <- try(summary(lm(ratiow ~ -1 + weights, data=tt))) - if(class(mod) != "try-error") + if(!inherits(mod, "try-error")) { estimates <- bind_rows(estimates, tibble( @@ -382,7 +377,7 @@ tryx.analyse <- function(tryxscan, plot=TRUE, id_remove=NULL, filter_duplicate_o { tt <- subset(dat, !SNP %in% tryxscan$true_outliers) mod <- try(summary(lm(ratiow ~ -1 + weights, data=tt))) - if(class(mod) != "try-error") + if(!inherits(mod, "try-error")) { estimates <- bind_rows(estimates, tibble( @@ -451,26 +446,6 @@ tryx.analyse <- function(tryxscan, plot=TRUE, id_remove=NULL, filter_duplicate_o -#' Analyse tryx results -#' -#' This returns various heterogeneity statistics, IVW estimates for raw, -#' adjusted and outlier removed datasets, and summary of peripheral -#' traits detected etc. -#' -#' @param tryxscan Output from \code{tryx.scan} -#' @param plot Whether to plot or not. Default is TRUE -#' @param filter_duplicate_outliers Whether to only allow each putative outlier to be adjusted by a single trait (in order of largest divergence). Default is TRUE. -#' -#' @export -#' @return List of -#' - adj_full: data frame of SNP adjustments for all candidate traits -#' - adj: The results from adj_full selected to adjust the exposure-outcome model -#' - Q: Heterogeneity stats -#' - estimates: Adjusted and unadjested exposure-outcome effects -#' - plot: Radial plot showing the comparison of different methods and the changes in SNP effects ater adjustment - - - #' Adjust and analyse the tryx results #' #' Similar to tryx.analyse, but when there are multiple traits associated with a single variant then we use a LASSO-based multivariable approach @@ -597,7 +572,6 @@ bootstrap_path <- function(gx, gx.se, gp, gp.se, px, px.se, nboot=1000) radialmr <- function(dat, outlier=NULL) { - library(ggplot2) beta.exposure <- dat$beta.exposure beta.outcome <- dat$beta.outcome se.outcome <- dat$se.outcome diff --git a/R/plots.r b/R/plots.r index 7868b19..ed9c462 100644 --- a/R/plots.r +++ b/R/plots.r @@ -6,17 +6,6 @@ #' @return ggplot of volcano plots volcano_plot <- function(res, what="exposure") { - cpg <- require(ggplot2) - if(!cpg) - { - stop("Please install the ggplot2 package") - } - cpg <- require(ggrepel) - if(!cpg) - { - stop("Please install the ggrepel package") - } - stopifnot(all(c("outcome", "exposure", "b", "se", "pval") %in% names(res))) if(!"sig" %in% names(res)) { @@ -44,7 +33,7 @@ volcano_plot <- function(res, what="exposure") geom_vline(xintercept=0, linetype="dotted") + geom_errorbarh(aes(xmin=b-1.96*se, xmax=b+1.96*se)) + geom_point(aes(colour=sig)) + - facet_grid(form, scale="free") + + facet_grid(form, scales="free") + geom_label_repel(data=subset(res, sig), aes(label=exposure), colour="black", segment.colour="black", point.padding = unit(0.7, "lines"), box.padding = unit(0.7, "lines"), segment.size=0.5, force=2, max.iter=3e3) + # geom_text_repel(data=subset(res, sig), aes(label=outcome, colour=category)) + geom_point(aes(colour=sig)) + @@ -69,16 +58,10 @@ volcano_plot <- function(res, what="exposure") tryx.network <- function(tryxscan) { - a <- require(igraph) - if(!a) + if(!requireNamespace("igraph", quietly=TRUE)) { stop("Please install the igraph R package") } - a <- require(dplyr) - if(!a) - { - stop("Please install the dplyr R package") - } stopifnot("candidate_outcome_mr" %in% names(tryxscan)) stopifnot("candidate_exposure_mr" %in% names(tryxscan)) @@ -174,14 +157,14 @@ tryx.network <- function(tryxscan) nodes <- rbind( - data_frame( + tibble( name=c( ao$trait[ao$id %in% tryxscan$dat$id.exposure[1]], ao$trait[ao$id %in% tryxscan$dat$id.outcome[1]]), id=c(tryxscan$dat$id.exposure[1], tryxscan$dat$id.outcome[1]), what=c("original") ), - data_frame( + tibble( name=unique(tryxscan$outliers), id=NA, what="Outlier instruments" @@ -230,20 +213,20 @@ tryx.network <- function(tryxscan) grp$size <- 0.1 grp$size[grp$what == "Main hypothesis"] <- 0.5 - layoutg <- graph_from_data_frame(layoutd2, vertices=nodes) - l <- layout_with_fr(layoutg) - grl <- graph_from_data_frame(grp, directed=TRUE, vertices=nodes) + layoutg <- igraph::graph_from_data_frame(layoutd2, vertices=nodes) + l <- igraph::layout_with_fr(layoutg) + grl <- igraph::graph_from_data_frame(grp, directed=TRUE, vertices=nodes) plot(grl, layout=l, - vertex.size=V(grl)$size, - vertex.label=V(grl)$label, - # edge.arrow.size=E(grl)$size, + vertex.size=igraph::V(grl)$size, + vertex.label=igraph::V(grl)$label, + # edge.arrow.size=igraph::E(grl)$size, edge.arrow.size=0.3, - edge.color=E(grl)$colour, + edge.color=igraph::E(grl)$colour, vertex.label.cex=0.5, vertex.label.family="sans", vertex.label.color="black", - vertex.color=V(grl)$colour, + vertex.color=igraph::V(grl)$colour, edge.color="red" ) } diff --git a/R/scan.r b/R/scan.r index 41e61c5..cc61342 100644 --- a/R/scan.r +++ b/R/scan.r @@ -56,16 +56,6 @@ tryx.scan <- function(dat, outliers="RadialMR", outlier_correction="none", outli if(outliers[1] == "RadialMR") { message("Using RadialMR package to detect outliers") - cpg <- require(RadialMR) - if(!cpg) - { - stop("Please install the RadialMR package\ndevtools::install_github('WSpiller/RadialMR')") - } - cpg <- require(dplyr) - if(!cpg) - { - stop("Please install the RadialMR package\ndevtools::install_github('WSpiller/RadialMR')") - } # radial <- RadialMR::ivw_radial(RadialMR::format_radial(dat$beta.exposure, dat$beta.outcome, dat$se.exposure, dat$se.outcome, dat$SNP), alpha=0.05/nrow(dat), weights=3) @@ -82,7 +72,7 @@ tryx.scan <- function(dat, outliers="RadialMR", outlier_correction="none", outli # apply outlier_correction method with outlier_threshold to radial SNP-Q statistics - if(radial$outliers[1] == "No significant outliers") + if(is.character(radial$outliers) && radial$outliers[1] == "No significant outliers") { message("No outliers found") message("Try changing the outlier_threshold parameter") @@ -318,6 +308,7 @@ strategy1 <- function(dat, het_threshold=0.05, ivw_max_snp=1) #' Identify putatively significant associations in the outlier scan #' +#' @param tryxscan Output from \code{tryx.scan} #' @param mr_threshold_method This is the argument to be passed to \code{p.adjust}. Default is "fdr". If no p-value adjustment is to be applied then specify "unadjusted" #' @param mr_threshold Threshold to declare significance #' @export diff --git a/R/simulations.r b/R/simulations.r index cd63ab6..420f506 100644 --- a/R/simulations.r +++ b/R/simulations.r @@ -25,7 +25,7 @@ #' @param vgxu2 = 0.2 Variance explained by each gx instrument on each u2 mediator #' @param vu2y = 0.2 Variance explained by all u2 mediators on y #' @param ngxu3 = 0 Number of gx instruments that pleiotropically associate with u3 mediator -#' @param vgxu3y = 0 Variance explained by all gx variants directly on u3 mediator +#' @param vgxu3 = 0 Variance explained by all gx variants directly on u3 mediator #' @param mininum_instruments = 10 Minimum number of instruments required to have been detected to run simulation #' @param instrument_threshold = "bonferroni" Threshold, either numeric or 'bonferroni' #' @param outlier_threshold = "bonferroni" Threshold, either numeric or 'bonferroni' @@ -36,21 +36,26 @@ #' @return list for tryx.analyse tryx.simulate <- function(nid = 10000, ngx = 30, ngu1 = 30, ngu2 = 30, nu2 = 2, ngu3 = 30, vgx = 0.2, vgu1 = 0.6, vgu2 = 0.2, vgu3 = 0.2, bxy = 0, bu1x = 0.6, bu1y = 0.4, bxu3 = 0.3, bu3y = 0, vgxu2 = 0.2, vu2y = 0.2, ngxu3 = 0, vgxu3=0, mininum_instruments = 10, instrument_threshold = "bonferroni", outlier_threshold = "bonferroni", outliers_known = "detected", directional_bias = FALSE) { + if(!requireNamespace("simulateGP", quietly=TRUE)) + { + stop("Please install the simulateGP package\nremotes::install_github('explodecomputer/simulateGP')") + } + out <- list() message("Generating genetic effects") - gx <- make_geno(nid, ngx, 0.5) - gu1 <- make_geno(nid, ngu1, 0.5) - gu2 <- make_geno(nid, ngu2 * nu2, 0.5) - gu3 <- make_geno(nid, ngu3, 0.5) - u1 <- make_phen(choose_effects(ngu1, vgu1), gu1) - x <- make_phen(c(abs(choose_effects(ngx, vgx)), bu1x), cbind(gx, u1)) + gx <- simulateGP::make_geno(nid, ngx, 0.5) + gu1 <- simulateGP::make_geno(nid, ngu1, 0.5) + gu2 <- simulateGP::make_geno(nid, ngu2 * nu2, 0.5) + gu3 <- simulateGP::make_geno(nid, ngu3, 0.5) + u1 <- simulateGP::make_phen(simulateGP::choose_effects(ngu1, vgu1), gu1) + x <- simulateGP::make_phen(c(abs(simulateGP::choose_effects(ngx, vgx)), bu1x), cbind(gx, u1)) if(ngxu3 > 0) { - u3 <- make_phen(c(choose_effects(ngu3, vgu3), bxu3, choose_effects(ngxu3, vgxu3)), cbind(gu3, x, gx[,sample(1:ngx, ngxu3)])) + u3 <- simulateGP::make_phen(c(simulateGP::choose_effects(ngu3, vgu3), bxu3, simulateGP::choose_effects(ngxu3, vgxu3)), cbind(gu3, x, gx[,sample(1:ngx, ngxu3)])) } else { - u3 <- make_phen(c(choose_effects(ngu3, vgu3), bxu3), cbind(gu3, x)) + u3 <- simulateGP::make_phen(c(simulateGP::choose_effects(ngu3, vgu3), bxu3), cbind(gu3, x)) } @@ -63,22 +68,22 @@ tryx.simulate <- function(nid = 10000, ngx = 30, ngu1 = 30, ngu2 = 30, nu2 = 2, for(i in 1:nu2) { message("SNP ", i, " is pleiotropic") - u2[,i] <- make_phen( - c(choose_effects(ngu2, vgu2), abs(choose_effects(1, vgxu2))), + u2[,i] <- simulateGP::make_phen( + c(simulateGP::choose_effects(ngu2, vgu2), abs(simulateGP::choose_effects(1, vgxu2))), cbind(gu2[,((i-1) * ngu2 + 1):(ngu2 * i)], gx[,i]) ) } message("Creating outcome") - bu2y <- choose_effects(nu2, vu2y) + bu2y <- simulateGP::choose_effects(nu2, vu2y) if(directional_bias) { message("U2 bias is directional") bu2y <- abs(bu2y) } - y <- make_phen( + y <- simulateGP::make_phen( c(bxy, bu3y, bu1y, bu2y), cbind(x, u3, u1, u2) ) @@ -117,7 +122,7 @@ tryx.simulate <- function(nid = 10000, ngx = 30, ngu1 = 30, ngu2 = 30, nu2 = 2, message("Getting instruments") - out$dat_all <- get_effs(x, y, G, "X", "Y") + out$dat_all <- simulateGP::get_effs(x, y, G, "X", "Y") out$dat <- subset(out$dat_all, pval.exposure < instrument_threshold) stopifnot(nrow(out$dat) > mininum_instruments) out$dat$mr_keep <- TRUE @@ -158,7 +163,7 @@ tryx.simulate <- function(nid = 10000, ngx = 30, ngu1 = 30, ngu2 = 30, nu2 = 2, } else if(outliers_known %in% c("detected", "all")) { message("Detecting outliers") radial <- RadialMR::ivw_radial(RadialMR::format_radial(out$dat$beta.exposure, out$dat$beta.outcome, out$dat$se.exposure, out$dat$se.outcome, out$dat$SNP), ifelse(outlier_threshold == "bonferroni", 0.05/nrow(out$dat), outlier_threshold), weights=3) - if(radial$outliers[1] == "No significant outliers") + if(is.character(radial$outliers) && radial$outliers[1] == "No significant outliers") { message("No significant outliers detected") outliers <- as.character(out$dat$SNP[out$dat$SNP %in% invalid]) @@ -190,7 +195,7 @@ tryx.simulate <- function(nid = 10000, ngx = 30, ngu1 = 30, ngu2 = 30, nu2 = 2, outlier_scan <- list() for(i in 1:ncol(U)) { - outlier_scan[[colnames(U)[i]]] <- gwas(U[,i], G[,outliers, drop=FALSE]) + outlier_scan[[colnames(U)[i]]] <- simulateGP::gwas(U[,i], G[,outliers, drop=FALSE]) outlier_scan[[colnames(U)[i]]]$SNP <- outliers outlier_scan[[colnames(U)[i]]]$outcome <- colnames(U)[i] } @@ -220,13 +225,13 @@ tryx.simulate <- function(nid = 10000, ngx = 30, ngu1 = 30, ngu2 = 30, nu2 = 2, message("Analysing ", length(PHEN), " traits: ", paste(names(PHEN), collapse=",")) snplist <- sapply(1:length(PHEN), function(x) { - subset(gwas(PHEN[[x]], G), pval < instrument_threshold)$snp + subset(simulateGP::gwas(PHEN[[x]], G), pval < instrument_threshold)$snp }) %>% unlist() %>% sort %>% unique message("Found ", length(snplist), " unique instruments") message("Perform mvmr") out$mvres <- try({ - mvdat <- make_mvdat(PHEN, y, G[,snplist]) + mvdat <- simulateGP::make_mvdat(PHEN, y, G[,snplist]) mvres <- mv_multiple(mvdat) mvres$result$exposure <- c("x", traitlist) mvres @@ -241,8 +246,8 @@ tryx.simulate <- function(nid = 10000, ngx = 30, ngu1 = 30, ngu2 = 30, nu2 = 2, for(i in traitlist) { message(i) - ux[[i]] <- get_effs(U[,i], x, G, i, "X") %>% subset(pval.exposure < instrument_threshold) - uy[[i]] <- get_effs(U[,i], y, G, i, "Y") %>% subset(pval.exposure < instrument_threshold) + ux[[i]] <- simulateGP::get_effs(U[,i], x, G, i, "X") %>% subset(pval.exposure < instrument_threshold) + uy[[i]] <- simulateGP::get_effs(U[,i], y, G, i, "Y") %>% subset(pval.exposure < instrument_threshold) if(nrow(ux[[i]]) > 0) { ux[[i]]$effect_allele.exposure <- "A" diff --git a/R/tryx-package.R b/R/tryx-package.R new file mode 100644 index 0000000..e0b962a --- /dev/null +++ b/R/tryx-package.R @@ -0,0 +1,26 @@ +#' @keywords internal +"_PACKAGE" + +#' @importFrom magrittr %>% %$% +#' @importFrom dplyr arrange bind_rows desc do filter group_by mutate n summarise +#' @importFrom tibble tibble +#' @importFrom ggplot2 aes arrow element_blank element_text facet_grid geom_abline geom_errorbarh geom_point geom_segment geom_vline ggplot labs scale_colour_brewer theme theme_bw unit xlim ylim +#' @importFrom ggrepel geom_label_repel +#' @importFrom TwoSampleMR available_outcomes extract_instruments extract_outcome_data harmonise_data mr mr_heterogeneity mr_method_list mv_extract_exposures mv_harmonise_data mv_multiple +#' @importFrom R6 R6Class +#' @importFrom stats as.formula coef coefficients lm p.adjust rnorm sd +#' @importFrom utils combn +NULL + +# Column names used in non-standard evaluation (subset, dplyr, ggplot2) +utils::globalVariables(c( + ".", "Q", "Q_df", "Q_pval", "Qj", "Qj_Chi", "SNP", + "adj.beta.exposure", "adj.beta.outcome", "adj.se.exposure", "adj.se.outcome", + "b", "beta.exposure", "beta.outcome", "candidate", "d", + "eaf.exposure", "eaf.outcome", "effect_allele.exposure", "effect_allele.outcome", + "est", "exposure", "id", "id.exposure", "id.outcome", "label", "method", "mp", + "mr_keep", "orig.ratiow", "orig.weights", "other_allele.exposure", "other_allele.outcome", + "outcome", "p", "pval", "pval.exposure", "pval.outcome", "qi", "ratiow", "ratiow.x", + "ratiow.y", "rdpadj", "sample_size", "se", "se.exposure", "se.outcome", "sig", + "snpcount", "trait", "weights", "weights.x", "weights.y", "what", "x", "xend", "y", "yend" +)) diff --git a/R/tryxclass.R b/R/tryxclass.R index 13ca1de..5330303 100644 --- a/R/tryxclass.R +++ b/R/tryxclass.R @@ -7,6 +7,7 @@ #' Perform MR of each of those candidate traits with the original exposure and outcome. #' @export Tryx <- R6::R6Class("Tryx", list( + #' @field output List holding the input data and the results of each analysis step. output = list(), ########################################################################################################################################################################## @@ -27,6 +28,9 @@ Tryx <- R6::R6Class("Tryx", list( invisible(self) }, + #' @description + #' Print a summary of the analysis status. + #' @param ... Unused. print = function(...) { cat("Tryx analysis of ", self$output$dat$exposure[1], " against ", self$output$dat$outcome[1], "\n") cat("Status:\n") @@ -52,16 +56,6 @@ Tryx <- R6::R6Class("Tryx", list( if(outliers[1] == "RadialMR") { message("Using RadialMR package to detect outliers") - cpg <- require(RadialMR) - if(!cpg) - { - stop("Please install the RadialMR package\ndevtools::install_github('WSpiller/RadialMR')") - } - cpg <- require(dplyr) - if(!cpg) - { - stop("Please install the RadialMR package\ndevtools::install_github('WSpiller/RadialMR')") - } radialor <- RadialMR::ivw_radial(RadialMR::format_radial(dat$beta.exposure, dat$beta.outcome, dat$se.exposure, dat$se.outcome, dat$SNP), alpha=1, weights=3) @@ -73,7 +67,7 @@ Tryx <- R6::R6Class("Tryx", list( rownames(radial$outliers) <- 1:nrow(radial$outliers) # apply outlier_correction method with outlier_threshold to radial SNP-Q statistics - if(radial$outliers[1] == "No significant outliers") + if(is.character(radial$outliers) && radial$outliers[1] == "No significant outliers") { message("No outliers found") message("Try changing the outlier_threshold parameter") @@ -689,7 +683,7 @@ Tryx <- R6::R6Class("Tryx", list( #' #' @param id_remove List of IDs to exclude from the adjustment analysis. It is possible that in the outlier search a candidate trait will come up which is essentially just a surrogate for the outcome trait (e.g. if you are analysing coronary heart disease as the outcome then a variable related to heart disease medication might come up as a candidate trait). Adjusting for a trait which is essentially the same as the outcome will erroneously nullify the result, so visually inspect the candidate trait list and remove those that are inappropriate. #' - #' @param duplicate_outliers_method Sometimes more than one trait will associate with a particular outlier. TRUE = only keep the trait that has the biggest influence on heterogeneity. + #' @param filter_duplicate_outliers Sometimes more than one trait will associate with a particular outlier. TRUE = only keep the trait that has the biggest influence on heterogeneity. analyse = function(tryxscan=self$output, plot=TRUE, id_remove=NULL, filter_duplicate_outliers=TRUE) { analysis <- list() @@ -709,11 +703,6 @@ Tryx <- R6::R6Class("Tryx", list( analysis$adj <- adj - cpg <- require(ggrepel) - if(!cpg) - { - stop("Please install the ggrepel package\ninstall.packages('ggrepel')") - } dat <- subset(tryxscan$dat, mr_keep, select=c(SNP, beta.exposure, beta.outcome, se.exposure, se.outcome)) dat$ratio <- dat$beta.outcome / dat$beta.exposure @@ -773,7 +762,7 @@ Tryx <- R6::R6Class("Tryx", list( # Outliers removed (all) tt <- subset(dat, !SNP %in% tryxscan$outliers) mod <- try(summary(lm(ratiow ~ -1 + weights, data=tt))) - if(class(mod) != "try-error") + if(!inherits(mod, "try-error")) { estimates <- bind_rows(estimates, tibble( @@ -791,7 +780,7 @@ Tryx <- R6::R6Class("Tryx", list( # Outliers removed (candidates) tt <- subset(dat, !SNP %in% temp$SNP) mod <- try(summary(lm(ratiow ~ -1 + weights, data=tt))) - if(class(mod) != "try-error") + if(!inherits(mod, "try-error")) { estimates <- bind_rows(estimates, tibble( @@ -811,7 +800,7 @@ Tryx <- R6::R6Class("Tryx", list( tt$qi <- private$cochrans_q(tt$beta.outcome / tt$beta.exposure, tt$se.outcome / abs(tt$beta.exposure)) analysis$Q$adj_Q <- sum(tt$qi) mod <- try(summary(lm(ratiow ~ -1 + weights, data=tt))) - if(class(mod) != "try-error") + if(!inherits(mod, "try-error")) { estimates <- bind_rows(estimates, tibble( @@ -845,7 +834,7 @@ Tryx <- R6::R6Class("Tryx", list( { tt <- subset(dat, !SNP %in% tryxscan$true_outliers) mod <- try(summary(lm(ratiow ~ -1 + weights, data=tt))) - if(class(mod) != "try-error") + if(!inherits(mod, "try-error")) { estimates <- bind_rows(estimates, tibble( @@ -903,6 +892,8 @@ Tryx <- R6::R6Class("Tryx", list( #' @param lasso Whether to shrink the estimates of each trait within SNP. Default=TRUE. #' #' @param proxies Look for proxies in the MVMR methods. Default = FALSE. + #' + #' @param plot Whether to plot or not. Default is TRUE. analyse.mv = function(tryxscan=self$output, lasso=TRUE, plot=TRUE, id_remove=NULL, proxies=FALSE) { x$adjustment.mv(tryxscan=self$output, lasso=lasso, id_remove=id_remove, proxies=proxies) adj <- tryxscan$adjustment.mv @@ -989,16 +980,6 @@ Tryx <- R6::R6Class("Tryx", list( #' @param label Display the names of the traits on the graph. manhattan_plot = function(what="outcome", id_remove=NULL, y_scale=NULL, label = TRUE){ - cpg <- require(ggplot2) - if(!cpg) - { - stop("Please install the ggplot2 package") - } - cpg <- require(ggrepel) - if(!cpg) - { - stop("Please install the ggrepel package") - } #Open & clean data #mr outcome: candidate traits-outcome / candidate traits-exposure / exposure-candidate traits diff --git a/R/tryxclass_private.R b/R/tryxclass_private.R index d4b9fd8..7c3968a 100644 --- a/R/tryxclass_private.R +++ b/R/tryxclass_private.R @@ -66,7 +66,6 @@ Tryx$set("private", "bootstrap_path", function(gx, gx.se, gp, gp.se, px, px.se, Tryx$set("private", "radialmr", function(dat, outlier=NULL) { - library(ggplot2) beta.exposure <- dat$beta.exposure beta.outcome <- dat$beta.outcome se.outcome <- dat$se.outcome diff --git a/docs/.DS_Store b/docs/.DS_Store deleted file mode 100644 index 5008ddf..0000000 Binary files a/docs/.DS_Store and /dev/null differ diff --git a/docs/404.html b/docs/404.html index f8e7ce2..ca09d91 100644 --- a/docs/404.html +++ b/docs/404.html @@ -1,66 +1,27 @@ - - -
- + + + + -The following analyses should run within a couple of minutes, depending on internet speed and the traffic that the IEU GWAS database servers are experiencing.
-Begin by choosing an exposure-outcome hypothesis to explore. e.g. LDL cholesterol on coronary heart disease. These data can be extracted from the IEU GWAS database using the TwoSampleMR package:
-The following analyses should run within a couple of minutes, +depending on internet speed and the traffic that the IEU GWAS database servers are +experiencing.
+Begin by choosing an exposure-outcome hypothesis to explore. e.g. LDL +cholesterol on coronary heart disease. These data can be extracted from +the IEU GWAS database using the TwoSampleMR +package:
+If necessary install TwoSampleMR:
--devtools::install_github("mrcieu/TwoSampleMR@ieugwasr") -
+devtools::install_github("mrcieu/TwoSampleMR@ieugwasr")Create a dataset for SBP and CHD
--library(TwoSampleMR) -a <- extract_instruments("ukb-b-20175") -#> API: public: http://gwas-api.mrcieu.ac.uk/ -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Systolic blood pressure, automated reading || id:ukb-b-20175. Just keeping the first instance: -#> rs17811915 -b <- extract_outcome_data(a$SNP, "ieu-a-7", access_token=NULL) -#> Extracting data for 244 SNP(s) from 1 GWAS(s) -#> Finding proxies for 4 SNPs in outcome ieu-a-7 -#> Extracting data for 4 SNP(s) from 1 GWAS(s) -dat <- harmonise_data(a,b) -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Coronary heart disease || id:ieu-a-7 (ieu-a-7) -#> Removing the following SNPs for incompatible alleles: -#> rs17811915 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs11592442, rs12779675, rs1290790, rs2246832, rs28470858, rs28667801 -
+library(TwoSampleMR)
+a <- extract_instruments("ukb-b-20175")
+b <- extract_outcome_data(a$SNP, "ieu-a-7", access_token=NULL)
+dat <- harmonise_data(a,b)We can now perform the analysis:
This will do the following:
dat object we already createddat object we
+already created-library(tryx) -x <- Tryx$new(dat) -x$mrtryx() -#> Using RadialMR package to detect outliers -#> -#> Radial IVW -#> -#> Estimate Std.Error t value Pr(>|t|) -#> Effect (Mod.2nd) 0.5991043 0.07718481 7.761945 8.363657e-15 -#> Iterative 0.5991043 0.07718481 7.761945 8.363657e-15 -#> Exact (FE) 0.6420699 0.04024276 15.954916 2.633294e-57 -#> Exact (RE) 0.6101965 0.08857214 6.889260 5.227019e-11 -#> -#> -#> Residual standard error: 1.92 on 232 degrees of freedom -#> -#> F-statistic: 60.25 on 1 and 232 DF, p-value: 2.66e-13 -#> Q-Statistic for heterogeneity: 855.6769 on 232 DF , p-value: 2.874833e-72 -#> -#> Outliers detected -#> Number of iterations = 2 -#> Warning in if (radial$outliers[1] == "No significant outliers") {: the condition -#> has length > 1 and only the first element will be used -#> Identified 11 outliers -#> Using default list of 6467 traits -#> Extracting data for 11 SNP(s) from 6467 GWAS(s) -#> Found 139 candidate traits associated with outliers at p < 5e-08 -#> Finding instruments for candidate traits -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype '3mm strong meridian (left) || id:ukb-b-14664. Just keeping the first instance: -#> rs8047844 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype '3mm strong meridian (right) || id:ukb-b-6852. Just keeping the first instance: -#> rs2242398 -#> rs8047844 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype '3mm weak meridian (left) || id:ukb-b-11113. Just keeping the first instance: -#> rs8047844 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype '3mm weak meridian (right) || id:ukb-b-13506. Just keeping the first instance: -#> rs8047844 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype '6mm strong meridian (right) || id:ukb-b-11452. Just keeping the first instance: -#> rs8047844 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype '6mm weak meridian (left) || id:ukb-b-13538. Just keeping the first instance: -#> rs8047844 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype '6mm weak meridian (right) || id:ukb-b-13416. Just keeping the first instance: -#> rs8047844 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Alcohol intake frequency. || id:ukb-b-5779. Just keeping the first instance: -#> rs9958320 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Ankle spacing width || id:ukb-b-4080. Just keeping the first instance: -#> rs3732360 -#> rs1294438 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Arm fat percentage (left) || id:ukb-b-20188. Just keeping the first instance: -#> rs2731238 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Arm fat-free mass (right) || id:ukb-b-19520. Just keeping the first instance: -#> rs3740591 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Basal metabolic rate || id:ukb-b-16446. Just keeping the first instance: -#> rs3129962 -#> rs3740591 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Birth weight || id:ukb-b-13378. Just keeping the first instance: -#> rs2140240 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Blood clot, DVT, bronchitis, emphysema, asthma, rhinitis, eczema, allergy diagnosed by doctor: Asthma || id:ukb-b-20296. Just keeping the first instance: -#> rs35320232 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Blood clot, DVT, bronchitis, emphysema, asthma, rhinitis, eczema, allergy diagnosed by doctor: Hayfever, allergic rhinitis or eczema || id:ukb-b-17241. Just keeping the first instance: -#> rs35320232 -#> rs2075973 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Blood clot, DVT, bronchitis, emphysema, asthma, rhinitis, eczema, allergy diagnosed by doctor: None of the above || id:ukb-b-18200. Just keeping the first instance: -#> rs35320232 -#> rs2097431 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Body fat percentage || id:ukb-b-8909. Just keeping the first instance: -#> rs2731238 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Diastolic blood pressure, automated reading || id:ukb-b-7992. Just keeping the first instance: -#> rs28752924 -#> rs17304212 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Duration to first press of snap-button in each round || id:ukb-b-19373. Just keeping the first instance: -#> rs9304167 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Hip circumference || id:ukb-b-15590. Just keeping the first instance: -#> rs1294438 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Impedance of arm (right) || id:ukb-b-7859. Just keeping the first instance: -#> rs111650620 -#> rs1382568 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Impedance of leg (left) || id:ukb-b-14068. Just keeping the first instance: -#> rs776912 -#> rs2952894 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Impedance of leg (right) || id:ukb-b-7376. Just keeping the first instance: -#> rs776912 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Leg fat percentage (left) || id:ukb-b-18377. Just keeping the first instance: -#> rs1428 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Leg fat percentage (right) || id:ukb-b-20531. Just keeping the first instance: -#> rs7027096 -#> rs2731238 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Leg fat-free mass (left) || id:ukb-b-16099. Just keeping the first instance: -#> rs3129962 -#> rs77760034 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Leg fat-free mass (right) || id:ukb-b-12828. Just keeping the first instance: -#> rs77760034 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Leg predicted mass (left) || id:ukb-b-17271. Just keeping the first instance: -#> rs3129962 -#> rs77760034 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Leg predicted mass (right) || id:ukb-b-14310. Just keeping the first instance: -#> rs77760034 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Medication for cholesterol, blood pressure or diabetes: None of the above || id:ukb-b-12014. Just keeping the first instance: -#> rs2209042 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Medication for cholesterol, blood pressure, diabetes, or take exogenous hormones: None of the above || id:ukb-b-20379. Just keeping the first instance: -#> rs13204736 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Medication for pain relief, constipation, heartburn: Paracetamol || id:ukb-b-17595. Just keeping the first instance: -#> rs34555420 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Non-cancer illness code, self-reported: asthma || id:ukb-b-18113. Just keeping the first instance: -#> rs17142799 -#> rs35320232 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Non-cancer illness code, self-reported: hypertension || id:ukb-b-14057. Just keeping the first instance: -#> rs4783581 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Number of self-reported non-cancer illnesses || id:ukb-b-4063. Just keeping the first instance: -#> rs13204736 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Pain type(s) experienced in last month: Headache || id:ukb-b-12181. Just keeping the first instance: -#> rs34555420 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Peak expiratory flow (PEF) || id:ukb-b-12019. Just keeping the first instance: -#> rs2666547 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Sitting height || id:ukb-b-16881. Just keeping the first instance: -#> rs4651157 -#> rs872937 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Standing height || id:ukb-b-10787. Just keeping the first instance: -#> rs11252860 -#> rs34773647 -#> rs664317 -#> rs7978217 -#> rs11051456 -#> rs1019075 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Treatment/medication code: amlodipine || id:ukb-b-9207. Just keeping the first instance: -#> rs2077111 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Trunk fat mass || id:ukb-b-20044. Just keeping the first instance: -#> rs2731238 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Trunk fat percentage || id:ukb-b-16407. Just keeping the first instance: -#> rs2731238 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Trunk fat-free mass || id:ukb-b-17409. Just keeping the first instance: -#> rs3735352 -#> rs3740591 -#> rs1040457 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Trunk predicted mass || id:ukb-b-9685. Just keeping the first instance: -#> rs77760034 -#> rs3735352 -#> rs7978217 -#> rs1040457 -#> rs3740591 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Vascular/heart problems diagnosed by doctor: High blood pressure || id:ukb-b-14177. Just keeping the first instance: -#> rs4783581 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Vascular/heart problems diagnosed by doctor: None of the above || id:ukb-b-13352. Just keeping the first instance: -#> rs4783581 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Whole body fat-free mass || id:ukb-b-13354. Just keeping the first instance: -#> rs434072 -#> rs3740591 -#> rs1040457 -#> rs77760034 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Whole body water mass || id:ukb-b-14540. Just keeping the first instance: -#> rs1040457 -#> rs3740591 -#> rs77760034 -#> Warning in format_data(d, type = "exposure", snps = NULL, phenotype_col = -#> "phenotype", : eaf column is not numeric. Coercing... -#> Removing outlier SNPs from candidate trait instrument lists -#> 139 traits with at least one instrument -#> Looking up candidate trait instruments for Coronary heart disease || id:ieu-a-7 -#> Extracting data for 10546 SNP(s) from 1 GWAS(s) -#> 1 of 1 outcomes -#> [>] 1 of 2 chunks -#> [>] 2 of 2 chunks -#> 10339 instruments extracted for Coronary heart disease || id:ieu-a-7 -#> Looking up candidate trait instruments for Systolic blood pressure, automated reading || id:ukb-b-20175 -#> Extracting data for 10546 SNP(s) from 1 GWAS(s) -#> 1 of 1 outcomes -#> [>] 1 of 2 chunks -#> [>] 2 of 2 chunks -#> instruments extracted for Systolic blood pressure, automated reading || id:ukb-b-20175 -#> Looking up exposure instruments for 139 candidate traits -#> Extracting data for 233 SNP(s) from 139 GWAS(s) -#> 30833 instruments extracted -#> Removing outlier SNPs from candidate trait outcome lists -#> Removed 212 outlier SNPs -#> Performing MR of 139 candidate traits against Coronary heart disease || id:ieu-a-7 -#> Performing MR of 139 candidate traits against Systolic blood pressure, automated reading || id:ukb-b-20175 -#> Performing MR of Systolic blood pressure, automated reading || id:ukb-b-20175 against 139 candidate traits -
The analysis performed by mrtryx() can be broken down into multiple steps, running the following commands:
-# Find outlier SNPs in the exposure-outcome analysis -x$get_outliers() - -# Find traits in the MR-Base database that those outliers associate with. These traits are known as 'candidate traits' -x$set_candidate_traits() -x$scan() -
Note that you can browse available traits here: https://gwas.mrcieu.ac.uk/ and get a complete list using:
--traits <- TwoSampleMR::available_outcomes() -
-# Extract instruments for those 'candidate traits' -x$extractions() #which includes the following functions: - x$candidate_instruments() - x$outcome_instruments() - x$exposure_instruments() - x$exposure_candidate_instruments() - -# Make datasets for MR analysis -x$harmonise() #which includes the following functions: - x$candidate_outcome_dat() - x$candidate_exposure_dat() - x$exposure_candidate_dat() - -# Perform MR of each of those 'candidate traits' against the exposure and the outcomes -x$mr() -
See the ?Tryx for options on the parameters for this analysis. e.g. You can specify your own set of outliers, for example SNPs that have extreme p-values in the outcome GWAS
-a <- as.character(subset(dat, pval.outcome < 5e-8)$SNP) -x <- Tryx$new(dat) -x$mrtryx(outliers=a) -
The next steps are to determine which of the candidate traits are of interest (e.g. using p-value thresholds), visualise the results, and adjust the exposure-outcome estimates based on knowledge of the ‘candidate trait’ associations.
+ +The analysis performed by mrtryx() can be broken down
+into multiple steps, running the following commands:
+# Find outlier SNPs in the exposure-outcome analysis
+x$get_outliers()
+
+# Find traits in the MR-Base database that those outliers associate with. These traits are known as 'candidate traits'
+x$set_candidate_traits()
+x$scan()Note that you can browse available traits here: https://gwas.mrcieu.ac.uk/ and get a complete list +using:
+
+traits <- TwoSampleMR::available_outcomes()
+# Extract instruments for those 'candidate traits'
+x$extractions() #which includes the following functions:
+ x$candidate_instruments()
+ x$outcome_instruments()
+ x$exposure_instruments()
+ x$exposure_candidate_instruments()
+
+# Make datasets for MR analysis
+x$harmonise() #which includes the following functions:
+ x$candidate_outcome_dat()
+ x$candidate_exposure_dat()
+ x$exposure_candidate_dat()
+
+# Perform MR of each of those 'candidate traits' against the exposure and the outcomes
+x$mr()See the ?Tryx for options on the parameters for this
+analysis. e.g. You can specify your own set of outliers, for example
+SNPs that have extreme p-values in the outcome GWAS
+a <- as.character(subset(dat, pval.outcome < 5e-8)$SNP)
+x <- Tryx$new(dat)
+x$mrtryx(outliers=a)The next steps are to determine which of the candidate traits are of +interest (e.g. using p-value thresholds), visualise the results, and +adjust the exposure-outcome estimates based on knowledge of the +‘candidate trait’ associations.
One can determine which of the putative associations might be ‘interesting’ in different ways. We have provided a simple convenience function to apply different multiple testing corrections. e.g.
--x$tryx.sig() -#> Adjusting p-value -#> * * * * -#> Number of candidate - outcome associations: 78 -#> * * * * -#> Large vessel disease || id:ieu-a-1110 -#> HDL cholesterol || id:ieu-a-299 -#> LDL cholesterol || id:ieu-a-300 -#> Total cholesterol || id:ieu-a-301 -#> Myocardial infarction || id:ieu-a-798 -#> Interleukin-2 receptor subunit beta || id:prot-a-1519 -#> Glutaminyl-peptide cyclotransferase-like protein || id:prot-a-2466 -#> Illnesses of mother: None of the above (group 1) || id:ukb-b-10454 -#> Age high blood pressure diagnosed || id:ukb-b-1061 -#> Standing height || id:ukb-b-10787 -#> Diagnoses - secondary ICD10: Z95.1 Presence of aortocoronary bypass graft || id:ukb-b-11064 -#> Father's age at death || id:ukb-b-11303 -#> Vascular/heart problems diagnosed by doctor: Heart attack || id:ukb-b-11590 -#> Treatment/medication code: atenolol || id:ukb-b-11632 -#> Medication for cholesterol, blood pressure or diabetes: Cholesterol lowering medication || id:ukb-b-11740 -#> Weight || id:ukb-b-11842 -#> Treatment/medication code: ramipril || id:ukb-b-11895 -#> Medication for cholesterol, blood pressure or diabetes: None of the above || id:ukb-b-12014 -#> Pain type(s) experienced in last month: Headache || id:ukb-b-12181 -#> Operation code: coronary artery bypass grafts (cabg) || id:ukb-b-12465 -#> Illnesses of mother: Heart disease || id:ukb-b-12477 -#> Diagnoses - secondary ICD10: I10 Essential (primary) hypertension || id:ukb-b-12493 -#> Treatment speciality of consultant (recoded): General medicine || id:ukb-b-12646 -#> Arm fat percentage (right) || id:ukb-b-12854 -#> Vascular/heart problems diagnosed by doctor: None of the above || id:ukb-b-13352 -#> Birth weight || id:ukb-b-13378 -#> 3mm weak meridian (right) || id:ukb-b-13506 -#> Long-standing illness, disability or infirmity || id:ukb-b-13764 -#> Non-cancer illness code, self-reported: hypertension || id:ukb-b-14057 -#> Vascular/heart problems diagnosed by doctor: High blood pressure || id:ukb-b-14177 -#> Illnesses of siblings: Heart disease || id:ukb-b-14371 -#> Medication for cholesterol, blood pressure or diabetes: Blood pressure medication || id:ukb-b-14395 -#> Illnesses of father: None of the above (group 1) || id:ukb-b-15169 -#> Operative procedures - main OPCS: K45.3 Anastomosis of mammary artery to left anterior descending coronary artery || id:ukb-b-15491 -#> Hip circumference || id:ukb-b-15590 -#> Diagnoses - secondary ICD10: I20.9 Angina pectoris, unspecified || id:ukb-b-15686 -#> Diagnoses - secondary ICD10: Z95.5 Presence of coronary angioplasty implant and graft || id:ukb-b-15748 -#> Non-cancer illness code, self-reported: heart attack/myocardial infarction || id:ukb-b-15829 -#> Main speciality of consultant (recoded): Cardiology || id:ukb-b-16376 -#> Trunk fat percentage || id:ukb-b-16407 -#> Diagnoses - secondary ICD10: I25.8 Other forms of chronic ischaemic heart disease || id:ukb-b-16606 -#> Diagnoses - main ICD10: I25.1 Atherosclerotic heart disease || id:ukb-b-1668 -#> Treatment/medication code: ibuprofen || id:ukb-b-16866 -#> Sitting height || id:ukb-b-16881 -#> Illnesses of siblings: None of the above (group 1) || id:ukb-b-17360 -#> Trunk fat-free mass || id:ukb-b-17409 -#> Operative procedures - secondary OPCS: Y02.2 Insertion of prosthesis into organ NOC || id:ukb-b-1744 -#> Treatment/medication code: levothyroxine sodium || id:ukb-b-17918 -#> Medication for cholesterol, blood pressure, diabetes, or take exogenous hormones: Blood pressure medication || id:ukb-b-18009 -#> Operative procedures - main OPCS: K49.1 Percutaneous transluminal balloon angioplasty of one coronary artery || id:ukb-b-18018 -#> Illnesses of mother: High blood pressure || id:ukb-b-18167 -#> Leg fat percentage (left) || id:ukb-b-18377 -#> Illnesses of father: Heart disease || id:ukb-b-18408 -#> Treatment/medication code: bendroflumethiazide || id:ukb-b-18799 -#> Impedance of arm (left) || id:ukb-b-19379 -#> Non-cancer illness code, self-reported: hypothyroidism/myxoedema || id:ukb-b-19732 -#> Impedance of whole body || id:ukb-b-19921 -#> Trunk fat mass || id:ukb-b-20044 -#> Arm fat percentage (left) || id:ukb-b-20188 -#> Taking other prescription medications || id:ukb-b-20292 -#> Treatment speciality of consultant (recoded): Cardiology || id:ukb-b-20300 -#> Medication for cholesterol, blood pressure, diabetes, or take exogenous hormones: None of the above || id:ukb-b-20379 -#> Leg fat percentage (right) || id:ukb-b-20531 -#> Birth weight of first child || id:ukb-b-3357 -#> Number of treatments/medications taken || id:ukb-b-3656 -#> Number of self-reported non-cancer illnesses || id:ukb-b-4063 -#> Diagnoses - secondary ICD10: E03.9 Hypothyroidism, unspecified || id:ukb-b-4226 -#> Medication for pain relief, constipation, heartburn: Aspirin || id:ukb-b-7137 -#> Diagnoses - secondary ICD10: I25.1 Atherosclerotic heart disease || id:ukb-b-7436 -#> Impedance of arm (right) || id:ukb-b-7859 -#> Operation code: coronary angioplasty (ptca) +/- stent || id:ukb-b-7869 -#> Diastolic blood pressure, automated reading || id:ukb-b-7992 -#> Vascular/heart problems diagnosed by doctor: Angina || id:ukb-b-8468 -#> Non-cancer illness code, self-reported: angina || id:ukb-b-8650 -#> Illnesses of siblings: High blood pressure || id:ukb-b-8746 -#> Treatment/medication code: aspirin || id:ukb-b-8755 -#> Body fat percentage || id:ukb-b-8909 -#> Treatment/medication code: amlodipine || id:ukb-b-9207 -#> -#> * * * * -#> Number of candidate - exposure associations: 68 -#> * * * * -#> Large vessel disease || id:ieu-a-1110 -#> Interleukin-2 receptor subunit beta || id:prot-a-1519 -#> Glutaminyl-peptide cyclotransferase-like protein || id:prot-a-2466 -#> Illnesses of mother: None of the above (group 1) || id:ukb-b-10454 -#> Age high blood pressure diagnosed || id:ukb-b-1061 -#> Standing height || id:ukb-b-10787 -#> Treatment/medication code: atenolol || id:ukb-b-11632 -#> Medication for cholesterol, blood pressure or diabetes: Cholesterol lowering medication || id:ukb-b-11740 -#> Treatment/medication code: ramipril || id:ukb-b-11895 -#> Pulse wave Arterial Stiffness index || id:ukb-b-11971 -#> Medication for cholesterol, blood pressure or diabetes: None of the above || id:ukb-b-12014 -#> Peak expiratory flow (PEF) || id:ukb-b-12019 -#> Pain type(s) experienced in last month: Headache || id:ukb-b-12181 -#> Diagnoses - secondary ICD10: I10 Essential (primary) hypertension || id:ukb-b-12493 -#> Leg fat-free mass (right) || id:ukb-b-12828 -#> Arm fat percentage (right) || id:ukb-b-12854 -#> Vascular/heart problems diagnosed by doctor: None of the above || id:ukb-b-13352 -#> Whole body fat-free mass || id:ukb-b-13354 -#> Birth weight || id:ukb-b-13378 -#> 6mm weak meridian (right) || id:ukb-b-13416 -#> 3mm weak meridian (right) || id:ukb-b-13506 -#> Long-standing illness, disability or infirmity || id:ukb-b-13764 -#> Non-cancer illness code, self-reported: hypertension || id:ukb-b-14057 -#> Vascular/heart problems diagnosed by doctor: High blood pressure || id:ukb-b-14177 -#> Leg predicted mass (right) || id:ukb-b-14310 -#> Medication for cholesterol, blood pressure or diabetes: Blood pressure medication || id:ukb-b-14395 -#> Whole body water mass || id:ukb-b-14540 -#> 3mm strong meridian (left) || id:ukb-b-14664 -#> Leg fat-free mass (left) || id:ukb-b-16099 -#> Trunk fat percentage || id:ukb-b-16407 -#> Basal metabolic rate || id:ukb-b-16446 -#> Arm predicted mass (right) || id:ukb-b-16698 -#> Treatment/medication code: ibuprofen || id:ukb-b-16866 -#> Sitting height || id:ukb-b-16881 -#> Leg predicted mass (left) || id:ukb-b-17271 -#> Illnesses of siblings: None of the above (group 1) || id:ukb-b-17360 -#> Trunk fat-free mass || id:ukb-b-17409 -#> Medication for cholesterol, blood pressure, diabetes, or take exogenous hormones: Blood pressure medication || id:ukb-b-18009 -#> Non-cancer illness code, self-reported: asthma || id:ukb-b-18113 -#> Illnesses of mother: High blood pressure || id:ukb-b-18167 -#> Leg fat percentage (left) || id:ukb-b-18377 -#> Treatment/medication code: bendroflumethiazide || id:ukb-b-18799 -#> Impedance of arm (left) || id:ukb-b-19379 -#> Illnesses of father: High blood pressure || id:ukb-b-19456 -#> Impedance of whole body || id:ukb-b-19921 -#> Arm fat-free mass (left) || id:ukb-b-19925 -#> Trunk fat mass || id:ukb-b-20044 -#> Arm fat percentage (left) || id:ukb-b-20188 -#> Ever smoked || id:ukb-b-20261 -#> Medication for cholesterol, blood pressure, diabetes, or take exogenous hormones: None of the above || id:ukb-b-20379 -#> Leg fat percentage (right) || id:ukb-b-20531 -#> Birth weight of first child || id:ukb-b-3357 -#> Number of treatments/medications taken || id:ukb-b-3656 -#> Operation code: hysterectomy || id:ukb-b-3700 -#> Number of self-reported non-cancer illnesses || id:ukb-b-4063 -#> Lifetime number of sexual partners || id:ukb-b-4256 -#> 6mm strong meridian (left) || id:ukb-b-645 -#> Impedance of arm (right) || id:ukb-b-7859 -#> Diastolic blood pressure, automated reading || id:ukb-b-7992 -#> Vascular/heart problems diagnosed by doctor: Angina || id:ukb-b-8468 -#> Non-cancer illness code, self-reported: angina || id:ukb-b-8650 -#> Illnesses of siblings: High blood pressure || id:ukb-b-8746 -#> Treatment/medication code: aspirin || id:ukb-b-8755 -#> Pulse wave peak to peak time || id:ukb-b-8778 -#> Body fat percentage || id:ukb-b-8909 -#> Arm predicted mass (left) || id:ukb-b-9093 -#> Treatment/medication code: amlodipine || id:ukb-b-9207 -#> Trunk predicted mass || id:ukb-b-9685 -#> -#> * * * * -#> Number of exposure - candidate associations: 89 -#> * * * * -#> Large vessel disease || id:ieu-a-1110 -#> Interleukin-2 receptor subunit beta || id:prot-a-1519 -#> Glutaminyl-peptide cyclotransferase-like protein || id:prot-a-2466 -#> Illnesses of mother: None of the above (group 1) || id:ukb-b-10454 -#> Age high blood pressure diagnosed || id:ukb-b-1061 -#> Standing height || id:ukb-b-10787 -#> Treatment/medication code: atenolol || id:ukb-b-11632 -#> Medication for cholesterol, blood pressure or diabetes: Cholesterol lowering medication || id:ukb-b-11740 -#> Treatment/medication code: ramipril || id:ukb-b-11895 -#> Pulse wave Arterial Stiffness index || id:ukb-b-11971 -#> Medication for cholesterol, blood pressure or diabetes: None of the above || id:ukb-b-12014 -#> Peak expiratory flow (PEF) || id:ukb-b-12019 -#> Pain type(s) experienced in last month: Headache || id:ukb-b-12181 -#> Diagnoses - secondary ICD10: I10 Essential (primary) hypertension || id:ukb-b-12493 -#> Leg fat-free mass (right) || id:ukb-b-12828 -#> Arm fat percentage (right) || id:ukb-b-12854 -#> Vascular/heart problems diagnosed by doctor: None of the above || id:ukb-b-13352 -#> Whole body fat-free mass || id:ukb-b-13354 -#> Birth weight || id:ukb-b-13378 -#> 6mm weak meridian (right) || id:ukb-b-13416 -#> 3mm weak meridian (right) || id:ukb-b-13506 -#> Long-standing illness, disability or infirmity || id:ukb-b-13764 -#> Non-cancer illness code, self-reported: hypertension || id:ukb-b-14057 -#> Vascular/heart problems diagnosed by doctor: High blood pressure || id:ukb-b-14177 -#> Leg predicted mass (right) || id:ukb-b-14310 -#> Medication for cholesterol, blood pressure or diabetes: Blood pressure medication || id:ukb-b-14395 -#> Whole body water mass || id:ukb-b-14540 -#> 3mm strong meridian (left) || id:ukb-b-14664 -#> Leg fat-free mass (left) || id:ukb-b-16099 -#> Trunk fat percentage || id:ukb-b-16407 -#> Basal metabolic rate || id:ukb-b-16446 -#> Arm predicted mass (right) || id:ukb-b-16698 -#> Treatment/medication code: ibuprofen || id:ukb-b-16866 -#> Sitting height || id:ukb-b-16881 -#> Leg predicted mass (left) || id:ukb-b-17271 -#> Illnesses of siblings: None of the above (group 1) || id:ukb-b-17360 -#> Trunk fat-free mass || id:ukb-b-17409 -#> Medication for cholesterol, blood pressure, diabetes, or take exogenous hormones: Blood pressure medication || id:ukb-b-18009 -#> Non-cancer illness code, self-reported: asthma || id:ukb-b-18113 -#> Illnesses of mother: High blood pressure || id:ukb-b-18167 -#> Leg fat percentage (left) || id:ukb-b-18377 -#> Treatment/medication code: bendroflumethiazide || id:ukb-b-18799 -#> Impedance of arm (left) || id:ukb-b-19379 -#> Illnesses of father: High blood pressure || id:ukb-b-19456 -#> Impedance of whole body || id:ukb-b-19921 -#> Arm fat-free mass (left) || id:ukb-b-19925 -#> Trunk fat mass || id:ukb-b-20044 -#> Arm fat percentage (left) || id:ukb-b-20188 -#> Ever smoked || id:ukb-b-20261 -#> Medication for cholesterol, blood pressure, diabetes, or take exogenous hormones: None of the above || id:ukb-b-20379 -#> Leg fat percentage (right) || id:ukb-b-20531 -#> Birth weight of first child || id:ukb-b-3357 -#> Number of treatments/medications taken || id:ukb-b-3656 -#> Operation code: hysterectomy || id:ukb-b-3700 -#> Number of self-reported non-cancer illnesses || id:ukb-b-4063 -#> Lifetime number of sexual partners || id:ukb-b-4256 -#> 6mm strong meridian (left) || id:ukb-b-645 -#> Impedance of arm (right) || id:ukb-b-7859 -#> Diastolic blood pressure, automated reading || id:ukb-b-7992 -#> Vascular/heart problems diagnosed by doctor: Angina || id:ukb-b-8468 -#> Non-cancer illness code, self-reported: angina || id:ukb-b-8650 -#> Illnesses of siblings: High blood pressure || id:ukb-b-8746 -#> Treatment/medication code: aspirin || id:ukb-b-8755 -#> Pulse wave peak to peak time || id:ukb-b-8778 -#> Body fat percentage || id:ukb-b-8909 -#> Arm predicted mass (left) || id:ukb-b-9093 -#> Treatment/medication code: amlodipine || id:ukb-b-9207 -#> Trunk predicted mass || id:ukb-b-9685 -
Will by default use FDR of 5%. See ?Tryx for more options.
One can determine which of the putative associations might be +‘interesting’ in different ways. We have provided a simple convenience +function to apply different multiple testing corrections. e.g.
+
+x$tryx.sig()Will by default use FDR of 5%. See ?Tryx for more
+options.
Finally, to adjust the SNP effects on the exposure and outcome traits given their influences on the candidate traits, we can run:
--x$analyse() -#> p->y: rs9349379 - Diagnoses - secondary ICD10: I20.9 Angina pectoris, unspecified || id:ukb-b-15686 -#> x<-p->y: rs10774625 - Birth weight || id:ukb-b-13378 -#> p->y: rs6430078 - Illnesses of father: Heart disease || id:ukb-b-18408 -#> x<-p->y: rs10774625 - Long-standing illness, disability or infirmity || id:ukb-b-13764 -#> x<-p->y: rs10774625 - Medication for cholesterol, blood pressure, diabetes, or take exogenous hormones: Blood pressure medication || id:ukb-b-18009 -#> x<-p->y: rs2681492 - Medication for cholesterol, blood pressure, diabetes, or take exogenous hormones: Blood pressure medication || id:ukb-b-18009 -#> x<-p->y: rs10774625 - Treatment/medication code: aspirin || id:ukb-b-8755 -#> x<-p->y: rs10774625 - Treatment/medication code: atenolol || id:ukb-b-11632 -#> x<-p->y: rs10774625 - Illnesses of siblings: High blood pressure || id:ukb-b-8746 -#> p->y: rs9349379 - Illnesses of siblings: Heart disease || id:ukb-b-14371 -#> x<-p->y: rs2681492 - Treatment/medication code: bendroflumethiazide || id:ukb-b-18799 -#> x<-p->y: rs57866767 - Treatment/medication code: amlodipine || id:ukb-b-9207 -#> p->y: rs9349379 - Operation code: coronary angioplasty (ptca) +/- stent || id:ukb-b-7869 -#> p->y: rs10774625 - Treatment speciality of consultant (recoded): Cardiology || id:ukb-b-20300 -#> x<-p->y: rs57866767 - Impedance of arm (left) || id:ukb-b-19379 -#> x<-p->y: rs35114617 - Sitting height || id:ukb-b-16881 -#> x<-p->y: rs8027450 - Non-cancer illness code, self-reported: hypertension || id:ukb-b-14057 -#> p->y: rs9349379 - Illnesses of mother: Heart disease || id:ukb-b-12477 -#> p->y: rs10774625 - Vascular/heart problems diagnosed by doctor: Heart attack || id:ukb-b-11590 -#> x<-p->y: rs2681492 - Medication for cholesterol, blood pressure or diabetes: Blood pressure medication || id:ukb-b-14395 -#> p->y: rs9349379 - Diagnoses - secondary ICD10: Z95.5 Presence of coronary angioplasty implant and graft || id:ukb-b-15748 -#> x<-p->y: rs57866767 - 3mm weak meridian (right) || id:ukb-b-13506 -#> p->y: rs10774625 - Hip circumference || id:ukb-b-15590 -#> p->y: rs10774625 - Illnesses of father: None of the above (group 1) || id:ukb-b-15169 -#> p->y: rs8027450 - Illnesses of father: None of the above (group 1) || id:ukb-b-15169 -#> x<-p->y: rs57866767 - Impedance of whole body || id:ukb-b-19921 -#> x<-p->y: rs57866767 - Arm fat percentage (left) || id:ukb-b-20188 -#> x<-p->y: rs57866767 - Birth weight || id:ukb-b-13378 -#> p->y: rs9349379 - Diagnoses - secondary ICD10: I25.1 Atherosclerotic heart disease || id:ukb-b-7436 -#> x<-p->y: rs10774625 - Medication for cholesterol, blood pressure, diabetes, or take exogenous hormones: None of the above || id:ukb-b-20379 -#> p->y: rs10774625 - Diagnoses - secondary ICD10: E03.9 Hypothyroidism, unspecified || id:ukb-b-4226 -#> x<-p->y: rs10774625 - Standing height || id:ukb-b-10787 -#> p->y: rs9349379 - Operative procedures - secondary OPCS: Y02.2 Insertion of prosthesis into organ NOC || id:ukb-b-1744 -#> x<-p->y: rs57866767 - Leg fat percentage (left) || id:ukb-b-18377 -#> x<-p->y: rs57866767 - Body fat percentage || id:ukb-b-8909 -#> x<-p->y: rs10774625 - Age high blood pressure diagnosed || id:ukb-b-1061 -#> x<-p->y: rs8027450 - Illnesses of mother: High blood pressure || id:ukb-b-18167 -#> p->y: rs10774625 - Medication for pain relief, constipation, heartburn: Aspirin || id:ukb-b-7137 -#> p->y: rs9349379 - Non-cancer illness code, self-reported: heart attack/myocardial infarction || id:ukb-b-15829 -#> p->y: rs9349379 - Diagnoses - secondary ICD10: I25.8 Other forms of chronic ischaemic heart disease || id:ukb-b-16606 -#> x<-p->y: rs10774625 - Illnesses of siblings: None of the above (group 1) || id:ukb-b-17360 -#> x<-p->y: rs57866767 - Leg fat percentage (right) || id:ukb-b-20531 -#> x<-p->y: rs57866767 - Non-cancer illness code, self-reported: hypertension || id:ukb-b-14057 -#> x<-p->y: rs10774625 - Medication for cholesterol, blood pressure or diabetes: None of the above || id:ukb-b-12014 -#> x<-p->y: rs2681492 - Medication for cholesterol, blood pressure or diabetes: None of the above || id:ukb-b-12014 -#> x<-p->y: rs57866767 - Medication for cholesterol, blood pressure or diabetes: Blood pressure medication || id:ukb-b-14395 -#> p->y: rs10774625 - Diagnoses - secondary ICD10: Z95.5 Presence of coronary angioplasty implant and graft || id:ukb-b-15748 -#> p->y: rs10774625 - Weight || id:ukb-b-11842 -#> x<-p->y: rs8027450 - Vascular/heart problems diagnosed by doctor: High blood pressure || id:ukb-b-14177 -#> x<-p->y: rs57866767 - Diastolic blood pressure, automated reading || id:ukb-b-7992 -#> x<-p->y: rs2681492 - Diastolic blood pressure, automated reading || id:ukb-b-7992 -#> p->y: rs10774625 - Diagnoses - secondary ICD10: I25.1 Atherosclerotic heart disease || id:ukb-b-7436 -#> p->y: rs9349379 - Diagnoses - secondary ICD10: Z95.1 Presence of aortocoronary bypass graft || id:ukb-b-11064 -#> x<-p->y: rs35114617 - Standing height || id:ukb-b-10787 -#> p->y: rs10774625 - Non-cancer illness code, self-reported: hypothyroidism/myxoedema || id:ukb-b-19732 -#> p->y: rs10774625 - Treatment/medication code: levothyroxine sodium || id:ukb-b-17918 -#> x<-p->y: rs10774625 - Treatment/medication code: ramipril || id:ukb-b-11895 -#> p->y: rs8027450 - Illnesses of father: Heart disease || id:ukb-b-18408 -#> x<-p->y: rs8027450 - Illnesses of siblings: High blood pressure || id:ukb-b-8746 -#> x<-p->y: rs57866767 - Arm fat percentage (right) || id:ukb-b-12854 -#> x<-p->y: rs10774625 - Trunk fat-free mass || id:ukb-b-17409 -#> p->y: rs9349379 - Operative procedures - main OPCS: K45.3 Anastomosis of mammary artery to left anterior descending coronary artery || id:ukb-b-15491 -#> x<-p->y: rs8027450 - Birth weight of first child || id:ukb-b-3357 -#> p->y: rs9349379 - Main speciality of consultant (recoded): Cardiology || id:ukb-b-16376 -#> x<-p->y: rs8027450 - Vascular/heart problems diagnosed by doctor: None of the above || id:ukb-b-13352 -#> x<-p->y: rs2681492 - Vascular/heart problems diagnosed by doctor: None of the above || id:ukb-b-13352 -#> x<-p->y: rs57866767 - Impedance of arm (right) || id:ukb-b-7859 -#> x<-p->y: rs10774625 - 3mm weak meridian (right) || id:ukb-b-13506 -#> x<-p->y: rs57866767 - Vascular/heart problems diagnosed by doctor: High blood pressure || id:ukb-b-14177 -#> x<-p->y: rs10774625 - Impedance of whole body || id:ukb-b-19921 -#> x<-p->y: rs6430078 - Diastolic blood pressure, automated reading || id:ukb-b-7992 -#> x<-p->y: rs8027450 - Medication for cholesterol, blood pressure, diabetes, or take exogenous hormones: Blood pressure medication || id:ukb-b-18009 -#> x<-p->y: rs57866767 - Medication for cholesterol, blood pressure, diabetes, or take exogenous hormones: Blood pressure medication || id:ukb-b-18009 -#> x<-p->y: rs10774625 - Diagnoses - secondary ICD10: I10 Essential (primary) hypertension || id:ukb-b-12493 -#> x<-p->y: rs8027450 - Diagnoses - secondary ICD10: I10 Essential (primary) hypertension || id:ukb-b-12493 -#> x<-p->y: rs57866767 - Diagnoses - secondary ICD10: I10 Essential (primary) hypertension || id:ukb-b-12493 -#> p->y: rs10774625 - Treatment speciality of consultant (recoded): General medicine || id:ukb-b-12646 -#> x<-p->y: rs8027450 - Treatment/medication code: atenolol || id:ukb-b-11632 -#> x<-p->y: rs10774625 - Number of treatments/medications taken || id:ukb-b-3656 -#> x<-p->y: rs9349379 - Treatment/medication code: ibuprofen || id:ukb-b-16866 -#> x<-p->y: rs57866767 - Trunk fat-free mass || id:ukb-b-17409 -#> x<-p->y: rs10774625 - Birth weight of first child || id:ukb-b-3357 -#> x<-p->y: rs10774625 - Vascular/heart problems diagnosed by doctor: None of the above || id:ukb-b-13352 -#> x<-p->y: rs57866767 - Vascular/heart problems diagnosed by doctor: None of the above || id:ukb-b-13352 -#> x<-p->y: rs2681492 - Non-cancer illness code, self-reported: hypertension || id:ukb-b-14057 -#> x<-p->y: rs10774625 - Non-cancer illness code, self-reported: hypertension || id:ukb-b-14057 -#> x<-p->y: rs10774625 - Impedance of arm (right) || id:ukb-b-7859 -#> p->y: rs9349379 - Operative procedures - main OPCS: K49.1 Percutaneous transluminal balloon angioplasty of one coronary artery || id:ukb-b-18018 -#> x<-p->y: rs8027450 - Medication for cholesterol, blood pressure or diabetes: None of the above || id:ukb-b-12014 -#> p->y: rs10774625 - Father's age at death || id:ukb-b-11303 -#> x<-p->y: rs2681492 - Vascular/heart problems diagnosed by doctor: High blood pressure || id:ukb-b-14177 -#> x<-p->y: rs10774625 - Vascular/heart problems diagnosed by doctor: High blood pressure || id:ukb-b-14177 -#> x<-p->y: rs10774625 - Diastolic blood pressure, automated reading || id:ukb-b-7992 -#> x<-p->y: rs8027450 - Diastolic blood pressure, automated reading || id:ukb-b-7992 -#> x<-p->y: rs8027450 - Birth weight || id:ukb-b-13378 -#> x<-p->y: rs57866767 - Trunk fat percentage || id:ukb-b-16407 -#> p->y: rs10774625 - Illnesses of father: Heart disease || id:ukb-b-18408 -#> p->y: rs9349379 - Illnesses of father: Heart disease || id:ukb-b-18408 -#> x<-p->y: rs8027450 - Treatment/medication code: ramipril || id:ukb-b-11895 -#> x<-p->y: rs9349379 - Vascular/heart problems diagnosed by doctor: Angina || id:ukb-b-8468 -#> p->y: rs9349379 - Operation code: coronary artery bypass grafts (cabg) || id:ukb-b-12465 -#> x<-p->y: rs2971603 - Pain type(s) experienced in last month: Headache || id:ukb-b-12181 -#> x<-p->y: rs9349379 - Pain type(s) experienced in last month: Headache || id:ukb-b-12181 -#> p->y: rs10774625 - Taking other prescription medications || id:ukb-b-20292 -#> x<-p->y: rs8027450 - Age high blood pressure diagnosed || id:ukb-b-1061 -#> x<-p->y: rs9349379 - Non-cancer illness code, self-reported: angina || id:ukb-b-8650 -#> x<-p->y: rs10774625 - Treatment/medication code: bendroflumethiazide || id:ukb-b-18799 -#> x<-p->y: rs8027450 - Medication for cholesterol, blood pressure or diabetes: Cholesterol lowering medication || id:ukb-b-11740 -#> p->y: rs10774625 - Non-cancer illness code, self-reported: heart attack/myocardial infarction || id:ukb-b-15829 -#> p->y: rs9349379 - Treatment speciality of consultant (recoded): Cardiology || id:ukb-b-20300 -#> x<-p->y: rs10774625 - Impedance of arm (left) || id:ukb-b-19379 -#> x<-p->y: rs10774625 - Number of self-reported non-cancer illnesses || id:ukb-b-4063 -#> p->y: rs9349379 - Diagnoses - main ICD10: I25.1 Atherosclerotic heart disease || id:ukb-b-1668 -#> p->y: rs10774625 - Diagnoses - main ICD10: I25.1 Atherosclerotic heart disease || id:ukb-b-1668 -#> p->y: rs7798197 - Diagnoses - main ICD10: I25.1 Atherosclerotic heart disease || id:ukb-b-1668 -#> x<-p->y: rs57866767 - Trunk fat mass || id:ukb-b-20044 -#> p->y: rs9349379 - Vascular/heart problems diagnosed by doctor: Heart attack || id:ukb-b-11590 -#> x<-p->y: rs10774625 - Medication for cholesterol, blood pressure or diabetes: Blood pressure medication || id:ukb-b-14395 -#> x<-p->y: rs8027450 - Medication for cholesterol, blood pressure or diabetes: Blood pressure medication || id:ukb-b-14395 -#> x<-p->y: rs8027450 - Illnesses of mother: None of the above (group 1) || id:ukb-b-10454 -#> x<-p->y: rs35114617 - Glutaminyl-peptide cyclotransferase-like protein || id:prot-a-2466 -#> x<-p->y: rs10774625 - Interleukin-2 receptor subunit beta || id:prot-a-1519 -#> p->y: rs9349379 - Myocardial infarction || id:ieu-a-798 -#> p->y: rs10774625 - Myocardial infarction || id:ieu-a-798 -#> p->y: rs10774625 - HDL cholesterol || id:ieu-a-299 -#> x<-p->y: rs7798197 - Large vessel disease || id:ieu-a-1110 -#> p->y: rs10774625 - Total cholesterol || id:ieu-a-301 -#> p->y: rs2681492 - Myocardial infarction || id:ieu-a-798 -#> p->y: rs10774625 - LDL cholesterol || id:ieu-a-300 -
This will estimate the outlier effect that is due to the candidate pathways, adjust the outlier-outcome estimate, and re-perform MR of exposure on outcome with the adjusted outliers.
-By default, this adjusts for the trait that has the largest impact for a particular SNP.
-There is also a multivariable adjustment method here, where for each outlier, all candidate trait effects are estimated jointly:
--x$analyse.mv() -
NOTE: it’s a good idea to check that there are no traits amongst the candidates that are identical or equivalent to the outcome:
--id_remove = c("ieu-a-1110", "ieu-a-798", "ukb-b-1061", "ukb-b-10454", "ukb-b-1061", "ukb-b-11064", - "ukb-b-11590", "ukb-b-11632", "ukb-b-11895", "ukb-b-11971", "ukb-b-12014", "ukb-b-12019", - "ukb-b-12465", "ukb-b-12493", "ukb-b-13352", "ukb-b-13506", "ukb-b-12477", "ukb-b-12493", - "ukb-b-12646", "ukb-b-13352", "ukb-b-13506", "ukb-b-14057", "ukb-b-14177", "ukb-b-14371", - "ukb-b-14395", "ukb-b-15169", "ukb-b-15491", "ukb-b-15686", "ukb-b-15748", "ukb-b-15829", - "ukb-b-16376", "ukb-b-16606", "ukb-b-1668", "ukb-b-17360", "ukb-b-18009", "ukb-b-18018", - "ukb-b-18167", "ukb-b-18408", "ukb-b-18799", "ukb-b-20300", "ukb-b-20379", "ukb-b-3656", - "ukb-b-4063", "ukb-b-7137", "ukb-b-7436", "ukb-b-7869", "ukb-b-7992", "ukb-b-8468", - "ukb-b-8650", "ukb-b-8746", "ukb-b-9207", "ieu-a-1110", "ukb-b-1061", "ukb-b-11971", - "ukb-b-12014", "ukb-b-12019", "ukb-b-19456", "ukb-b-8778", "ukb-b-10454", "ukb-b-11632", - "ukb-b-11895") - -x$analyse.mv(id_remove = id_remove) -#> Estimating joint effects of the following trait(s) associated with rs10774625 -#> Birth weight || id:ukb-b-13378 -#> Long-standing illness, disability or infirmity || id:ukb-b-13764 -#> Treatment/medication code: aspirin || id:ukb-b-8755 -#> Hip circumference || id:ukb-b-15590 -#> Diagnoses - secondary ICD10: E03.9 Hypothyroidism, unspecified || id:ukb-b-4226 -#> Standing height || id:ukb-b-10787 -#> Weight || id:ukb-b-11842 -#> Non-cancer illness code, self-reported: hypothyroidism/myxoedema || id:ukb-b-19732 -#> Treatment/medication code: levothyroxine sodium || id:ukb-b-17918 -#> Trunk fat-free mass || id:ukb-b-17409 -#> Impedance of whole body || id:ukb-b-19921 -#> Birth weight of first child || id:ukb-b-3357 -#> Impedance of arm (right) || id:ukb-b-7859 -#> Father's age at death || id:ukb-b-11303 -#> Taking other prescription medications || id:ukb-b-20292 -#> Impedance of arm (left) || id:ukb-b-19379 -#> Interleukin-2 receptor subunit beta || id:prot-a-1519 -#> HDL cholesterol || id:ieu-a-299 -#> Total cholesterol || id:ieu-a-301 -#> LDL cholesterol || id:ieu-a-300 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Birth weight || id:ukb-b-13378. Just keeping the first instance: -#> rs2140240 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Hip circumference || id:ukb-b-15590. Just keeping the first instance: -#> rs1294438 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Impedance of arm (right) || id:ukb-b-7859. Just keeping the first instance: -#> rs111650620 -#> rs1382568 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Standing height || id:ukb-b-10787. Just keeping the first instance: -#> rs11252860 -#> rs34773647 -#> rs664317 -#> rs7978217 -#> rs11051456 -#> rs1019075 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Systolic blood pressure, automated reading || id:ukb-b-20175. Just keeping the first instance: -#> rs17811915 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Trunk fat-free mass || id:ukb-b-17409. Just keeping the first instance: -#> rs3735352 -#> rs3740591 -#> rs1040457 -#> Warning in format_data(d, type = "exposure", snps = NULL, phenotype_col = -#> "phenotype", : eaf column is not numeric. Coercing... -#> Warning: 'clump_data' is deprecated. -#> Use 'ieugwasr::ld_clump()' instead. -#> See help("Deprecated") -#> Clumping 1, 4776 variants -#> Removing 3745 of 4776 variants due to LD with other variants or absence from LD reference panel -#> Extracting data for 765 SNP(s) from 21 GWAS(s) -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Systolic blood pressure, automated reading || id:ukb-b-20175. Just keeping the first instance: -#> rs664317 -#> rs11252860 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and HDL cholesterol || id:ieu-a-299 (ieu-a-299) -#> Removing the following SNPs for incompatible alleles: -#> rs664317 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs10498672, rs10499659, rs10505073, rs11122824, rs11664336, rs11756783, rs12258967, rs12572775, rs1290790, rs1420150, rs1467847, rs1556516, rs16905189, rs17010961, rs1867780, rs1875969, rs2138628, rs219162, rs2270894, rs2410728, rs2422054, rs2663335, rs2952615, rs3771382, rs3790086, rs3812163, rs4865956, rs519384, rs578475, rs6824592, rs7619139, rs7652177, rs7917801, rs7961994, rs832806, rs9352895, rs964184, rs968821 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and LDL cholesterol || id:ieu-a-300 (ieu-a-300) -#> Removing the following SNPs for incompatible alleles: -#> rs664317 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs10498672, rs10499659, rs10505073, rs11122824, rs11664336, rs11756783, rs12258967, rs12572775, rs1290790, rs1420150, rs1467847, rs1556516, rs16905189, rs17010961, rs1867780, rs1875969, rs2138628, rs219162, rs2270894, rs2410728, rs2422054, rs2663335, rs2952615, rs3771382, rs3790086, rs3812163, rs4865956, rs519384, rs578475, rs6824592, rs7619139, rs7652177, rs7917801, rs7961994, rs832806, rs9352895, rs964184, rs968821 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Total cholesterol || id:ieu-a-301 (ieu-a-301) -#> Removing the following SNPs for incompatible alleles: -#> rs664317 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs10498672, rs10499659, rs10505073, rs11122824, rs11664336, rs11756783, rs12258967, rs12572775, rs1290790, rs1420150, rs1467847, rs1556516, rs16905189, rs17010961, rs1867780, rs1875969, rs2138628, rs219162, rs2270894, rs2410728, rs2422054, rs2663335, rs2952615, rs3771382, rs3790086, rs3812163, rs4865956, rs519384, rs578475, rs6824592, rs7619139, rs7652177, rs7917801, rs7961994, rs832806, rs9352895, rs964184, rs968821 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Interleukin-2 receptor subunit beta || id:prot-a-1519 (prot-a-1519) -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs11664336, rs11756783, rs12572775, rs1290790, rs13264909, rs1467847, rs1556516, rs1580100, rs165656, rs3771382, rs3790086, rs3812163, rs418280, rs4243765, rs4302014, rs5759006, rs62134416, rs7652177, rs7754251, rs7917801, rs832806, rs9352895, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Standing height || id:ukb-b-10787 (ukb-b-10787) -#> Removing the following SNPs for incompatible alleles: -#> rs11252860, rs11252860, rs664317, rs664317 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs11664336, rs11756783, rs12572775, rs1290790, rs13264909, rs1467847, rs1556516, rs1580100, rs165656, rs3771382, rs3790086, rs3812163, rs418280, rs4243765, rs4302014, rs5759006, rs62134416, rs7652177, rs7754251, rs7917801, rs832806, rs9352895, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Father's age at death || id:ukb-b-11303 (ukb-b-11303) -#> Removing the following SNPs for incompatible alleles: -#> rs11252860, rs11252860, rs664317, rs664317 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs11664336, rs11756783, rs12572775, rs1290790, rs13264909, rs1467847, rs1556516, rs1580100, rs165656, rs3771382, rs3790086, rs3812163, rs418280, rs4243765, rs4302014, rs5759006, rs62134416, rs7652177, rs7754251, rs7917801, rs832806, rs9352895, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Weight || id:ukb-b-11842 (ukb-b-11842) -#> Removing the following SNPs for incompatible alleles: -#> rs11252860, rs11252860, rs664317, rs664317 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs11664336, rs11756783, rs12572775, rs1290790, rs13264909, rs1467847, rs1556516, rs1580100, rs165656, rs3771382, rs3790086, rs3812163, rs418280, rs4243765, rs4302014, rs5759006, rs62134416, rs7652177, rs7754251, rs7917801, rs832806, rs9352895, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Birth weight || id:ukb-b-13378 (ukb-b-13378) -#> Removing the following SNPs for incompatible alleles: -#> rs11252860, rs11252860, rs664317, rs664317 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs11664336, rs11756783, rs12572775, rs1290790, rs13264909, rs1467847, rs1556516, rs1580100, rs165656, rs3771382, rs3790086, rs3812163, rs418280, rs4243765, rs4302014, rs5759006, rs62134416, rs7652177, rs7754251, rs7917801, rs832806, rs9352895, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Long-standing illness, disability or infirmity || id:ukb-b-13764 (ukb-b-13764) -#> Removing the following SNPs for incompatible alleles: -#> rs664317, rs664317 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs11664336, rs11756783, rs12572775, rs1290790, rs13264909, rs1467847, rs1556516, rs1580100, rs165656, rs3771382, rs3790086, rs3812163, rs418280, rs4243765, rs4302014, rs5759006, rs62134416, rs7652177, rs7754251, rs7917801, rs832806, rs9352895, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Hip circumference || id:ukb-b-15590 (ukb-b-15590) -#> Removing the following SNPs for incompatible alleles: -#> rs11252860, rs11252860, rs664317, rs664317 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs11664336, rs11756783, rs12572775, rs1290790, rs13264909, rs1467847, rs1556516, rs1580100, rs165656, rs3771382, rs3790086, rs3812163, rs418280, rs4243765, rs4302014, rs5759006, rs62134416, rs7652177, rs7754251, rs7917801, rs832806, rs9352895, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Trunk fat-free mass || id:ukb-b-17409 (ukb-b-17409) -#> Removing the following SNPs for incompatible alleles: -#> rs11252860, rs11252860, rs664317, rs664317 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs11664336, rs11756783, rs12572775, rs1290790, rs13264909, rs1467847, rs1556516, rs1580100, rs165656, rs3771382, rs3790086, rs3812163, rs418280, rs4243765, rs4302014, rs5759006, rs62134416, rs7652177, rs7754251, rs7917801, rs832806, rs9352895, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Treatment/medication code: levothyroxine sodium || id:ukb-b-17918 (ukb-b-17918) -#> Removing the following SNPs for incompatible alleles: -#> rs664317, rs664317 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs11664336, rs11756783, rs12572775, rs1290790, rs13264909, rs1467847, rs1556516, rs1580100, rs165656, rs3771382, rs3790086, rs3812163, rs418280, rs4243765, rs4302014, rs5759006, rs62134416, rs7652177, rs7754251, rs7917801, rs832806, rs9352895, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Impedance of arm (left) || id:ukb-b-19379 (ukb-b-19379) -#> Removing the following SNPs for incompatible alleles: -#> rs11252860, rs11252860, rs664317, rs664317 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs11664336, rs11756783, rs12572775, rs1290790, rs13264909, rs1467847, rs1556516, rs1580100, rs165656, rs3771382, rs3790086, rs3812163, rs418280, rs4243765, rs4302014, rs5759006, rs62134416, rs7652177, rs7754251, rs7917801, rs832806, rs9352895, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Non-cancer illness code, self-reported: hypothyroidism/myxoedema || id:ukb-b-19732 (ukb-b-19732) -#> Removing the following SNPs for incompatible alleles: -#> rs664317, rs664317 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs11664336, rs11756783, rs12572775, rs1290790, rs13264909, rs1467847, rs1556516, rs1580100, rs165656, rs3771382, rs3790086, rs3812163, rs418280, rs4243765, rs4302014, rs5759006, rs62134416, rs7652177, rs7754251, rs7917801, rs832806, rs9352895, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Impedance of whole body || id:ukb-b-19921 (ukb-b-19921) -#> Removing the following SNPs for incompatible alleles: -#> rs11252860, rs11252860, rs664317, rs664317 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs11664336, rs11756783, rs12572775, rs1290790, rs13264909, rs1467847, rs1556516, rs1580100, rs165656, rs3771382, rs3790086, rs3812163, rs418280, rs4243765, rs4302014, rs5759006, rs62134416, rs7652177, rs7754251, rs7917801, rs832806, rs9352895, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Taking other prescription medications || id:ukb-b-20292 (ukb-b-20292) -#> Removing the following SNPs for incompatible alleles: -#> rs664317, rs664317 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs11664336, rs11756783, rs12572775, rs1290790, rs13264909, rs1467847, rs1556516, rs1580100, rs165656, rs3771382, rs3790086, rs3812163, rs418280, rs4243765, rs4302014, rs5759006, rs62134416, rs7652177, rs7754251, rs7917801, rs832806, rs9352895, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Birth weight of first child || id:ukb-b-3357 (ukb-b-3357) -#> Removing the following SNPs for incompatible alleles: -#> rs664317, rs664317 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs11664336, rs11756783, rs12572775, rs1290790, rs13264909, rs1467847, rs1556516, rs1580100, rs165656, rs3771382, rs3790086, rs3812163, rs418280, rs4243765, rs4302014, rs5759006, rs62134416, rs7652177, rs7754251, rs7917801, rs832806, rs9352895, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Diagnoses - secondary ICD10: E03.9 Hypothyroidism, unspecified || id:ukb-b-4226 (ukb-b-4226) -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs11664336, rs11756783, rs12572775, rs1290790, rs13264909, rs1467847, rs1556516, rs1580100, rs165656, rs3771382, rs3790086, rs3812163, rs418280, rs4243765, rs4302014, rs5759006, rs62134416, rs7652177, rs7754251, rs7917801, rs832806, rs9352895, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Impedance of arm (right) || id:ukb-b-7859 (ukb-b-7859) -#> Removing the following SNPs for incompatible alleles: -#> rs11252860, rs11252860, rs664317, rs664317 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs11664336, rs11756783, rs12572775, rs1290790, rs13264909, rs1467847, rs1556516, rs1580100, rs165656, rs3771382, rs3790086, rs3812163, rs418280, rs4243765, rs4302014, rs5759006, rs62134416, rs7652177, rs7754251, rs7917801, rs832806, rs9352895, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Treatment/medication code: aspirin || id:ukb-b-8755 (ukb-b-8755) -#> Removing the following SNPs for incompatible alleles: -#> rs664317, rs664317 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10228350, rs11664336, rs11756783, rs12572775, rs1290790, rs13264909, rs1467847, rs1556516, rs1580100, rs165656, rs3771382, rs3790086, rs3812163, rs418280, rs4243765, rs4302014, rs5759006, rs62134416, rs7652177, rs7754251, rs7917801, rs832806, rs9352895, rs9976812 -#> Performing shrinkage -#> After shrinkage keeping: -#> ieu-a-299 -#> ieu-a-300 -#> prot-a-1519 -#> ukb-b-10787 -#> ukb-b-11303 -#> ukb-b-11842 -#> ukb-b-13378 -#> ukb-b-13764 -#> ukb-b-17918 -#> ukb-b-19379 -#> ukb-b-20175 -#> ukb-b-20292 -#> ukb-b-3357 -#> ukb-b-4226 -#> ukb-b-8755 -#> Estimating joint effects of the following trait(s) associated with rs57866767 -#> Impedance of arm (left) || id:ukb-b-19379 -#> Impedance of whole body || id:ukb-b-19921 -#> Arm fat percentage (left) || id:ukb-b-20188 -#> Birth weight || id:ukb-b-13378 -#> Leg fat percentage (left) || id:ukb-b-18377 -#> Body fat percentage || id:ukb-b-8909 -#> Leg fat percentage (right) || id:ukb-b-20531 -#> Arm fat percentage (right) || id:ukb-b-12854 -#> Impedance of arm (right) || id:ukb-b-7859 -#> Trunk fat-free mass || id:ukb-b-17409 -#> Trunk fat percentage || id:ukb-b-16407 -#> Trunk fat mass || id:ukb-b-20044 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Arm fat percentage (left) || id:ukb-b-20188. Just keeping the first instance: -#> rs2731238 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Birth weight || id:ukb-b-13378. Just keeping the first instance: -#> rs2140240 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Body fat percentage || id:ukb-b-8909. Just keeping the first instance: -#> rs2731238 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Impedance of arm (right) || id:ukb-b-7859. Just keeping the first instance: -#> rs111650620 -#> rs1382568 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Leg fat percentage (left) || id:ukb-b-18377. Just keeping the first instance: -#> rs1428 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Leg fat percentage (right) || id:ukb-b-20531. Just keeping the first instance: -#> rs7027096 -#> rs2731238 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Systolic blood pressure, automated reading || id:ukb-b-20175. Just keeping the first instance: -#> rs17811915 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Trunk fat mass || id:ukb-b-20044. Just keeping the first instance: -#> rs2731238 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Trunk fat percentage || id:ukb-b-16407. Just keeping the first instance: -#> rs2731238 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Trunk fat-free mass || id:ukb-b-17409. Just keeping the first instance: -#> rs3735352 -#> rs3740591 -#> rs1040457 -#> Warning: 'clump_data' is deprecated. -#> Use 'ieugwasr::ld_clump()' instead. -#> See help("Deprecated") -#> Clumping 1, 5198 variants -#> Removing 4002 of 5198 variants due to LD with other variants or absence from LD reference panel -#> Extracting data for 668 SNP(s) from 13 GWAS(s) -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Systolic blood pressure, automated reading || id:ukb-b-20175. Just keeping the first instance: -#> rs2731238 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Arm fat percentage (right) || id:ukb-b-12854 (ukb-b-12854) -#> Removing the following SNPs for incompatible alleles: -#> rs2731238, rs2731238 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs1080347, rs10887578, rs11208779, rs12722976, rs13264909, rs1443641, rs1905095, rs2592828, rs28721380, rs2968669, rs3771382, rs3773851, rs445077, rs4714935, rs59086897, rs62134416, rs6540497, rs7491529, rs7788672, rs7917801, rs7971536, rs9882731, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Birth weight || id:ukb-b-13378 (ukb-b-13378) -#> Removing the following SNPs for incompatible alleles: -#> rs2731238, rs2731238 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs1080347, rs10887578, rs11208779, rs12722976, rs13264909, rs1443641, rs1905095, rs2592828, rs28721380, rs2968669, rs3771382, rs3773851, rs445077, rs4714935, rs59086897, rs62134416, rs6540497, rs7491529, rs7788672, rs7917801, rs7971536, rs9882731, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Trunk fat percentage || id:ukb-b-16407 (ukb-b-16407) -#> Removing the following SNPs for incompatible alleles: -#> rs2731238, rs2731238 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs1080347, rs10887578, rs11208779, rs12722976, rs13264909, rs1443641, rs1905095, rs2592828, rs28721380, rs2968669, rs3771382, rs3773851, rs445077, rs4714935, rs59086897, rs62134416, rs6540497, rs7491529, rs7788672, rs7917801, rs7971536, rs9882731, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Trunk fat-free mass || id:ukb-b-17409 (ukb-b-17409) -#> Removing the following SNPs for incompatible alleles: -#> rs2731238, rs2731238 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs1080347, rs10887578, rs11208779, rs12722976, rs13264909, rs1443641, rs1905095, rs2592828, rs28721380, rs2968669, rs3771382, rs3773851, rs445077, rs4714935, rs59086897, rs62134416, rs6540497, rs7491529, rs7788672, rs7917801, rs7971536, rs9882731, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Leg fat percentage (left) || id:ukb-b-18377 (ukb-b-18377) -#> Removing the following SNPs for incompatible alleles: -#> rs2731238, rs2731238 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs1080347, rs10887578, rs11208779, rs12722976, rs13264909, rs1443641, rs1905095, rs2592828, rs28721380, rs2968669, rs3771382, rs3773851, rs445077, rs4714935, rs59086897, rs62134416, rs6540497, rs7491529, rs7788672, rs7917801, rs7971536, rs9882731, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Impedance of arm (left) || id:ukb-b-19379 (ukb-b-19379) -#> Removing the following SNPs for incompatible alleles: -#> rs2731238, rs2731238 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs1080347, rs10887578, rs11208779, rs12722976, rs13264909, rs1443641, rs1905095, rs2592828, rs28721380, rs2968669, rs3771382, rs3773851, rs445077, rs4714935, rs59086897, rs62134416, rs6540497, rs7491529, rs7788672, rs7917801, rs7971536, rs9882731, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Impedance of whole body || id:ukb-b-19921 (ukb-b-19921) -#> Removing the following SNPs for incompatible alleles: -#> rs2731238, rs2731238 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs1080347, rs10887578, rs11208779, rs12722976, rs13264909, rs1443641, rs1905095, rs2592828, rs28721380, rs2968669, rs3771382, rs3773851, rs445077, rs4714935, rs59086897, rs62134416, rs6540497, rs7491529, rs7788672, rs7917801, rs7971536, rs9882731, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Trunk fat mass || id:ukb-b-20044 (ukb-b-20044) -#> Removing the following SNPs for incompatible alleles: -#> rs2731238, rs2731238 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs1080347, rs10887578, rs11208779, rs12722976, rs13264909, rs1443641, rs1905095, rs2592828, rs28721380, rs2968669, rs3771382, rs3773851, rs445077, rs4714935, rs59086897, rs62134416, rs6540497, rs7491529, rs7788672, rs7917801, rs7971536, rs9882731, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Arm fat percentage (left) || id:ukb-b-20188 (ukb-b-20188) -#> Removing the following SNPs for incompatible alleles: -#> rs2731238, rs2731238 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs1080347, rs10887578, rs11208779, rs12722976, rs13264909, rs1443641, rs1905095, rs2592828, rs28721380, rs2968669, rs3771382, rs3773851, rs445077, rs4714935, rs59086897, rs62134416, rs6540497, rs7491529, rs7788672, rs7917801, rs7971536, rs9882731, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Leg fat percentage (right) || id:ukb-b-20531 (ukb-b-20531) -#> Removing the following SNPs for incompatible alleles: -#> rs2731238, rs2731238 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs1080347, rs10887578, rs11208779, rs12722976, rs13264909, rs1443641, rs1905095, rs2592828, rs28721380, rs2968669, rs3771382, rs3773851, rs445077, rs4714935, rs59086897, rs62134416, rs6540497, rs7491529, rs7788672, rs7917801, rs7971536, rs9882731, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Impedance of arm (right) || id:ukb-b-7859 (ukb-b-7859) -#> Removing the following SNPs for incompatible alleles: -#> rs2731238, rs2731238 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs1080347, rs10887578, rs11208779, rs12722976, rs13264909, rs1443641, rs1905095, rs2592828, rs28721380, rs2968669, rs3771382, rs3773851, rs445077, rs4714935, rs59086897, rs62134416, rs6540497, rs7491529, rs7788672, rs7917801, rs7971536, rs9882731, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Body fat percentage || id:ukb-b-8909 (ukb-b-8909) -#> Removing the following SNPs for incompatible alleles: -#> rs2731238, rs2731238 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs1080347, rs10887578, rs11208779, rs12722976, rs13264909, rs1443641, rs1905095, rs2592828, rs28721380, rs2968669, rs3771382, rs3773851, rs445077, rs4714935, rs59086897, rs62134416, rs6540497, rs7491529, rs7788672, rs7917801, rs7971536, rs9882731, rs9976812 -#> Performing shrinkage -#> After shrinkage keeping: -#> ukb-b-12854 -#> ukb-b-13378 -#> ukb-b-17409 -#> ukb-b-20175 -#> ukb-b-20188 -#> ukb-b-20531 -#> ukb-b-7859 -#> Estimating joint effects of the following trait(s) associated with rs35114617 -#> Sitting height || id:ukb-b-16881 -#> Standing height || id:ukb-b-10787 -#> Glutaminyl-peptide cyclotransferase-like protein || id:prot-a-2466 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Sitting height || id:ukb-b-16881. Just keeping the first instance: -#> rs4651157 -#> rs872937 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Standing height || id:ukb-b-10787. Just keeping the first instance: -#> rs11252860 -#> rs34773647 -#> rs664317 -#> rs7978217 -#> rs11051456 -#> rs1019075 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Systolic blood pressure, automated reading || id:ukb-b-20175. Just keeping the first instance: -#> rs17811915 -#> Warning: 'clump_data' is deprecated. -#> Use 'ieugwasr::ld_clump()' instead. -#> See help("Deprecated") -#> Clumping 1, 1620 variants -#> Removing 796 of 1620 variants due to LD with other variants or absence from LD reference panel -#> Extracting data for 738 SNP(s) from 4 GWAS(s) -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Systolic blood pressure, automated reading || id:ukb-b-20175. Just keeping the first instance: -#> rs11252860 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Glutaminyl-peptide cyclotransferase-like protein || id:prot-a-2466 (prot-a-2466) -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10811092, rs12572775, rs12722976, rs1290790, rs1467847, rs153661, rs3771382, rs3790086, rs3812163, rs418280, rs4302014, rs6947915, rs7652177, rs7847059, rs832806, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Standing height || id:ukb-b-10787 (ukb-b-10787) -#> Removing the following SNPs for incompatible alleles: -#> rs11252860, rs11252860 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10811092, rs12572775, rs12722976, rs1290790, rs1467847, rs153661, rs3771382, rs3790086, rs3812163, rs418280, rs4302014, rs6947915, rs7652177, rs7847059, rs832806, rs9976812 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Sitting height || id:ukb-b-16881 (ukb-b-16881) -#> Removing the following SNPs for incompatible alleles: -#> rs11252860, rs11252860 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs10811092, rs12572775, rs12722976, rs1290790, rs1467847, rs153661, rs3771382, rs3790086, rs3812163, rs418280, rs4302014, rs6947915, rs7652177, rs7847059, rs832806, rs9976812 -#> Performing shrinkage -#> After shrinkage keeping: -#> ukb-b-10787 -#> ukb-b-20175 -#> Estimating joint effects of the following trait(s) associated with rs8027450 -#> Birth weight of first child || id:ukb-b-3357 -#> Birth weight || id:ukb-b-13378 -#> Medication for cholesterol, blood pressure or diabetes: Cholesterol lowering medication || id:ukb-b-11740 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Birth weight || id:ukb-b-13378. Just keeping the first instance: -#> rs2140240 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Systolic blood pressure, automated reading || id:ukb-b-20175. Just keeping the first instance: -#> rs17811915 -#> Warning: 'clump_data' is deprecated. -#> Use 'ieugwasr::ld_clump()' instead. -#> See help("Deprecated") -#> Clumping 1, 507 variants -#> Removing 183 of 507 variants due to LD with other variants or absence from LD reference panel -#> Extracting data for 318 SNP(s) from 4 GWAS(s) -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Medication for cholesterol, blood pressure or diabetes: Cholesterol lowering medication || id:ukb-b-11740 (ukb-b-11740) -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs11592442, rs12779675, rs1290790, rs1344672, rs2246832 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Birth weight || id:ukb-b-13378 (ukb-b-13378) -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs11592442, rs12779675, rs1290790, rs1344672, rs2246832 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Birth weight of first child || id:ukb-b-3357 (ukb-b-3357) -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs11592442, rs12779675, rs1290790, rs1344672, rs2246832 -#> Performing shrinkage -#> After shrinkage keeping: -#> ukb-b-11740 -#> ukb-b-13378 -#> ukb-b-20175 -#> ukb-b-3357 -#> Estimating joint effects of the following trait(s) associated with rs9349379 -#> Operative procedures - secondary OPCS: Y02.2 Insertion of prosthesis into organ NOC || id:ukb-b-1744 -#> Treatment/medication code: ibuprofen || id:ukb-b-16866 -#> Pain type(s) experienced in last month: Headache || id:ukb-b-12181 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Pain type(s) experienced in last month: Headache || id:ukb-b-12181. Just keeping the first instance: -#> rs34555420 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Systolic blood pressure, automated reading || id:ukb-b-20175. Just keeping the first instance: -#> rs17811915 -#> Warning: 'clump_data' is deprecated. -#> Use 'ieugwasr::ld_clump()' instead. -#> See help("Deprecated") -#> Clumping 1, 298 variants -#> Removing 36 of 298 variants due to LD with other variants or absence from LD reference panel -#> Extracting data for 259 SNP(s) from 4 GWAS(s) -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Systolic blood pressure, automated reading || id:ukb-b-20175. Just keeping the first instance: -#> rs17811915 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Pain type(s) experienced in last month: Headache || id:ukb-b-12181 (ukb-b-12181) -#> Removing the following SNPs for incompatible alleles: -#> rs17811915, rs17811915 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs11592442, rs12779675, rs1290790, rs2246832 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Treatment/medication code: ibuprofen || id:ukb-b-16866 (ukb-b-16866) -#> Removing the following SNPs for incompatible alleles: -#> rs17811915, rs17811915 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs11592442, rs12779675, rs1290790, rs2246832 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Operative procedures - secondary OPCS: Y02.2 Insertion of prosthesis into organ NOC || id:ukb-b-1744 (ukb-b-1744) -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs11592442, rs12779675, rs1290790, rs2246832 -#> Performing shrinkage -#> After shrinkage keeping: -#> ukb-b-12181 -#> ukb-b-1744 -#> ukb-b-20175 -#> Estimating joint effects of the following trait(s) associated with rs2971603 -#> Pain type(s) experienced in last month: Headache || id:ukb-b-12181 -#> Only one candidate trait for SNP rs2971603 so performing standard MVMR instead of LASSO -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Pain type(s) experienced in last month: Headache || id:ukb-b-12181. Just keeping the first instance: -#> rs34555420 -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Systolic blood pressure, automated reading || id:ukb-b-20175. Just keeping the first instance: -#> rs17811915 -#> Warning: 'clump_data' is deprecated. -#> Use 'ieugwasr::ld_clump()' instead. -#> See help("Deprecated") -#> Clumping 1, 292 variants -#> Removing 34 of 292 variants due to LD with other variants or absence from LD reference panel -#> Extracting data for 257 SNP(s) from 2 GWAS(s) -#> Warning in .fun(piece, ...): Duplicated SNPs present in exposure data for phenotype 'Systolic blood pressure, automated reading || id:ukb-b-20175. Just keeping the first instance: -#> rs17811915 -#> Harmonising Systolic blood pressure, automated reading || id:ukb-b-20175 (ukb-b-20175) and Pain type(s) experienced in last month: Headache || id:ukb-b-12181 (ukb-b-12181) -#> Removing the following SNPs for incompatible alleles: -#> rs17811915, rs17811915 -#> Removing the following SNPs for being palindromic with intermediate allele frequencies: -#> rs11592442, rs12779675, rs1290790, rs2246832 -
Finally, to adjust the SNP effects on the exposure and outcome traits +given their influences on the candidate traits, we can run:
+
+x$analyse()This will estimate the outlier effect that is due to the candidate +pathways, adjust the outlier-outcome estimate, and re-perform MR of +exposure on outcome with the adjusted outliers.
+By default, this adjusts for the trait that has the largest impact +for a particular SNP.
+There is also a multivariable adjustment method here, where for each +outlier, all candidate trait effects are estimated jointly:
+
+x$analyse.mv()NOTE: it’s a good idea to check that there are no traits amongst the +candidates that are identical or equivalent to the outcome:
+
+id_remove = c("ieu-a-1110", "ieu-a-798", "ukb-b-1061", "ukb-b-10454", "ukb-b-1061", "ukb-b-11064",
+ "ukb-b-11590", "ukb-b-11632", "ukb-b-11895", "ukb-b-11971", "ukb-b-12014", "ukb-b-12019",
+ "ukb-b-12465", "ukb-b-12493", "ukb-b-13352", "ukb-b-13506", "ukb-b-12477", "ukb-b-12493",
+ "ukb-b-12646", "ukb-b-13352", "ukb-b-13506", "ukb-b-14057", "ukb-b-14177", "ukb-b-14371",
+ "ukb-b-14395", "ukb-b-15169", "ukb-b-15491", "ukb-b-15686", "ukb-b-15748", "ukb-b-15829",
+ "ukb-b-16376", "ukb-b-16606", "ukb-b-1668", "ukb-b-17360", "ukb-b-18009", "ukb-b-18018",
+ "ukb-b-18167", "ukb-b-18408", "ukb-b-18799", "ukb-b-20300", "ukb-b-20379", "ukb-b-3656",
+ "ukb-b-4063", "ukb-b-7137", "ukb-b-7436", "ukb-b-7869", "ukb-b-7992", "ukb-b-8468",
+ "ukb-b-8650", "ukb-b-8746", "ukb-b-9207", "ieu-a-1110", "ukb-b-1061", "ukb-b-11971",
+ "ukb-b-12014", "ukb-b-12019", "ukb-b-19456", "ukb-b-8778", "ukb-b-10454", "ukb-b-11632",
+ "ukb-b-11895")
+
+x$analyse.mv(id_remove = id_remove)The adjusted effect estimates:
--x$output$analyse.mv$estimates -#> est b se pval nsnp Q -#> 1 Raw 0.5991067 0.07717696 2.642311e-13 233 870.8370 -#> 2 Outliers removed (all) 0.6437695 0.06349886 3.767303e-20 222 393.1945 -#> 3 Outliers removed (candidates) 0.7095277 0.05475819 6.135623e-29 227 553.3497 -#> 4 Outliers adjusted 0.6192846 0.06555078 3.930161e-18 233 616.0294 -#> int Isq -#> 1 0 0.7312930 -#> 2 0 0.4328507 -#> 3 0 0.5879640 -#> 4 0 0.6201480 -
+x$output$analyse.mv$estimatesA plot is generated showing how SNP effects have changed due to candidate trait adjustments in:
--x$output$analyse.mv$plot -

A plot is generated showing how SNP effects have changed due to +candidate trait adjustments in:
+
+x$output$analyse.mv$plotTo produce a basic diagram of the connectivity of SNPs, candidate traits, exposure and outcome:
--tryx.network(x$output) -
This shows that some candidate traits influence the exposure only, the outcome only, or both the exposure and the outcome.
+To produce a basic diagram of the connectivity of SNPs, candidate +traits, exposure and outcome:
+
+tryx.network(x$output)This shows that some candidate traits influence the exposure only, +the outcome only, or both the exposure and the outcome.
You can also create a volcano plot of the candidate-exposure and/or candidate-outcome associations. e.g. to show exposures and outcomes
--volcano_plot( - rbind(x$output$candidate_exposure_mr, x$output$candidate_outcome_mr) -) -

You can also create a volcano plot of the candidate-exposure and/or +candidate-outcome associations. e.g. to show exposures and outcomes
+
+volcano_plot(
+ rbind(x$output$candidate_exposure_mr, x$output$candidate_outcome_mr)
+)or e.g. just exposures
--volcano_plot(x$output$candidate_exposure_mr) -

+volcano_plot(x$output$candidate_exposure_mr)Similar to the volcano plot, a Manhattan plot can also be produced. This can be done for the candidate-exposure associations
--x$manhattan_plot("exposure") -x$output$plots$manhattan_plot -

Similar to the volcano plot, a Manhattan plot can also be produced. +This can be done for the candidate-exposure associations
+
+x$manhattan_plot("exposure")
+x$output$plots$manhattan_plotor the candidate-outcome associations
--x$manhattan_plot("outcome") -x$output$plots$manhattan_plot -

+x$manhattan_plot("outcome")
+x$output$plots$manhattan_plotDeveloped by Gibran Hemani, Yoonsu Cho.
+ +Developed by Gibran Hemani, Yoonsu Cho.