From 54d5ede52dca9afe2c303f1303b4f787fb06d9a0 Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Tue, 16 Dec 2025 12:20:38 +0000 Subject: [PATCH 1/4] Skip tests if MendelianRandomization not installed --- tests/testthat/test_otherformats.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/testthat/test_otherformats.R b/tests/testthat/test_otherformats.R index c6f9d35c..95b1272a 100644 --- a/tests/testthat/test_otherformats.R +++ b/tests/testthat/test_otherformats.R @@ -6,6 +6,7 @@ load(system.file("extdata", "test_commondata.RData", package = "TwoSampleMR")) test_that("MRInput", { skip_if(getRversion() < '4.4.0') # because MendelianRandomization will not be installed + skip_if_not_installed("MendelianRandomization") w <- dat_to_MRInput(dat, get_correlations = FALSE) expect_true(length(w) == 1) expect_true(class(w) == "list") @@ -18,6 +19,7 @@ test_that("MRInput with cor", { skip_if_offline() skip_if_offline(host = "api.opengwas.io") skip_if(getRversion() < '4.4.0') # because MendelianRandomization will not be installed + skip_if_not_installed("MendelianRandomization") w <- tryCatch( dat_to_MRInput(dat, get_correlations = TRUE)[[1]], error = skip("Server issues"), From a3d9204f97bdd3040fbb17567ea2c5198cc83c41 Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Tue, 16 Dec 2025 12:21:03 +0000 Subject: [PATCH 2/4] Bump version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 0d6a7cba..c1ef4673 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: TwoSampleMR Title: Two Sample MR Functions and Interface to MRC Integrative Epidemiology Unit OpenGWAS Database -Version: 0.6.28 +Version: 0.6.29 Authors@R: c( person("Gibran", "Hemani", , "g.hemani@bristol.ac.uk", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-0920-1055")), From 0f26664b2c1ce596127f2dca7414419d1994ea7c Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Tue, 16 Dec 2025 12:25:59 +0000 Subject: [PATCH 3/4] Don't eval chunks if MendelianRandomization not installed --- vignettes/perform_mr.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/perform_mr.Rmd b/vignettes/perform_mr.Rmd index e07f9d7d..70f672cb 100644 --- a/vignettes/perform_mr.Rmd +++ b/vignettes/perform_mr.Rmd @@ -13,7 +13,7 @@ vignette: > --- ```{r, include=FALSE} -evalinr44 <- getRversion() >= '4.4.0' +evalinr44 <- (getRversion() >= '4.4.0') && requireNamespace("MendelianRandomization", quietly = TRUE) knitr::opts_chunk$set( collapse = TRUE, comment = "#>", From 9a1ec63a3639696131d34f89dc3f6ab58729a776 Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Tue, 16 Dec 2025 12:21:09 +0000 Subject: [PATCH 4/4] Update NEWS.md --- NEWS.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 3902f3d3..a57974d8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,12 @@ # TwoSampleMR v0.6.28 -(Release date 2025-12-15) +(Release date 2025-12-16) + +* Skip two tests if the **MendelianRandomization** package is not installed and protected the running of the perform_mr vignette. + +# TwoSampleMR v0.6.28 + +(Release date 2025-12-16) * Allowed the arguments for `clump_data()` to be specified from `read_exposure_data()` (thanks @al3xjwood). * Fixed two function calls in `mr_moe_single()`